Skip to content

ci(integration): fix fork-lane checkout opt-in and per-event concurrency - #62

Merged
mislavivanda merged 1 commit into
mainfrom
ci/integration-fork-lane-fixes
Sep 17, 2026
Merged

mislavivanda merged 1 commit into
mainfrom
ci/integration-fork-lane-fixes

Conversation

@mislavivanda

@mislavivanda mislavivanda commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Why

Fork PR #61 exposed two issues in the integration.yml fork lane:

  1. actions/checkout@v4 now refuses fork-code checkout in pull_request_target workflows unless explicitly opted in. The approved run for fix(pi-extension): guard before_agent_start against undefined systemPrompt #61 failed at the checkout step with:

    Refusing to check out fork pull request code from a 'pull_request_target' workflow…

    The opt-in is safe in this workflow specifically because the compensating controls GitHub's guidance calls for are already in place: the integration-tests environment approval is a required manual review gate in front of every suite job, the head SHA is pinned at event time (later pushes spawn a new run needing fresh approval), and the workflow file always comes from main (a fork cannot alter the pipeline). The flag is conditional — inert in the same-repo pull_request lane.

  2. Both pull_request and pull_request_target fire for every fork PR and shared one concurrency group (integration-<PR>). GitHub keeps only the newest queued run per group, so the sibling lane cancelled the fork lane 2s after creation ("Canceling since a higher priority waiting request for integration-61 exists") — killing the only lane that reports the required integration-success check for fork PRs, wedging the PR at 'Expected'. Keying the group by event name gives each lane its own queue. Exactly one lane executes suites for any given PR (the decide() IS_FORK gate), so per-lane serialization loses nothing and live runs stay serialized per PR.

Rollout note

Re-runs reuse the original workflow snapshot, so after this merges, wedged fork PRs (#61) need a fresh event — close/reopen — to pick up the fixed workflow.


Summary by cubic

Fixes the fork PR integration workflow so fork lanes no longer fail at checkout, get cancelled by the sibling pull_request lane, or leave the read-only GITHUB_TOKEN in .git/config.

  • Opts into fork-code checkout in pull_request_target via allow-unsafe-pr-checkout; safe because manual approval gates the job and the workflow file comes from main.
  • Keys the concurrency group by event name so each lane queues independently; previously the shared group let the newer run cancel the fork lane.
  • Disables persist-credentials on suite checkouts since the approved fork code never needs to push or pull.

Rollout note: Re-runs reuse the original workflow snapshot, so wedged fork PRs need a fresh event (close/reopen) to pick up the fixed workflow.

Written for commit ecce5c0. Summary will update on new commits.

Review in cubic

@mislavivanda
mislavivanda requested a review from a team as a code owner September 17, 2026 12:45
@mislavivanda
mislavivanda force-pushed the ci/integration-fork-lane-fixes branch from acee4d6 to aed8a28 Compare September 17, 2026 12:46
aprojic
aprojic previously approved these changes Sep 17, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread .github/workflows/integration.yml
Comment thread .github/workflows/integration.yml
Three fixes hardening + unwedging fork-PR live tests (first hit by PR #61):

1. checkout@v4 now refuses fork-code checkout in pull_request_target
   workflows by default. Opt in explicitly on the five suite jobs -
   safe here because the integration-tests environment approval is a
   required manual review gate, the head SHA is pinned at event time,
   and the workflow file always comes from main.

2. Key the concurrency group by event name. Both pull_request and
   pull_request_target fire for every fork PR and shared one group,
   so the newer queued run cancelled the older one - always killing
   the fork lane, the only lane that reports integration-success for
   fork PRs. Exactly one lane executes suites per PR, so per-lane
   serialization loses nothing.

3. persist-credentials: false on the suite checkouts - the approved
   fork code has no need for the (read-only) GITHUB_TOKEN that
   checkout would otherwise leave in .git/config.

Signed-off-by: Mislav Ivanda <mislavivanda454@gmail.com>
@mislavivanda
mislavivanda merged commit 9b76674 into main Sep 17, 2026
33 checks passed
@mislavivanda
mislavivanda deleted the ci/integration-fork-lane-fixes branch September 17, 2026 13:19
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants