hack/metrics: add ci-failure-analysis script - #801
Open
Aditya Shantanu (aditya-shantanu) wants to merge 1 commit into
Open
hack/metrics: add ci-failure-analysis script#801Aditya Shantanu (aditya-shantanu) wants to merge 1 commit into
Aditya Shantanu (aditya-shantanu) wants to merge 1 commit into
Conversation
Samples recent failed CI runs, fetches their job logs, and classifies
each failure by root cause:
named_test_fail — a specific Go test emitted "--- FAIL: TestName"
no_free_workers — envtest/integration tests hit resource contention
e2e_timeout — e2e tests timed out waiting for actor/service responses
gcs_access — GCS/S3 bucket access denied when fetching sandbox assets
license_check — hack/verify/licenses.sh detected uncommitted LICENSES changes
verify_fail — other hack/verify-all.sh step failed
unknown — could not classify from log output
Usage:
python hack/metrics/ci-failure-analysis.py \
--repo agent-substrate/substrate \
--fetch-limit 500 --sample 40 \
--save ci-breakdown.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
hack/metrics/ci-failure-analysis.py, a script that samples recent failedpr-workflowCI runs, fetches their job logs, and classifies each failure by root cause rather than treating all CI failures as equivalent.Failure categories:
named_test_fail— a specific Go test emitted--- FAIL: TestNameno_free_workers— envtest/integration tests hit worker resource contentione2e_timeout— e2e tests timed out waiting for actor/service responses (503s, connection resets)gcs_access— GCS/S3 bucket access denied when fetching sandbox assetslicense_check—hack/verify/licenses.shdetected uncommitted LICENSES changesverify_fail— otherhack/verify-all.shstep failedunknown— could not classify from log outputUsage:
python hack/metrics/ci-failure-analysis.py \ --repo agent-substrate/substrate \ --fetch-limit 500 --sample 40 # Save for later comparison python hack/metrics/ci-failure-analysis.py \ --repo agent-substrate/substrate \ --fetch-limit 500 --sample 40 \ --save ci-breakdown.jsonSample output (40 sampled runs, Aug 2026):
This informed the timeout fixes in #800 and is intended to feed the planned scheduled CI remediation agent.
Checklist
go test ./...)