feat(ci): add schema link checker for docs PRs#1209
Conversation
Adds a GitHub Actions workflow that validates schema URLs in documentation: - Checks if referenced schemas exist in static/schemas/source/ - Warns when schemas exist in source but haven't been released yet - Dynamically determines the next release version (works for any vN) - Comments on PRs with broken links and guidance on how to fix them Also updates sync_audiences schema links from v1 to v3. The v3 links will work once 3.0.0-beta.4 is released (sync_audiences was added after beta.3). Closes #1181 Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
- Create dist/schemas/1.0.0/ with 48 schemas unique to v1 - Update v1 symlink to point to 1.0.0 instead of latest - Remove v1->latest special cases from build script, HTTP middleware, and CI - v1 now resolves like other major versions (v1 -> 1.0.0) Schemas in 1.0.0 include catalog items, creative briefs, audience members, and other schemas that were added after the v2.x and v3.x release lines. Made-with: Cursor
- brand.json: v1 → v3 (exists in v3 beta.2+) - core/offering.json: v1 → v3 (exists in v3 beta.1+) - core/targeting.json: v1 → v3 (exists in v2 and v3) - core/brand-ref.json: v2 → v3 (exists in v3 beta.2+) - core/event.json: v2 → v3 (exists in v3 beta.2+) - core/optimization-goal.json: v2 → v3 (exists in v3 beta.2+) - core/creative-brief.json: v2 → v1 (only exists in 1.0.0) Made-with: Cursor
Previously, the workflow only commented when issues were found. This left stale warning comments on PRs even after the issues were fixed. Now the workflow deletes the old comment when all schema links are valid. Made-with: Cursor
- Fix grep pattern to match URLs with hyphens (use [^"') ] instead of \s) - Show success message instead of deleting comment when all links pass - Add commit SHA and message to comment header for traceability Made-with: Cursor
Schema Link Check ResultsCommit: ✅ All schema links checked - 88 URLs verified, all good! |
GITHUB_SHA points to the merge commit, but we want to show the actual PR commit SHA that users can click to see the changes. Made-with: Cursor
The regex was capturing markdown link syntax like `](url` because backticks weren't excluded from the character class. Made-with: Cursor
When a schema URL uses v1 but the schema only exists in v3, the check now reports this as an error with a suggestion to use the correct version instead of just warning about unreleased schemas. Made-with: Cursor
The 1.0.0 release incorrectly included schemas that were created after 3.0.0-beta.3. These schemas should wait for the next v3 release instead. Changes: - Remove dist/schemas/1.0.0/ (all schemas were post-3.0.0-beta.3) - Remove scripts/create-v1-release.cjs (flawed logic) - Update CI to check latest before other versions - Prioritize warning for schemas in latest over suggesting other versions Made-with: Cursor
All documentation schema links now use v3 instead of v1. Some schemas are already released in 3.0.0-beta.3, others will be available in the next beta release. Updated files: - docs/protocol/get_adcp_capabilities.mdx - docs/accounts/tasks/get_account_financials.mdx - docs/accounts/tasks/sync_accounts.mdx - docs/creative/catalogs.mdx - docs/creative/task-reference/build_creative.mdx - docs/reference/migration/channels.mdx - docs/reference/migration/pricing.mdx - docs/reference/migration/geo-targeting.mdx - docs/reference/migration/creatives.mdx - docs/reference/media-channel-taxonomy.mdx - docs/reference/release-notes.mdx Made-with: Cursor
Changed from an error saying "build issue" to a warning with actionable guidance: change to latest or wait for the next release. Made-with: Cursor
In production, /schemas/latest/ serves from static/schemas/source/, not from dist/schemas/latest/. Updated CI to recognize that if a schema exists in source, it's available at the latest URL. Made-with: Cursor
These schemas were added after v2.5.3 and only exist in v3: - content-standards/* (all tasks) - core/event-custom-data, core/user-match - creative/get-creative-delivery-* - media-buy/log-event-*, sync-event-sources-*, get-media-buys-* - pricing-options/* (cpa, cpm, time, vcpm) - property/base-property-source - protocol/get-adcp-capabilities-response Made-with: Cursor
Additional files with v2 URLs that needed updating: - docs/media-buy/specification.mdx (log-event, sync-event-sources, get-adcp-capabilities-response) - docs/media-buy/product-discovery/media-products.mdx (cpm-option) - docs/governance/property/tasks/property_lists.mdx (base-property-source) - docs/governance/property/specification.mdx (base-property-source) - docs/signals/specification.mdx (get-adcp-capabilities-response) - docs/creative/specification.mdx (get-adcp-capabilities-response) Made-with: Cursor
For schemas not yet in any release, use /schemas/latest/ so links work immediately. These will be updated to versioned URLs after the next release. Updated files: - docs/media-buy/task-reference/get_media_buys.mdx - docs/media-buy/task-reference/sync_catalogs.mdx - docs/media-buy/task-reference/sync_audiences.mdx - docs/media-buy/specification.mdx - docs/accounts/tasks/get_account_financials.mdx - docs/accounts/tasks/report_usage.mdx - docs/creative/catalogs.mdx - docs/creative/task-reference/build_creative.mdx Made-with: Cursor
Reverts changes that made v1 point to 1.0.0. v1 should continue to fall back to latest for backward compatibility. Made-with: Cursor
- Document how to choose correct schema version in docs - Use /schemas/latest/ for unreleased schemas with reminder comment - Use version aliases (v2, v3) for released schemas - Reference CI workflow for validation Made-with: Cursor
|
@BaiyuScope3 to the comment about latest - confirming that latest remains the head/main branch, not versioned to last release |
Yess, this PR doesn’t change any version-link resolution logic. So for now we can safely use Note: right now |



Summary
/schemas/latest/Schema Link Checker
The new workflow (
.github/workflows/check-schema-links.yml) addresses #1181 by:Extracting schema URLs from docs (e.g.,
https://adcontextprotocol.org/schemas/v3/media-buy/sync-audiences-request.json)Validating each URL:
static/schemas/source/dist/schemas/X.Y.Z/)Dynamically determining versions:
vN→ finds latestN.x.xrelease indist/schemas/Commenting on PRs with:
v1 Schema Alias
The
v1alias continues to point tolatestfor backward compatibility. This means:Schema Link Fixes
Fixed incorrect version links in documentation:
v1/v2 → v3 (schemas released in v3):
v2/v3 → latest (schemas in source but not yet released):
Test plan
Closes #1181