mz992: skip the push on a dryrun - #999
Conversation
|
Warning Review limit reached
Next review available in: 45 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe executor now skips pushes during dry-run execution and rejects nil images in ChangesDry-run and Kaniko validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
d921095 to
70c6840
Compare
70c6840 to
11b3e96
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
integration/integration_test.go (1)
251-254: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the dry-run plan output.
TestKanikoOnlyonly checks thatBuildKanikoImagereturns no error. A regression that exits successfully without rendering the plan would pass this test. Capture the executor output forDockerfile_test_issue_mz992and assert the expected plan output.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@integration/integration_test.go` around lines 251 - 254, Update TestKanikoOnly around BuildKanikoImage to capture the executor output specifically for Dockerfile_test_issue_mz992, then assert that it contains the expected dry-run plan output. Retain the existing error assertion while ensuring a successful return also requires the plan to be rendered.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@integration/integration_test.go`:
- Around line 251-254: Update TestKanikoOnly around BuildKanikoImage to capture
the executor output specifically for Dockerfile_test_issue_mz992, then assert
that it contains the expected dry-run plan output. Retain the existing error
assertion while ensuring a successful return also requires the plan to be
rendered.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a9120f2b-f242-42e0-ab96-072f7485b868
📒 Files selected for processing (6)
cmd/executor/cmd/root.gointegration/dockerfiles/Dockerfile_test_issue_mz473integration/dockerfiles/Dockerfile_test_issue_mz992integration/images.gointegration/integration_test.gopkg/executor/push.go
Fixes #992
A dryrun renders the plan and builds nothing, so
DoBuildreturns a nil image.DoPushonly skipped the push for--no-push, so it dereferenced that nil image and the executor panicked right after printing a complete plan. Combining--dryrunwith a real destination is the natural way to preview what a build will push, and it was the one combination that crashed. The push is not the only path that dereferenced the image, the digest files, the tarball and the OCI layout do too. The nil image is howDoBuildsignals plan-only, so the caller that reads that convention is the one that skips the push, andDoPushasserts a non-nil image instead of quietly tolerating one.The golden suite passes
--dryrunbut callsDoBuilddirectly and never reachesDoPush, which is why nothing caught this. The repro therefore needs a real executor run, and it has no docker counterpart, so it comes withTestKanikoOnly, a suite for scenarios that live inside kaniko itself and have no oracle to diff against. Several existing tests were being shoehorned into docker parity for want of such a home, either carrying diffoci ignores that only existed to make a meaningless comparison pass, or asking/proc/1/exeat build time whether kaniko was the builder so the docker side would pass vacuously. Those move over here and shed the workarounds.Summary by CodeRabbit
Bug Fixes
Tests