Skip to content

fix: add 52 missing redirects from GitBook → Astro migration audit#192

Open
rachaelrenk wants to merge 6 commits into
mainfrom
oz/fix-missing-redirects-gitbook-audit
Open

fix: add 52 missing redirects from GitBook → Astro migration audit#192
rachaelrenk wants to merge 6 commits into
mainfrom
oz/fix-missing-redirects-gitbook-audit

Conversation

@rachaelrenk

@rachaelrenk rachaelrenk commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds 52 missing redirects to vercel.json plus the weekly-404-monitor Oz 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.md files 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/
  • 6 paths containing + have both literal and %2B-encoded variants

Tooling added (reusable for future audits):

  • scripts/audit_redirects.py — extracts GitBook paths and diffs against vercel.json
  • scripts/add_missing_redirects.py — idempotent script to apply a curated mapping
  • scripts/fix_redirects_globs.py — consolidates individual rules into globs, adds %2B variants

Part 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.py queries stg_website_events for docs_404 track events via Metabase API
  • Diffs broken URLs against live redirect sources in vercel.json
  • Computes week-over-week delta (new gaps vs resolved)
  • Writes a CSV artifact per run (not committed — lives in the Oz run)
  • Skill defines the Slack Block Kit message format and failure handling

To activate: Once this merges, create a scheduled agent in oz.warp.dev with cron 0 17 * * 1 (Monday 9am PT) using a docs-monitoring environment with METABASE_API_KEY, SLACK_BOT_TOKEN, and SLACK_CHANNEL_ID set.


Testing

  • npm run build passes (337 pages, no errors)

Part of

Broken-redirects fix plan. PR #191 (404 instrumentation) already merged.

Co-Authored-By: Oz oz-agent@warp.dev

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>
@cla-bot cla-bot Bot added the cla-signed label Jun 8, 2026
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Redirect at index 1917 has invalid `source` pattern "/guides/developer-workflows/beginner/how-to-create-project-rules-for-an-existing-project-astro-+-typescript-+-tailwind".

Learn More: https://vercel.link/invalid-route-source-pattern

@oz-for-oss

oz-for-oss Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@rachaelrenk

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread vercel.json
},
{
"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/",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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>

@oz-for-oss oz-for-oss Bot left a comment

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.

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.json redirect 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

Comment thread vercel.json Outdated
"statusCode": 308
},
{
"source": "/guides/developer-workflows/beginner/how-to-create-project-rules-for-an-existing-project-astro-+-typescript-+-tailwind",

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.

⚠️ [IMPORTANT] Escape the literal + 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 rachaelrenk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@rachaelrenk rachaelrenk self-assigned this Jun 8, 2026
@rachaelrenk rachaelrenk requested a review from petradonka June 8, 2026 18:54
rachaelrenk and others added 2 commits June 8, 2026 12:57
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>
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 8, 2026 8:11pm

Request Review

- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants