Fix robot-authored feature branch PRs being misrouted as integration PRs#269
Merged
matthiasL-scality merged 3 commits intoMay 22, 2026
Merged
Conversation
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>
charlesprost
approved these changes
May 22, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
handle_pull_requestwas routing all robot-authored PRs tohandle_parent_pull_requestwithout checking whether the source branch was actually anIntegrationBranchfeature/ARTESCA-17576-bump-identity-ui-0.41.0) areFeatureBranchinstances 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 → 404IntegrationBranch.pattern(w/...) before routing tohandle_parent_pull_requestCloses 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 routedtest_robot_authored_feature_branch_does_not_route_to_parent: regression test for the bug — a CID bump PR must not enterhandle_parent_pull_request🤖 Generated with Claude Code