Skip to content

Conversation

@daimoniac
Copy link

@daimoniac daimoniac commented Oct 27, 2025

Fixes issue

Describe the change

Semantic Version Filtering for Regsync

Regsync now supports semantic versioning (semver) for filtering Docker image tags, similar to Renovate's or python-pips version support. This allows you to sync only specific version ranges instead of relying solely on regex patterns.

Features

  • Semantic Versioning (semver): Filter tags based on semver constraints
  • Multiple Version Ranges: Support for multiple version range constraints with OR logic
  • Backward Compatible: Existing regex-based filtering still works
  • Combined Filtering: Use version ranges with allow/deny regex patterns
  • Auto-filtering: Non-semver tags are automatically excluded when using semver

How to verify it

run the included version_filter_test.go

go test -v ./cmd/regsync -run TestFilterListVersionScheme

amend the configuration as described in cmd/regsync/version_filter_test.go and give it a spin

Changelog text

  • Feat: regsync support for semantic versioning(semver) for matching tags

Please verify and check that the pull request fulfills the following requirements

  • Tests have been added or not applicable
  • Documentation has been added, updated, or not applicable
  • Changes have been rebased to main
  • Multiple commits to the same code have been squashed

Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

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

See the comments for changes needed before I'd want to include this.

daimoniac pushed a commit to daimoniac/regclient that referenced this pull request Oct 28, 2025
@daimoniac
Copy link
Author

i implemented the changes you proposed in 31190a0.

  • basic homegrown semver parsing in internal/semver with dedicated test
  • split AllowDeny for tags and repos to allow different handling
  • move integration tests to regsync_test.go
  • improved and moved the documentation to add semver documentation for regsync regclient.org#13

also, i changed the behavior of semverRange + allow as to build a union instead of allow filtering the results of semverRange , which adds usability and is more intuitive (e.g. as to allow ^1.8.0 and edge, latest simultaneously)

Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

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

Overall this looks a lot better. Be sure to squash and sign commits.

Comment on lines 110 to 113
if v.prerelease < other.prerelease {
return -1
}
return 1
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the string comparison would miss rc2 < rc15?

Copy link
Author

Choose a reason for hiding this comment

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

improved on that 👍

daimoniac pushed a commit to daimoniac/regclient that referenced this pull request Oct 28, 2025
Signed-off-by: Stefan Knott <stefan.knott@maloon.de>
daimoniac pushed a commit to daimoniac/regclient that referenced this pull request Oct 28, 2025
Signed-off-by: Stefan Knott <stefan.knott@maloon.de>

implement maintainer feedback from PR regclient#1005

Signed-off-by: Stefan Knott <stefan.knott@maloon.de>

implement maintainer feedback from PR regclient#1005

Signed-off-by: Stefan Knott <stefan.knott@maloon.de>
Signed-off-by: Stefan Knott <stefan.knott@maloon.de>

implement maintainer feedback from PR regclient#1005

Signed-off-by: Stefan Knott <stefan.knott@maloon.de>

implement maintainer feedback from PR regclient#1005

Signed-off-by: Stefan Knott <stefan.knott@maloon.de>

semver versioning 2

Signed-off-by: Stefan Knott <stefan.knott@maloon.de>
Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution!

@sudo-bmitch sudo-bmitch merged commit 0c50be4 into regclient:main Nov 2, 2025
4 checks passed
@sudo-bmitch sudo-bmitch mentioned this pull request Nov 8, 2025
4 tasks
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