Skip to content

fix(artifactcache): return after storage.Write error on upload - #6132

Open
baiyuxi930826 wants to merge 1 commit into
nektos:masterfrom
baiyuxi930826:fix/artifactcache-upload-return
Open

fix(artifactcache): return after storage.Write error on upload#6132
baiyuxi930826 wants to merge 1 commit into
nektos:masterfrom
baiyuxi930826:fix/artifactcache-upload-return

Conversation

@baiyuxi930826

Copy link
Copy Markdown

Summary

Fixes #6131: when storage.Write fails during artifact cache upload, the handler now returns after the 500 response instead of continuing into useCache and a second 200 responseJSON (which produced a double body and superfluous response.WriteHeader).

Test plan

  • go test ./pkg/artifactcache/ -run TestHandler
  • New regression case: force Write failure (storage root is a file) and assert single 500 JSON error body

@baiyuxi930826

Copy link
Copy Markdown
Author

Friendly ping for review when you have a moment.

This is a small fail-closed fix for #6131: return after storage.Write failure on artifact cache upload so we don't double-write a 200 after a 500. Includes a regression test that forces Write failure (storage root is a file) and asserts a single 500 JSON body.

Local: go test ./pkg/artifactcache/ -run TestHandler passes on this branch.

@louzt

louzt commented Jul 28, 2026

Copy link
Copy Markdown

Verified locally against act master HEAD 4f41128 — the missing return after responseJSON(w, r, 500, err) correctly prevents the second WriteHeader(200) call. The new regression test upload write failure returns 500 once (bad rootDir path) is a clean way to assert the single-response contract. Happy to retest if you rebase or want a second reviewer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: artifact cache upload missing return after storage.Write error (double response + useCache)

3 participants