ci(check-links): exclude non-ASCII bytes when extracting GitHub URLs#5336
Closed
davidkonigsberg wants to merge 1 commit intomainfrom
Closed
ci(check-links): exclude non-ASCII bytes when extracting GitHub URLs#5336davidkonigsberg wants to merge 1 commit intomainfrom
davidkonigsberg wants to merge 1 commit intomainfrom
Conversation
The releases/tag and other GitHub URL extraction regexes terminated only on ASCII whitespace and common markdown delimiters. Translated prose (e.g., the recently-added zh translations) can place a fullwidth Chinese right parenthesis (U+FF09) immediately after a URL, which got absorbed into the extracted URL and made the local tag verification fail. Switch to grep -P with a terminator class that also excludes any non-ASCII byte (\x80-\xff). LC_ALL=C is set so PCRE runs in byte-oriented mode and the byte range matches as expected. Co-Authored-By: David Konigsberg <davidakonigsberg@gmail.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #5334. After the sitemap fix landed, the next
Check Linksrun still failed — but for a different reason: the local GitHub URL verification step extracted(note the trailing fullwidth Chinese right parenthesis, U+FF09, hex
EF BC 89) from <ref_file file="/home/ubuntu/repos/docs/fern/translations/zh/products/sdks/generators/csharp/changelog/2026-03-13.mdx" />, then tried to verify that a tag literally namedv0.1.7)exists infern-api/protoc-gen-openapi, which of course it doesn't.The URL terminator class in each
grepwas[^"')<>[:space:]]+— i.e. ASCII whitespace and a few markdown delimiters. The Chinese paren is none of those, so it was absorbed into the URL.Fix: switch the URL extraction greps to
grep -P(PCRE) with a terminator class that also excludes any non-ASCII byte (\x80-\xff), andexport LC_ALL=Cin those steps so PCRE runs in byte-oriented mode. URLs are pure ASCII per RFC 3986, so this is a tighter, correct constraint and is robust to any future CJK / accented punctuation that might land next to a bare URL in translated prose.Verified locally on the current
main:releases/tagextraction: 8 URLs before / 8 after — only difference is the previously-broken one is now extracted as…/v0.1.7instead of…/v0.1.7).blob/tree,issues,compare,commits?,discussions,pullextractions: identical sets before/after.Review & Testing Checklist for Human
Check Linksworkflow manually viaworkflow_dispatchon this branch and confirm the job completes green (i.e.GitHub URLs missing locally: 0).Notes
This only fixes the URL extractor. If you'd prefer the source markdown to use ASCII parens (or, better, a real
[text](url)link) in the zh translation, that's a separate change in <ref_file file="/home/ubuntu/repos/docs/fern/translations/zh/products/sdks/generators/csharp/changelog/2026-03-13.mdx" /> — happy to do that as a follow-up.The earlier-flagged empty
sitemap-en.xmlissue (buildwithfern.com/learn/sitemap-en.xmlreturning an empty<urlset>) is unrelated to this PR and still worth investigating infern-platform.Link to Devin session: https://app.devin.ai/sessions/f71d9cbb5efc401799576519b960ef05
Requested by: @davidkonigsberg