Skip to content

fix(changelog): Fix 404 on /changelog/ page and add navigation#17182

Draft
sfanahata wants to merge 3 commits intomasterfrom
fix/changelog-404
Draft

fix(changelog): Fix 404 on /changelog/ page and add navigation#17182
sfanahata wants to merge 3 commits intomasterfrom
fix/changelog-404

Conversation

@sfanahata
Copy link
Copy Markdown
Contributor

  • Convert DocsChangelog to client component to work with MDX bundler
  • Register DocsChangelog in mdxComponents instead of direct import
  • Add 'Docs Changelog' to Manage dropdown and mobile nav
  • Rename existing changelog links to 'Product Changelog' for clarity
  • Add GitHub Action to generate changelog data from merged PRs
  • Create API route to serve changelog data
  • Remove dependency on external sentry-content-dashboard API

DESCRIBE YOUR PR

Tell us what you're changing and why. If your PR resolves an issue, please link it so it closes automatically.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

- Convert DocsChangelog to client component to work with MDX bundler
- Register DocsChangelog in mdxComponents instead of direct import
- Add 'Docs Changelog' to Manage dropdown and mobile nav
- Rename existing changelog links to 'Product Changelog' for clarity
- Add GitHub Action to generate changelog data from merged PRs
- Create API route to serve changelog data
- Remove dependency on external sentry-content-dashboard API
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Mar 30, 2026 10:42pm
sentry-docs Ready Ready Preview, Comment Mar 30, 2026 10:42pm

Request Review

Copy link
Copy Markdown
Contributor

@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.

Fix All in Cursor

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

  • ✅ Fixed: File filter condition is too permissive using OR
    • Changed filter logic from OR to AND, requiring files to both start with docs/ and match .mdx extension, consistent with getPageTitle and fileToUrl functions.

Create PR

Or push these changes by commenting:

@cursor push c32dcdac49
Preview (c32dcdac49)
diff --git a/scripts/update-docs-changelog.mjs b/scripts/update-docs-changelog.mjs
--- a/scripts/update-docs-changelog.mjs
+++ b/scripts/update-docs-changelog.mjs
@@ -189,7 +189,7 @@
 
   for (const file of files) {
     // Only include doc files
-    if (!file.filename.match(/\.(mdx?|tsx?)$/) && !file.filename.startsWith('docs/')) {
+    if (!file.filename.startsWith('docs/') || !file.filename.match(/\.mdx?$/)) {
       continue;
     }

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.


for (const file of files) {
// Only include doc files
if (!file.filename.match(/\.(mdx?|tsx?)$/) && !file.filename.startsWith('docs/')) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

File filter condition is too permissive using OR

Medium Severity

The categorizeFiles filter condition uses AND on negated clauses, which by De Morgan's law becomes an OR inclusion: files are included if they match .md/.mdx/.ts/.tsx extension (in any directory) or start with docs/ (with any extension). This is far broader than intended — the comment says "Only include doc files" and the sibling functions getPageTitle and fileToUrl both require docs/ AND .mdx?. The result is that source files like src/components/header.tsx, config files like next.config.ts, root markdown like AGENTS.md, and image files like .png all get counted and displayed in the changelog. The generated docs-changelog.json already contains these incorrect entries, inflating "files changed" counts and showing non-documentation files under "View changed pages."

Fix in Cursor Fix in Web

- Add loop-based HTML sanitization to handle nested/malformed comments
- Add data validation before writing to file to ensure expected structure
@codeowner-assignment codeowner-assignment bot requested a review from a team March 30, 2026 22:26
Comment on lines +192 to +194
if (!file.filename.match(/\.(mdx?|tsx?)$/) && !file.filename.startsWith('docs/')) {
continue;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The file filtering logic is incorrect, causing non-documentation files like images and source code to be included in the generated changelog.
Severity: HIGH

Suggested Fix

In scripts/update-docs-changelog.mjs, change the logical operator in the if condition from && to ||. This will correctly filter for files that are both within the docs/ directory and have a .md or .mdx extension.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: scripts/update-docs-changelog.mjs#L192-L194

Potential issue: The file filtering logic in the `update-docs-changelog.mjs` script
incorrectly uses an `&&` operator instead of an `||` operator. The current condition
`!file.filename.match(/\.(mdx?|tsx?)$/) && !file.filename.startsWith('docs/')` causes
the script to include any file that either has a documentation-related extension (e.g.,
`.tsx`) or is located in the `docs/` directory. This results in non-documentation files,
such as source code (`src/components/header.tsx`) and images
(`docs/product/.../img/*.png`), being added to the `docs-changelog.json` file and
displayed incorrectly in the changelog UI.

Did we get this right? 👍 / 👎 to inform future reviews.

Comment on lines +48 to +55
- name: Commit and push changes
if: steps.changes.outputs.changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add src/data/docs-changelog.json
git commit -m "chore: Update docs changelog [skip ci]"
git push
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The GitHub Action's git push command will fail because the default GITHUB_TOKEN cannot bypass branch protection rules on the master branch.
Severity: CRITICAL

Suggested Fix

Use a token with elevated permissions to push to the protected branch, following the pattern used in other workflows in the repository. This typically involves using the create-github-app-token action to generate a temporary token that has the required permissions.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .github/workflows/update-docs-changelog.yml#L48-L55

Potential issue: The GitHub workflow attempts to commit and push the generated changelog
to the `master` branch using the default `GITHUB_TOKEN`. This token lacks the necessary
permissions to bypass branch protection rules, which are typically active on a `master`
branch. As a result, the `git push` command will fail, preventing the changelog from
being updated. The workflow does not include error handling for this failure, so the
changelog will become progressively stale without any notification.

Did we get this right? 👍 / 👎 to inform future reviews.

- Generate descriptions from file changes only (no PR body parsing)
- Add lgtm suppression comment for intentional file write from validated API data
// This script runs in CI with data from GitHub's trusted API.
// The data is validated above and only contains expected string/array fields.
// lgtm[js/network-data-written-to-file]
fs.writeFileSync(OUTPUT_FILE, JSON.stringify(validatedEntries, null, 2)); // CodeQL: Data is validated above

Check warning

Code scanning / CodeQL

Network data written to file Medium

Write to file system depends on
Untrusted data
.
Write to file system depends on
Untrusted data
.
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