fix(registry): handle v-prefixed and dirty git versions in version checks#344
Merged
Conversation
…ecks - `pkg/registry/version.go`: Strip `v` prefix in ParseVersion to accept `v1.0.0` format - `pkg/registry/version_test.go`: Add tests for v-prefixed versions and constraint checks - `internal/interfaces/cli/workflow_cmd.go`: Fall back to 999.0.0 for unparseable git describe output - `internal/interfaces/cli/workflow_cmd_test.go`: Add test cases for v-prefixed and dirty version strings - `internal/infrastructure/workflowpkg/manifest_test.go`: Remove invalid test case for v-prefix rejection - `tests/integration/features/execution_order_determinism_test.go`: Fix alignment formatting
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
v0.8.1) or intermediate commits (v0.8.1-3-gabcdef-dirty) — these are valid states during development but were rejected by the version parserParseVersionnow strips a leadingvprefix before parsing, aligning with the common convention that git tags usev-prefixed semvereffectiveCLIVersionfalls back to999.0.0for any unparseable version string (e.g.git describeoutput with commit distance and hash), preventing plugin/pack version checks from hard-failing on dirty dev buildsChanges
Version Parsing
pkg/registry/version.go: Strip leadingvprefix inParseVersionbefore regex match; update doc comment to reflect accepted formatspkg/registry/version_test.go: AddParseVersioncases forv-prefixed plain, prerelease, and complex prerelease versions; addCheckVersionConstraintcases forv-prefixed and dirty versionsCLI Version Handling
internal/interfaces/cli/workflow_cmd.go: ExtendeffectiveCLIVersionto fall back to999.0.0whenParseVersionfails (coversgit describeoutput likev0.8.1-3-gabcdef-dirty)internal/interfaces/cli/workflow_cmd_test.go: Add test cases forv-prefixed,v-prefixed dirty, andgit describe-style version stringsTest Fixtures
internal/infrastructure/workflowpkg/manifest_test.go: Remove thev-prefixed invalid version test case —v1.0.0is now a valid inputtests/integration/features/execution_order_determinism_test.go: Fix whitespace alignment in a test case struct literalTest plan
make testpasses with no failures, including updatedTestParseVersion,TestCheckVersionConstraint, andTestEffectiveCLIVersion_DevPrefixv-tagged commit and confirm plugin/pack version checks succeed:awf run <workflow>Version = "v0.8.1-3-gabcdef-dirty"and confirmeffectiveCLIVersion()returns999.0.0make lintpasses with zero violationsGenerated with awf commit workflow