Skip to content

Pair Downstream with a saas namesake only when a PR of it is open - #2123

Closed
joepio wants to merge 1 commit into
developfrom
claude/downstream-pairing-pr-lookup
Closed

joepio wants to merge 1 commit into
developfrom
claude/downstream-pairing-pr-lookup

Conversation

@joepio

@joepio joepio commented Oct 6, 2026

Copy link
Copy Markdown
Member

Before: the Downstream job's "Pick the atomic-saas branch" step could never list atomic-saas pull requests, because the dispatch token gets a 403 ("Resource not accessible by personal access token"). Every failed lookup fell back to pairing with a same-named saas branch, so a stale branch left after its PR merged was built instead of main. Its old Cargo.lock then failed cargo --locked and turned the Main check red for a change that had nothing to do with it (#2114, the wuchale key fix, closed and redone as #2118).

After: when the PR list is unreadable, the step asks the commit's own PR list next (commits/<branch>/pulls), which a token that can read the branch may also read, and only counts an open PR whose head is that branch. Only when both lookups fail does it pair with the namesake as before, with the same warning, so a branch that really adds dependencies is still not built against main by accident.

How: one || fallback in .github/workflows/main.yml. Checked by running the step script with the first lookup forced to 403: the stale claude/project-thread-8tdupo now builds main, an open PR's branch (codex/cloud-server-audit-20261006) still pairs, a branch without a namesake builds main, and with both lookups forced to fail the old warning and namesake pairing remain. Not verified: that the real dispatch token may call the commit endpoint; if it cannot, behaviour is unchanged and the real fix is giving the token "Pull requests: read" on atomic-saas (Joep's secret).


Generated by Claude Code

…en if the PR list is unreadable

Before: the dispatch token cannot list atomic-saas pull requests (403), so the
open-PR check always failed and Downstream paired with any same-named saas
branch, including a stale one left after its PR merged. Its old Cargo.lock then
failed cargo --locked and turned the Main check red for a change that had
nothing to do with it (#2114).

After: when the PR list is unreadable, the commit's own PR list is asked next,
which a token that can read the branch may also read. Only when both fail does
the step pair with the namesake, as before, with the same warning.
joepio added a commit that referenced this pull request Oct 8, 2026
Combines #2123, #2127, #2133, #2134, #2135, #2136, #2138, #2140, #2141, #2142, #2143, #2147, #2149, #2132, #2121, #2129, #2146 and #1870. Includes fixes for the combination: Dagger mount for the form validation cases, drive mapping list without the flush sentinel, web_time in search, sidebar resize test at the touch bar height.

joepio commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Landed on develop through the batch #2153 (d102056), with this PR's head unchanged. Closing as merged.


Generated by Claude Code

@joepio joepio closed this Oct 8, 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.

1 participant