As noted in #520 (comment), the --version flag in upstream-finalize could be inferred from the local repository's suite.py files instead of requiring the user to pass it explicitly.
By the time upstream-finalize runs, Step 1 (upstream-mark) has already set the version in suite.py and the PR has been merged, so the version is available locally after a git pull.
There is already a version-extraction pattern in SuiteOpsUtils.inferOpenMilestone() (using VERSION_PATTERN against compiler/mx.compiler/suite.py) that could be reused.
Proposed change:
- Make
--version optional in upstream-finalize
- When omitted, read the version from
compiler/mx.compiler/suite.py in --dir and print it (e.g., "Auto-inferred version from suite.py: 23.1.11")
- Fail with a clear error if the version cannot be determined and
--version was not provided
As noted in #520 (comment), the
--versionflag inupstream-finalizecould be inferred from the local repository'ssuite.pyfiles instead of requiring the user to pass it explicitly.By the time
upstream-finalizeruns, Step 1 (upstream-mark) has already set the version insuite.pyand the PR has been merged, so the version is available locally after agit pull.There is already a version-extraction pattern in
SuiteOpsUtils.inferOpenMilestone()(usingVERSION_PATTERNagainstcompiler/mx.compiler/suite.py) that could be reused.Proposed change:
--versionoptional inupstream-finalizecompiler/mx.compiler/suite.pyin--dirand print it (e.g.,"Auto-inferred version from suite.py: 23.1.11")--versionwas not provided