ci: match the watcher's quoting to how GitHub parses code, and pin it - #388
Conversation
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.
|
Warning Review limit reached
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. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
|
@coderabbitai review |
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.comandx=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,.@useror**@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.comstill quotes@user.Pinned it. Three rounds of subtle edge cases in one regex is enough, so
scripts/tests/test_upstream_watch.pycovers 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 existingunittest discoverstep, 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=1clean over both modes.