Skip to content

ci: drop the pull_request_target lane from the integration tests - #128

Merged
mislavivanda merged 4 commits into
mainfrom
ci/drop-fork-integration-lane
Nov 19, 2026
Merged

mislavivanda merged 4 commits into
mainfrom
ci/drop-fork-integration-lane

Conversation

@mislavivanda

@mislavivanda mislavivanda commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Removes the pull_request_target lane from integration.yml, ahead of GitHub's Dec 2 change. Once this is merged, Actions policy 14618 (which allows pull_request_target for integration.yml) can be deleted.

Why

  • The approval could land on the wrong commit. The fork lane checked out a fork PR's head and ran its install and test code with DAYTONA_API_KEY, gated only by the integration-tests approval. That approval binds to whichever run is waiting, and each run is pinned to the commit that was the PR head when it started. A run waiting for approval keeps its place in the queue; feat(agentenv-daytona)!: migrate to Daytona SDK 2.x (v0 namespace) #111's run sat behind a Nov 16 run on a commit that was no longer on the branch. So a contributor could push a malicious commit and then a clean one: "Files changed" shows the clean one, while the waiting run checks out the malicious one.
  • The required check passed too early. The lane that doesn't own a PR posted a skipped integration-success, which GitHub counts as passing. feat(agentenv-daytona)!: migrate to Daytona SDK 2.x (v0 namespace) #111 showed as mergeable on Nov 17 while its live run was still queued. With one lane, in-repo PRs wait for the real result.

What changes

  • on: no longer includes pull_request_target. The suites check out the default ref again (no ref:, no allow-unsafe-pr-checkout); persist-credentials: false stays.
  • decide() runs suites only for PRs from branches in this repo, and for dispatch. For a fork PR that touches a live-tested package, it sets needs_maintainer_run.
  • integration-success never skips. With needs_maintainer_run, it reports as integration-success (fork PR, needs a maintainer run), so the required check stays "Expected" and the fork PR can't merge untested. Fork PRs that don't touch a live-tested package pass as before.
  • The concurrency key drops the event name, which only separated the two lanes.
  • CONTRIBUTING.md tells fork contributors why integration-success stays pending on their PR, that a maintainer runs the live tests on a copy of it and merges that copy, and that the merged commit credits them as co-author.

Testing

  • actionlint passes. I extracted the decide step and ran it locally for six cases: in-repo PRs and fork PRs, each with and without a package change, plus dispatch with pi and with all. It routes all six correctly.
  • Fork PRs are held. I opened test fork PR test: fork PR held at integration-success (do not merge) #129 from mislavivanda/integrations, built on this branch plus a change in packages/pi-extension. Its integration run (44525506813) ran no suites and reported integration-success (fork PR, needs a maintainer run). The commit had no check named integration-success, so the required check stayed "Expected" (rollup PENDING).
  • Why the maintainer merges a copy. I pushed the same commit to an in-repo branch and dispatched the workflow on it (run 44525633542; I rejected the deployment on purpose). Its integration-success was attached to the commit, but it didn't count for test: fork PR held at integration-success (do not merge) #129: it's not in test: fork PR held at integration-success (do not merge) #129's rollup, and its check suite isn't linked to the PR. So a maintainer run can't make the fork PR itself mergeable, and the maintainer merges an in-repo copy instead.
  • Not testable before merge: the in-repo gate fix. Until this is merged, main's pull_request_target lane still posts a skipped integration-success on every PR. After merge, an in-repo PR that touches a package should show integration-success as "Expected" until its live run is approved and passes.

#129, its branches, and main's old fork-lane run on it are cleaned up. That run was cancelled without approval.

Related issue(s)

None.

Scope

  • This PR touches no more than one package/app (release routing is by changed file path).
  • The PR title follows Conventional Commits
    (e.g. feat(pi-extension): ..., fix(adk-plugin): ...) — it becomes the squash-commit
    message that release-please reads.

Checks

  • I ran the affected package's lint/build/test locally and they pass. (CI-only change. actionlint passes, plus the tests above.)
  • I updated documentation where relevant. (CONTRIBUTING.md)

Legal

  • Every commit is signed off for the
    DCO (git commit -s); the sign-off matches the
    commit author.
  • I agree to the
    Contributor License Agreement.
    On my first PR, the CLA assistant will comment and I will reply to sign (once).

See CONTRIBUTING.md for
details.

The fork lane checked out a fork PR's head and ran its install and test
code with DAYTONA_API_KEY, gated only by the integration-tests approval.
That approval binds to whichever run is waiting, and each run is pinned
to the commit that was the PR head when it started, so a contributor can
get an older commit approved than the one shown in "Files changed".

Run the suites only on pull_request from branches in this repo. Fork PRs
never get the key, so a fork PR that touches a live-tested package now
reports integration-success under another name and the required check
stays "Expected". Maintainers review it, push the reviewed commit to a
branch here and merge a PR from that branch instead (CONTRIBUTING.md):
checks from runs on other branches don't count for the fork PR, even on
the same commit.

This also removes the other lane's skipped integration-success, which
GitHub counted as passing, so in-repo PRs no longer pass the gate before
their live suites ran. Policy 14618 can be deleted once this is merged.

Signed-off-by: Mislav Ivanda <[email protected]>
@mislavivanda
mislavivanda force-pushed the ci/drop-fork-integration-lane branch from 366199f to 7403760 Compare November 19, 2026 12:41
@mislavivanda
mislavivanda marked this pull request as ready for review November 19, 2026 12:42
@mislavivanda
mislavivanda requested a review from a team as a code owner November 19, 2026 12:42

@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.

All reported issues were addressed across 2 files

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

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .github/workflows/integration.yml Resolved
Contributors only need to know why integration-success stays pending on
their PR and that a maintainer runs the live tests on a copy of it; the
maintainer runbook doesn't belong in a contributor-facing document.

Signed-off-by: Mislav Ivanda <[email protected]>
A fork PR that touches a live-tested package is merged through a copy
from a branch in this repo, so the contributor's own PR gets closed.
Say up front that the merged commit credits them as co-author.

Signed-off-by: Mislav Ivanda <[email protected]>

@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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread CONTRIBUTING.md Resolved
The paragraph's opening condition covered every PR that changes a
live-tested package, but only fork PRs go through a maintainer's copy;
PRs from branches in this repo run their live tests on the PR itself.

Signed-off-by: Mislav Ivanda <[email protected]>
@mislavivanda
mislavivanda merged commit ada17ac into main Nov 19, 2026
40 checks passed
@mislavivanda
mislavivanda deleted the ci/drop-fork-integration-lane branch November 19, 2026 14:03
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 19, 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