-
Notifications
You must be signed in to change notification settings - Fork 0
ci(contract): catch a stale client-runtime pin, which nothing did #1043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
LukasWodka
wants to merge
5
commits into
develop
Choose a base branch
from
ci/2460-pin-staleness-guard
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ca9084d
ci(contract): catch a stale client-runtime pin, which nothing did (ba…
LukasWodka 8b1c6f5
ci(contract): mint an App token for the cross-repo read, and bound it…
LukasWodka e7222b2
ci(contract): the stale-pin check covers BOTH contracts the pin gover…
LukasWodka b9983ca
ci(contract): gate the pin's shape, and stop the display line decidin…
LukasWodka 8dd5042
ci(contract): stop cannot-read reddening a PR, and finish the claim t…
LukasWodka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #!/usr/bin/env python3 | ||
| """Print `<contract_version>|<cpu>m / <mem> MiB` for an envelope contract. | ||
|
|
||
| Exists so the pin-staleness job in envelope-contract-drift.yml can compare two | ||
| copies of client-runtime/envelope_contract.json without a nested heredoc inside | ||
| a YAML block scalar -- which is how the first attempt at that job broke, and is | ||
| unreadable even when it works. | ||
|
|
||
| FAILS LOUDLY on anything it cannot read. A summary that silently degrades to | ||
| "unknown" would let the comparison report two unknowns as equal, which is the | ||
| "cannot tell reads as agreement" trap (CLAUDE.md rule 3). | ||
|
|
||
| stdlib only: it runs on a bare runner before any pip install. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import json | ||
| import sys | ||
|
|
||
| MIB = 1024 * 1024 | ||
|
|
||
|
|
||
| def summarise(path: str) -> str: | ||
| with open(path, encoding="utf-8") as handle: | ||
| document = json.load(handle) | ||
| version = document["contract_version"] | ||
| overhead = document["overhead"] | ||
| cpu = overhead["cpu_millicores"] | ||
| memory = overhead["memory_bytes"] | ||
| if ( | ||
| not isinstance(version, int) | ||
| or not isinstance(cpu, int) | ||
| or not isinstance(memory, int) | ||
| ): | ||
| raise TypeError( | ||
| f"{path}: contract_version, overhead.cpu_millicores and " | ||
| f"overhead.memory_bytes must all be integers" | ||
| ) | ||
| return f"{version}|{cpu}m / {memory // MIB} MiB" | ||
|
|
||
|
|
||
| def main(argv: list[str]) -> int: | ||
| if len(argv) != 2: | ||
| print( | ||
| f"usage: {argv[0] if argv else 'contract-summary.py'} <envelope_contract.json>", | ||
| file=sys.stderr, | ||
| ) | ||
| return 2 | ||
| print(summarise(argv[1])) | ||
| return 0 | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| sys.exit(main(sys.argv)) |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Token step still fails pull requests
Medium Severity
The
create-github-app-tokenstep has nocontinue-on-erroror outcome check, so a fork or Dependabotpull_request(emptyRELEASE_TRAIN_APP_*secrets) or an App outage fails the job beforecannot_tellruns. That still reddens the PR instead of warning, which is the outcome the job's comments say they avoided.Additional Locations (1)
.github/workflows/envelope-contract-drift.yml#L166-L185Reviewed by Cursor Bugbot for commit 8dd5042. Configure here.