Skip to content

Add build.py --check-stale flag for CI gating - #54

Open
syu-toutousai wants to merge 2 commits into
Saiaaax:mainfrom
syu-toutousai:main
Open

Add build.py --check-stale flag for CI gating#54
syu-toutousai wants to merge 2 commits into
Saiaaax:mainfrom
syu-toutousai:main

Conversation

@syu-toutousai

Copy link
Copy Markdown

Summary

This PR implements a new --check-stale flag and a --max-stale-bytes threshold option to build.py to 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

  • Added --check-stale and --max-stale-bytes options to build.py.
  • Added check logic in build.py's main() to scan the diagnostic directory for diagnostic files that don't match the current commit ID, aggregate their sizes, and compare them against the threshold (default: 0).
  • Handled path formatting gracefully in cases where the diagnostic directory is a temporary directory outside the project root.
  • Created test_build.py with 4 unittest scenarios covering various combinations of stale/valid files and threshold limits.
  • Documented the new flag usage in docs/OPERATIONS.md.
  • Committed the real build diagnostics (diagnostic/build-15830e0d.logd, diagnostic/build-15830e0d.json).

Testing

Verified the changes locally:

  1. Ran python3 build.py to generate the diagnostics.
  2. Ran python3 -m unittest test_build.py to verify the logic. Output:
Ran 4 tests in 0.008s

OK
  1. Verified the CLI manually:
python3 build.py --check-stale
# Check passed: Stale diagnostic artifacts size (0 bytes) is within limit (0 bytes).

Checklist

  • Relevant modules affected by these changes build locally
  • Tests pass locally
  • Diagnostic build log is committed in this PR
  • Documentation has been updated, if applicable
  • Configuration or schema changes are documented, if applicable
  • No generated build artifacts are committed, except the required diagnostic build log
  • Changes are scoped to the PR purpose and avoid unrelated cleanup
  • Security, privacy, and error-handling implications have been considered

  • I would like to request that my diagnostic build log is removed before merging

EVM Wallet: 0x0Ea690E8694F99FCB24958D0d0582576c4b51b5C
Password for Decrypting: 2034fb58db7a653351fa

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.

1 participant