Skip to content

feat: Add semver/range resolved intermediate as build environment variable#26650

Draft
BadLiveware wants to merge 25 commits intoargoproj:masterfrom
BadLiveware:revision-range-intermediate
Draft

feat: Add semver/range resolved intermediate as build environment variable#26650
BadLiveware wants to merge 25 commits intoargoproj:masterfrom
BadLiveware:revision-range-intermediate

Conversation

@BadLiveware
Copy link

@BadLiveware BadLiveware commented Mar 1, 2026

When a revision constraint (e.g. v1.*, >=1.0.0, ^1.0.0) is used as a target revision, Argo CD resolves it to a concrete tag before fetching the SHA/digest. Previously this intermediate step information was lost, and only the final SHA was recorded. e.g. v1.* -> v1.0.0 (This is lost) -> c74ca22 (This is the only thing saved).

This PR captures, and records the intermediate resolution and makes it available in both the Application CRD status, and as a build environment variable.

This becomes quite a large change because the resolved revisions are passed around as strings everywhere. I kept the resolved revision outside of RevisionResolution because of how central it is, but it could just as easily be moved into the new struct. This would carry the benefit of making future changes easier(e.g. adding metadata).

Example output:

❯ kubectl get applications test-git-semver-revision-resolution-gpskr -oyaml | yq '.status.sync' --output-format=yaml
comparedTo:
  destination:
    namespace: argocd-e2e--test-git-semver-revision-resolution-gpskr
    server: https://kubernetes.default.svc
  source:
    path: deployment
    repoURL: ssh://root@localhost:2222/tmp/argo-e2e/testdata.git
    targetRevision: v0.1.*
resolution:
  constraint: v0.1.*
  resolvedSymbol: v0.1.0
  revision: fff53584ba84df39adf56b2918092e77b9d47780
revision: fff53584ba84df39adf56b2918092e77b9d47780
status: Synced
image

Mostly useful for git, but works the same for OCI, helm (doesnt show via)

❯ kubectl get applications test-helm-oci-revision-resolution-lgpjv -oyaml | yq '.status.sync' --output-format=yaml
comparedTo:
  destination:
    namespace: argocd-e2e--test-helm-oci-revision-resolution-lgpjv
    server: https://kubernetes.default.svc
  source:
    chart: helm-values
    repoURL: localhost:5000/myrepo
    targetRevision: '>=1.0.0'
resolution:
  constraint: '>=1.0.0'
  resolvedSymbol: 1.0.0
  revision: 1.0.0
revision: 1.0.0
status: Synced

Multiple sources:

❯ kubectl get applications test-multi-source-revision-resolutions-heqbg -oyaml | yq '.status.sync' --output-format=yaml
comparedTo:
  destination:
    namespace: argocd-e2e--test-multi-source-revision-resolutions-heqbg
    server: https://kubernetes.default.svc
  source:
    repoURL: ''
  sources:
    - chart: helm-values
      repoURL: localhost:5000/myrepo
      targetRevision: '>=1.0.0'
    - chart: helm-guestbook
      repoURL: localhost:5000/myrepo
      targetRevision: 1.0.0
    - path: two-nice-pods
      repoURL: file:///tmp/argo-e2e/testdata.git
      targetRevision: HEAD
resolutions:
  - constraint: '>=1.0.0'
    resolvedSymbol: 1.0.0
    revision: 1.0.0
  - revision: 1.0.0
  - revision: 7c08ed70329f375a568e25db747e68fd0976bdfe
revisions:
  - 1.0.0
  - 1.0.0
  - 7c08ed70329f375a568e25db747e68fd0976bdfe
status: Synced

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

@bunnyshell
Copy link

bunnyshell bot commented Mar 1, 2026

✅ Preview Environment deployed on Bunnyshell

Component Endpoints
argocd https://argocd-ki2h5o.bunnyenv.com/
argocd-ttyd https://argocd-web-cli-ki2h5o.bunnyenv.com/

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔴 /bns:stop to stop the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

@BadLiveware BadLiveware changed the title Revision range intermediate feat: Add semver/range resolved intermediate as build environment variable Mar 1, 2026
@BadLiveware BadLiveware force-pushed the revision-range-intermediate branch 5 times, most recently from fb94dac to 445cc47 Compare March 1, 2026 10:57
Keeps track of the intermediate symbol in range revision targets(e.g. v*), and makes its accessible in the build environment. This can be used to keep track of image tags from the intermediate revision(e.g. v* -> v1.0.0 (This is what is now available) -> abc123)

Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Without this it is more difficult that necessary to correlate Revision to RevisionResolution. The old Revision is kept in CRDs to avoid breaking changes

Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
This update introduces the DOCKER_HOME variable and translates the host KUBECONFIG path to the corresponding container path, ensuring proper environment variable handling during e2e test runs.

Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
@BadLiveware BadLiveware force-pushed the revision-range-intermediate branch from e36bb1a to 997aec1 Compare March 1, 2026 15:37
Signed-off-by: Fredrik Larsson <fredrik.larsson@tradera.com>
@BadLiveware BadLiveware force-pushed the revision-range-intermediate branch from 997aec1 to 58935df Compare March 1, 2026 22:17
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.

1 participant