Repository navigation
refactor(snapshot): extract blob spool helper from PushBlobStreaming - #1611
Conversation
Move temp-file spooling and digest computation into spoolBlob with explicit cleanup ownership. Add failure-path tests asserting no spool file leaks on read, upload, or repository-parse failure.
✅ Deploy Preview for devsydev canceled.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
✅ Deploy Preview for images-devsy-sh canceled.
|
os.TempDir reads TMP and TEMP on Windows, so setting only TMPDIR left the cleanup assertions inspecting an unrelated directory. Set all three variables.
|
Run handoff: needs human / next run; not merged. Current head: Local format, lint, snapshot tests, Windows cross-vet, and fresh CodeRabbit CLI review passed on this head (0 findings). Native Windows snapshot tests were not run locally. Previous head Kept draft because CI must pass before ready. CodeRabbit GitHub currently says draft review skipped, not a completed review. No Greptile review is present. Zero review threads. Next run: shepherd this PR, verify all CI on the current SHA, mark ready, obtain completed CodeRabbit coverage and Greptile >=4/5 if it reviews, verify threads/signatures/final policy, then squash-merge only if every gate passes. Do not start another auto-refactor PR. |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
Run handoff: needs human / next run; left ready, not merged. Current head: e970685. All five commits are GitHub-verified signed by Samuel K. Final diff is only pkg/snapshot/registry.go and registry_test.go: 77 non-test changed lines (+56/-21), one non-test file. Fixed the valid CodeRabbit summary concern: deferred cleanup now closes and removes the spool on reader panic/Goexit until ownership is handed off. Both regression tests failed with the guard removed and passed after restoration. Local format, lint, snapshot tests, Windows cross-vet, and fresh CodeRabbit CLI passed on this head (0 findings). Current-head implementation CI passed: 101 success, 3 conditional skipped, 7 neutral. One external check remains in progress: Entire Gates (check run 118733758330, app entire). Its output still says "PR #1611 is a draft" although this PR was marked ready after CI Success passed. It has not refreshed that stale assessment. Do not bypass it. CodeRabbit GitHub: success, Review completed, coverage through e970685, no actionable findings, minimal merge/security risk. Zero review threads. No Greptile review/status is present. CodeRabbit's advisory description/docstring warnings: the body follows the auto-refactor skill's prescribed sections, and extra restating docstrings would conflict with its comment policy; no source churn for these warnings. Main advanced again during CI. A further signed base update plus full CI/review cycle would exceed this run's approximately 3.5-hour budget (the refreshed-head CI took about 90 minutes). Auto-merge is withheld for base freshness and the unresolved external check. Next run: shepherd this PR only; inspect the stale Entire Gates assessment, update the owned branch to current main with a signed normal push, rerun local checks/CLI, then verify CI, completed CodeRabbit, Greptile >=4/5 if present, threads, signatures, and final policy before squash merge. Workspace wks_f870af130a5a3776 and worker a17b0555-2b4c-4732-b664-ac20ce8fcece are retained. |
|
Run handoff: needs human - repeated CI runner disk quota failure. Not merged; kept draft because current-head CI has not passed. Head: Local format, lint, snapshot tests, Windows cross-vet, and fresh CodeRabbit CLI passed on this head (0 findings, 2 files reviewed). CI run 39506012123 is completed, attempt 2. Both initial and rerun Linux CLI builds failed with CodeRabbit status on the current head says success / Review completed, but its comment still identifies coverage through Old-head Entire Gates also remained unassessed (no active assessed Change); no repository configuration or installed CLI was found to repair it. Do not bypass it if it reappears. Next: repair the CI runner disk issue through the CI owner, rerun failed jobs, then complete current-head CI before ready and fresh reviewer gates. Retained workspace wks_f870af130a5a3776 and worker a17b0555-2b4c-4732-b664-ac20ce8fcece. No new refactor PR should be started while this one is open. |
|
Run handoff: needs human; not merged and kept draft. Current head: Local validation on this head passed: CI run 39553597019 is terminal. Next run: investigate/resolve the runner disk-capacity failure, then rerun CI on this head. Only after green CI, mark ready and obtain fresh CodeRabbit plus Greptile review coverage before considering auto-merge. |
|
@greptileai review |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
[Medium impact] This PR appears safe to merge; no actionable issues were found. SummaryExtracts file spooling from
|
What and why
Extracted blob spooling from
PushBlobStreaminginto named stages with explicit temp-file ownership. This preserves the existing upload behavior and guarantees cleanup if the input reader errors, panics, or callsruntime.Goexit.Refs none.
Type of change
AI assistance
Testing
runtime.Goexit.pkg/snapshot; existingTestPushBlobStreaming_MatchesPushBlobDigestand the new cleanup tests exercise the path.How I verified it:
mise run cli:formatmise run cli:lint:cigo test ./pkg/snapshot/... -count=1GOOS=windows GOARCH=amd64 go vet ./pkg/snapshot/Checklist
mise run cli:lint:cipasses.mise run cli:testnot run; the relevant snapshot package tests passed.CodeRabbit CLI
coderabbit review --agent --committed --fresh --base-commit ec3619ac6on274641be1: 0 findings across both changed files. The later head changes only merge current main; the PR diff is unchanged.Auto-merge
Eligible: yes. 77 non-test changed lines (+56/-21) in one production file, two files total.
Next
None.