Skip to content

ci(#1975): move functional, behaviour and vouch workflows off pull_request_target - #1976

Merged
waynesun09 merged 3 commits into
mainfrom
agent/1975-move-off-pull-request-target
Nov 12, 2026
Merged

waynesun09 merged 3 commits into
mainfrom
agent/1975-move-off-pull-request-target

Conversation

@fullsend-ai-coder

@fullsend-ai-coder fullsend-ai-coder Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1975.

GitHub blocks pull_request_target by default on public repos from 2026-12-02 (next brownout 2026-11-16). This PR moves Functional Tests, Behaviour Tests and Vouch Check off it, with the same design as fullsend-ai/fullsend#9246.

What changes for contributors

PR from Functional Tests and Behaviour Tests
A branch in this repo Run on pull_request, gated as before (write access or trusted bot)
A fork Do not run. A user with write access reviews the latest push and comments /ok-to-test <full 40-char sha>. The checks functional-tests-complete and behaviour then land on that sha. A new push needs a new comment.
  • The ok-to-test label no longer starts a run.
  • Fork authors with write access also need /ok-to-test, because fork pull_request runs get no secrets.
  • Vouch Check runs every 10 minutes instead of on PR open. It closes and comments on PRs from unvouched authors opened or reopened in the last 60 minutes.
  • merge_group, push to main, the nightly and fullsend's release.yml call are unchanged. The required checks (script-test, test, commit-lint, skillsaw) come from pull_request workflows already.

Changes

File Change
functional-tests.yml, behaviour-tests.yml pull_request with gh-aw's same-repo guard (head.repo.id == repository_id); new workflow_call inputs pr_number / head_sha (optional in functional-tests.yml, so release.yml is unaffected); separate *-ok-to-test-<pr> concurrency groups; a result output
ok-to-test.yml (new) issue_comment → authorize (commenter role + exact sha) → calls both suites → report completes the check runs. Only authorize and report hold checks: write / pull-requests: write
vouch-check.yml schedule + workflow_dispatch (dry_run), runs .github/scripts/vouch-sweep.sh
.github/scripts/check-e2e-authorization.sh, the action /ok-to-test <sha> mode: comment read by id; reasons ok_to_test, untrusted_commenter, missing_sha, stale_ok_to_test
.github/scripts/check-rollup-result.sh pull_request / issue_comment; a fork failure names the /ok-to-test <sha> to post
.github/scripts/workflow-triggers-test.sh (new) Fails if any workflow declares pull_request_target; only fullsend.yaml is allowlisted (it moves in fullsend-ai/fullsend#9230)
CONTRIBUTING.md, eval/README.md New /ok-to-test instructions

gh-aw reference (main at 62ddc3a8): same-repo guard in pkg/workflow/expression_builder.go L377-385; role-gated slash commands in pkg/workflow/command.go and role_checks.go L152; writes kept out of jobs that run PR code (architecture.mdx L145). Links are in #1975.

Validation

Real runs in nonflux/tmp-1975-ok-to-test, a copy of this tree with the suite steps stubbed to "check out, print HEAD" (no secrets there):

Case Result
Same-repo PR (nonflux/tmp-1975-ok-to-test#1) pull_request: gate, detect, functional-tests, functional-tests-complete, behaviour all pass
Fork PR, no comment (nonflux/tmp-1975-ok-to-test#2) gate/detect/behaviour skipped; functional-tests-complete fails with comment '/ok-to-test 7bc7d45446f2fd76419d745901917b8a7af046d1' on the PR
/ok-to-test 7bc7d45 Refused, reason=missing_sha
/ok-to-test <other sha> Refused, reason=stale_ok_to_test, gate comment updated
/ok-to-test 7bc7d454… Both suites log ran on 7bc7d45446f2fd76419d745901917b8a7af046d1; functional-tests-complete and behaviour success on that sha (app 15368)
Vouch Check dry_run #2: waynesun09 has write access; skipping

On this PR, the pull_request runs of both workflows ran in this repo with real secrets. The stray cancelled pull_request_target runs come from main's old workflow sharing the concurrency group, and stop after merge.

Script tests: check-e2e-authorization-test.sh, check-rollup-result-test.sh (24), vouch-sweep-test.sh, workflow-triggers-test.sh pass; actionlint clean.

After merge

Comment /ok-to-test <sha> on one real fork PR to confirm the path with real secrets; issue_comment workflows only run from the default branch, so this cannot run before merge.

GitHub blocks pull_request_target by default on public repos from
2026-12-02. This is the codeable part of moving the functional,
behaviour and vouch workflows off it; the .github/workflows/ edits
(pull_request triggers, new ok-to-test.yml, scheduled vouch-check.yml)
are left for the maintainer: the code agent cannot push
.github/workflows/.

- check-e2e-authorization.sh + action: port fullsend's /ok-to-test
  command mode (EVENT_NAME=issue_comment). The comment is read from the
  API by id, must be on the PR and by the commenter, the commenter needs
  admin/maintain/write, and the first line must name the full 40-char
  head sha. New inputs event_name, commenter_login, comment_id; new
  output head_sha; reasons ok_to_test, untrusted_commenter, missing_sha,
  stale_ok_to_test, error. Gate comment text points at
  /ok-to-test <full sha of the latest push>.
- check-rollup-result.sh: pull_request and issue_comment replace
  pull_request_target; the labeled-event mirroring is removed; a
  skipped detect on a PR event fails with a message naming
  /ok-to-test <sha>.
- vouch-sweep.sh: scheduled vouch gate ported from fullsend, reading
  VOUCHED.td from fullsend-ai/fullsend's vouched branch as today.
  Replaces vouch-check-test.sh in make script-test.
- workflow-triggers-test.sh: yq guard that fails when any workflow but
  the allowlisted fullsend.yaml declares pull_request_target under on:.
- CONTRIBUTING.md, eval/README.md: document /ok-to-test <sha>.

workflow-triggers-test.sh fails until the maintainer moves
functional-tests.yml, behaviour-tests.yml and vouch-check.yml off
pull_request_target; that is the guard working as intended.

Note: pre-commit could not fetch hook repos in the sandbox (TLS error);
hooks were run directly at their pinned versions (pre-commit-hooks
6.0.0, shellcheck-py 0.10.0.1, lint-release-cases) and passed. gitleaks
ran via scan-secrets. make lint could not run (no uvx); skillsaw 0.18.0
--strict was run directly and passed.

Related to #1975
@waynesun09

Copy link
Copy Markdown
Member

/fs-fix-stop

@github-actions github-actions Bot added the fullsend-no-fix Skip bot-triggered fix agent runs label Nov 12, 2026
@github-actions

Copy link
Copy Markdown

Fix agent disabled for this PR. Remove the fullsend-no-fix label or use /fs-fix to re-engage.

…quest_target

GitHub blocks pull_request_target by default on public repos from
2026-12-02. Same-repo PRs now run Functional Tests and Behaviour Tests on
pull_request behind gh-aw's same-repo guard. Fork PRs run only after a
writer comments `/ok-to-test <sha>`: ok-to-test.yml authorizes that exact
sha, creates functional-tests-complete and behaviour check runs on it,
calls both suites through workflow_call and completes the checks from
their results. Vouch Check runs vouch-sweep.sh on a 10-minute schedule.

merge_group, push and fullsend release.yml calls are unchanged.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
@fullsend-ai-review

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Ended 7:28 PM UTC

Commit: e295691 · View workflow run →

This review was superseded by a newer commit. Check the current pull request HEAD's review status before merging.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ⚠️ Cancelled · Started 7:30 PM UTC · Completed 7:38 PM UTC

Commit: 59e17da · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.35

This review was superseded by a newer commit. Check the current pull request HEAD's review status before merging.

A called functional-tests-complete job that finished its steps in seconds
was marked cancelled at its 1-minute limit, and ok-to-test.yml now reads
its result. The comments now say what pull_request actually trusts: a fork
PR controls the workflow file, checkout does not enforce /ok-to-test, and
the roll-up is not a required check.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
@waynesun09 waynesun09 changed the title ci(#1975): add /ok-to-test <sha> gate, vouch sweep and trigger guard ci(#1975): move functional, behaviour and vouch workflows off pull_request_target Nov 12, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 7:40 PM UTC · Completed 7:51 PM UTC

Commit: 793efc7 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.60

@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate risk reflects extensive CI workflow and protected path modifications by an established bot author, balanced by solid test coverage, moderate historical churn across modified files, and complete alignment with linked issue acceptance criteria.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [protected-path] .github/workflows/ok-to-test.yml — This PR modifies protected governance/infrastructure paths: .github/actions/check-e2e-authorization/action.yml, .github/scripts/check-e2e-authorization-test.sh, .github/scripts/check-e2e-authorization.sh, .github/scripts/check-rollup-result-test.sh, .github/scripts/check-rollup-result.sh, .github/scripts/vouch-check-test.sh (removed), .github/scripts/vouch-sweep-test.sh, .github/scripts/vouch-sweep.sh, .github/scripts/workflow-triggers-test.sh, .github/workflows/behaviour-tests.yml, .github/workflows/functional-tests.yml, .github/workflows/ok-to-test.yml, .github/workflows/vouch-check.yml. The PR links issue ci: move functional, behaviour and vouch workflows off pull_request_target before the 2026-12-02 default block #1975 and explains the rationale, but human approval is always required for protected-path changes, regardless of context.

Low

  • [injection-vuln] .github/scripts/check-rollup-result.sh:38 — The new HEAD_SHA check (printf '%s' "$HEAD_SHA" | grep -Eqx '[0-9a-f]{40}') is line-based: -x anchors each line, so a value whose first line is a valid 40-hex SHA followed by \n::warning::injected passes and is echoed verbatim into the ::error:: workflow-command line. The existing regression test (check-rollup-result-test.sh) only uses abc\n::warning::injected, so it misses this bypass. Current in-repo callers supply GitHub-generated or already whole-string-validated SHAs, but functional-tests.yml accepts a free-form head_sha via workflow_call, so the script comment that only a 40-hex SHA reaches the line does not hold for every caller.
    Remediation: Use a whole-string comparison, e.g. [[ "$HEAD_SHA" =~ ^[0-9a-f]{40}$ ]], and add a regression test where a valid SHA is followed by an injected command on the next line.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

@fullsend-ai-review fullsend-ai-review 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.

See the review comment for full details.

Comment thread .github/scripts/check-rollup-result.sh Resolved

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving. This ports fullsend#9246 to agents ahead of GitHub's 2026-12-02 pull_request_target default block. Functional and behaviour tests run on pull_request with the same-repo guard, forks need /ok-to-test from a writer, vouch-check runs on a schedule, and a guard test rejects pull_request_target. Validated in a temp repo, and CI is green.

@waynesun09
waynesun09 added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit cf7123e Nov 12, 2026
71 of 76 checks passed
@waynesun09
waynesun09 deleted the agent/1975-move-off-pull-request-target branch November 12, 2026 22:40

This branch was previously deployed

1 inactive deployment
dev — 793efc74 Deployed Nov 12, 2026 by waynesun09 via behaviour #1949
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fullsend-no-fix Skip bot-triggered fix agent runs ready-for-review Triggers review agent dispatch risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: move functional, behaviour and vouch workflows off pull_request_target before the 2026-12-02 default block

1 participant