Skip to content

🏗️🔧:read a wrapped trailer the way git does - #1900

Merged
openinf-commit-queue[bot] merged 1 commit into
livefrom
fix/fold-trailer-continuations
Sep 13, 2026
Merged

openinf-commit-queue[bot] merged 1 commit into
livefrom
fix/fold-trailer-continuations

Conversation

@DerekNonGeneric

@DerekNonGeneric DerekNonGeneric commented Sep 13, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #1899, which merged an hour ago. CodeRabbit found the hole on the .github copy of the same change: a trailer whose value runs onto an indented line was read as far as the fold and no further.

The continuation was dropped before any check saw it. These two are one trailer to git, and git interpret-trailers --parse prints both as the same line, but only the first was refused:

Co-authored-by: Some Person <noreply@anthropic.com>

Co-authored-by: Some Person
 <noreply@anthropic.com>

The address is the half that says who a trailer names. It sits at the end, so it is the half a fold hides, which made folding a way around the check that just landed.

Sign-off had the same hole from the other side, and older: a wrapped Signed-off-by: lost the address that gets compared against the commit author, and the check passed for nobody.

What changed

The continuation is joined onto the value rather than discarded, which is what git does with it. Reading a message now agrees with git interpret-trailers on a folded trailer as well as a plain one, and that agreement is already cross-checked by the verify task on every commit.

Nothing has to be wrapped to begin with. The trailer block stays exempt from the width limit, because a trailer is metadata and the limit is for prose. The comment claiming a trailer is one line by construction went with the construction.

Validation

Message Before After
address inline refused refused
address folded onto the next line accepted refused
  • two tests added: the folded co-author, and a folded sign-off that now resolves to the right author
  • the existing test that a long trailer is exempt from wrapping still passes, with its reasoning corrected
  • full suite passes, 151 tests

Related

The same fix is folded into the unmerged copies, so all three stay byte-identical: OpenINF/sdk#38 and OpenINF/.github#916.

Summary by CodeRabbit

  • Bug Fixes
    • Commit trailer parsing now correctly includes indented continuation lines in trailer values, matching Git behavior.
    • Folded co-author and sign-off trailers are now validated and matched correctly.
    • Folded trailer values remain exempt from body-line width limits.

A trailer whose value ran onto an indented line was read as far as the
fold and no further. The continuation was dropped before any check saw
it, so whatever had been wrapped was invisible.

That is a way around the check that just landed. These two are one
trailer to git, and `git interpret-trailers --parse` prints both as the
same line, but only the first was refused:

    Co-authored-by: Some Person <noreply@anthropic.com>

    Co-authored-by: Some Person
     <noreply@anthropic.com>

The address is the half that says who a trailer names, and it is the
half at the end, so it is the half a fold hides. Sign-off had the same
hole from the other side: a wrapped `Signed-off-by:` lost the address
the author is compared against, and the check passed for nobody.

So the continuation is joined onto the value rather than discarded,
which is what git does with it. Reading a message now agrees with
`git interpret-trailers` on a folded trailer as well as a plain one,
which is the agreement the verify task already cross-checks.

Nothing has to be wrapped to begin with: the trailer block stays exempt
from the width limit, because a trailer is metadata and the limit is for
prose. The comment saying a trailer is one line by construction went
with the construction.

Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is>
Assisted-by: Claude-Code:claude-opus-5
@netlify

netlify Bot commented Sep 13, 2026

Copy link
Copy Markdown

Deploy Preview for gh-pages-openinf ready!

Name Link
🔨 Latest commit 0dfe3c6
🔍 Latest deploy log https://app.netlify.com/projects/gh-pages-openinf/deploys/6aa5ffbaf301b80007e87e05
😎 Deploy Preview https://deploy-preview-1900--gh-pages-openinf.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@DerekNonGeneric

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@OpenINF OpenINF deleted a comment from coderabbitai Bot Sep 13, 2026
@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 963a1865-39b1-4576-a553-0681f641e84a

📥 Commits

Reviewing files that changed from the base of the PR and between aeb6317 and 0dfe3c6.

📒 Files selected for processing (2)
  • build/shared/commit-message.mts
  • build/shared/commit-message.test.mts

Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

Trailer parsing now preserves indented continuation lines by folding them into the preceding trailer value. Sign-off and co-author validation now inspect the complete value. Tests cover folded addresses and updated trailer width documentation.

Changes

Trailer parsing

Layer / File(s) Summary
Folded trailer parsing and validation
build/shared/commit-message.mts, build/shared/commit-message.test.mts
trailerBlockOf joins indented continuation lines to the preceding trailer. Tests verify folded co-author rejection and folded sign-off matching. Comments describe complete folded trailer values and trailer width handling.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 0dfe3

Trailer continuations are preserved for validation, and no merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: parsing wrapped trailer lines according to Git behavior. The emojis add minor noise but do not make the title unclear.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/fold-trailer-continuations

Comment @coderabbitai help to get the list of available commands.

@DerekNonGeneric DerekNonGeneric added the 🚀 Status: Commit Queue Land this pull request when its checks pass label Sep 13, 2026
@openinf-commit-queue
openinf-commit-queue Bot merged commit 07add86 into live Sep 13, 2026
18 checks passed
@openinf-commit-queue openinf-commit-queue Bot removed the 🚀 Status: Commit Queue Land this pull request when its checks pass label Sep 13, 2026
@openinf-commit-queue
openinf-commit-queue Bot deleted the fix/fold-trailer-continuations branch September 13, 2026 02:02
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