Skip to content

CLI: keep the takumi-pdf version out of the PDF band goldens - #2669

Merged
kane50613 merged 1 commit into
masterfrom
fix/cli-pdf-goldens-version
Nov 20, 2026
Merged

kane50613 merged 1 commit into
masterfrom
fix/cli-pdf-goldens-version

Conversation

@kane50613

@kane50613 kane50613 commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Why

The PDF producer carries the takumi-pdf version, takumi-pdf 0.21.0. The Version Packages merge bumped it to 0.21.1, so bands-footer-only.pdf and bands-header-and-footer.pdf changed and Rust Test failed on master. That failure skipped the publish job, which needs pass-test, so the release published nothing. Every later release would fail the same way.

What

pdf_bands.rs writes each digit of the producer version as 0 after the CLI writes the PDF. The string keeps its length, so every byte offset in the PDF stays valid: qpdf --check finds no errors. The goldens now carry takumi-pdf 0.00.0 and change only if the version gains a digit.

Summary by CodeRabbit

  • Tests
    • PDF validation now treats producer version differences consistently, helping generated-document checks remain stable across version updates.

@kane50613
kane50613 enabled auto-merge (squash) November 20, 2026 07:47
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The PDF test helper now normalizes version digits after each takumi-pdf producer marker in generated PDFs after a successful CLI run. It writes the modified PDF bytes back to the generated file.

Changes: PDF Test Normalization

Layer / File(s) Summary
Normalize generated PDF producer versions
takumi-cli/tests/pdf_bands.rs
The helper replaces version digits after each takumi-pdf marker with 0, while preserving periods and string length. After a successful CLI run, the render helper applies this normalization to the generated PDF and writes the modified bytes back.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Merge Risk: Moderate · up to 18d3f

The test helper rewrites the producer version in the generated PDFs. The identifiers derived from that version are left as they were, so the next version bump will likely change the band goldens again and block the release job. Fix this before merging if the aim is to stop version bumps from touching the goldens.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@kane50613
kane50613 disabled auto-merge November 20, 2026 07:49
@kane50613
kane50613 merged commit 247dfb7 into master Nov 20, 2026
18 of 19 checks passed
@kane50613
kane50613 deleted the fix/cli-pdf-goldens-version branch November 20, 2026 07:49
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