Commit 72fae25
committed
test(remote-worker): guard probed capabilities against the images (#252 review)
Nothing in CI builds either leaf Dockerfile -- build.yaml's matrix is the harness, the OCP sandbox
and the echo target, and it only fires on push to main; ci.yml's remote-worker job is the Go build;
hadolint parses these files but does not resolve packages. So the exact mismatch this PR exists to
fix -- `probed` naming a tool the image does not install, which shipped as `caps=[bash base64 file]`
on a real VM -- had no guard, and neither did the two Dockerfiles' agreement with each other.
A Go test rather than the suggested vitest parse of main.go: in-package it can reference `probed`
directly, so the list it checks cannot drift from the list the worker advertises. It runs in the
`go test -race ./...` step CI already has, needs no daemon, no network and no build.
`provides` maps each probed tool to what actually puts it on PATH -- base64 comes from
coreutils-single, rg from the vendored tarball -- because a test that grepped for the tool's own
name would pass while the image stayed broken. `knownGap` is deliberately empty: an entry there
means the agent's tools built on that binary fail at runtime in every leaf sandbox, so adding one
should require saying so in the Dockerfile and the PR.
Three properties, each negative-tested rather than assumed green:
- against the pre-fix tree it reports rg, git and python3 missing (exit 1)
- dropping git from Dockerfile.runtime only trips the drift check (exit 1)
- removing the digest verification trips the pinning check (exit 1)
and all three pass on this branch. The regex asserts a match exists, so a stale pattern fails
loudly instead of vacuously passing -- the failure mode verify-sandbox-inventory.sh documents.
Static analysis cannot prove a package still resolves in a future UBI 9 minor; only building the
image does. verify-sandbox-inventory.sh is the in-image counterpart, and is the pattern to follow
if these images are ever published to GHCR.
Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Paolo Dettori <dettori@us.ibm.com>1 parent 187e7bf commit 72fae25
1 file changed
Lines changed: 123 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 | + | |
| 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 | + | |
0 commit comments