Skip to content

Conversation

@sasa-tomic
Copy link
Collaborator

@sasa-tomic sasa-tomic commented Mar 24, 2025

Major Changes

  • Refactor Upgrade Command: Pass the current version (curr_version) as an explicit argument to Upgrade::run and Upgrade::check methods instead of using environment constants, for improved robustness.

  • Update Regex for Version Parsing: Modified the regular expression in check_latest_release to accommodate version strings with -v prefixes, improving version specification accuracy and compatibility with git tags we use.

  • Log Enhancements: Added logging to display the current and latest release versions during checks, increasing visibility for users.

In particular, previous code was always trying to upgrade when running from bazel due to special env variable handling, and it also wasn't able to handle versions like 0.6.0-v0.6.1 that would sometimes show up locally.

### Major Changes

- **Method `run`:** Augmented with an additional parameter `curr_version` to decouple version retrieval from method logic.
- **Signature Update:** The `check` and `check_latest_release` methods now utilize a string reference for `curr_version`, improving interface consistency.
- **Logging Enhancement:** Added version comparison logging for enhanced traceability using `info!` macro.
- **Version Pattern Matching:** Extended regular expression for version format consistency.

### Tests

- Updated tests to align with interface changes.
@sasa-tomic sasa-tomic self-assigned this Mar 24, 2025
@sasa-tomic sasa-tomic changed the title refactor(cli): pass version as argument for Upgrade fix(cli): improve version upgrade checks Mar 24, 2025
@sasa-tomic sasa-tomic marked this pull request as ready for review March 24, 2025 14:17
@sasa-tomic sasa-tomic requested a review from a team as a code owner March 24, 2025 14:17
@sasa-tomic sasa-tomic merged commit 93c63f7 into main Mar 24, 2025
7 checks passed
@sasa-tomic sasa-tomic deleted the refactor/upgrade-command-signature branch March 24, 2025 15:10
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.

2 participants