Skip to content

fix(registry): handle v-prefixed and dirty git versions in version checks#344

Merged
pocky merged 1 commit into
mainfrom
fix/343-plugin-version-check-dirty
May 13, 2026
Merged

fix(registry): handle v-prefixed and dirty git versions in version checks#344
pocky merged 1 commit into
mainfrom
fix/343-plugin-version-check-dirty

Conversation

@pocky
Copy link
Copy Markdown
Contributor

@pocky pocky commented May 13, 2026

Summary

  • Fix version constraint checks failing for CLI binaries built from git tags (v0.8.1) or intermediate commits (v0.8.1-3-gabcdef-dirty) — these are valid states during development but were rejected by the version parser
  • ParseVersion now strips a leading v prefix before parsing, aligning with the common convention that git tags use v-prefixed semver
  • effectiveCLIVersion falls back to 999.0.0 for any unparseable version string (e.g. git describe output with commit distance and hash), preventing plugin/pack version checks from hard-failing on dirty dev builds

Changes

Version Parsing

  • pkg/registry/version.go: Strip leading v prefix in ParseVersion before regex match; update doc comment to reflect accepted formats
  • pkg/registry/version_test.go: Add ParseVersion cases for v-prefixed plain, prerelease, and complex prerelease versions; add CheckVersionConstraint cases for v-prefixed and dirty versions

CLI Version Handling

  • internal/interfaces/cli/workflow_cmd.go: Extend effectiveCLIVersion to fall back to 999.0.0 when ParseVersion fails (covers git describe output like v0.8.1-3-gabcdef-dirty)
  • internal/interfaces/cli/workflow_cmd_test.go: Add test cases for v-prefixed, v-prefixed dirty, and git describe-style version strings

Test Fixtures

  • internal/infrastructure/workflowpkg/manifest_test.go: Remove the v-prefixed invalid version test case — v1.0.0 is now a valid input
  • tests/integration/features/execution_order_determinism_test.go: Fix whitespace alignment in a test case struct literal

Test plan

  • make test passes with no failures, including updated TestParseVersion, TestCheckVersionConstraint, and TestEffectiveCLIVersion_DevPrefix
  • Build a binary from a v-tagged commit and confirm plugin/pack version checks succeed: awf run <workflow>
  • Simulate a dirty intermediate build by setting Version = "v0.8.1-3-gabcdef-dirty" and confirm effectiveCLIVersion() returns 999.0.0
  • make lint passes with zero violations

Generated with awf commit workflow

…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
@pocky pocky marked this pull request as ready for review May 13, 2026 13:03
@pocky pocky merged commit 8747b02 into main May 13, 2026
5 checks passed
@pocky pocky deleted the fix/343-plugin-version-check-dirty branch May 13, 2026 13:04
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.

1 participant