-
Notifications
You must be signed in to change notification settings - Fork 103
test(#5987): add behaviour coverage for code applier branch handling #5992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| Feature: Code applier branch handling | ||
|
|
||
| The code applier must land pushes inside the dispatched issue's | ||
| agent/<issue>-* branch namespace no matter which branch the sandbox | ||
| leaves checked out, and must leave other issues' branches untouched. | ||
| These scenarios drive real code runs through the post-scripts against | ||
| live GitHub, so the branch guarantees are asserted on the scripts as | ||
| shipped rather than on unit-level copies of their logic. | ||
|
|
||
| The scenarios are gated behind the applier-branch-namespace capability | ||
| (declare it via BEHAVIOUR_CAPABILITIES) because they assert applier | ||
| behavior that ships with the agents-side branch-namespace enforcement; | ||
| runs against older agents releases skip them. | ||
|
|
||
| The fix applier's refuse-to-push-on-branch-mismatch counterpart cannot | ||
| be expressed here yet: the fix stage's only dispatch route is a | ||
| changes_requested review submitted by the org review bot, which the | ||
| behaviour suite cannot produce (suite-posted comments are bot-authored | ||
| and bot comments are dropped by the dispatch gates). That path stays | ||
| covered by script-level tests in the agents repo until a | ||
| suite-reachable fix trigger exists. | ||
|
|
||
| The decoy branch uses issue number 990000099 — far above any issue | ||
| number a pool repo will ever reach — so the anchored | ||
| agent/<issue>-.* head assertion can never match the decoy itself. | ||
|
|
||
| Background: | ||
| Given the enrolled test repository | ||
|
|
||
| @requires:capability:applier-branch-namespace | ||
| Scenario: Code run is renamed into the issue namespace and other branches are untouched | ||
| Given an open pull request on branch "agent/990000099-decoy" | ||
| And the tip of branch "agent/990000099-decoy" is recorded | ||
| And an issue | ||
| And a dummy agent that would: | ||
| | description | op | args | | ||
| | Check out decoy branch | checkout_branch | agent/990000099-decoy | | ||
| | Emit code JSON | write_fixture | output/agent-result.json, fixtures/code/implemented.json | | ||
| When the issue is labeled "ready-to-code" | ||
| Then the harness "code" workflow completes successfully | ||
| And the agent will succeed to Check out decoy branch | ||
| And the pull request head branch matches "agent/<issue>-.*" | ||
| And branch "agent/990000099-decoy" is unchanged | ||
|
|
||
| @requires:capability:applier-branch-namespace | ||
| Scenario: Conforming branch is pushed without rename | ||
| Given an issue | ||
| And a remote branch "agent/<issue>-impl" seeded with a commit | ||
| And a dummy agent that would: | ||
| | description | op | args | | ||
| | Check out namespaced branch | checkout_branch | agent/<issue>-impl | | ||
| | Emit code JSON | write_fixture | output/agent-result.json, fixtures/code/implemented.json | | ||
| When the issue is labeled "ready-to-code" | ||
| Then the harness "code" workflow completes successfully | ||
| And the agent will succeed to Check out namespaced branch | ||
| And the pull request head branch matches "agent/<issue>-impl" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "target_branch": "main", | ||
| "pr_body": "Automated behaviour-test implementation emitted by the scripted code run." | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.