From 4f438e71cf3efe250f7c6ccfbb8db6210ff48513 Mon Sep 17 00:00:00 2001 From: Edward Angert Date: Fri, 17 Jan 2025 13:18:48 -0500 Subject: [PATCH] docs: fix broken links (#16179) Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> Co-authored-by: Cian Johnston --- .github/.linkspector.yml | 1 + coderd/healthcheck/health/model.go | 6 ++-- coderd/healthcheck/health/model_test.go | 6 ++-- codersdk/healthsdk/healthsdk_test.go | 47 +++++++++++++++++++------ docs/admin/integrations/jfrog-xray.md | 2 +- docs/tutorials/faqs.md | 14 ++------ 6 files changed, 46 insertions(+), 30 deletions(-) diff --git a/.github/.linkspector.yml b/.github/.linkspector.yml index 00db63af8e..3e19913c4b 100644 --- a/.github/.linkspector.yml +++ b/.github/.linkspector.yml @@ -19,5 +19,6 @@ ignorePatterns: - pattern: "code.visualstudio.com" - pattern: "www.emacswiki.org" - pattern: "linux.die.net/man" + - pattern: "www.gnu.org" aliveStatusCodes: - 200 diff --git a/coderd/healthcheck/health/model.go b/coderd/healthcheck/health/model.go index d918e6a1bd..4b09e4b344 100644 --- a/coderd/healthcheck/health/model.go +++ b/coderd/healthcheck/health/model.go @@ -79,7 +79,7 @@ func (m Message) String() string { return sb.String() } -// URL returns a link to the admin/healthcheck docs page for the given Message. +// URL returns a link to the admin/monitoring/health-check docs page for the given Message. // NOTE: if using a custom docs URL, specify base. func (m Message) URL(base string) string { var codeAnchor string @@ -91,11 +91,11 @@ func (m Message) URL(base string) string { if base == "" { base = docsURLDefault - return fmt.Sprintf("%s/admin/healthcheck#%s", base, codeAnchor) + return fmt.Sprintf("%s/admin/monitoring/health-check#%s", base, codeAnchor) } // We don't assume that custom docs URLs are versioned. - return fmt.Sprintf("%s/admin/healthcheck#%s", base, codeAnchor) + return fmt.Sprintf("%s/admin/monitoring/health-check#%s", base, codeAnchor) } // Code is a stable identifier used to link to documentation. diff --git a/coderd/healthcheck/health/model_test.go b/coderd/healthcheck/health/model_test.go index ca4c43d58d..8b28dc5862 100644 --- a/coderd/healthcheck/health/model_test.go +++ b/coderd/healthcheck/health/model_test.go @@ -17,9 +17,9 @@ func Test_MessageURL(t *testing.T) { base string expected string }{ - {"empty", "", "", "https://coder.com/docs/admin/healthcheck#eunknown"}, - {"default", health.CodeAccessURLFetch, "", "https://coder.com/docs/admin/healthcheck#eacs03"}, - {"custom docs base", health.CodeAccessURLFetch, "https://example.com/docs", "https://example.com/docs/admin/healthcheck#eacs03"}, + {"empty", "", "", "https://coder.com/docs/admin/monitoring/health-check#eunknown"}, + {"default", health.CodeAccessURLFetch, "", "https://coder.com/docs/admin/monitoring/health-check#eacs03"}, + {"custom docs base", health.CodeAccessURLFetch, "https://example.com/docs", "https://example.com/docs/admin/monitoring/health-check#eacs03"}, } { tt := tt t.Run(tt.name, func(t *testing.T) { diff --git a/codersdk/healthsdk/healthsdk_test.go b/codersdk/healthsdk/healthsdk_test.go index 78820e5832..517837e20a 100644 --- a/codersdk/healthsdk/healthsdk_test.go +++ b/codersdk/healthsdk/healthsdk_test.go @@ -41,22 +41,22 @@ func TestSummarize(t *testing.T) { expected := []string{ "Access URL: Error: test error", "Access URL: Warn: TEST: testing", - "See: https://coder.com/docs/admin/healthcheck#test", + "See: https://coder.com/docs/admin/monitoring/health-check#test", "Database: Error: test error", "Database: Warn: TEST: testing", - "See: https://coder.com/docs/admin/healthcheck#test", + "See: https://coder.com/docs/admin/monitoring/health-check#test", "DERP: Error: test error", "DERP: Warn: TEST: testing", - "See: https://coder.com/docs/admin/healthcheck#test", + "See: https://coder.com/docs/admin/monitoring/health-check#test", "Provisioner Daemons: Error: test error", "Provisioner Daemons: Warn: TEST: testing", - "See: https://coder.com/docs/admin/healthcheck#test", + "See: https://coder.com/docs/admin/monitoring/health-check#test", "Websocket: Error: test error", "Websocket: Warn: TEST: testing", - "See: https://coder.com/docs/admin/healthcheck#test", + "See: https://coder.com/docs/admin/monitoring/health-check#test", "Workspace Proxies: Error: test error", "Workspace Proxies: Warn: TEST: testing", - "See: https://coder.com/docs/admin/healthcheck#test", + "See: https://coder.com/docs/admin/monitoring/health-check#test", } actual := hr.Summarize("") assert.Equal(t, expected, actual) @@ -66,6 +66,7 @@ func TestSummarize(t *testing.T) { name string br healthsdk.BaseReport pfx string + docsURL string expected []string }{ { @@ -93,9 +94,9 @@ func TestSummarize(t *testing.T) { expected: []string{ "Error: testing", "Warn: TEST01: testing one", - "See: https://coder.com/docs/admin/healthcheck#test01", + "See: https://coder.com/docs/admin/monitoring/health-check#test01", "Warn: TEST02: testing two", - "See: https://coder.com/docs/admin/healthcheck#test02", + "See: https://coder.com/docs/admin/monitoring/health-check#test02", }, }, { @@ -117,16 +118,40 @@ func TestSummarize(t *testing.T) { expected: []string{ "TEST: Error: testing", "TEST: Warn: TEST01: testing one", - "See: https://coder.com/docs/admin/healthcheck#test01", + "See: https://coder.com/docs/admin/monitoring/health-check#test01", "TEST: Warn: TEST02: testing two", - "See: https://coder.com/docs/admin/healthcheck#test02", + "See: https://coder.com/docs/admin/monitoring/health-check#test02", + }, + }, + { + name: "custom docs url", + br: healthsdk.BaseReport{ + Error: ptr.Ref("testing"), + Warnings: []health.Message{ + { + Code: "TEST01", + Message: "testing one", + }, + { + Code: "TEST02", + Message: "testing two", + }, + }, + }, + docsURL: "https://my.coder.internal/docs", + expected: []string{ + "Error: testing", + "Warn: TEST01: testing one", + "See: https://my.coder.internal/docs/admin/monitoring/health-check#test01", + "Warn: TEST02: testing two", + "See: https://my.coder.internal/docs/admin/monitoring/health-check#test02", }, }, } { tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - actual := tt.br.Summarize(tt.pfx, "") + actual := tt.br.Summarize(tt.pfx, tt.docsURL) if len(tt.expected) == 0 { assert.Empty(t, actual) return diff --git a/docs/admin/integrations/jfrog-xray.md b/docs/admin/integrations/jfrog-xray.md index bb1b9db106..f37a813366 100644 --- a/docs/admin/integrations/jfrog-xray.md +++ b/docs/admin/integrations/jfrog-xray.md @@ -24,7 +24,7 @@ workspaces using Coder's [JFrog Xray Integration](https://github.com/coder/coder 1. Create a JFrog Platform [Access Token](https://jfrog.com/help/r/jfrog-platform-administration-documentation/access-tokens) with a user that has the `read` [permission](https://jfrog.com/help/r/jfrog-platform-administration-documentation/permissions) for the repositories you want to scan. -1. Create a Coder [token](../../reference/cli/tokens_create.md#tokens-create) with a user that has the [`owner`](../users#roles) role. +1. Create a Coder [token](../../reference/cli/tokens_create.md#tokens-create) with a user that has the [`owner`](../users/index.md#roles) role. 1. Create Kubernetes secrets for the JFrog Xray and Coder tokens. diff --git a/docs/tutorials/faqs.md b/docs/tutorials/faqs.md index 46f3856ee7..06cc76adbe 100644 --- a/docs/tutorials/faqs.md +++ b/docs/tutorials/faqs.md @@ -344,9 +344,6 @@ the IDE can be baked into the container image and manually open Gateway (or IntelliJ which has Gateway built-in), using a session token to Coder and then open the IDE. -- [IntelliJ IDEA](https://github.com/sharkymark/v2-templates/tree/main/src/pod-idea) -- [IntelliJ IDEA with Icon](https://github.com/sharkymark/v2-templates/tree/main/src/pod-idea-icon) - ## What options do I have for adding VS Code extensions into code-server, VS Code Desktop or Microsoft's Code Server? Coder has an open-source project called @@ -357,20 +354,13 @@ Artifactory. - [Blog post](https://coder.com/blog/running-a-private-vs-code-extension-marketplace) - [OSS project](https://github.com/coder/code-marketplace) -[See this example template](https://github.com/sharkymark/v2-templates/blob/main/src/code-marketplace/main.tf#L229C1-L232C12) -where the agent specifies the URL and config environment variables which -code-server picks up and points the developer to. - -Another option is to use Microsoft's code-server - which is like Coder's, but it +You can also use Microsoft's code-server - which is like Coder's, but it can connect to Microsoft's extension marketplace so Copilot and chat can be retrieved there. Another option is to use VS Code Desktop (local) and that connects to Microsoft's marketplace. -> Note: these are example templates with no SLAs on them and are not guaranteed -> for long-term support. - ## I want to run Docker for my workspaces but not install Docker Desktop [Colima](https://github.com/abiosoft/colima) is a Docker Desktop alternative. @@ -404,7 +394,7 @@ colima start --arch x86_64 --cpu 4 --memory 8 --disk 10 Colima will show the path to the docker socket so we have a [community template](https://github.com/sharkymark/v2-templates/tree/main/src/docker-code-server) -that prompts the Coder admin to enter the docker socket as a Terraform variable. +that prompts the Coder admin to enter the Docker socket as a Terraform variable. ## How to make a `coder_app` optional?