fix(agent-runtime): create the OPA destination directory, which does not exist on a clean checkout - #676
Merged
Conversation
…not exist on a clean checkout
Root cause, at last, and it was never the download.
`.gitignore:47` ignores `.harness/bin/` — roughly 400 MB of platform OPA binaries —
so git tracks not one file there. A developer's machine has that directory because
they downloaded into it. **A clean checkout does not have it at all.** So
`mv /tmp/opa .harness/bin/opa` failed for want of a destination.
Two things hid this for three attempts:
* BusyBox `mv` names the SOURCE when the DESTINATION is missing —
`can't rename '/tmp/opa': No such file or directory` reads exactly like a download
that produced nothing, which is what I chased first with wget→curl.
* Every local build passed, because it used files that exist only on my disk. That is
the same class of error as the original one: verifying something adjacent to what
CI runs instead of what CI runs.
`mkdir -p .harness/bin` before the move. One line.
**Two claims of mine are corrected in the process.** The Dockerfile comment, and the
commit that introduced this step, said the build was shipping a Mach-O binary into a
Linux image. It was not: those binaries are gitignored, so on CI there was no binary
at all — which is what the original audit actually said ("absent from the alpine
image"). I overstated it, and the corrected comments now say what is true.
Verified the way it should have been from the start: in a clean `git worktree` — no
`.harness/bin/`, exactly what the runner checks out — building `--platform
linux/amd64 --no-cache`. `mkdir -p` runs, `mv` succeeds, `opa version` reports
`Version: 1.19.0`.
A note the chain earned: a transient DNS failure during one of these runs stopped the
build AT `apk add` and said so. Under the previous `;` form that would have surfaced
as the same misleading `mv` error.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: aarroyo <beyondnet.peru@gmail.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📊 Bilingual Coverage ImpactPR Changes
Repository Coverage
✅ Good: All EN changes have ES counterparts. Generated by GitHub Actions |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause, and it was never the download
.gitignore:47ignores.harness/bin/— roughly 400 MB of platform OPA binaries — so git tracks not one file there. A developer's machine has that directory because they downloaded into it. A clean checkout does not have it at all.So
mv /tmp/opa .harness/bin/opafailed for want of a destination. One line fixes it:Why it took three attempts
Two things hid it:
mvnames the source when the destination is missing.can't rename '/tmp/opa': No such file or directoryreads exactly like a download that produced nothing — which is what #672 chased, replacing wget with curl. Necessary (BusyBox wget really does not follow the redirect) but not the cause.#675 is what made this findable — it turned the step into an
&&chain withset -x, so a failure stops at the command that failed. It earned its keep immediately: a transient DNS failure during verification stopped the build atapk addand said so. Under the previous;form that would have surfaced as the same misleadingmverror.Two of my own claims, corrected
The Dockerfile comment and the commit that introduced this step said the build was shipping a Mach-O binary into a Linux image. It was not — those binaries are gitignored, so on CI there was no binary at all. That is what the original audit actually said ("absent from the alpine image"); I overstated it. The comments now say what is true.
Verified the way it should have been from the start
In a clean
git worktree— no.harness/bin/, exactly what the runner checks out — building--platform linux/amd64 --no-cache:Before you submit
Signed-off-by.Linked ADRs / Issues
What the reviewer should know
Build & Push Services (GHCR)is gated ongithub.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'). It does not run on PRs, and it is skipped on develop — so this PR's green checks will not prove the image builds, and neither did the green checks on #669, #670, #673 or #675. The first honest signal comes only whenmainmoves.That is the finding worth acting on beyond this fix: the only job that answers "does the artifact we ship actually build?" runs after every gate that could have stopped it.
🤖 Generated with Claude Code