Skip to content

🏗️🔧:read the trailer [bot] check in linear time - #1931

Merged
openinf-commit-queue[bot] merged 1 commit into
livefrom
claude/project-thread-fqaph2
Nov 3, 2026
Merged

openinf-commit-queue[bot] merged 1 commit into
livefrom
claude/project-thread-fqaph2

Conversation

@DerekNonGeneric

@DerekNonGeneric DerekNonGeneric commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Requested by DerekNonGeneric

Before: in build/shared/commit-message.mts, the [bot] lookahead in TOOL_IDENTITY put two \s* runs next to each other. When [bot] was followed by a long run of spaces and then some other character, the regex tried every way of splitting the spaces between the two runs before failing. With 200,000 spaces that took 20 s, and the landing runner applies this check to contributor commit messages (CWE-1333, found by CodeRabbit's security deepscan of the SDK).

After: the same input takes 3 ms. The address group now takes its own trailing whitespace, so the pattern matches exactly the same strings as before.

How: this is the same change as OpenINF/sdk#140 and OpenINF/.github#948, so all three copies of commit-message.mts stay byte-for-byte identical. It also adds the same regression test. All 59 tests in commit-message.test.mts pass on Node 24.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of commit messages containing long runs of whitespace after a bot label. These messages are processed more efficiently, and a bot label followed by additional text is less likely to cause the message to be incorrectly classified as tool-generated. This also preserves accurate handling of co-author lines with unusually large amounts of whitespace.

@netlify

netlify Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for gh-pages-openinf ready!

Name Link
🔨 Latest commit 1f6057f
🔍 Latest deploy log https://app.netlify.com/projects/gh-pages-openinf/deploys/6ae91c7d2679b9c3fd82bb0f
😎 Deploy Preview https://deploy-preview-1931--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.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The tool identity pattern now handles trailing whitespace within the optional address group. Tests cover a long whitespace run and adjust bare-link trailer comparisons based on the Git version.

Changes: Commit message parsing

Layer / File(s) Summary
Identity pattern and regression test
build/shared/commit-message.mts, build/shared/commit-message.test.mts
The pattern moves trailing whitespace into the optional address group. A test checks that a co-author value with 200,000 spaces after [bot] is not reported as tool authorship and validates in under one second.
Bare-link Git comparison
build/shared/commit-message.test.mts
The test adds a bare-link fixture. It skips comparing that fixture with Git 2.56 or newer and continues comparison for other messages. On earlier versions, it compares the bare link.

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

Merge Risk: Minimal · up to 1f605

No actionable merge-blocking risk is established by the reviewed changes.

Pre-merge checks: Passed 5
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: making the trailer [bot] check run in linear time. The emojis add noise, but the title remains specific and related to the changeset.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: ef71f608-b4e7-4e26-8869-da2cf2684015
Commits

Reviewing files that changed from the base of the PR and between 6a2f9bb and 1f6057f.

Files selected for processing: 1
  • build/shared/commit-message.test.mts

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@DerekNonGeneric DerekNonGeneric self-assigned this Nov 2, 2026
TOOL_IDENTITY put two runs of \s* side by side after a [bot], so a
long run of spaces with something else at the end could be split
between them every possible way before the match gave up: 200,000
spaces took 20 seconds, and the landing runner reads contributor
commit messages. The address group now takes its own trailing
whitespace along, which matches the same strings in linear time.

git 2.56 no longer reads a line starting `token://` as a trailer, so
on the runners' new git the readTrailers comparison disagreed on a
bare link and CI has been red since. The rules keep the older
reading, because a history is read by every git and not only the
newest, so that one case is only compared against a git before 2.56.

This is the same change as OpenINF/sdk#140; the three copies of
commit-message.mts stay byte for byte the same.

Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is>
Assisted-by: Claude-Code:claude-opus-5
@DerekNonGeneric
DerekNonGeneric force-pushed the claude/project-thread-fqaph2 branch from 5e799ed to 1f6057f Compare November 2, 2026 23:27

Copy link
Copy Markdown
Member Author

@coderabbitai review


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Nov 3, 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.

@DerekNonGeneric DerekNonGeneric added the 🚀 Status: Commit Queue Land this pull request when its checks pass label Nov 3, 2026 — with Claude
@openinf-commit-queue
openinf-commit-queue Bot merged commit 616f554 into live Nov 3, 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 Nov 3, 2026
@openinf-commit-queue
openinf-commit-queue Bot deleted the claude/project-thread-fqaph2 branch November 3, 2026 00:43
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