Skip to content

fix: normalize plugin version tags on download#679

Open
ahmedhesham6 wants to merge 1 commit intomainfrom
fix/plugin-version-prefix-fallback
Open

fix: normalize plugin version tags on download#679
ahmedhesham6 wants to merge 1 commit intomainfrom
fix/plugin-version-prefix-fallback

Conversation

@ahmedhesham6
Copy link
Copy Markdown
Collaborator

Description

Normalize plugin version resolution so download/install uses a canonical version format and retries the alternate tag form when needed.

Related Issues

None.

Changes Made

  • normalize configured/latest plugin versions to a canonical v-prefixed form
  • retry downloads with the alternate version form when storage/tag naming disagrees
  • harden version comparisons against whitespace and V/v prefix differences
  • add unit coverage for normalization, fallback toggling, and comparisons

Testing

  • cargo fmt --check -- cli/src/utils/plugins.rs
  • cargo clippy -p stakpak --all-targets -- -D warnings
  • cargo test -p stakpak -- --nocapture
  • Tested on macOS

Breaking Changes

None.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Normalizes plugin version resolution so downloads/installations use a canonical v-prefixed version string, while still supporting backends that store artifacts/tags without the v prefix.

Changes:

  • Canonicalize configured and “latest” versions into a v-prefixed form for internal comparisons and selection.
  • Add a one-time retry that flips the v prefix (v1.2.31.2.3) when a download fails.
  • Harden version comparison to ignore whitespace and V/v prefix differences; add unit tests for normalization and comparisons.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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