From dfe9146ed30b438708e4711187af1b20898813f2 Mon Sep 17 00:00:00 2001 From: Michael Bahr Date: Thu, 3 Sep 2026 12:09:02 +0000 Subject: [PATCH 1/2] Rewrite docs.sourcegraph.com links to sourcegraph.com/docs --- DEVELOPMENT.md | 2 +- README.md | 8 ++++---- cmd/src/search.go | 2 +- internal/api/flags.go | 2 +- internal/batches/ui/tui.go | 2 +- internal/clicompat/api_flags.go | 2 +- internal/users/admin.go | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 29a600ba71..e6df062da0 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -62,7 +62,7 @@ For quick end-to-end CLI sanity checks against a live Sourcegraph instance, run: This script intentionally uses your currently exported `SRC_*` environment variables, is not hooked up to CI, and is meant for manual regression checks (for example, to catch issues like `src users list` failing unexpectedly). -We adhere to the [general Sourcegraph principles for testing](https://docs.sourcegraph.com/dev/background-information/testing_principles), as well as [the Go specific directions](https://docs.sourcegraph.com/dev/background-information/languages/testing_go_code), at least to the extent they apply to a standalone tool like `src`. +We adhere to the [general Sourcegraph principles for testing](https://sourcegraph.com/docs/dev/background-information/testing_principles), as well as [the Go specific directions](https://sourcegraph.com/docs/dev/background-information/languages/testing_go_code), at least to the extent they apply to a standalone tool like `src`. ## Releasing diff --git a/README.md b/README.md index 653942aed1..586bf2e1b1 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - **Search & get results in your terminal** - **Search & get JSON** for programmatic consumption - Make **GraphQL API requests** with auth easily & get JSON back fast -- Execute **[batch changes](https://docs.sourcegraph.com/batch_changes)** +- Execute **[batch changes](https://sourcegraph.com/docs/batch_changes)** - **Manage & administrate** repositories, users, and more - **Easily convert src-CLI commands to equivalent curl commands**, just add --get-curl! @@ -173,7 +173,7 @@ Is your Sourcegraph instance behind a custom auth proxy? See [auth proxy configu - `src auth` - print the active authentication token or authorization header - `src search` - perform searches and get results in your terminal or as JSON - `src api` - run Sourcegraph GraphQL API requests - - `src batch` - execute and manage [batch changes](https://docs.sourcegraph.com/batch_changes) + - `src batch` - execute and manage [batch changes](https://sourcegraph.com/docs/batch_changes) - `src repos` - manage repositories - `src users` - manage users - `src orgs` - manages organization @@ -185,7 +185,7 @@ Is your Sourcegraph instance behind a custom auth proxy? See [auth proxy configu - `src version` - check version and guaranteed-compatible version for your Sourcegraph instance Run `src -h` and `src -h` for more detailed usage information. -You can also read the [usage docs for the latest version of `src-cli`](https://docs.sourcegraph.com/cli/references) online. +You can also read the [usage docs for the latest version of `src-cli`](https://sourcegraph.com/docs/cli/references) online. #### Optional: Renaming `src` @@ -211,7 +211,7 @@ src-cli/3.21.10 linux amd64 To disable this and _only_ send the version, you can set `-user-agent-telemetry=false` for a single command, or set the `SRC_DISABLE_USER_AGENT_TELEMETRY` environment variable to any non-blank string. -As with [other Sourcegraph telemetry](https://docs.sourcegraph.com/dev/background-information/telemetry), any collected data is only sent to Sourcegraph.com in aggregate form. +As with [other Sourcegraph telemetry](https://sourcegraph.com/docs/dev/background-information/telemetry), any collected data is only sent to Sourcegraph.com in aggregate form. ## Development diff --git a/cmd/src/search.go b/cmd/src/search.go index a2cd1a0bbe..9cbb050a4d 100644 --- a/cmd/src/search.go +++ b/cmd/src/search.go @@ -48,7 +48,7 @@ Other tips: Force color output on (not on by default when piped to other programs) by setting COLOR=t - Query syntax: https://docs.sourcegraph.com/code_search/reference/queries + Query syntax: https://sourcegraph.com/docs/code_search/reference/queries Be careful with search strings including negation: a search with an initial negated term may be parsed as a flag rather than as a search string. You can diff --git a/internal/api/flags.go b/internal/api/flags.go index be2397e818..3954982e75 100644 --- a/internal/api/flags.go +++ b/internal/api/flags.go @@ -42,7 +42,7 @@ func NewFlags(flagSet *flag.FlagSet) *Flags { return &Flags{ dump: flagSet.Bool("dump-requests", false, "Log GraphQL requests and responses to stdout"), getCurl: flagSet.Bool("get-curl", false, "Print the curl command for executing this query and exit (WARNING: includes printing your access token!)"), - trace: flagSet.Bool("trace", false, "Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing"), + trace: flagSet.Bool("trace", false, "Log the trace ID for requests. See https://sourcegraph.com/docs/admin/observability/tracing"), insecureSkipVerify: flagSet.Bool("insecure-skip-verify", false, "Skip validation of TLS certificates against trusted chains"), userAgentTelemetry: flagSet.Bool("user-agent-telemetry", defaultUserAgentTelemetry(), "Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph"), } diff --git a/internal/batches/ui/tui.go b/internal/batches/ui/tui.go index 405918909e..9666349a14 100644 --- a/internal/batches/ui/tui.go +++ b/internal/batches/ui/tui.go @@ -400,7 +400,7 @@ func printExecutionError(out *output.Output, err error) { out.Write("") block := out.Block(output.Line(output.EmojiLightbulb, output.StyleSuggestion, "The troubleshooting documentation can help to narrow down the cause of the errors:")) - block.WriteLine(output.Line("", output.StyleSuggestion, "https://docs.sourcegraph.com/batch_changes/references/troubleshooting")) + block.WriteLine(output.Line("", output.StyleSuggestion, "https://sourcegraph.com/docs/batch_changes/references/troubleshooting")) block.Close() } diff --git a/internal/clicompat/api_flags.go b/internal/clicompat/api_flags.go index 736d9997cb..0cc627ce59 100644 --- a/internal/clicompat/api_flags.go +++ b/internal/clicompat/api_flags.go @@ -16,7 +16,7 @@ func WithAPIFlags(baseFlags ...cli.Flag) []cli.Flag { }{ {"dump-requests", false, "Log GraphQL requests and responses to stdout"}, {"get-curl", false, "Print the curl command for executing this query and exit (WARNING: includes printing your access token!)"}, - {"trace", false, "Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing"}, + {"trace", false, "Log the trace ID for requests. See https://sourcegraph.com/docs/admin/observability/tracing"}, {"insecure-skip-verify", false, "Skip validation of TLS certificates against trusted chains"}, {"user-agent-telemetry", defaultAPIUserAgentTelemetry(), "Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph"}, } diff --git a/internal/users/admin.go b/internal/users/admin.go index 6840f9f22c..a2fd6cc766 100644 --- a/internal/users/admin.go +++ b/internal/users/admin.go @@ -262,7 +262,7 @@ func (c *Client) GraphQL(token, query string, variables map[string]any, target a req.Header.Set("Authorization", fmt.Sprintf("token %s", token)) } else { // NOTE: This header is required to authenticate our session with a session cookie, see: - // https://docs.sourcegraph.com/dev/security/csrf_security_model#authentication-in-api-endpoints + // https://sourcegraph.com/docs/dev/security/csrf_security_model#authentication-in-api-endpoints req.Header.Set("X-Requested-With", "Sourcegraph") req.AddCookie(c.sessionCookie) From 0c19fdbafdb4c51107143424cd1299001043d645 Mon Sep 17 00:00:00 2001 From: bahrmichael Date: Fri, 4 Sep 2026 09:22:10 +0200 Subject: [PATCH 2/2] Remove dead links to deleted Sourcegraph dev docs The testing principles, Go testing, telemetry, and CSRF security model pages no longer exist on sourcegraph.com/docs. Replace the links with plain text and inline the relevant context in the code comment. Co-Authored-By: Claude Fable 5.1 --- DEVELOPMENT.md | 2 +- README.md | 2 +- internal/users/admin.go | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index e6df062da0..7b005e24de 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -62,7 +62,7 @@ For quick end-to-end CLI sanity checks against a live Sourcegraph instance, run: This script intentionally uses your currently exported `SRC_*` environment variables, is not hooked up to CI, and is meant for manual regression checks (for example, to catch issues like `src users list` failing unexpectedly). -We adhere to the [general Sourcegraph principles for testing](https://sourcegraph.com/docs/dev/background-information/testing_principles), as well as [the Go specific directions](https://sourcegraph.com/docs/dev/background-information/languages/testing_go_code), at least to the extent they apply to a standalone tool like `src`. +We adhere to the general Sourcegraph principles for testing, as well as the Go specific directions used in the main Sourcegraph repository, at least to the extent they apply to a standalone tool like `src`. ## Releasing diff --git a/README.md b/README.md index 586bf2e1b1..37100691a3 100644 --- a/README.md +++ b/README.md @@ -211,7 +211,7 @@ src-cli/3.21.10 linux amd64 To disable this and _only_ send the version, you can set `-user-agent-telemetry=false` for a single command, or set the `SRC_DISABLE_USER_AGENT_TELEMETRY` environment variable to any non-blank string. -As with [other Sourcegraph telemetry](https://sourcegraph.com/docs/dev/background-information/telemetry), any collected data is only sent to Sourcegraph.com in aggregate form. +As with other Sourcegraph telemetry, any collected data is only sent to Sourcegraph.com in aggregate form. ## Development diff --git a/internal/users/admin.go b/internal/users/admin.go index a2fd6cc766..8ba706b5af 100644 --- a/internal/users/admin.go +++ b/internal/users/admin.go @@ -261,8 +261,9 @@ func (c *Client) GraphQL(token, query string, variables map[string]any, target a if token != "" { req.Header.Set("Authorization", fmt.Sprintf("token %s", token)) } else { - // NOTE: This header is required to authenticate our session with a session cookie, see: - // https://sourcegraph.com/docs/dev/security/csrf_security_model#authentication-in-api-endpoints + // NOTE: This header is required to authenticate our session with a session + // cookie. Sourcegraph's CSRF protection rejects cookie-authenticated API + // requests that do not carry this header. req.Header.Set("X-Requested-With", "Sourcegraph") req.AddCookie(c.sessionCookie)