Skip to content

Generalize remembered patterns for prefixed release tags - #19

Merged
jsnjack merged 1 commit into
jsnjack:masterfrom
tonysurfly:fix-prefixed-tag-patterns
Oct 29, 2026
Merged

jsnjack merged 1 commit into
jsnjack:masterfrom
tonysurfly:fix-prefixed-tag-patterns

Conversation

@tonysurfly

Copy link
Copy Markdown
Contributor

Fixes: grm update fails for any package whose release tags carry a prefix, e.g. SeleniumHQ/selenium (selenium-4.41.0):

asset pattern "selenium-server-4.41.0.jar" matches 0 assets; use --asset with a more specific choice

Cause

  • rememberPattern only strips the full tag and the tag minus v. Neither appears in selenium-server-4.41.0.jar, so the saved asset pattern and binary path keep the version.

Change

  • rememberPattern also strips the tag's version part (from the first digit, only when it contains a .).
  • generalizeSelections re-runs that on already-saved selections against the installed tag before resolving, so existing configs heal on the next update. No manual --asset / --binary needed.

Tested

  • go vet + go test ./... green on Linux. (Several existing tests are Linux-only and fail on macOS on master too.)
  • New TestPrefixedTagPatternsSurviveUpdates covers the selenium case.
  • E2E in an almalinux:10 container: grm install SeleniumHQ/selenium==selenium-4.41.0 -f jar -n selenium-server-standalone -y
    • v2.0.7 grm update -y → the error above
    • this branch → installs selenium-4.51.0, saves selenium-server-*.jar, a second update reports latest

Tags like selenium-4.41.0 name assets selenium-server-4.41.0.jar, so the
saved asset and binary patterns kept the version and the next update
matched 0 assets. Strip the tag's version part too, and repair patterns
already saved that way before resolving them.
@jsnjack
jsnjack merged commit e300aa8 into jsnjack:master Oct 29, 2026
2 checks passed
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