Skip to content

feat: Github Action to linkify 404 links#14927

Open
a-hariti wants to merge 3 commits intomasterfrom
linkify-404s
Open

feat: Github Action to linkify 404 links#14927
a-hariti wants to merge 3 commits intomasterfrom
linkify-404s

Conversation

@a-hariti
Copy link
Collaborator

Motivation

make the links in user 404 reports clickable for easy verifiability

Not sure the ideal way to test this action aside from merging into master then observing its behavior

make the links in user 404s reports clickable for easy verifiability
@vercel
Copy link

vercel bot commented Sep 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Mar 5, 2026 5:15pm
sentry-docs Ready Ready Preview, Comment Mar 5, 2026 5:15pm

Request Review

cursor[bot]

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Sep 14, 2025

Bundle Report

Changes will decrease total bundle size by 299 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 9.91MB -290 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 12.63MB -9 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.78MB -0.0%
../instrumentation.js -3 bytes 1.1MB -0.0%
9523.js -3 bytes 1.08MB -0.0%
view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 882.71kB -0.0%
static/chunks/8321-*.js -3 bytes 425.87kB -0.0%
static/media/7c239973d8aef789-*.woff2 (New) 32.56kB 32.56kB 100.0% 🚀
static/media/32c80fb7588b7a2e-*.woff2 (New) 32.48kB 32.48kB 100.0% 🚀
static/media/a5d9f2ead0568494-*.woff2 (New) 21.08kB 21.08kB 100.0% 🚀
static/media/5b25d60b4670300e-*.woff2 (New) 19.29kB 19.29kB 100.0% 🚀
static/media/fc5b975a09123a00-*.woff2 (New) 9.75kB 9.75kB 100.0% 🚀
static/media/99e31c27a1524300-*.woff2 (New) 9.35kB 9.35kB 100.0% 🚀
server/middleware-*.js 5.55kB 6.55kB 555.3% ⚠️
server/middleware-*.js -5.55kB 1.0kB -84.74%
static/LTp2tiCQkIsnglFEKzS-*.js (New) 684 bytes 684 bytes 100.0% 🚀
static/LTp2tiCQkIsnglFEKzS-*.js (New) 77 bytes 77 bytes 100.0% 🚀
static/media/4fca85807f6c09f6-*.woff2 (Deleted) -32.6kB 0 bytes -100.0% 🗑️
static/media/d695df15e3ff125c-*.woff2 (Deleted) -32.58kB 0 bytes -100.0% 🗑️
static/media/acdf4f392b58827a-*.woff2 (Deleted) -21.13kB 0 bytes -100.0% 🗑️
static/media/501d9eeee6e2b0cc-*.woff2 (Deleted) -19.41kB 0 bytes -100.0% 🗑️
static/media/a72efd2c2476ebb2-*.woff2 (Deleted) -9.7kB 0 bytes -100.0% 🗑️
static/media/9d7436bc73437f75-*.woff2 (Deleted) -9.36kB 0 bytes -100.0% 🗑️
static/hfL-*.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
static/hfL-*.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️

@chargome
Copy link
Member

Related: seems like the 404 linter has failed to detect some of the 404s lately, maybe we need to re-visit

@chargome chargome requested a review from sergical October 14, 2025 07:02
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Regex character class accidentally excludes literal dot
    • Updated urlLineRegex to remove the unintended literal dot exclusion so dot-prefixed relative paths are now matched and linkified.

Create PR

Or push these changes by commenting:

@cursor push 410b793782
Preview (410b793782)
diff --git a/.github/workflows/linkify-404s.yml b/.github/workflows/linkify-404s.yml
--- a/.github/workflows/linkify-404s.yml
+++ b/.github/workflows/linkify-404s.yml
@@ -23,7 +23,7 @@
 
             // Find the FIRST url after in the "### URL" section produced by the form, replace it with a linkified version
             // ignores the [url](url) pattern (set by the user or from a previous run)
-            const urlLineRegex = /### URL\n+([^\[.\n].*)/;
+            const urlLineRegex = /### URL\n+([^\[\n].*)/;
             const updated = body.replace(urlLineRegex, "### URL\n[$1]($1)")
 
             if (updated !== body) {
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.


// Find the FIRST url after in the "### URL" section produced by the form, replace it with a linkified version
// ignores the [url](url) pattern (set by the user or from a previous run)
const urlLineRegex = /### URL\n+([^\[.\n].*)/;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regex character class accidentally excludes literal dot

Low Severity

The character class [^\[.\n] in urlLineRegex excludes literal . (dot is literal inside [...]), but the comment only explains the [ exclusion for avoiding already-linkified [url](url) patterns. The . exclusion is likely unintentional and would prevent matching any URL or path starting with a dot (e.g., ./relative/path). The intended character class was probably [^\[\n].

Fix in Cursor Fix in Web

@sergical
Copy link
Member

sergical commented Mar 5, 2026

@a-hariti let me know if you can update this based on the bugbot feedback. one thing that would actually be really helpful is having the ticket report the previous page from where the 404 was accessed, not sure if we can do location.history or something and pass it off to the github issue

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.

3 participants