Add single-source CLI version management and release workflow#55
Merged
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
CLI_VERSIONwas hardcoded to"v1.0.0"inconfig.py— a user-editable file — while git tags had moved on tov1.1.4, andpyproject.tomlcarried a second version that drifted independently. That version is sent in the assessment payload to exitcloud.io/escapecloud.io and used to debug by CLI version, so it needs one reliable source. This PR establishes a single source of truth for the version, wires it into the payload and a--versionflag, and adds a guarded manual release workflow so tagging can't drift from the version file again.What changed
utils/version.py(new) —__version__is the single source of truth. Starts at1.0.0; the release workflow is the only thing that bumps it.pyproject.toml—versionis nowdynamic, derived fromutils.version.__version__. Eliminates the second, independently-drifting version.config.py— removedCLI_VERSIONand its "do not modify" note; the file is now purely user config (HOST/KEY).core/utils_sync.py— assessment payload reportsf"v{__version__}".main.py— added--version(cloudexit vX.Y.Z) and moved argument parsing ahead of the ASCII art andinitialize_dataset(), so--version/--helpexit before any side effects (no dataset download just to print a version).tests/test_utils_sync.py— dropped the now-unusedCLI_VERSIONfake..github/workflows/release.yml(new) — manualworkflow_dispatch: validates the version, refuses to re-release an existing tag (checked against the remote viagit ls-remote, so it works with the shallow checkout), refuses to run offmain, then bumpsutils/version.py, commits, tagsvX.Y.Z, and pushes. Only users with write access can trigger it.