Skip to content

Fix robot-authored feature branch PRs being misrouted as integration PRs#269

Merged
matthiasL-scality merged 3 commits into
mainfrom
PTFE-3261-fix-robot-authored-feature-branch-routing
May 22, 2026
Merged

Fix robot-authored feature branch PRs being misrouted as integration PRs#269
matthiasL-scality merged 3 commits into
mainfrom
PTFE-3261-fix-robot-authored-feature-branch-routing

Conversation

@matthiasL-scality
Copy link
Copy Markdown
Contributor

Summary

  • handle_pull_request was routing all robot-authored PRs to handle_parent_pull_request without checking whether the source branch was actually an IntegrationBranch
  • CID bump PRs (e.g. feature/ARTESCA-17576-bump-identity-ui-0.41.0) are FeatureBranch instances created by the robot — bert-e was extracting the first number in the description (a Jira ticket ID from a URL) and trying to fetch a non-existent PR → 404
  • Fix: also check that the source branch matches IntegrationBranch.pattern (w/...) before routing to handle_parent_pull_request

Closes PTFE-3261

Test plan

  • bert_e/tests/unit/test_handle_pull_request.py — 2 new unit tests:
    • test_robot_authored_integration_branch_routes_to_parent: verifies that real integration PRs (w/...) are correctly routed
    • test_robot_authored_feature_branch_does_not_route_to_parent: regression test for the bug — a CID bump PR must not enter handle_parent_pull_request
  • Verify on artesca that bert-e no longer crashes on CID bump PRs

🤖 Generated with Claude Code

bert-e was crashing with 404 when processing CID bump PRs (authored by
the robot but on feature/... branches): handle_pull_request routed all
robot-authored PRs to handle_parent_pull_request, which extracted the
first number from the description and tried to fetch a non-existent
parent PR.

Fix by also checking that the source branch matches IntegrationBranch
pattern (w/...) before routing to handle_parent_pull_request.

Closes PTFE-3261

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@matthiasL-scality matthiasL-scality requested a review from a team as a code owner May 22, 2026 11:49
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.31%. Comparing base (24545a4) to head (53a3420).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #269      +/-   ##
==========================================
+ Coverage   89.28%   89.31%   +0.03%     
==========================================
  Files          77       78       +1     
  Lines       10287    10316      +29     
==========================================
+ Hits         9185     9214      +29     
  Misses       1102     1102              
Flag Coverage Δ
integration 87.51% <100.00%> (ø)
tests 87.47% <100.00%> (ø)
tests-BuildFailedTest 26.79% <0.00%> (ø)
tests-QuickTest 34.38% <0.00%> (ø)
tests-RepositoryTests 26.45% <0.00%> (ø)
tests-TaskQueueTests 51.66% <100.00%> (ø)
tests-TestBertE 65.59% <100.00%> (ø)
tests-TestQueueing 53.90% <100.00%> (ø)
tests-api-mock 15.77% <0.00%> (-0.05%) ⬇️
tests-noqueue 77.63% <100.00%> (ø)
tests-noqueue-BuildFailedTest 26.79% <0.00%> (ø)
tests-noqueue-QuickTest 34.38% <0.00%> (ø)
tests-noqueue-RepositoryTests 26.45% <0.00%> (ø)
tests-noqueue-TaskQueueTests 51.66% <100.00%> (ø)
tests-noqueue-TestBertE 61.95% <100.00%> (ø)
tests-noqueue-TestQueueing 26.48% <0.00%> (ø)
tests-server 29.04% <0.00%> (-0.09%) ⬇️
unittests 41.83% <100.00%> (+0.20%) ⬆️
utests 26.16% <100.00%> (+0.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

matthiasL-scality and others added 2 commits May 22, 2026 14:06
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add mock_handle.assert_not_called() to positive routing test
- Simplify docstrings to single line
- Remove unused _FakeRepo.cmd method

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@matthiasL-scality matthiasL-scality merged commit 8481bef into main May 22, 2026
18 checks passed
@matthiasL-scality matthiasL-scality deleted the PTFE-3261-fix-robot-authored-feature-branch-routing branch May 22, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants