-
Notifications
You must be signed in to change notification settings - Fork 9
ci(#388): fail roll-up when tests are skipped on pull_request_target #400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -367,10 +367,15 @@ jobs: | |
| steps: | ||
| - name: Check results | ||
| env: | ||
| EVENT_NAME: ${{ github.event_name }} | ||
| GATE_RESULT: ${{ needs.gate.result }} | ||
| DETECT_RESULT: ${{ needs.detect.result }} | ||
| TESTS_RESULT: ${{ needs.functional-tests.result }} | ||
| run: | | ||
| if [ "$EVENT_NAME" = "pull_request_target" ] && [ "$DETECT_RESULT" = "skipped" ]; then | ||
| echo "::error::Detect was skipped on pull_request_target — tests were not authorized to run" | ||
| exit 1 | ||
| fi | ||
|
Comment on lines
+370
to
+378
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Protected workflow file modified This PR modifies .github/workflows/functional-tests.yml, which is a protected governance/infrastructure path requiring explicit human review and must not be auto-approved. Ensure the PR receives the required human approval (e.g., CODEOWNERS) before merge. Agent Prompt
Comment on lines
+375
to
+378
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Label events fail rollup On pull_request_target, the roll-up now hard-fails when detect is skipped; because the workflow triggers on any labeled event but gate is skipped unless the applied label is exactly ok-to-test, adding any other label will skip gate/detect and fail functional-tests-complete (even for already-authorized PRs). This can unexpectedly block merges when maintainers apply unrelated labels after tests have passed. Agent Prompt
|
||
| if [ "$GATE_RESULT" = "failure" ] || [ "$GATE_RESULT" = "cancelled" ]; then | ||
| echo "::error::Gate job ${GATE_RESULT}" | ||
| exit 1 | ||
|
Comment on lines
+375
to
381
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Gate failure masked functional-tests-complete checks for detect==skipped before checking needs.gate.result, so if the gate job fails/cancels (causing detect to be skipped), the roll-up exits with a misleading “not authorized” message instead of reporting the gate failure. This makes diagnosing real gate errors harder. Agent Prompt
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[low] error-message-format
The new error message uses a static string rather than interpolating DETECT_RESULT, unlike the existing error messages which interpolate their respective variables. Since this branch only executes when DETECT_RESULT is exactly skipped, interpolation would add redundant information. Minor stylistic inconsistency.
Suggested fix: Optionally interpolate for visual consistency: echo ::error::Detect was skipped on pull_request_target (${DETECT_RESULT}) — tests were not authorized to run