Skip to content

Keep legacy selectors connected to current versions - #1849

Open
HawkSE wants to merge 3 commits into
mainfrom
hawkse/fix-legacy-current-version-manifest
Open

Keep legacy selectors connected to current versions#1849
HawkSE wants to merge 3 commits into
mainfrom
hawkse/fix-legacy-current-version-manifest

Conversation

@HawkSE

@HawkSE HawkSE commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • read the canonical version manifest through the stable main Vercel origin, avoiding Cloudflare challenges on cross-subdomain browser requests
  • keep the full version list on current docs while arranging legacy menus as latest, selected, then older versions
  • document the manifest origin and legacy filtering behavior in the publishing skill

Test plan

  • npx --yes pnpm@10.25.0 run build
  • browser-verified the Vercel manifest returns CORS JSON from a legacy origin
  • browser-verified current docs retain the full list

Amp-Thread-ID: https://ampcode.com/threads/T-01a04534-2413-71c9-ac1f-51d83bd1fdbc
Co-authored-by: Scott Ellison II <scott.ellison@sourcegraph.com>
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Sep 1, 2026 3:52pm UTC

Request Review

Comment thread src/components/VersionSelector.tsx Outdated
const versionsUrl =
process.env.NEXT_PUBLIC_DOCS_VERSIONS_URL ??
'https://sourcegraph.com/docs/api/versions';
'https://sourcegraph-docs-git-main-sourcegraph-f8c71130.vercel.app/docs/api/versions';

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.

hmm is this URL safe to use? Will it always point to main?

Can we see if the Security team has any advice on how to accomplish this? If we must, I think a better URL would be https://sourcegraph-docs-v2.vercel.app/docs as that seems to be static to our main deployment but I'd prefer if we kept this to sourcegraph.com domain

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.

I think the only way to get around this would be to add some sort of Cloudflare WAF exception for sourcegraph.com/docs/api/versions to keep this all in-tact.

@HawkSE HawkSE Sep 1, 2026

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.

With the latest change to Cloudflare bot detection from the SEC team, this is no longer failing and the workaround is no longer needed. I've restored the Sourcegraph.com domain for this update.

Co-authored-by: Scott Ellison II <scott.ellison@sourcegraph.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a04534-2413-71c9-ac1f-51d83bd1fdbc
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.

3 participants