Repository navigation
fix(server): watched PRs wake the agent when they merge #26271
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
Open
juliusmarminge
wants to merge
1
commit into
main
Choose a base branch
from
fix/pr-watch-wakes-on-merge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+416
−60
Open
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ import { assert, describe, it } from "@effect/vitest"; | |
| import { | ||
| PULL_REQUEST_WATCH_WAKE_LIMIT, | ||
| evaluatePullRequestWatch as evaluate, | ||
| pullRequestWatchEndMessage, | ||
| pullRequestWatchMessage, | ||
| } from "./pullRequestWatch.ts"; | ||
|
|
||
|
|
@@ -436,3 +437,42 @@ describe("evaluatePullRequestWatch", () => { | |
| assert.isTrue(anHourLater(watch(), silent).every((kinds) => kinds.length === 0)); | ||
| }); | ||
| }); | ||
|
|
||
| describe("pullRequestWatchEndMessage", () => { | ||
| const url = "https://git.cafe/pingdotgg/t3code/pull/7"; | ||
| const end = (overrides: Partial<Parameters<typeof pullRequestWatchEndMessage>[0]["detail"]>) => | ||
| pullRequestWatchEndMessage({ | ||
| number: 7, | ||
| url, | ||
| detail: { state: "merged", baseBranch: "main", ...overrides }, | ||
| }); | ||
| const mergeCommitSha = "3b2f958603a51d8c42c4ede02eee7b8cb310b2d9"; | ||
|
|
||
| it("says how the pull request ended, with the merge commit and merger the host reports", () => { | ||
|
Comment on lines
+441
to
+451
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test locks down notification copy rather than behavior, which the testing rules explicitly exclude. Could you delete it and keep the lifecycle coverage in the reactor tests? Posted via Macroscope — Test Signal |
||
| const merged = end({ | ||
| mergeCommitSha, | ||
| mergedBy: { login: "juliusmarminge", name: null, avatarUrl: null }, | ||
| }); | ||
| assert.equal( | ||
| merged.text, | ||
| `Pull request #7 (${url}) was merged into main by juliusmarminge as 3b2f958, so T3 Code stopped watching it.`, | ||
| ); | ||
| assert.deepEqual(merged.notification, { | ||
| source: { kind: "monitor" }, | ||
| outcome: "completed", | ||
| summary: "#7: merged, stopped watching", | ||
| }); | ||
| // GitCafe reports a merge made on GitHub without who made it. | ||
| assert.equal( | ||
| end({ mergeCommitSha }).text, | ||
| `Pull request #7 (${url}) was merged into main as 3b2f958, so T3 Code stopped watching it.`, | ||
| ); | ||
|
|
||
| const closed = end({ state: "closed" }); | ||
| assert.equal( | ||
| closed.text, | ||
| `Pull request #7 (${url}) was closed without merging, so T3 Code stopped watching it. If it is reopened, call watch_pull_request to watch it again.`, | ||
| ); | ||
| assert.equal(closed.notification.summary, "#7: closed, stopped watching"); | ||
| }); | ||
| }); | ||
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: pingdotgg/t3code
Length of output: 945
Script executed:
Repository: pingdotgg/t3code
Length of output: 13590
Script executed:
Repository: pingdotgg/t3code
Length of output: 45662
Script executed:
Repository: pingdotgg/t3code
Length of output: 19681
Script executed:
Repository: pingdotgg/t3code
Length of output: 8437
Script executed:
Repository: pingdotgg/t3code
Length of output: 21933
Script executed:
Repository: pingdotgg/t3code
Length of output: 2740
Script executed:
Repository: pingdotgg/t3code
Length of output: 9483
Prevent auto-settlement before the merge wake.
If a merged snapshot is synced before the watch sweep, auto-settlement can remove the watch without a wake. Default settings enable settlement on merge.
Keep the thread from auto-settling until the merge wake is recorded and its run finishes. Add a runtime test with a completed run, default settings, and a synced merged snapshot. Assert one merge wake and settlement after that wake’s run.