argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18.07k stars 5.53k forks source link

Allow the use of hierarchical tags in semver target revisions #20949

Open chzar opened 1 week ago

chzar commented 1 week ago

Summary

Allow the use of hierarchical tags in semver target revisions

Motivation

Teams want to use hierarchical tags for

Proposal

targetRevision: 'foo/bar/ >= v1.0.0-rc1'

How do you think this should be implemented?

Use regex to filter prefixes out of semver and constraint strings so they can be processed. Ensure prefixes are considered during matching.

andrii-korotkov-verkada commented 1 week ago

Does targetRevision: 'foo/bar/ >= v1.0.0-rc1' mean that the newest version since v1.0.0-rc1 should be used?

chzar commented 1 week ago

correct, so if the latest tag is foo/bar/v2.0.0 then that is what should be returned. No change to how semver works currently. It should simply be possible to specify a path prefix.

chzar commented 1 week ago

At my organization - we have teams that use release tags on github. We would like to give them a practical option to keep using that workflow on ArgoCD as well. But, we want to add the ability to deploy on different argo clusters by adding a path prefix in front of the semver and optionally distinguishing between releases in a monorepo.

There have been broader discussions (#18899, #5609 for example) in the Argo project about having more options when using tags in target revisions, but would require changes in the upstream library Argo is using to parse semver tags. This change will give teams degree of flexibility without any breaking changes.

chzar commented 1 week ago

@andrii-korotkov-verkada I have updated the PR to support the original semver constraints format (ex: >= /foo/bar/v1.0.0 < foo/bar/v2.0.0)