Skip to content

Confirm the pull request is open before a Base fix - #2152

Merged
JacobStephens2 merged 2 commits into
mainfrom
issue-2151
Nov 13, 2026
Merged

JacobStephens2 merged 2 commits into
mainfrom
issue-2151

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

A Ticket run writes a Base fix issue only after a fresh read, still holding the look, shows its pull request is open.

BaseFix::fix_through
  look
  list open base-fix issues
  covering issue exists
    wait, or start a Left one again
  no covering issue
    confirm_pull_request_open          # Outside::pull_request_state
      open
        create the Base fix issue and start it
      closed, merged, missing, or unreadable
        fail the Ticket run and write nothing

The seam is Outside::pull_request_state, exercised by BaseFix::fix. LaunchAndGitHub reads through GitHub::pr_state. A view of a different URL, or a URL outside the issue's repository, fails closed with PR <url> is not open.

Evidence

Execution evidence

  • Before: 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::tests
    test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 1853 filtered out; finished in 0.01s
    
    That run includes a_pull_request_that_is_not_open_writes_no_base_fix and a_pull_request_that_cannot_be_read_writes_no_base_fix. cargo test --bin thirdshift github::tests passed (2 passed), including a_pull_request_view_is_its_state_only_when_it_is_that_pull_request.
  • Full suite on ff401127: scripts/affected-tests main. npm test --prefix site passed (111.25s, including docs:check). cargo nextest run passed: 4517 tests run: 4517 passed (28 slow), 199 skipped (3334.977s).

Visual evidence

How it works, 1440×900, Inherited failure paragraph:

Before
After

User manual, 1440×900, Base fix steps:

Before
After

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_repo calls split_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_state serves the new view and PullRequestState::from_json.

Standards

  • 1 (remainder). PullRequest::from_json still matches OPEN / CLOSED / MERGED itself (src/github.rs lines 1752-1759). Declined. A missing state there is gh output has no state, and an unknown state is gh output has an unknown PR state {other} with no URL. The shared parser's message is gh 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::tests passed (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 from docs/guide.md by site/generate-docs.mjs. Both reviewers accepted the exclusion. npm run docs:check --prefix site passed inside npm test --prefix site during scripts/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.

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.
@JacobStephens2
JacobStephens2 merged commit c84de08 into main Nov 13, 2026
28 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-2151 branch November 13, 2026 12:03
@JacobStephens2 JacobStephens2 mentioned this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confirm the pull request is open before a Base fix

1 participant