diff --git a/dev/managedservicesplatform/operationdocs/BUILD.bazel b/dev/managedservicesplatform/operationdocs/BUILD.bazel index 1b18b985a817..0a9bb29131de 100644 --- a/dev/managedservicesplatform/operationdocs/BUILD.bazel +++ b/dev/managedservicesplatform/operationdocs/BUILD.bazel @@ -6,6 +6,7 @@ go_library( srcs = [ "index.go", "links.go", + "notion.go", "operationdocs.go", ], importpath = "github.com/sourcegraph/sourcegraph/dev/managedservicesplatform/operationdocs", @@ -16,6 +17,8 @@ go_library( "//dev/managedservicesplatform/spec", "//lib/errors", "//lib/pointers", + "@com_github_sourcegraph_notionreposync//markdown:go_default_library", + "@com_github_sourcegraph_notionreposync//renderer:go_default_library", "@com_github_vvakame_gcplogurl//:gcplogurl", "@org_golang_x_exp//maps", ], @@ -34,6 +37,8 @@ go_test( "//dev/managedservicesplatform/spec", "//lib/pointers", "@com_github_hexops_autogold_v2//:autogold", + "@com_github_sourcegraph_notionreposync//renderer/renderertest:go_default_library", + "@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//require", ], ) diff --git a/dev/managedservicesplatform/operationdocs/internal/markdown/BUILD.bazel b/dev/managedservicesplatform/operationdocs/internal/markdown/BUILD.bazel index 985028ea450e..9611ed88b642 100644 --- a/dev/managedservicesplatform/operationdocs/internal/markdown/BUILD.bazel +++ b/dev/managedservicesplatform/operationdocs/internal/markdown/BUILD.bazel @@ -9,7 +9,10 @@ go_library( ], importpath = "github.com/sourcegraph/sourcegraph/dev/managedservicesplatform/operationdocs/internal/markdown", visibility = ["//dev/managedservicesplatform/operationdocs:__subpackages__"], - deps = ["@com_github_olekukonko_tablewriter//:tablewriter"], + deps = [ + "//dev/managedservicesplatform/operationdocs/internal/markdown/headings", + "@com_github_olekukonko_tablewriter//:tablewriter", + ], ) go_test( diff --git a/dev/managedservicesplatform/operationdocs/internal/markdown/headings/BUILD.bazel b/dev/managedservicesplatform/operationdocs/internal/markdown/headings/BUILD.bazel new file mode 100644 index 000000000000..b4634ded1207 --- /dev/null +++ b/dev/managedservicesplatform/operationdocs/internal/markdown/headings/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "headings", + srcs = ["headings.go"], + importpath = "github.com/sourcegraph/sourcegraph/dev/managedservicesplatform/operationdocs/internal/markdown/headings", + visibility = ["//dev/managedservicesplatform/operationdocs:__subpackages__"], +) diff --git a/dev/managedservicesplatform/operationdocs/operationdocs.go b/dev/managedservicesplatform/operationdocs/operationdocs.go index 2cd80f2629be..f361c850c1f3 100644 --- a/dev/managedservicesplatform/operationdocs/operationdocs.go +++ b/dev/managedservicesplatform/operationdocs/operationdocs.go @@ -303,12 +303,8 @@ You may want to check your service environment's TFC workspaces if a Terraform a markdown.Link(markdown.Code("sourcegraph/managed-services"), "https://github.com/sourcegraph/managed-services")) md.Admonitionf(markdown.AdmonitionNote, `If you are looking for service logs, see the %s section instead. In general: - -%s`, - cloudRunSectionLink, markdown.List([]string{ - fmt.Sprintf("check service logs (%s) if your service has gone down or is misbehaving", cloudRunSectionLink), - "check TFC workspaces for infrastructure provisioning or configuration issues", - })) +check service logs if your service has gone down or is misbehaving, and check TFC workspaces for infrastructure provisioning or configuration issues.`, + cloudRunSectionLink) md.Paragraphf(`To access this environment's Terraform Cloud workspaces, you will need to [log in to Terraform Cloud](https://app.terraform.io/app/sourcegraph) and then [request Entitle access to membership in the "Managed Services Platform Operator" TFC team](https://app.entitle.io/request?data=eyJkdXJhdGlvbiI6IjM2MDAiLCJqdXN0aWZpY2F0aW9uIjoiSlVTVElGSUNBVElPTiBIRVJFIiwicm9sZUlkcyI6W3siaWQiOiJiMzg3MzJjYy04OTUyLTQ2Y2QtYmIxZS1lZjI2ODUwNzIyNmIiLCJ0aHJvdWdoIjoiYjM4NzMyY2MtODk1Mi00NmNkLWJiMWUtZWYyNjg1MDcyMjZiIiwidHlwZSI6InJvbGUifV19). The "Managed Services Platform Operator" team has access to all MSP TFC workspaces.`) diff --git a/dev/managedservicesplatform/operationdocs/testdata/TestRender/basic.golden b/dev/managedservicesplatform/operationdocs/testdata/TestRender/basic.golden index 2e1c0028cfd8..a59cd1957fe7 100644 --- a/dev/managedservicesplatform/operationdocs/testdata/TestRender/basic.golden +++ b/dev/managedservicesplatform/operationdocs/testdata/TestRender/basic.golden @@ -72,9 +72,7 @@ You may want to check your service environment's TFC workspaces if a Terraform a > [!NOTE] > If you are looking for service logs, see the [test Cloud Run](#test-cloud-run) section instead. In general: -> -> - check service logs ([test Cloud Run](#test-cloud-run)) if your service has gone down or is misbehaving -> - check TFC workspaces for infrastructure provisioning or configuration issues +> check service logs if your service has gone down or is misbehaving, and check TFC workspaces for infrastructure provisioning or configuration issues. To access this environment's Terraform Cloud workspaces, you will need to [log in to Terraform Cloud](https://app.terraform.io/app/sourcegraph) and then [request Entitle access to membership in the "Managed Services Platform Operator" TFC team](https://app.entitle.io/request?data=eyJkdXJhdGlvbiI6IjM2MDAiLCJqdXN0aWZpY2F0aW9uIjoiSlVTVElGSUNBVElPTiBIRVJFIiwicm9sZUlkcyI6W3siaWQiOiJiMzg3MzJjYy04OTUyLTQ2Y2QtYmIxZS1lZjI2ODUwNzIyNmIiLCJ0aHJvdWdoIjoiYjM4NzMyY2MtODk1Mi00NmNkLWJiMWUtZWYyNjg1MDcyMjZiIiwidHlwZSI6InJvbGUifV19). The "Managed Services Platform Operator" team has access to all MSP TFC workspaces. diff --git a/dev/managedservicesplatform/operationdocs/testdata/TestRender/multi_env_rollout.golden b/dev/managedservicesplatform/operationdocs/testdata/TestRender/multi_env_rollout.golden index 8a8696f807e2..14f4594294e4 100644 --- a/dev/managedservicesplatform/operationdocs/testdata/TestRender/multi_env_rollout.golden +++ b/dev/managedservicesplatform/operationdocs/testdata/TestRender/multi_env_rollout.golden @@ -75,9 +75,7 @@ You may want to check your service environment's TFC workspaces if a Terraform a > [!NOTE] > If you are looking for service logs, see the [test Cloud Run](#test-cloud-run) section instead. In general: -> -> - check service logs ([test Cloud Run](#test-cloud-run)) if your service has gone down or is misbehaving -> - check TFC workspaces for infrastructure provisioning or configuration issues +> check service logs if your service has gone down or is misbehaving, and check TFC workspaces for infrastructure provisioning or configuration issues. To access this environment's Terraform Cloud workspaces, you will need to [log in to Terraform Cloud](https://app.terraform.io/app/sourcegraph) and then [request Entitle access to membership in the "Managed Services Platform Operator" TFC team](https://app.entitle.io/request?data=eyJkdXJhdGlvbiI6IjM2MDAiLCJqdXN0aWZpY2F0aW9uIjoiSlVTVElGSUNBVElPTiBIRVJFIiwicm9sZUlkcyI6W3siaWQiOiJiMzg3MzJjYy04OTUyLTQ2Y2QtYmIxZS1lZjI2ODUwNzIyNmIiLCJ0aHJvdWdoIjoiYjM4NzMyY2MtODk1Mi00NmNkLWJiMWUtZWYyNjg1MDcyMjZiIiwidHlwZSI6InJvbGUifV19). The "Managed Services Platform Operator" team has access to all MSP TFC workspaces. @@ -136,9 +134,7 @@ You may want to check your service environment's TFC workspaces if a Terraform a > [!NOTE] > If you are looking for service logs, see the [robert Cloud Run](#robert-cloud-run) section instead. In general: -> -> - check service logs ([robert Cloud Run](#robert-cloud-run)) if your service has gone down or is misbehaving -> - check TFC workspaces for infrastructure provisioning or configuration issues +> check service logs if your service has gone down or is misbehaving, and check TFC workspaces for infrastructure provisioning or configuration issues. To access this environment's Terraform Cloud workspaces, you will need to [log in to Terraform Cloud](https://app.terraform.io/app/sourcegraph) and then [request Entitle access to membership in the "Managed Services Platform Operator" TFC team](https://app.entitle.io/request?data=eyJkdXJhdGlvbiI6IjM2MDAiLCJqdXN0aWZpY2F0aW9uIjoiSlVTVElGSUNBVElPTiBIRVJFIiwicm9sZUlkcyI6W3siaWQiOiJiMzg3MzJjYy04OTUyLTQ2Y2QtYmIxZS1lZjI2ODUwNzIyNmIiLCJ0aHJvdWdoIjoiYjM4NzMyY2MtODk1Mi00NmNkLWJiMWUtZWYyNjg1MDcyMjZiIiwidHlwZSI6InJvbGUifV19). The "Managed Services Platform Operator" team has access to all MSP TFC workspaces. diff --git a/dev/managedservicesplatform/operationdocs/testdata/TestRender/resources.golden b/dev/managedservicesplatform/operationdocs/testdata/TestRender/resources.golden index a9d1a4643fdd..2c80a41560be 100644 --- a/dev/managedservicesplatform/operationdocs/testdata/TestRender/resources.golden +++ b/dev/managedservicesplatform/operationdocs/testdata/TestRender/resources.golden @@ -98,9 +98,7 @@ You may want to check your service environment's TFC workspaces if a Terraform a > [!NOTE] > If you are looking for service logs, see the [test Cloud Run](#test-cloud-run) section instead. In general: -> -> - check service logs ([test Cloud Run](#test-cloud-run)) if your service has gone down or is misbehaving -> - check TFC workspaces for infrastructure provisioning or configuration issues +> check service logs if your service has gone down or is misbehaving, and check TFC workspaces for infrastructure provisioning or configuration issues. To access this environment's Terraform Cloud workspaces, you will need to [log in to Terraform Cloud](https://app.terraform.io/app/sourcegraph) and then [request Entitle access to membership in the "Managed Services Platform Operator" TFC team](https://app.entitle.io/request?data=eyJkdXJhdGlvbiI6IjM2MDAiLCJqdXN0aWZpY2F0aW9uIjoiSlVTVElGSUNBVElPTiBIRVJFIiwicm9sZUlkcyI6W3siaWQiOiJiMzg3MzJjYy04OTUyLTQ2Y2QtYmIxZS1lZjI2ODUwNzIyNmIiLCJ0aHJvdWdoIjoiYjM4NzMyY2MtODk1Mi00NmNkLWJiMWUtZWYyNjg1MDcyMjZiIiwidHlwZSI6InJvbGUifV19). The "Managed Services Platform Operator" team has access to all MSP TFC workspaces. diff --git a/dev/managedservicesplatform/operationdocs/testdata/TestRender/with_README.golden b/dev/managedservicesplatform/operationdocs/testdata/TestRender/with_README.golden index eb1437e7c274..2b35e627cad5 100644 --- a/dev/managedservicesplatform/operationdocs/testdata/TestRender/with_README.golden +++ b/dev/managedservicesplatform/operationdocs/testdata/TestRender/with_README.golden @@ -73,9 +73,7 @@ You may want to check your service environment's TFC workspaces if a Terraform a > [!NOTE] > If you are looking for service logs, see the [test Cloud Run](#test-cloud-run) section instead. In general: -> -> - check service logs ([test Cloud Run](#test-cloud-run)) if your service has gone down or is misbehaving -> - check TFC workspaces for infrastructure provisioning or configuration issues +> check service logs if your service has gone down or is misbehaving, and check TFC workspaces for infrastructure provisioning or configuration issues. To access this environment's Terraform Cloud workspaces, you will need to [log in to Terraform Cloud](https://app.terraform.io/app/sourcegraph) and then [request Entitle access to membership in the "Managed Services Platform Operator" TFC team](https://app.entitle.io/request?data=eyJkdXJhdGlvbiI6IjM2MDAiLCJqdXN0aWZpY2F0aW9uIjoiSlVTVElGSUNBVElPTiBIRVJFIiwicm9sZUlkcyI6W3siaWQiOiJiMzg3MzJjYy04OTUyLTQ2Y2QtYmIxZS1lZjI2ODUwNzIyNmIiLCJ0aHJvdWdoIjoiYjM4NzMyY2MtODk1Mi00NmNkLWJiMWUtZWYyNjg1MDcyMjZiIiwidHlwZSI6InJvbGUifV19). The "Managed Services Platform Operator" team has access to all MSP TFC workspaces. diff --git a/dev/sg/msp/BUILD.bazel b/dev/sg/msp/BUILD.bazel index 019aed7b7d37..bd56bbd9b44b 100644 --- a/dev/sg/msp/BUILD.bazel +++ b/dev/sg/msp/BUILD.bazel @@ -5,6 +5,7 @@ go_library( name = "msp", srcs = [ "helpers.go", + "notion.go", "sg_msp.go", ], importpath = "github.com/sourcegraph/sourcegraph/dev/sg/msp", @@ -32,9 +33,13 @@ go_library( "//lib/errors", "//lib/output", "//lib/pointers", + "@com_github_jomei_notionapi//:go_default_library", + "@com_github_sourcegraph_conc//pool", + "@com_github_sourcegraph_notionreposync//notion:go_default_library", "@com_github_sourcegraph_run//:run", "@com_github_urfave_cli_v2//:cli", "@org_golang_x_exp//maps", + "@org_uber_go_atomic//:atomic", ], )