Skip to content

Ci fast fail on job failure#5759

Open
jyotshnayaparla-00 wants to merge 1 commit intofeldera:mainfrom
jyotshnayaparla-00:ci-fast-fail-on-job-failure
Open

Ci fast fail on job failure#5759
jyotshnayaparla-00 wants to merge 1 commit intofeldera:mainfrom
jyotshnayaparla-00:ci-fast-fail-on-job-failure

Conversation

@jyotshnayaparla-00
Copy link
Contributor

@jyotshnayaparla-00 jyotshnayaparla-00 commented Mar 5, 2026

Add a 'check-prior-build' job that queries the GitHub API for a prior run on the same commit SHA. If all required binary and Docker digest artifacts are found unexpired, the Rust, Java, and Docker build jobs are skipped and test workflows download artifacts from that prior run instead of rebuilding.

Fixes: #5531

Add a check-prior-build job to ci.yml that queries the GitHub API for a
prior run on the same commit SHA. If all required binary and Docker digest
artifacts are found unexpired, the Rust, Java, and Docker build jobs are
skipped and test workflows download artifacts from that prior run instead
of rebuilding from scratch.

Each test workflow now accepts an artifacts_run_id input passed through
from ci.yml, and uses it as the run-id in actions/download-artifact so
cross-run artifact fetches work with the built-in action and no third-party
dependencies. Build jobs that are skipped leave result=skipped (not
failure), so sentinel cancel jobs and the final main job are unaffected.
@jyotshnayaparla-00 jyotshnayaparla-00 force-pushed the ci-fast-fail-on-job-failure branch from 67e0a3b to 12a497a Compare March 5, 2026 02:23
Copy link
Collaborator

@mythical-fred mythical-fred left a comment

Choose a reason for hiding this comment

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

Solid design. The two-step fallback (consolidate-outputs always runs, defaults to empty run_id) means the job truly never fails and never blocks. The test-integration-runtime.yml gap is intentional — that job runs against deployed infra, not build artifacts.

One soft note: the artifact list fetch uses per_page=100. If a future run ever exceeds 100 artifacts, the check silently falls back to rebuilding (not a correctness bug, just a missed optimization). Worth a comment or bumping to 200.

needs: [invoke-build-rust, invoke-build-java]
needs: [check-prior-build, invoke-build-rust, invoke-build-java]
if: |
always() &&
Copy link
Contributor

Choose a reason for hiding this comment

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

is there some special semantic associated with always() in gha? otherwise this is just if true && a && b and can be rewritten as if a && b

needs: [invoke-build-rust]
needs: [check-prior-build, invoke-build-rust]
if: |
always() &&
Copy link
Contributor

Choose a reason for hiding this comment

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

same q as above

needs: [invoke-build-rust, invoke-build-java]
needs: [check-prior-build, invoke-build-rust, invoke-build-java]
if: |
always() &&
Copy link
Contributor

Choose a reason for hiding this comment

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

same

invoke-generate-sbom:
name: Generate SBOMs
needs: [invoke-build-docker]
if: |
Copy link
Contributor

Choose a reason for hiding this comment

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

same

name: Integration Tests
needs: [invoke-build-docker]
needs: [check-prior-build, invoke-build-docker]
if: |
Copy link
Contributor

Choose a reason for hiding this comment

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

same

name: Integration Tests
needs: [invoke-build-java]
needs: [check-prior-build, invoke-build-java]
if: |
Copy link
Contributor

Choose a reason for hiding this comment

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

same

name: Java Tests
needs: [invoke-build-java]
needs: [check-prior-build, invoke-build-java]
if: |
Copy link
Contributor

Choose a reason for hiding this comment

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

same

name: Publish Crates (Dry Run)
needs: [invoke-build-rust]
needs: [check-prior-build, invoke-build-rust]
if: |
Copy link
Contributor

Choose a reason for hiding this comment

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

same q

type: string
required: false
default: ""
workflow_dispatch:
Copy link
Contributor

Choose a reason for hiding this comment

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

does this also need a run id similar to test-integration-platform.yaml?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

If a CI job is re-enqueued but build passed, start from test phase and don't go through build phase again

3 participants