Commit 276cb7d
authored
Run the docker-compose version tagging update manually instead of using Dependabot (#8506)
## Summary of changes
- Dependabot sucks
- I guess we'll do it ourselves
## Reason for change
tl;dr; [Dependabot continues to be terrible at its
job](https://github.com/DataDog/dd-trace-dotnet/actions/runs/24776168750/job/72494856573#step:3:1525)
<details><summary>🤖 explanation</summary>
<p>
```
Root cause
The dependabot job fails on the first image it checks (dotnet/aspnet 2.1-stretch-slim) with DockerRegistry2::NotFound — Image not found at mcr.microsoft.com, and because the whole group shares a single job, one failure kills the run.
The actual HTTP call that 404s (from the proxy log):
HEAD https://mcr.microsoft.com/v2/dotnet/aspnet/blobs/sha256:80ddf066edeeb7e489b23c3c90d8e5dd741037d4a4875150c1dec777fd24cc76
→ 404
That digest is the one we pinned in smoke-test-images.docker-compose.yml:15. I verified against MCR:
┌───────────────────────────────────────────────────┬────────────────────────────────────┐
│ Endpoint │ Result │
├───────────────────────────────────────────────────┼────────────────────────────────────┤
│ HEAD /v2/dotnet/aspnet/manifests/sha256:80ddf066… │ 200 (it's a valid manifest digest) │
├───────────────────────────────────────────────────┼────────────────────────────────────┤
│ HEAD /v2/dotnet/aspnet/blobs/sha256:80ddf066… │ 404 │
└───────────────────────────────────────────────────┴────────────────────────────────────┘
So the digest is fine — the problem is Dependabot is querying the wrong endpoint for it.
Why Dependabot does this
The stack trace leads to apply_cooldown → publication_detail → get_tag_publication_details (docker/update_checker.rb:346 → 362 → 380). That method:
1. Calls client.digest(repo, tag) which does a HEAD /manifests/<tag> and returns the Docker-Content-Digest header — that's the manifest digest.
2. Then does client.dohead "v2/#{repo}/blobs/#{digest}" and reads Last-Modified from the response to know when the image was published (so it can apply the 2-day cooldown).
Step 2 assumes the manifest digest is also accessible via the /blobs/ endpoint. MCR doesn't do that cross-storage, so every cooldown lookup 404s. The docker-compose ecosystem is the only one of ours where we enabled cooldown and target
MCR, so it's the only one this surfaces on. This is a bug in dependabot-core's Docker update checker, not in our config per se.
```
</p>
</details>
We could either remove the cool down (not acceptable) or we could try to
fix the bug in dependabot (not worth the hassle), or we can just do it
ourselves (what I settled on)
## Implementation details
Told 🤖 to "implement it properly" and it did a good enough job 😄 It
handles getting an anonymous token for the docker hub registry and
managing the cool down, but there _is_ a possibility that we could hit
rate limits. For now I'm inclined to just "meh" over it, as these
_should_ be very rare, because most of the requests don't count towards
it, and it shouldn't be an issue for mcr.
One slight issue is the way the tagging works we can't get "all the
recent new images", so that we can update to the latest image _outside_
the cooldown. We get the latest, see if it's in the cooldown, and if
not, don't update. In the pathological case, we could end up never
updating. In practice, that shouldn't be an issue for the images we're
using
## Test coverage
We can't actually test this properly until it's merged, but I ran a test
locally, and it output the following (abbreviated)
```
╬════════════════════════════════
║ UpdateSmokeTestImageDigests
╬═══════════════════════
09:46:16 [INF] ────────────────────────────────────────────────────────────
09:46:16 [INF] Updating pinned digests in C:\repos\dd-trace-dotnet-5\tracer\build\_build\SmokeTests\smoke-test-images.docker-compose.yml
09:46:16 [INF] ────────────────────────────────────────────────────────────
09:46:16 [INF] Found 96 pinned images to evaluate
09:46:16 [DBG] Evaluating mcr.microsoft.com/dotnet/aspnet:2.1-alpine3.12
09:46:16 [INF] Unchanged mcr.microsoft.com/dotnet/aspnet:2.1-alpine3.12 (digest 43ff07984cea)
09:46:16 [DBG] Evaluating mcr.microsoft.com/dotnet/aspnet:2.1-stretch-slim
...
09:46:33 [DBG] Evaluating andrewlock/dotnet-ubuntu:25.04-9.0
09:46:33 [INF] Unchanged andrewlock/dotnet-ubuntu:25.04-9.0 (digest 0e5c1ae3e68d)
09:46:33 [INF] Rewrote C:\repos\dd-trace-dotnet-5\tracer\build\_build\SmokeTests\smoke-test-images.docker-compose.yml with 10 digest update(s)
09:46:33 [INF] Summary - updated: 10, cooldown: 8, unchanged: 78, failed: 0
09:46:33 [INF] Image digest cooldown report saved to C:\repos\dd-trace-dotnet-5\.nuke\temp\smoke_test_image_cooldown_report.md
╬══════════════════════
║ Errors & Warnings
╬═════════════
[WRN] UpdateSmokeTestImage: Cooldown mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim: new digest f88c77644f4c is only 28h old (< 48h cooldown); keeping current pin f24d74e8185b
[WRN] UpdateSmokeTestImage: Cooldown mcr.microsoft.com/dotnet/aspnet:9.0-bookworm-slim: new digest 4e07e00025f1 is only 28h old (< 48h cooldown); keeping current pin d6c93f1bd94f
[WRN] UpdateSmokeTestImage: Cooldown mcr.microsoft.com/dotnet/aspnet:10.0-noble: new digest 55e37c7795bf is only 41h old (< 48h cooldown); keeping current pin ccdca44cd4f2
[WRN] UpdateSmokeTestImage: Cooldown mcr.microsoft.com/dotnet/aspnet:10.0-noble-chiseled: new digest f43461f1774d is only 41h old (< 48h cooldown); keeping current pin 1191b4891ae8
[WRN] UpdateSmokeTestImage: Cooldown mcr.microsoft.com/dotnet/aspnet:10.0-noble-chiseled-composite: new digest a6fe6804ff21 is only 41h old (< 48h cooldown); keeping current pin 168f51340812
[WRN] UpdateSmokeTestImage: Cooldown mcr.microsoft.com/dotnet/aspnet:10.0-windowsservercore-ltsc2022: new digest 17c963b25ddb is only 41h old (< 48h cooldown); keeping current pin 31eccd550269
[WRN] UpdateSmokeTestImage: Cooldown mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim: new digest f9ddb8a31ae9 is only 28h old (< 48h cooldown); keeping current pin dbbdd47fae7a
[WRN] UpdateSmokeTestImage: Cooldown mcr.microsoft.com/dotnet/sdk:10.0-noble: new digest 8a90a473da52 is only 41h old (< 48h cooldown); keeping current pin f061e5a7532b
```
And seems to work 🤞
## Other details
I'd _like_ to update the pipeline to always run _all_ smoke tests for
these PRs, but I'll move that to a separate PR so as not to block this,
as might require some faffing
https://datadoghq.atlassian.net/browse/APMLP-12821 parent 33380a2 commit 276cb7d
7 files changed
Lines changed: 814 additions & 25 deletions
File tree
- .github
- chainguard
- workflows
- tracer/build/_build
- SmokeTests
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 105 | | |
121 | 106 | | |
122 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
28 | 43 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
0 commit comments