Skip to content

fix(artifacts): fail on an incomplete ZIP instead of reporting success - #337

Merged
finalerock44 merged 1 commit into
devfrom
fix/zip-integrity-check
Nov 18, 2026
Merged

finalerock44 merged 1 commit into
devfrom
fix/zip-integrity-check

Conversation

@finalerock44

Copy link
Copy Markdown
Contributor

Artifact and HTML report ZIPs are streamed while they are built. When the server hits an error after the response headers, the stream can still end cleanly, and the CLI saved a ZIP with no central directory and reported the download as a success. unzip rejects such a file.

Every ZIP download is now checked for a complete central directory, read from the end of the file without touching the entries' data:

  • A bundle download that is incomplete falls back to the inline endpoint, recorded as bundle_truncated.
  • An inline download that is incomplete fails with a clear message, and the partial file is deleted so nothing downstream picks it up.

dcd artifacts now exits 1 when its download fails, with or without --json. dcd cloud is unchanged: a failed download still only warns, and the command keeps its test-result exit codes. JUnit and Allure reports are not ZIPs and are not checked.

What & why

Type of change

  • fix — bug fix
  • feat — new feature
  • perf — performance improvement
  • refactor — code change that's neither a fix nor a feature
  • docs — documentation only
  • chore / ci / build / test — tooling, no user-facing change
  • Breaking change (title has ! or PR notes a BREAKING CHANGE:)

Checklist

  • PR title follows the Conventional Commits format (see comment above)
  • pnpm lint passes
  • pnpm typecheck passes
  • pnpm build passes
  • I have not bumped the version or edited CHANGELOG.md (the release workflow handles this)
  • I have signed the CLA (the bot will prompt on first contribution)
  • Docs / README.md / STYLE_GUIDE.md updated if behaviour or output changed

How to test

Artifact and HTML report ZIPs are streamed while they are built. When the
server hits an error after the response headers, the stream can still end
cleanly, and the CLI saved a ZIP with no central directory and reported
the download as a success. unzip rejects such a file.

Every ZIP download is now checked for a complete central directory, read
from the end of the file without touching the entries' data:

- A bundle download that is incomplete falls back to the inline endpoint,
  recorded as bundle_truncated.
- An inline download that is incomplete fails with a clear message, and
  the partial file is deleted so nothing downstream picks it up.

dcd artifacts now exits 1 when its download fails, with or without --json.
dcd cloud is unchanged: a failed download still only warns, and the
command keeps its test-result exit codes. JUnit and Allure reports are
not ZIPs and are not checked.
@finalerock44 finalerock44 self-assigned this Nov 18, 2026
@claude

claude Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

@finalerock44
finalerock44 merged commit e4b18b2 into dev Nov 18, 2026
9 checks passed
@finalerock44
finalerock44 deleted the fix/zip-integrity-check branch November 18, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant