Repository navigation
Confirm the pull request is open before a Base fix - #2152
Merged
Merged
Conversation
A Ticket run writes a Base fix issue only after a fresh read, still holding the look, shows its pull request is open. A closed, merged, missing, or unreadable pull request fails the run and writes nothing.
Share the inbox pull-request state's OPEN, CLOSED and MERGED parser, and parse the view URL with the existing pull-request URL splitter. PullRequest::from_json keeps its own message: a missing state is "gh output has no state", and an unknown state names no URL.
Merged
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
A Ticket run writes a Base fix issue only after a fresh read, still holding the look, shows its pull request is open.
The seam is
Outside::pull_request_state, exercised byBaseFix::fix.LaunchAndGitHubreads throughGitHub::pr_state. A view of a different URL, or a URL outside the issue's repository, fails closed withPR <url> is not open.Evidence
Execution evidence
refs/remotes/origin/main(9cdc717b) writes the Base fix issue in the no-covering-issue branch without another pull-request read. The assertions below were added with the check, so there is no earlier failing run of the same test.After:
cargo test --bin thirdshift base_fix::testsa_pull_request_that_is_not_open_writes_no_base_fixanda_pull_request_that_cannot_be_read_writes_no_base_fix.cargo test --bin thirdshift github::testspassed (2 passed), includinga_pull_request_view_is_its_state_only_when_it_is_that_pull_request.ff401127:scripts/affected-tests main.npm test --prefix sitepassed (111.25s, includingdocs:check).cargo nextest runpassed:4517 tests run: 4517 passed (28 slow), 199 skipped(3334.977s).Visual evidence
How it works, 1440×900, Inherited failure paragraph:
User manual, 1440×900, Base fix steps:
Merge Danger
Door: two-way
Reverting the two commits restores the previous Base fix creation. Nothing is migrated.
Blast Radius: Base fix
A Ticket run whose only red checks are Inherited failures fails, and writes no issue, when its pull request is closed, merged, missing, or unreadable at the moment that issue would be created. Waiting on an existing open Base fix, and starting a Left one again, stay as they are.
Unaddressed findings
Spec raised none. Security raised none. Standards raised two judgement calls. Finding 2 is addressed in
ff401127:pr_url_in_repocallssplit_pull_request_url, then compares the owner and repository case-insensitively, after trimming a trailing slash. Finding 1 is addressed for the identical parser:parse_pr_stateserves the new view andPullRequestState::from_json.Standards
PullRequest::from_jsonstill matchesOPEN/CLOSED/MERGEDitself (src/github.rslines 1752-1759). Declined. A missing state there isgh output has no state, and an unknown state isgh output has an unknown PR state {other}with no URL. The shared parser's message isgh output has an unknown PR state {other:?} for {url}. The Standards reviewer said sharing that copy is not free. The finding names structure, and it supplied no test that behaviour is wrong. After the shared parser,cargo test --bin thirdshift github::testspassed (2 tests).Spec
None.
Security
None.
No finding was left for a Spec or the Day shift, so no triage issue was filed.
Review coverage: both reviewers read every changed file except
site/docs/index.html. That page is generated fromdocs/guide.mdbysite/generate-docs.mjs. Both reviewers accepted the exclusion.npm run docs:check --prefix sitepassed insidenpm test --prefix siteduringscripts/affected-tests main. No other changed file was left unread.Closes #2151
Built with grok grok 1.0.70 (f50904eaee6c) [stable] · default model · default effort
Security review outcome
No unaddressed introduced findings.