argo-cd icon indicating copy to clipboard operation
argo-cd copied to clipboard

Allow git client to discover non-semver tags

Open klagroix opened this issue 1 year ago • 1 comments

Summary

https://github.com/argoproj/argo-cd/pull/17566 updated Argo CD to be able to compare semver tags. This allows us to use a constraint like >=1.2.0 to select the latest git tag that meets the constraint.

While this works well for git repositories that are tagged following semver, this does not work for repositories using a different versioning scheme (example: calver)

Motivation

Auto-discovery of git tags allows for nicer tracking and deployment vs retagging a git tag (like `production) or overwriting the target revision per-application when a new tag is released. While semver is the most widely used versioning scheme, it's not the only one in use. It would be nice if ArgoCD supported different versioning schemes in additon to semver.

(i.e. the same motivation as https://github.com/argoproj/argo-cd/issues/5609 and https://github.com/argoproj/argo-cd/pull/17566)

Proposal

Allow for lexical sort like is supported in ArgoCD Image Updater. Assuming a regex pattern could be provided like ArgoCD Image Updater, this method could be used for non-semver versioning schemes (including calver)

klagroix avatar Jul 02 '24 19:07 klagroix

I could imagine other use-case for this feature. So let's assume that you have a single repository with multiple manifests (applications) (e.g. microservices apps) and would like to track each app separately based on the specific tag group. Then with this feature you could define the tracking rule with some prefix, e.g. targetRevision: app1-*. Then we could have multiple tags like: app1-1.0.0, app1-1.0.1 for app1 and app2-1.0.1, app2-1.0.2 for app 2 - each pushed separately by CI/CD pipeline when specific app is released.

I think above use-case is not possible to handle with current tracking.

pnowy avatar Oct 14 '24 15:10 pnowy

We currently tag our repositories with both version numbers and environment identifiers, like 0.1.1-dev or 0.1.1-stg. This approach was useful before we started using ArgoCD, as it helped us identify the environment for each deployment. However, now that we’ve transitioned to ArgoCD, we can no longer use this tagging strategy because ArgoCD doesn’t recognize the environment suffix (-env) at the end of the tag.

It would be ideal if ArgoCD supported patterns like *-dev for development environments, allowing us to maintain this tagging convention across environments.

jose-arcatar avatar Nov 01 '24 16:11 jose-arcatar

We just ran into this issue as well :smile:

I started a discussion here as I honestly thought I was doing something wrong, as suffixs are part of the SemVar convetion, though it seems this falls outside of the ArgoCD implementation

Spazzy757 avatar Nov 14 '24 15:11 Spazzy757

I created a PR that should help with SemVar Pre-release bug: https://github.com/argoproj/argo-cd/pull/20862

Spazzy757 avatar Nov 20 '24 13:11 Spazzy757