Skip to content

fix(ci): fix regex in update-agent-version workflow#2009

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
jszwedko/fix-update-agent-version-workflow
Jul 6, 2026
Merged

fix(ci): fix regex in update-agent-version workflow#2009
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
jszwedko/fix-update-agent-version-workflow

Conversation

@jszwedko

@jszwedko jszwedko commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

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.37\.80\.3) and then reused that escaped string with grep -lF. Because -F matches the pattern literally, it searched for the backslashes too and matched nothing, so the find/sed loop never ran — only the explicit echo "$NEW_VERSION" > .datadog-agent-version took effect.

The fix passes the raw version to the fixed-string grep while keeping the escaped form for the sed regex replacement.

grep -lF "$OLD_VERSION"          # literal match, finds the files
sed  -i "s/$OLD_VERSION_ESCAPED/$NEW_VERSION/g"  # regex replace

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

  • Verified locally that the corrected find/grep/sed loop rewrites .gitlab-ci.yml and .gitlab/windows.yml while leaving unrelated historical version mentions (e.g. Agent 7.80.1 code comments) untouched.

🤖 Generated with Claude Code

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>
@jszwedko jszwedko requested a review from a team as a code owner July 6, 2026 15:57
@dd-octo-sts dd-octo-sts Bot added the area/ci CI/CD, automated testing, etc. label Jul 6, 2026
@jszwedko jszwedko changed the title fix(ci): update-agent-version workflow only bumped one file fix(ci): fix regex in update-agent-version workflow Jul 6, 2026
-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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@pr-commenter

pr-commenter Bot commented Jul 6, 2026

Copy link
Copy Markdown

Binary Size Analysis (Agent Data Plane)

Baseline: 4de556d · Comparison: 10587f5 · diff
Analysis Configuration: stripped binaries · Pass/Fail Threshold: +5%
Sizes: 41.63 MiB (baseline) vs 41.63 MiB (comparison)
Size Change: +8 B (+0.00%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
anon.c332a4a573d0a9a1bf7c71b0a1f57672.1.llvm.14590403547123792447 +130 B 1
anon.c332a4a573d0a9a1bf7c71b0a1f57672.1.llvm.9750049935919588109 -129 B 1
anon.c332a4a573d0a9a1bf7c71b0a1f57672.4.llvm.14590403547123792447 +115 B 1
anon.c332a4a573d0a9a1bf7c71b0a1f57672.4.llvm.9750049935919588109 -114 B 1
anon.c332a4a573d0a9a1bf7c71b0a1f57672.3.llvm.14590403547123792447 +109 B 1
anon.c332a4a573d0a9a1bf7c71b0a1f57672.3.llvm.9750049935919588109 -108 B 1
anon.c332a4a573d0a9a1bf7c71b0a1f57672.0.llvm.14590403547123792447 +97 B 1
anon.c332a4a573d0a9a1bf7c71b0a1f57672.0.llvm.9750049935919588109 -96 B 1
anon.c332a4a573d0a9a1bf7c71b0a1f57672.2.llvm.14590403547123792447 +95 B 1
anon.c332a4a573d0a9a1bf7c71b0a1f57672.2.llvm.9750049935919588109 -94 B 1
[Unmapped] +3 B 1
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW]    +130  [NEW]     +40    anon.c332a4a573d0a9a1bf7c71b0a1f57672.1.llvm.14590403547123792447
  [NEW]    +115  [NEW]     +25    anon.c332a4a573d0a9a1bf7c71b0a1f57672.4.llvm.14590403547123792447
  [NEW]    +109  [NEW]     +19    anon.c332a4a573d0a9a1bf7c71b0a1f57672.3.llvm.14590403547123792447
  [NEW]     +97  [NEW]      +7    anon.c332a4a573d0a9a1bf7c71b0a1f57672.0.llvm.14590403547123792447
  [NEW]     +95  [NEW]      +5    anon.c332a4a573d0a9a1bf7c71b0a1f57672.2.llvm.14590403547123792447
  +0.1%      +3  [ = ]       0    [Unmapped]
  [DEL]     -94  [DEL]      -5    anon.c332a4a573d0a9a1bf7c71b0a1f57672.2.llvm.9750049935919588109
  [DEL]     -96  [DEL]      -7    anon.c332a4a573d0a9a1bf7c71b0a1f57672.0.llvm.9750049935919588109
  [DEL]    -108  [DEL]     -19    anon.c332a4a573d0a9a1bf7c71b0a1f57672.3.llvm.9750049935919588109
  [DEL]    -114  [DEL]     -25    anon.c332a4a573d0a9a1bf7c71b0a1f57672.4.llvm.9750049935919588109
  [DEL]    -129  [DEL]     -40    anon.c332a4a573d0a9a1bf7c71b0a1f57672.1.llvm.9750049935919588109
  +0.0%      +8  [ = ]       0    TOTAL

@pr-commenter

pr-commenter Bot commented Jul 6, 2026

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Run ID: 3035bd39-f179-4875-9b2c-11a3cb7deaaa
Baseline: 4de556d0 · Comparison: 10587f56 · diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment (5)

Experiments configured erratic: true are tagged (ignored) and skipped when determining which experiments regressed or improved. Experiments which are detected as erratic at runtime are tagged (erratic) to flag that the run's sample dispersion was high, but their regression / improvement signal still counts.

experiment goal Δ mean % links
quality_gates_rss_dsd_ultraheavy memory ⚪ +0.14 metrics profiles logs
quality_gates_rss_dsd_low memory ⚪ +0.10 metrics profiles logs
quality_gates_rss_dsd_medium memory ⚪ -0.23 metrics profiles logs
quality_gates_rss_dsd_heavy memory ⚪ -0.33 metrics profiles logs
quality_gates_rss_idle memory ⚪ -0.47 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 131 MiB ≤ 140 MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 43.2 MiB ≤ 50 MiB metrics profiles logs
quality_gates_rss_dsd_medium memory_usage 10/10 ✅ 64.9 MiB ≤ 75 MiB metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 ✅ 191 MiB ≤ 200 MiB metrics profiles logs
quality_gates_rss_idle memory_usage 10/10 ✅ 28.9 MiB ≤ 40 MiB metrics profiles logs
Explanation

A 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 (is_regression: true). Improvements use the matching criteria for the improving direction. Experiments configured erratic: true (tagged (ignored)) are skipped outright; experiments detected as erratic at runtime (tagged (erratic)) still count, since that flag describes sample dispersion rather than directional certainty. The Δ mean % cell is colored accordingly: 🟢 = improvement, 🔴 = regression, ⚪ = neutral. Reduction in CPU or memory is an improvement; reduction in ingress throughput is a regression.

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit d3ea688 into main Jul 6, 2026
89 of 90 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the jszwedko/fix-update-agent-version-workflow branch July 6, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci CI/CD, automated testing, etc. mergequeue-status: done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants