Repository navigation
feat: open a pull request's build gate runs from the pull request - #32
Merged
Merged
Conversation
Seeing whether a pull request's CI gate passed meant leaving boardwalk, or scrolling the project's build list for a run that may have aged off it. B on an opened pull request reads its policy evaluations, keeps the build validation policies that have produced a run, and opens the build list over those runs: enter reads the failing gate's logs, Q re-runs it. Policy evaluations rather than a branch search is what makes these the gates rather than whatever happened to build the branch; a gate with no run yet is left out, and a pull request nothing gates says so instead of opening empty. The gate list is the first second instance of a list view in one stack, so it does not rely on the invariant the ErrMsg broadcast depends on: it fetches through gateRunsMsg, which names its pull request, ignores the project listing, and reports its own failures rather than emitting an unowned ErrMsg. TestListViewsAreConstructedOnlyByRootBuild is narrowed to that one exception. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EnkNZwrGWfCeQDsHVkvPuE
Pressing B came back with "The requested version "7.1" of the resource is under preview. The -preview flag must be supplied in the api-version for such requests." Policy evaluations are still a preview resource and refuse a plain version outright, so the endpoint gets APIVersion's preview twin — the same arrangement connectionData already needed. Verified against a live pull request: the four build gates on !11924 come back with their policy names, verdicts and run ids, and each run reads. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EnkNZwrGWfCeQDsHVkvPuE
The ProjectID field and the project object beside it went in by hand and left the surrounding alignment stale, which the CI gofmt check caught. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EnkNZwrGWfCeQDsHVkvPuE
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.
Seeing whether a pull request's CI gate passed meant leaving boardwalk, or scrolling the project's build list for a run that may have aged off the end of it.
Bon an opened pull request reads its policy evaluations, keeps the build validation policies that have produced a run, and opens the build list over those runs:enterreads the failing gate's logs,Qre-runs it,oopens it in the browser.Policy evaluations rather than a branch search is what makes these the gates rather than whatever happened to build the branch. A gate with no run yet is left out — the whole point is opening the run — and a pull request nothing gates says so on the status line instead of opening an empty list. The policy's own verdict rides along on that status line, because it is not the build's: a rejected gate over a green run means the policy was evaluated against an earlier iteration.
PullRequest.ProjectIDcomes fromrepository.project.id, already in both pull request payloads, because the evaluations endpoint addresses a pull request by an artifact id built from the project GUID and will not take its name.The endpoint is still a preview resource and refuses a plain api-version outright — "The requested version "7.1" of the resource is under preview. The -preview flag must be supplied" — so it gets
APIVersion's preview twin, the same arrangementconnectionDataalready needed. That is the second commit; it was caught running the first against a live pull request.The second Builds instance
This is the first feature that can put two
Buildsviews in one stack — menu, builds,p, thenBon the pull request that opened.TestListViewsAreConstructedOnlyByRootBuildguards the invariant that makes the unownedErrMsgbroadcast safe, and rather than weaken it, the gate list stops depending on it:gateRunsMsg, which names its pull requestbuildsMsg, the project listing, and the project list ignores gate runsErrMsgwith no owner to route onThe guard test is narrowed to that one exemption, with the reason written into its doc comment. Cross-talk in both directions is covered by tests.
Verification
make vet testgreen. Run against a live pull request, four gates:Follow-up, not in this change
The evaluation context also carries
buildIsNotCurrent, which marks a gate whose run predates the latest push. Surfacing it would stop a green gate on stale code from reading as passing.🤖 Generated with Claude Code
https://claude.ai/code/session_01EnkNZwrGWfCeQDsHVkvPuE