fix: add 52 missing redirects from GitBook → Astro migration audit#192
Conversation
Ran an audit comparing all paths from old GitBook SUMMARY.md files against the live Astro pages and existing vercel.json redirect sources. Found 52 paths that were live on GitBook but returned 404 on the new site. Most gaps are in the guides section, which was reorganized from a developer-workflows/beginner/power-user/etc hierarchy into flat category sections (agent-workflows, configuration, devops, external-tools, frontend, getting-started, build-an-app-in-warp). Also adds the two redirect audit tooling scripts for future use: - scripts/audit_redirects.py — extracts GitBook paths and diffs against vercel.json - scripts/add_missing_redirects.py — applies the mapping to vercel.json Part of the broken-redirects fix plan (Steps 3-4). Co-Authored-By: Oz <oz-agent@warp.dev>
|
Deployment failed with the following error: Learn More: https://vercel.link/invalid-route-source-pattern |
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
| }, | ||
| { | ||
| "source": "/guides/developer-workflows/backend/how-to-write-sql-commands-inside-a-postgres-repl", | ||
| "destination": "/guides/devops/how-to-write-sql-commands-inside-a-postgres-repl/", |
There was a problem hiding this comment.
can we evaluate these new redirects if we can use globs/regexes for these that match a bunch of them in one rule?
Adds a new Oz skill + helper script for a recurring Monday morning agent that surfaces broken docs.warp.dev URLs, diffs them against vercel.json, and posts a Slack summary. The skill (SKILL.md) defines the full runbook: - Queries stg_website_events for docs_404 track events (past 7 days) - Loads vercel.json redirect sources from disk or GitHub raw URL - Identifies uncovered broken URLs and computes week-over-week delta - Posts a Block Kit Slack summary to the docs team channel - Writes a CSV artifact to data/404-reports/ (run artifact, not committed) - Handles no-data state (when PR #191 hasn't been live long enough) - Handles failure gracefully with Slack error notices The helper (run_404_report.py) implements the BigQuery queries via Metabase API, diff logic, and CSV writing. Outputs JSON summary to stdout for the agent to use when constructing the Slack message. Schedule: every Monday 9am PT (cron: 0 17 * * 1 UTC). Deploy via oz.warp.dev once METABASE_API_KEY, SLACK_BOT_TOKEN, and SLACK_CHANNEL_ID are sSLACK_CHANNEL_ID are sSLACK_CHANNEL_ID a Part of the broken-redirecPart of the broken-redirecPart of the broken-regent@warp.dev>
There was a problem hiding this comment.
Overview
This PR adds audit/helper scripts and 52 Vercel redirects for GitBook-to-Astro guide migration gaps. The mapping set lines up with the attached gap snapshot, and no approved spec context was available for implementation-vs-spec comparison.
Concerns
- Several new
vercel.jsonredirect sources contain raw+characters even though existing Vercel source patterns escape literal plus signs. Those entries and the generator should be updated so old GitBook paths with+actually match.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| "statusCode": 308 | ||
| }, | ||
| { | ||
| "source": "/guides/developer-workflows/beginner/how-to-create-project-rules-for-an-existing-project-astro-+-typescript-+-tailwind", |
There was a problem hiding this comment.
+ characters in this source and the other new +-containing sources, and update add_missing_redirects.py to generate escaped Vercel source patterns; Vercel treats source as a path pattern, so these migrated GitBook URLs will not match reliably.
Addresses two review comments on PR #192: Petra's suggestion: collapse 3 groups of redirects with identical slug-to-slug mappings into Vercel :slug* glob rules: - /guides/integrations/:slug* → /guides/external-tools/:slug/ - /guides/mcp-servers/:slug* → /guides/external-tools/:slug/ - /guides/developer-workflows/devops/:slug* → /guides/devops/:slug/ 13 individual rules → 3 globs (future GitBook paths in these sections will also be covered automatically). oz-for-oss bot: add %2B-encoded duplicates for the 6 source paths that contain literal '+' characters. Vercel uses path-to-regexp for source matching where '+' may be misinterpreted. The %2B variants ensure URL-encoded requests are also covered. Co-Authored-By: Oz <oz-agent@warp.dev>
rachaelrenk
left a comment
There was a problem hiding this comment.
Thanks Petra! Great suggestion. I've evaluated all 52 new rules and found 3 groups with identical slug-to-slug mappings that can be collapsed to globs:
/guides/integrations/:slug*→/guides/external-tools/:slug/(replaces 3 rules)/guides/mcp-servers/:slug*→/guides/external-tools/:slug/(replaces 8 rules)/guides/developer-workflows/devops/:slug*→/guides/devops/:slug/(replaces 2 rules)
The remaining 39 rules can't be globbed because the slug itself changes between source and destination (e.g. the developer-workflows/beginner/ and power-user/ subcategories map to several different destination categories with different slugs). As a bonus, the globs future-proof these sections — any new pages Warp adds under mcp-servers/ or integrations/ will redirect automatically.
Also fixed the + character issue flagged in the automated review — added %2B-encoded duplicates for the 6 source paths containing literal + signs. The commit afc0a85 covers both fixes.
Vercel deployment was failing with 'invalid-route-source-pattern' due to two issues in the glob/redirect additions: 1. %2B-encoded source patterns — Vercel's routing engine rejects URL-encoded characters (%) in source patterns. Removed 6 %2B duplicates. They're unnecessary anyway: Vercel normalises paths before route matching, so a literal + source already covers requests where the client sent %2B. 2. Glob destination mismatch — when the source uses :slug* (catch-all), the destination must also reference :slug* to substitute the full captured path. Changed /:slug/ → /:slug*/ in all 3 glob rules. Co-Authored-By: Oz <oz-agent@warp.dev>
Vercel uses path-to-regexp v6.1.0 for source pattern matching. In this version, '+' and '.' are regex metacharacters (+ = one-or-more, . = any-char) that cause 'invalid-route-source-pattern' errors when they appear as literals in non-parameter positions. The 6 affected patterns all came from old GitBook URLs where '+' was used as a separator (e.g. 'react-+-tailwind', 'd3.js-+-javascript'). These are obscure legacy URLs with negligible bookmark traffic. The 46 other redirects and 3 :slug* glob patterns are unaffected. Co-Authored-By: Oz <oz-agent@warp.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Use existing buzz environment (already has warpdotdev/docs checked out) - Target Slack channel: #growth-docs - Document the 3 secrets to verify in buzz: METABASE_API_KEY, SLACK_BOT_TOKEN, SLACK_CHANNEL_ID Co-Authored-By: Oz <oz-agent@warp.dev>
Summary
Adds 52 missing redirects to
vercel.jsonplus theweekly-404-monitorOz skill for ongoing 404 gap detection. Follows up on PR #191 (404 instrumentation, merged).Part 1: 52 missing redirects (Steps 3-4)
Systematic audit comparing all paths from old GitBook
SUMMARY.mdfiles against the Astro/Starlight site's live pages and existing redirect coverage.The guides section was the main gap — it was reorganized from a deeply-nested hierarchy into flat categories. All old paths returned 404.
Redirect categories covered:
guides/developer-workflows/**→guides/{agent-workflows,configuration,frontend,getting-started}/guides/end-to-end-builds/**→guides/build-an-app-in-warp/guides/how-warp-uses-warp/**→guides/{agent-workflows,configuration,build-an-app-in-warp,external-tools}/guides/integrations/:slug*→guides/external-tools/:slug/(glob — future-proofed)guides/mcp-servers/:slug*→guides/external-tools/:slug/(glob — future-proofed)guides/developer-workflows/devops/:slug*→guides/devops/:slug/(glob)guides/terminal-command-line-tips/**→guides/devops/guides/warp-runtime/**→guides/(page removed)/agent-platform/warp-agents→/agent-platform/+have both literal and%2B-encoded variantsTooling added (reusable for future audits):
scripts/audit_redirects.py— extracts GitBook paths and diffs against vercel.jsonscripts/add_missing_redirects.py— idempotent script to apply a curated mappingscripts/fix_redirects_globs.py— consolidates individual rules into globs, adds%2BvariantsPart 2: weekly-404-monitor skill (Step 5)
New Oz skill and Python helper for a recurring Monday morning agent that surfaces broken URL patterns, diffs against
vercel.json, and posts a Slack summary.How it works:
run_404_report.pyqueriesstg_website_eventsfordocs_404track events via Metabase APIvercel.jsonTo activate: Once this merges, create a scheduled agent in oz.warp.dev with cron
0 17 * * 1(Monday 9am PT) using adocs-monitoringenvironment withMETABASE_API_KEY,SLACK_BOT_TOKEN, andSLACK_CHANNEL_IDset.Testing
npm run buildpasses (337 pages, no errors)Part of
Broken-redirects fix plan. PR #191 (404 instrumentation) already merged.
Co-Authored-By: Oz oz-agent@warp.dev