Skip to content

feat/externalapi: Add API migration guide #1644

Open
julialeex wants to merge 16 commits intomainfrom
jlxu/api_migration
Open

feat/externalapi: Add API migration guide #1644
julialeex wants to merge 16 commits intomainfrom
jlxu/api_migration

Conversation

@julialeex
Copy link
Contributor

@julialeex julialeex commented Feb 26, 2026

CLOSE CU-2424
Adds a new guide that walks integrators through migrating to the new Sourcegraph API

@vercel
Copy link

vercel bot commented Feb 26, 2026

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

Project Deployment Actions Updated (UTC)
sourcegraph-docs Error Error Feb 27, 2026 11:38pm

Request Review

@bobheadxi bobheadxi requested a review from a team February 26, 2026 15:45
@julialeex julialeex requested review from a team and stefanhengl and removed request for a team February 26, 2026 15:46
@julialeex julialeex requested a review from a team February 26, 2026 15:48

The fastest way to migrate is to give your AI coding agent the OpenAPI schema and let it update your code. You can download the schema from `/api-reference` on your Sourcegraph instance (e.g. `https://sourcegraph.example.com/api-reference`) — look for the **Download OpenAPI** button. Then tell your agent to migrate your Deep Search API calls to the new `/api/` equivalents.

For a real-world example, see [this Amp thread](https://ampcode.com/threads/T-019c9bf7-e5bd-778e-b8c8-0796ce033784) migrating the [raycast-sourcegraph](https://github.com/bobheadxi/raycast-sourcegraph) extension from the old API to the new endpoints.
Copy link
Member

@bobheadxi bobheadxi Feb 26, 2026

Choose a reason for hiding this comment

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

Can you also try with just this prompt? Curious if it works also 😁

Migrate the Deep Search API calls in this project from the deprecated /.api/deepsearch/v1 endpoints to the new Sourcegraph /api/deepsearch.v1.Service/ endpoints.

The main file to update is src/sourcegraph/deep-search/index.ts. Use the attached OpenAPI schema (@sourcesourcegraph-openapi.json) as the specification for the new API.

Also, did you try running the extension to make sure the migrated changes work correctly? happy to pair to try that out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just tried this prompt, down to pair later

Copy link
Member

Choose a reason for hiding this comment

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

Should we tell them to point the agent to this doc page to? Meaning, should we treat this page as one giant migration prompt for humans and agents?

Copy link
Member

Choose a reason for hiding this comment

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

yeah, though i worry it's a bit large since it includes the old schema

we should also remove the preview status of this page too, since it's currently hidden by default, to make it easier for the agent to access. with the migration guide on top and all the warnings i think it's fine for it to be discoverable

- `404` - Not Found
- `500` - Internal Server Error

## Migrating to the New Sourcegraph API
Copy link
Member

Choose a reason for hiding this comment

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

should we put this at the top?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think having this at the very end of the page makes the flow better? I added a new callout at the top; however, let me know if you still want this section at the top.

Copy link
Member

Choose a reason for hiding this comment

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

I think having the migration at the top sets the expectations right when you land on the page, that we want you to migrate - a link is easy to miss/ignore

@stefanhengl
Copy link
Member

I tried to run this locally with pnpm run dev but the link from the index page to deep-search/api doesn't work. Maybe that's just my setup?

Should we mention this guide on the top-level API page as well? It's quite hidden right now.

Co-authored-by: Robert Lin <robert@bobheadxi.dev>
Copy link
Member

@stefanhengl stefanhengl left a comment

Choose a reason for hiding this comment

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

Left a couple of minor comments, but otherwise the content looks great!

@bobheadxi
Copy link
Member

I tried to run this locally with pnpm run dev but the link from the index page to deep-search/api doesn't work. Maybe that's just my setup?

I think it might be the ?preview parameter - we should remove the preview guard now, there's sufficient warnings etc

Updated migration checklist to recommend generating a new access token.
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