-
Notifications
You must be signed in to change notification settings - Fork 7
Add redirect checker to block PRs with deleted pages missing redirects #666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adds a GitHub Action and local script that compares the branch to main, detects deleted markdown files, and ensures each has a corresponding redirect entry in next.config.ts. Prevents broken bookmarks and SEO issues. Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this 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 4 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
scripts/check-redirects.sh
Outdated
| fi | ||
|
|
||
| # Get list of deleted markdown files (comparing to base branch) | ||
| DELETED_FILES=$(git diff --name-status "$BASE_BRANCH"...HEAD 2>/dev/null | grep "^D" | grep -E '\.(md|mdx)$' | awk '{print $2}' || true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script silently succeeds when base branch unavailable
High Severity
When the base branch cannot be fetched (network failure, invalid remote, wrong branch name), the script silently reports success with "No deleted markdown files found" instead of failing. The || true on the fetch command allows continuation, and the subsequent git diff against the non-existent branch fails silently due to 2>/dev/null || true. This allows PRs with deleted files to pass the check without any actual verification being performed.
…t checker Content moves: - Move guides/agent-frameworks/* to get-started/agent-frameworks/* - Move guides/tool-calling/mcp-clients/* to get-started/mcp-clients/* - Add wildcard redirects for moved content - Fix stale _meta.tsx references Redirect checker enhancements: - Interactive mode prompts for redirect destinations - Validates existing redirects for placeholder text (REPLACE_WITH, TODO, FIXME) - Catches circular redirects (source == destination) - Verifies destination pages exist - Detects both deletes and renames Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Fail with error when base branch is unavailable instead of silent success - Fix root page URL path handling (app/en/page.mdx -> /:locale) - Only check page.md/mdx files (skip non-routable markdown like README.md) - Use cut with tab delimiter instead of awk to handle filenames with spaces Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this 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 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
- Adjusted the script to use cut for field extraction, improving handling of deleted and renamed page files. - Updated informational messages to redirect stderr, ensuring clarity in user prompts. This improves the user experience when managing redirects in the Arcade platform.
There was a problem hiding this 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 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
There was a problem hiding this 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 is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| source: "/:locale/guides/tool-calling/mcp-clients/:path*", | ||
| destination: "/:locale/get-started/mcp-clients/:path*", | ||
| permanent: true, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New redirects create chains with existing redirect destinations
Medium Severity
The new redirects from /:locale/guides/agent-frameworks and /:locale/guides/tool-calling/mcp-clients create redirect chains with existing redirects that already target those paths. For example, /:locale/home/agent-frameworks-overview redirects to /:locale/guides/agent-frameworks, which now redirects again to /:locale/get-started/agent-frameworks. Similarly, /:locale/home/mcp-clients/cursor and related paths now require two hops. This degrades user experience with extra latency and can negatively impact SEO since search engines may not follow redirect chains correctly.
Summary
scripts/check-redirects.sh) that works via git comparison to main.md/.mdxfiles and verifies they have redirect entries innext.config.tsTest plan
./scripts/check-redirects.shon a branch with deleted files🤖 Generated with Claude Code
Note
Introduces CI to prevent broken docs links and updates redirects/links for moved pages.
check-redirects.ymlthat runsscripts/check-redirects.shto detect deletedapp/**/page.md(x)without entries innext.config.ts, comments details on the PR, and fails if missingscripts/check-redirects.shvalidates existing redirects (placeholders, circular refs, dead destinations), supports wildcards, and suggests entries (interactive locally)next.config.tswith redirects movingguides/agent-frameworksandguides/tool-calling/mcp-clientstoget-started/*public/llms.txtlinks to newget-startedpathsWritten by Cursor Bugbot for commit cc59b74. This will update automatically on new commits. Configure here.