Add build.py --check-stale flag for CI gating - #54
Open
syu-toutousai wants to merge 2 commits into
Open
Conversation
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
This PR implements a new
--check-staleflag and a--max-stale-bytesthreshold option tobuild.pyto check for stale (non-current-commit) diagnostic build artifacts. This is intended to be used as a CI gate to prevent accidental inclusion of outdated diagnostics in PRs.Changes
--check-staleand--max-stale-bytesoptions tobuild.py.build.py'smain()to scan thediagnosticdirectory for diagnostic files that don't match the current commit ID, aggregate their sizes, and compare them against the threshold (default: 0).test_build.pywith 4 unittest scenarios covering various combinations of stale/valid files and threshold limits.docs/OPERATIONS.md.diagnostic/build-15830e0d.logd,diagnostic/build-15830e0d.json).Testing
Verified the changes locally:
python3 build.pyto generate the diagnostics.python3 -m unittest test_build.pyto verify the logic. Output:python3 build.py --check-stale # Check passed: Stale diagnostic artifacts size (0 bytes) is within limit (0 bytes).Checklist
EVM Wallet: 0x0Ea690E8694F99FCB24958D0d0582576c4b51b5C
Password for Decrypting: 2034fb58db7a653351fa