Skip to content

Fix: Buildkite detective skip conditions exit cleanly instead of failing - #1947

Draft
v1v with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-skip-exits-buildkite-analyser
Draft

Fix: Buildkite detective skip conditions exit cleanly instead of failing#1947
v1v with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-skip-exits-buildkite-analyser

Conversation

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

The buildkite PR detective workflow was reporting failures when skip conditions were met (no PR association, build not failed, no failed jobs). The skip() function used sys.exit(1), causing the job to fail rather than complete successfully.

Changes

  • .github/workflows/gh-aw-estc-pr-buildkite-detective.md: Changed skip() function exit code from 1 to 0
  • .github/workflows/gh-aw-estc-pr-buildkite-detective.lock.yml: Recompiled workflow with updated exit code
def skip(reason):
    subprocess.run(['bash', '-c', f'echo "::notice::{reason}"'], check=False)
    print(reason)
    sys.exit(0)  # was: sys.exit(1)

The workflow still emits notice messages but now completes successfully when skipping, preventing false failure notifications.

The skip() function in the buildkite PR detective workflow now exits
with code 0 instead of 1 when conditions don't require analysis (no PR,
build not failed, or no failed jobs). This prevents the workflow from
reporting false failures when it should skip gracefully.

Closes #1946

Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix skip behavior in Buildkite PR build analyser Fix: Buildkite detective skip conditions exit cleanly instead of failing Aug 28, 2026
Copilot finished work on behalf of v1v August 28, 2026 12:09
Copilot AI requested a review from v1v August 28, 2026 12:09
@v1v

v1v commented Aug 28, 2026

Copy link
Copy Markdown
Member

@copilot run the make compile

@v1v

v1v commented Aug 28, 2026

Copy link
Copy Markdown
Member

@copilot given https://github.github.com/gh-aw/ can we configure the skip for the other jobs to be skipped conditionally somehow?

Run make compile to update all lock files with compiler improvements:
- Fix report-failure-as-issue to use input parameter instead of hardcoded "true"
- Update workflow metadata hashes

Co-authored-by: v1v <2871786+v1v@users.noreply.github.com>

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run the make compile

Done! I've run make compile and committed the updated lock files. The compilation applied compiler improvements including fixing report-failure-as-issue to use the input parameter instead of being hardcoded. Changes committed in c771c9b.

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

@copilot given https://github.github.com/gh-aw/ can we configure the skip for the other jobs to be skipped conditionally somehow?

Yes, there are two approaches to conditionally skip the agent job when there's no data:

Option 1: Move data fetch to activation job (better architecture)
Move the "Resolve event context and fetch Buildkite data" step from the agent job to the activation job, set a step output (e.g., has_data: 'true'/'false'), then make the agent job conditional:

agent:
  needs: activation
  if: needs.activation.outputs.has_data == 'true'

Option 2: Use noop safe output (current architecture)
Keep the current structure but instead of calling skip() early, let the agent run and emit a noop safe output with "No data to analyze". The workflow already has safe-outputs: noop: configured for this pattern.

Option 1 is cleaner because it avoids starting the agent job entirely when there's nothing to do. The current fix (exit 0) prevents false failures, but the agent still runs and consumes resources. Would you like me to implement Option 1?

Copilot finished work on behalf of v1v August 28, 2026 12:19
@github-actions github-actions Bot added the small_boom Small PR blast radius; usually low human-review need label Aug 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

TL;DR

Internal: CI failed in Verify compiled workflows because generated lock files were stale after source workflow edits. Re-run make compile and commit the resulting .lock.yml updates from this branch.

Remediation

  • Run make compile locally in this PR branch and commit all changed generated lock files.
  • Push that commit; CI should pass once Ensure lock files are up to date sees a clean diff.
Investigation details

Root Cause

The failing step is a generated-artifact consistency check, not a runtime or logic failure. Source workflow changes landed without the corresponding regenerated lock files, so the CI diff check fails.

Evidence

Validation

  • Not run in this environment (read-only detective workflow).

Follow-up

  • If this recurs often, consider adding a local pre-push/pre-commit reminder to run make compile when touching gh-aw-*.md sources.

What is this? | From workflow: Trigger PR Actions Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small_boom Small PR blast radius; usually low human-review need

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skip exits with 1 for the buildkite pr build analyser

2 participants