mirror of
https://github.com/openai/codex.git
synced 2026-09-28 08:43:01 +08:00
## Why Publishing a hotfix for an older release line or alpha can replace a newer prerelease pointer. Release pointers should advance according to version order. ## What changed - Share release version validation and numeric comparison across publishing scripts, including alpha hotfix suffixes and alpha, beta, and stable ordering. - Read the prerelease pointer directly from R2 and update it only for a newer version or missing or invalid version metadata. - Restrict `latest-alpha-cli` updates to alpha releases with successful R2 and npm publishing, and compare against the branch's Cargo version before advancing it. Allow replacement when the manifest version cannot be parsed or validated. ## Testing Add 15 passing unit tests covering version validation, older release lines and alphas, numeric hotfix ordering, prerelease precedence, equal versions, and missing or invalid versions. GitOrigin-RevId: 6bee3906a47f613b662ef2b2224cfcbd1b56650c
27 lines
644 B
Python
27 lines
644 B
Python
#!/usr/bin/env python3
|
|
"""Compare a publishing release with the canary Cargo manifest from stdin.
|
|
|
|
Usage: check_github_canary.py RELEASE_VERSION
|
|
"""
|
|
|
|
import sys
|
|
import tomllib
|
|
|
|
from releases import should_update_version
|
|
|
|
|
|
def main() -> None:
|
|
try:
|
|
current_version = tomllib.loads(sys.stdin.read())["workspace"]["package"][
|
|
"version"
|
|
]
|
|
except (tomllib.TOMLDecodeError, KeyError, TypeError):
|
|
current_version = ""
|
|
if not isinstance(current_version, str):
|
|
current_version = ""
|
|
print(str(should_update_version(sys.argv[1], current_version)).lower())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|