ci(functional-tests): use pull_request_target for fork PR support - #2534
Conversation
PR Summary by QodoCI: Run functional tests via pull_request_target with fork-safe gating Description
Diagram
High-Level Assessment
Files changed (1)
|
Site previewPreview: https://41d0a016-site.fullsend-ai.workers.dev Commit: |
Code Review by Qodo
1.
|
|
🤖 Review · |
| # version and config stay in sync across both places. | ||
| - name: Set OpenShell version | ||
| if: steps.changes.outputs.relevant != 'false' | ||
| run: echo "OPENSHELL_VERSION=0.0.38" >> "${GITHUB_ENV}" |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🤖 Finished Review · ✅ Success · Started 9:21 PM UTC · Completed 9:33 PM UTC |
ReviewFindingsHigh
Medium
Low
Previous runReviewFindingsHigh
Low
Previous runReviewFindingsHigh
Low
Labels: PR modifies CI workflow infrastructure (.github/workflows/functional-tests.yml) to add pull_request_target fork support. Previous runReviewFindingsHigh
Low
Previous run (2)ReviewFindingsHigh
Low
Labels: PR modifies CI workflow infrastructure (.github/workflows/functional-tests.yml) to add pull_request_target fork support. |
| @@ -163,12 +264,12 @@ jobs: | |||
| run: make functional-tests | |||
There was a problem hiding this comment.
[low] secrets exposure
The functional-tests job exposes EVAL_GH_TOKEN and GCP WIF credentials to fork PR code after gate authorization. The gate mitigates unauthorized access, but the blast radius of a compromised ok-to-test label includes these secrets. Inherent to the pull_request_target pattern and matches the accepted e2e.yml risk profile.
The functional tests workflow used pull_request, which meant fork PRs never received secrets — causing GCP auth to fail unconditionally. Apply the same pattern as e2e.yml: - Switch to pull_request_target with a gate job for PR authorization - Add change-relevance filtering so PRs without eval/scaffold changes skip - Add a secrets-check step to gracefully skip when secrets are unavailable - Pin all actions to full-length commit SHAs - Set persist-credentials: false when checking out untrusted PR head code Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
- Add allow-unsafe-pr-checkout for checkout@v7 on pull_request_target (without it, fork PR head checkouts are blocked) - Add .github/scripts/ to paths filter and grep regex so openshell version bumps re-trigger functional tests Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
53106e3 to
470372d
Compare
|
🤖 Finished Review · ✅ Success · Started 11:06 PM UTC · Completed 11:17 PM UTC |
|
🤖 Finished Review · ✅ Success · Started 2:02 PM UTC · Completed 2:14 PM UTC |
| with: | ||
| ref: ${{ github.sha }} # Base branch only — never checkout PR head in gate | ||
|
|
||
| - name: Check PR authorization |
There was a problem hiding this comment.
[medium] naming-abstraction-misalignment
The workflow reuses .github/actions/check-e2e-authorization for functional test authorization, but the action's name, description, and default docs_url are all e2e-specific. This creates a naming mismatch and will direct users to the wrong documentation (e2e-testing.md instead of functional testing docs) when authorization fails.
Suggested fix: Either: (1) rename the action to something generic like check-pr-authorization and update its description and docs_url parameter, or (2) pass a custom docs_url parameter pointing to functional test documentation when invoking the action from this workflow.
| @@ -118,12 +221,12 @@ jobs: | |||
| run: make functional-tests | |||
There was a problem hiding this comment.
[low] secret-exposure
The functional-tests job exposes EVAL_GH_TOKEN and GCP WIF credentials to fork PR code after gate authorization. The gate mitigates unauthorized access, but the blast radius of a compromised ok-to-test label includes these secrets. This is inherent to the pull_request_target pattern and matches the accepted e2e.yml risk profile.
| timeout-minutes: 5 | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write |
There was a problem hiding this comment.
[low] action-version-pinning
Actions are SHA-pinned with version comments (e.g., actions/checkout@9c091bb...# v7.0.0), which is a security best practice. However, the reference workflow (e2e.yml) uses semver tags (@v7). The inconsistency is minor — SHA pinning is strictly more secure.
|
🤖 Finished Retro · ✅ Success · Started 2:23 PM UTC · Completed 2:32 PM UTC |
Retro: PR #2534 — ci(functional-tests): use pull_request_target for fork PR supportTimelineThis was a human-authored PR by
Observations4 review runs (3 completed) for a 1-file CI config change. The review agent requested changes 3 times, all overridden by the human. Key friction points:
AssessmentAll issues observed on this PR are already tracked in the existing issue backlog. The most impactful improvements would be resolving #1452 (deduplicate same-SHA reviews), #1282 (skip merge-only re-reviews), and #2115 (COMMENT verdict for human PRs with medium/low findings). Together these would have reduced this PR from 4 review runs to 1, saving significant tokens and eliminating the noise of 3 false CHANGES_REQUESTED verdicts. No new proposals filed — all findings are covered by existing issues. |
…ests-fork-support ci(functional-tests): use pull_request_target for fork PR support
Summary
pull_requesttopull_request_targetwith a gate job so fork PRs receive secrets (same pattern as e2e.yml)eval/orinternal/scaffold/changes skip the testspersist-credentials: falseon untrusted checkoutFixes the failure seen in https://github.com/fullsend-ai/fullsend/actions/runs/27982063986/job/82816098640?pr=2346 where fork PRs hit
google-github-actions/authwith empty secrets.Test plan
eval/orinternal/scaffold/skip gracefully🤖 Generated with Claude Code