Open Cobraeti opened 1 year ago
+1
Right now I can make tag like x.y.z
immutable but this will also include dev tags like x.y.z-dev.N
which is not the desired behavior
I've opened https://github.com/bmatcuk/doublestar/issues/91 to ask for quantifier support for character classes in doublestar which would at least allow [0-9]+.[0-9]+.[0-9]+
matching
Is your feature request related to a problem? Please describe. Hello, I'm trying to create an immutability rule for all SemVer tags corresponding to "normal" release versions (refered as
<version core>
at https://semver.org/). It seems even the tag matching is made using doublestar, wich is really limiting to describe widely-used SemVer tags, as[0-9].[0-9].[0-9]
would only match versions with major/minor/patch up to 9, whereas*.*.*
would match versions with major/minor/patch even over 9 but also any pre-release or build variants of the same version...Describe the solution you'd like I would have expected tag matching rules to use a less limiting regexp engine, like https://pkg.go.dev/regexp#Regexp.Match, as doublestar is really nice for repo paths matching, but really poor for SemVer or any more generic tags matching...
Describe the main design/architecture of your solution Replace doublestar.Match by regexp.Match for tag rules (breaking API, maybe not desired) or allow
kind: 'regexp'
in addition tokind: 'doublestar'
(by creating a regexp selector available at least forRetentionSelector
andImmutableSelector
+ maybeRetentionSelectorMetadata
)Describe the development plan you've considered I could contribute directly for option 1, but option 2 might be a bit too high-level for my coding skills :sweat_smile: Unless option 2 is just adding
regexp/selector.go
andregexp/selector_test.go
to/src/lib/selector/selectors
? but I bet I'm dreaming :rofl:Additional context I'm currently stuck with Harbor version 2.5.6 because of my cloud provider offer, but able to start a higher version aside with a custom deployment if it could help testing :wink: