fix(ci): fix regex in update-agent-version workflow#2009
Conversation
The update-agent-version workflow passed the regex-escaped version string to `grep -lF`, but `-F` matches literally, so `7\.80\.3` never matched files containing `7.80.3`. As a result only `.datadog-agent-version` (updated via an explicit echo) was bumped, leaving other references stale. Search with the raw version for the fixed-string grep while keeping the escaped form for the sed replacement. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
| -not -path "./bun.lock" \ | ||
| -not -path "./Cargo.lock" \ | ||
| -not -path "./.github/workflows/update-agent-version.yml" \ | ||
| -exec grep -lF "$OLD_VERSION_ESCAPED" {} \; 2>/dev/null | while read -r file; do |
There was a problem hiding this comment.
This seems like it'll still hit some false positives in Cargo.toml for example if there are other packages with the same version specifier as the one we're updating. That's fine as long as this still requires some human review somewhere, just mentioning in case this is automerged.
There was a problem hiding this comment.
Mmm, good point. For now these PRs require human review, but we could enhance this to be more granular with where it updates (maybe by putting comments by each specification).
Binary Size Analysis (Agent Data Plane)Baseline: 4de556d · Comparison: 10587f5 · diff ✅ Binary size difference within thresholdChanges by Module
Detailed Symbol Changes |
Regression Detector (Agent Data Plane)Run ID: Optimization Goals: ✅ No significant changes detectedFine details of change detection per experiment (5)Experiments configured
Bounds Checks: ✅ Passed (5)
ExplanationA change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression ( |
d3ea688
into
main
Summary
The scheduled Update Datadog Agent Version workflow is supposed to rewrite every occurrence of the old Agent version across the repo, but in practice it only ever updated
.datadog-agent-version. This left the version references in.gitlab-ci.yml(PUBLIC_DSD_VERSION,PUBLIC_DD_AGENT_VERSION) and.gitlab/windows.yml(the Windows base image tag) stale on every auto-generated bump PR (e.g. #2003), requiring a manual follow-up. The intent is a single PR that bumps all references consistently.The root cause: the workflow escaped the version for
sed(7.80.3→7\.80\.3) and then reused that escaped string withgrep -lF. Because-Fmatches the pattern literally, it searched for the backslashes too and matched nothing, so the find/sed loop never ran — only the explicitecho "$NEW_VERSION" > .datadog-agent-versiontook effect.The fix passes the raw version to the fixed-string
grepwhile keeping the escaped form for thesedregex replacement.The stale references from #2003 are being fixed directly on that PR's branch; this PR fixes the workflow so future bumps are complete.
Test plan
.gitlab-ci.ymland.gitlab/windows.ymlwhile leaving unrelated historical version mentions (e.g.Agent 7.80.1code comments) untouched.🤖 Generated with Claude Code