Skip to content

ci: match the watcher's quoting to how GitHub parses code, and pin it - #388

Merged
caezium merged 1 commit into
mainfrom
fix/upstream-watch-quoting-fidelity
Aug 17, 2026
Merged

ci: match the watcher's quoting to how GitHub parses code, and pin it#388
caezium merged 1 commit into
mainfrom
fix/upstream-watch-quoting-fidelity

Conversation

@caezium

@caezium caezium commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Follow-up review of #387. Both findings were valid, and one of them was a leak rather than a cosmetic issue.

Erring wide about what counts as code is not the safe direction. Anything we treat as code but GitHub does not is a live mention we skipped. An inline run of two backticks closed by one — not code @user` `` — is not a span to GitHub, so that mention stayed linked while we passed over it. Spans now close on a run of equal length. A fence now closes only on a run of its own character, so ```~~~ no longer ends a ``` block that GitHub itself keeps open (a closing fence may not contain other characters).

The punctuation blacklist guarding e-mail local parts was wrong in both directions. It still mangled o'brien'@x.com, a&b&@x.com and x=y=@x.com — a local part can end in any of ~20 characters, so the blacklist was never going to be complete — and it suppressed real mentions written -@user, .@user or **@user**, all of which GitHub links. Addresses are now matched positively and passed through whole, which needs no guess at what a local part may end with, and the mention lookbehind narrows back to GitHub's own rule (preceded by a non-word character). An address can't swallow a handle in front of it: ping @user@example.com still quotes @user.

Pinned it. Three rounds of subtle edge cases in one regex is enough, so scripts/tests/test_upstream_watch.py covers both failure directions — quoting too little (mention stays live) and quoting too much (text GitHub wouldn't treat as code gets skipped). It runs in the compliance job's existing unittest discover step, so no workflow change: 22 new tests, 91 green locally.

Verified: byte-identical output on the six most recent real Mole release bodies, zero residual mentions, zero residual PR URLs, WATCH_DRY_RUN=1 clean over both modes.

Review of #387. Erring wide when deciding what counts as code is not the
safe direction it looks like: text we treat as code but GitHub does not is
a live mention we skipped. An inline run of two backticks closed by one is
not a span to GitHub, so a mention inside it stayed linked. Spans now
close on a run of equal length, and a fence closes only on a run of its
own character, so ```~~~ no longer ends a ``` block that GitHub keeps open.

The punctuation blacklist guarding e-mail local parts was the wrong shape
in both directions: it still mangled o'brien'@x.com, a&b&@x.com and
x=y=@x.com, and it suppressed real mentions written -@user, .@user or
**@user**, which GitHub does link. Match addresses positively and pass
them through whole instead, which needs no guess at what a local part may
end with, and narrow the mention lookbehind back to GitHub's own rule.

Three rounds of subtle edge cases in one regex is enough, so pin the
behaviour: scripts/tests/test_upstream_watch.py covers both failure
directions and runs in the compliance job's existing unittest discovery.

Byte-identical output on the last six real Mole release bodies.
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@caezium, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 33 minutes

Limit details: You’ve used all 3 included reviews currently available under your plan.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f97dcc4-02d4-4129-a4f3-c00f31cbb2d6

📥 Commits

Reviewing files that changed from the base of the PR and between 8243226 and f261633.

📒 Files selected for processing (2)
  • .github/scripts/upstream_watch.py
  • scripts/tests/test_upstream_watch.py

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

@caezium

caezium commented Aug 17, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@caezium
caezium merged commit 598710e into main Aug 17, 2026
5 checks passed
@caezium
caezium deleted the fix/upstream-watch-quoting-fidelity branch August 17, 2026 07:11
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