Cleanup: Use get-agent-version for semverCompare - #2885
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cdb7047399
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
cdb7047 to
7487a1b
Compare
There was a problem hiding this comment.
Pull request overview
This PR standardizes Datadog chart version gating by using the existing get-agent-version helper whenever semverCompare is used, so floating/variant tags (e.g. 7, latest, *-full, *-fips) are normalized to a clean x.y.z for comparisons.
Changes:
- Updated a few templates to use
include "get-agent-version" .instead of ad-hoc tag parsing beforesemverCompare. - Expanded
get-agent-versionto strip common build-variant suffixes prior to resolving/normalizing versions. - Bumped chart version and added a changelog entry.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| charts/datadog/templates/system-probe-configmap.yaml | Switches network monitoring version gate to use get-agent-version. |
| charts/datadog/templates/datadog-yaml-configmap.yaml | Uses get-agent-version for the JMX container support version gate. |
| charts/datadog/templates/_helpers.tpl | Enhances get-agent-version and refactors remaining semver guards to use it. |
| charts/datadog/README.md | Updates chart version badge. |
| charts/datadog/Chart.yaml | Bumps chart version to 3.240.6. |
| charts/datadog/CHANGELOG.md | Adds 3.240.6 entry describing this cleanup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| {{- $version := .Values.agents.image.tag | toString -}} | ||
| {{/* Strip build-variant suffixes (any combination/order) so version guards compare on a clean version. */}} | ||
| {{- range until 3 -}} | ||
| {{- $version = $version | trimSuffix "-jmx" | trimSuffix "-full" | trimSuffix "-fips" | trimSuffix "-servercore" -}} | ||
| {{- end -}} |
There was a problem hiding this comment.
no real published image has more than 3 suffixes
07ae930 to
c889d98
Compare
- bump version for datadog to 3.241.1 (patch-version) - update changelog for datadog with version 3.241.1 - update readme for datadog
What this PR does / why we need it:
#2876 removed an incorrect use of
get-agent-version, as a container image tag.This present PR does the inverse: make sure
get-agent-versionis used when doing semver comparison.Why ? valid tags include:
7.82.3, easy to semverCompare ✅7, that will compare as below7.67.0even though it actually is more recent ❌latest, that will fail the comparison ❌7.83.0-full, that will be considered a "beta", so below7.83.0❌This complexity is exactly the reason why
get-agent-versionwas created, to takes the tag as input and gives us a simplex.yy.zversion as output, ready to be compared.Most
semverComparechecks use it, but I found a few that remained. They had brittle ad-hoc checks and transforms to handle some cases, but usingget-agent-versioncentralizes this logic and solves it in a robust way once and for all.Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
<chartName>/minor-version,<chartName>/patch-version, or<chartName>/no-version-bump)datadogordatadog-operatorchart or value changes, update the test baselines (run:make update-test-baselines)datadogchart changes, received ✅ from a member of your teamGitHub CI takes care of the below, but are still required:
.github/helm-docs.sh)CHANGELOG.mdhas been updatedREADME.md