Repository navigation
test(occdev): pin the k3d import retry at both call sites and selector value quoting - #1578
Conversation
…r value quoting Mutation sweep of #1572 and #1263 (test-gaps-19). The retry loop was pinned on its own, but nothing exercised it through importDevelopmentImage or importOpenShellImage: reverting either call site to a one-shot import, dropping the archive cleanup, or skipping the development digest lookup all survived. Each attempt's output buffer could also be shared across attempts, so a later non-stream failure was retried. - k3d_import_test.go: a second attempt that fails for another reason is not retried; both call sites retry a closed stream, keep the archive for each attempt, look the image up only after the import that succeeded, forward k3d's stdout, and remove the archive afterwards. - bootstrap-volume.test.mjs: the YAML-scalar node selector case now uses each key as its value, so an unquoted selector value fails too.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
…(review) Review nits: the new OpenShell retry test repeated TestOpenShellImageImportRegistersThePodmanRecordedName, so that test now loses its first import stream and checks the retry instead. Name the later failure laterFailure, build the development server name from the cluster, and say why the staging name mirrors importDevelopmentImage and why flakyK3dImportCase exists. Mutation results unchanged: 24/25.
|
Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 11:23 PM ET / October 7, 2026, 03:23 UTC (Revision 2). ClawSweeper reviewWhat this changesAdds tests for both local Kubernetes image-import callers, retry error isolation, archive cleanup and digest verification, and bootstrap node selector values that resemble YAML scalars. Merge readiness✅ Ready for maintainer review Keep open: these focused regression tests remain absent from current main and add useful coverage beyond the merged fixes. No actionable correctness or security findings remain. Priority: P3 Review scores
Verification
How this fits togetherThe development launcher exports local container images, imports them into k3d, and verifies their immutable references before deployment. Separately, the production bootstrap helper renders a preparation Pod from operator-supplied namespace and node selector settings. flowchart TD
A[Local container images] --> B[Development image export]
B --> C[Bounded k3d import retry]
C --> D[Digest verification and archive cleanup]
D --> E[Deployment image reference]
F[Operator bootstrap settings] --> G[Preparation Pod manifest]
G --> H[Kubernetes volume preparation]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Retain these focused regressions alongside the existing retry and bootstrap serialization owners. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR strengthens regression coverage rather than reporting a remaining product defect; tests were inspected but not executed in this read-only review. Is this the best way to solve the issue? Yes: exercising the real import callers and extending the existing parsed-manifest assertion is a focused way to protect the uncovered behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 45b6d2421f1f. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Problem
A mutation sweep of #1572 (retry a direct k3d image import that lost its stream) and #1263 (quote the bootstrap preparation namespace) left real gaps. The retry loop in
importArchiveDirectis well pinned on its own (16 of 25 mutants killed), but nothing ran it through its two callers:importDevelopmentImageorimportOpenShellImageto the old one-shotk3d image importsurvived.ctr images listdigest lookup or importing by the requested name instead of the engine-recorded one.importDevelopmentImage's staged path had no test at all.For #1263, the namespace and key quoting are pinned, but an unquoted node selector value (for example
yesor010) survived.Change
Test-only.
internal/occdev/k3d_import_test.go:importDevelopmentImage(staged digest image, Podman). Before this, its staged path had no test at all.internal/occdev/openshell_k3d_profile_test.go: in the existingTestOpenShellImageImportRegistersThePodmanRecordedName, the first import now loses its stream.flakyK3dImportCase, whose fake k3d checks that the archive still exists on every attempt. They check:tests/integration/bootstrap-volume.test.mjs: the YAML-scalar node selector test now uses each key as its own value, so an unquoted value fails as well as an unquoted key.Verification
go test ./internal/occdev/ -count=1per mutant): fix(occdev): retry a direct k3d image import that lost its stream #1572 went from 16/25 to 24/25 killed. The survivor dropsstrings.ToLowerfrom the closed-stream matcher. It is equivalent for k3d's real output, which carries every phrase in lower case on its second line.--namespacemust be a DNS label.completeExpectedwas driven against fake queues: it fails when a key is never claimed (queue drained, queue empty, 200 unrelated claims, duplicate claim). Four of five helper mutants are caught. The survivor returns early once every key has been claimed, which is equivalent.taskset -c 0-1,GOMAXPROCS=2), each round gated on a 1-minute load under 40:go test ./internal/occdev/ -count=1 -p 1andnode --test --test-concurrency=2 tests/integration/bootstrap-volume.test.mjs(11/11).go vet ./internal/occdev/,gofmt -l, andprettier --checkon the touched files are clean.No new conflicts with open PRs that touch
internal/occdev/or the bootstrap volume files (git merge-tree --write-tree --name-only <pr-head> <base>):2f2d8b41fa6bfbc98568d745246187cba5e499f6a4602f40438227a3a64a1d76ee4c77e1e6837de6cRisks
Test-only; the new Go tests add well under a second to
internal/occdev. The new fakes match exact command lines, so a future change to the import's arguments has to update them. That is the intent.