From 58fe87f6b51d60fd9e3b524884573fb1bb58799f Mon Sep 17 00:00:00 2001 From: Erik Seliger Date: Thu, 5 Oct 2023 22:15:40 +0200 Subject: [PATCH] enterprise: Move last directory out (#57392) This is the end of the PR train to remove the enterprise directory from out repo since we have consolidated to use a single license. Bye rough code split :) --- .buildkite/hooks/post-checkout | 4 +- .buildkite/hooks/pre-exit | 2 +- .buildkite/pipeline.app.yml | 16 +-- .github/test.CODEOWNERS | 20 +-- .github/workflows/scip-go.yml | 2 +- .github/workflows/sg-binary-release.yml | 2 +- .gitignore | 2 + CONTRIBUTING.md | 4 - dev/check/go-dbconn-import.sh | 2 +- {enterprise/dev => dev}/ci/BUILD.bazel | 8 +- {enterprise/dev => dev}/ci/CODENOTIFY | 0 dev/ci/OWNERS | 3 +- {enterprise/dev => dev}/ci/README.md | 0 {enterprise/dev => dev}/ci/gen-pipeline.go | 11 +- dev/ci/gen-pipeline.sh | 6 +- {enterprise/dev => dev}/ci/glossary.md | 0 {enterprise/dev => dev}/ci/images/BUILD.bazel | 2 +- dev/ci/images/go.mod | 3 + {enterprise/dev => dev}/ci/images/images.go | 0 .../integration/executors/docker-compose.yml | 0 .../ci/integration/executors/run.sh | 4 +- .../ci/integration/executors/test.sh | 2 +- .../integration/executors/tester/BUILD.bazel | 4 +- .../executors/tester/config/BUILD.bazel | 4 +- .../executors/tester/config/config.go | 0 .../executors/tester/config/repos.json | 0 .../executors/tester/config/site-config.json | 0 .../ci/integration/executors/tester/init.go | 2 +- .../ci/integration/executors/tester/main.go | 0 .../integration/executors/tester/testinfra.go | 0 .../ci/internal/buildkite/BUILD.bazel | 4 +- .../ci/internal/buildkite/agents.go | 0 .../ci/internal/buildkite/buildkite.go | 0 .../ci/internal/buildkite/buildkite_test.go | 3 +- .../ci/internal/buildkite/cache.go | 0 .../ci/internal/buildkite/feature_flags.go | 0 .../ci/internal/buildkite/step_notify.go | 0 .../dev => dev}/ci/internal/ci/BUILD.bazel | 14 +- .../ci/internal/ci/bazel_operations.go | 22 ++-- .../ci/internal/ci/bazel_operations_test.go | 0 .../ci/internal/ci/cache_helpers.go | 2 +- .../ci/internal/ci/changed/BUILD.bazel | 4 +- .../ci/internal/ci/changed/diff.go | 4 +- .../ci/internal/ci/changed/diff_test.go | 0 .../ci/internal/ci/changed/files.go | 0 .../ci/internal/ci/changed/linters.go | 0 .../ci/internal/ci/changed/linters_test.go | 0 .../dev => dev}/ci/internal/ci/config.go | 4 +- .../dev => dev}/ci/internal/ci/operations.go | 25 ++-- dev/ci/internal/ci/operations/BUILD.bazel | 12 ++ .../ci/internal/ci/operations/operations.go | 2 +- .../dev => dev}/ci/internal/ci/pipeline.go | 8 +- .../ci/internal/ci/test/BUILD.bazel | 2 +- .../test/wolfi-images/wolfi-test-image-1.yaml | 0 .../test/wolfi-images/wolfi-test-image-2.yaml | 0 .../internal/ci/web-integration-workloads.go | 0 .../ci/internal/ci/wolfi_operations.go | 10 +- .../ci/internal/ci/wolfi_operations_test.go | 0 {enterprise/dev => dev}/ci/push_all.sh | 0 .../dev => dev}/ci/scripts/annotate.sh | 0 .../ci/scripts/annotated-command.sh | 6 +- .../ci/scripts/app-token/BUILD.bazel | 4 +- .../dev => dev}/ci/scripts/app-token/main.go | 0 .../ci/scripts/app-token/main_test.go | 0 .../testdata/TestGetInstallAccessToken.yaml | 0 .../dev => dev}/ci/scripts/buildevent_file | 0 .../ci/scripts/check-dependency-soft-fail.sh | 0 .../dev => dev}/ci/scripts/compare-hash.sh | 0 .../dev => dev}/ci/scripts/release-app.sh | 0 .../dev => dev}/ci/scripts/sentry-capture.sh | 0 .../ci/scripts/upload-build-logs.sh | 2 +- .../ci/scripts/upload-buildevent-report.sh | 2 +- .../ci/scripts/upload-test-report.sh | 0 .../ci/scripts/wolfi/build-base-image.sh | 2 +- .../ci/scripts/wolfi/build-package.sh | 2 +- .../ci/scripts/wolfi/build-repo-index.sh | 0 .../ci/scripts/wolfi/upload-package.sh | 4 +- dev/codecov.yml | 4 +- dev/release/src/release.ts | 2 +- dev/sg/ci/subcommands.go | 8 +- dev/sg/internal/images/BUILD.bazel | 4 +- dev/sg/internal/images/images_test.go | 2 +- dev/sg/internal/images/registry.go | 3 +- dev/sg/internal/sgconf/config_test.go | 2 - dev/sg/linters/go_checks.go | 2 +- dev/sg/linters/linters.go | 2 +- .../updates/migrator/migrator-operations.md | 2 +- .../references/precise_examples.md | 4 +- doc/dependency_decisions.yml | 122 +++++++++--------- .../background-information/ci/development.md | 14 +- doc/dev/background-information/ci/index.md | 8 +- .../background-information/ci/reference.md | 2 +- .../testing_principles.md | 1 - .../ci_soft_failure_and_still_notify.md | 14 +- doc/dev/how-to/deploy_executor_image.md | 2 +- ..._slack_notification_on_a_failed_ci_step.md | 4 +- doc/dev/how-to/update_ci_glossary.md | 2 +- doc/dev/how-to/wolfi/add_update_packages.md | 2 +- docker-images/README.md | 4 +- enterprise/.gitignore | 16 --- enterprise/README.md | 10 -- enterprise/dev/ci/OWNERS | 3 - enterprise/dev/ci/images/go.mod | 3 - .../dev/ci/internal/ci/operations/BUILD.bazel | 12 -- go.mod | 6 +- lib/api/version_check.go | 2 +- monitoring/definitions/containers.go | 3 +- 107 files changed, 232 insertions(+), 274 deletions(-) rename {enterprise/dev => dev}/ci/BUILD.bazel (69%) rename {enterprise/dev => dev}/ci/CODENOTIFY (100%) rename {enterprise/dev => dev}/ci/README.md (100%) rename {enterprise/dev => dev}/ci/gen-pipeline.go (93%) rename {enterprise/dev => dev}/ci/glossary.md (100%) rename {enterprise/dev => dev}/ci/images/BUILD.bazel (66%) create mode 100644 dev/ci/images/go.mod rename {enterprise/dev => dev}/ci/images/images.go (100%) rename {enterprise/dev => dev}/ci/integration/executors/docker-compose.yml (100%) rename {enterprise/dev => dev}/ci/integration/executors/run.sh (94%) rename {enterprise/dev => dev}/ci/integration/executors/test.sh (71%) rename {enterprise/dev => dev}/ci/integration/executors/tester/BUILD.bazel (85%) rename {enterprise/dev => dev}/ci/integration/executors/tester/config/BUILD.bazel (57%) rename {enterprise/dev => dev}/ci/integration/executors/tester/config/config.go (100%) rename {enterprise/dev => dev}/ci/integration/executors/tester/config/repos.json (100%) rename {enterprise/dev => dev}/ci/integration/executors/tester/config/site-config.json (100%) rename {enterprise/dev => dev}/ci/integration/executors/tester/init.go (96%) rename {enterprise/dev => dev}/ci/integration/executors/tester/main.go (100%) rename {enterprise/dev => dev}/ci/integration/executors/tester/testinfra.go (100%) rename {enterprise/dev => dev}/ci/internal/buildkite/BUILD.bazel (79%) rename {enterprise/dev => dev}/ci/internal/buildkite/agents.go (100%) rename {enterprise/dev => dev}/ci/internal/buildkite/buildkite.go (100%) rename {enterprise/dev => dev}/ci/internal/buildkite/buildkite_test.go (97%) rename {enterprise/dev => dev}/ci/internal/buildkite/cache.go (100%) rename {enterprise/dev => dev}/ci/internal/buildkite/feature_flags.go (100%) rename {enterprise/dev => dev}/ci/internal/buildkite/step_notify.go (100%) rename {enterprise/dev => dev}/ci/internal/ci/BUILD.bazel (66%) rename {enterprise/dev => dev}/ci/internal/ci/bazel_operations.go (96%) rename {enterprise/dev => dev}/ci/internal/ci/bazel_operations_test.go (100%) rename {enterprise/dev => dev}/ci/internal/ci/cache_helpers.go (91%) rename {enterprise/dev => dev}/ci/internal/ci/changed/BUILD.bazel (75%) rename {enterprise/dev => dev}/ci/internal/ci/changed/diff.go (98%) rename {enterprise/dev => dev}/ci/internal/ci/changed/diff_test.go (100%) rename {enterprise/dev => dev}/ci/internal/ci/changed/files.go (100%) rename {enterprise/dev => dev}/ci/internal/ci/changed/linters.go (100%) rename {enterprise/dev => dev}/ci/internal/ci/changed/linters_test.go (100%) rename {enterprise/dev => dev}/ci/internal/ci/config.go (98%) rename {enterprise/dev => dev}/ci/internal/ci/operations.go (97%) create mode 100644 dev/ci/internal/ci/operations/BUILD.bazel rename {enterprise/dev => dev}/ci/internal/ci/operations/operations.go (97%) rename {enterprise/dev => dev}/ci/internal/ci/pipeline.go (98%) rename {enterprise/dev => dev}/ci/internal/ci/test/BUILD.bazel (57%) rename {enterprise/dev => dev}/ci/internal/ci/test/wolfi-images/wolfi-test-image-1.yaml (100%) rename {enterprise/dev => dev}/ci/internal/ci/test/wolfi-images/wolfi-test-image-2.yaml (100%) rename {enterprise/dev => dev}/ci/internal/ci/web-integration-workloads.go (100%) rename {enterprise/dev => dev}/ci/internal/ci/wolfi_operations.go (95%) rename {enterprise/dev => dev}/ci/internal/ci/wolfi_operations_test.go (100%) rename {enterprise/dev => dev}/ci/push_all.sh (100%) rename {enterprise/dev => dev}/ci/scripts/annotate.sh (100%) rename {enterprise/dev => dev}/ci/scripts/annotated-command.sh (94%) rename {enterprise/dev => dev}/ci/scripts/app-token/BUILD.bazel (86%) rename {enterprise/dev => dev}/ci/scripts/app-token/main.go (100%) rename {enterprise/dev => dev}/ci/scripts/app-token/main_test.go (100%) rename {enterprise/dev => dev}/ci/scripts/app-token/tests/testdata/TestGetInstallAccessToken.yaml (100%) rename {enterprise/dev => dev}/ci/scripts/buildevent_file (100%) rename {enterprise/dev => dev}/ci/scripts/check-dependency-soft-fail.sh (100%) rename {enterprise/dev => dev}/ci/scripts/compare-hash.sh (100%) rename {enterprise/dev => dev}/ci/scripts/release-app.sh (100%) rename {enterprise/dev => dev}/ci/scripts/sentry-capture.sh (100%) rename {enterprise/dev => dev}/ci/scripts/upload-build-logs.sh (88%) rename {enterprise/dev => dev}/ci/scripts/upload-buildevent-report.sh (71%) rename {enterprise/dev => dev}/ci/scripts/upload-test-report.sh (100%) rename {enterprise/dev => dev}/ci/scripts/wolfi/build-base-image.sh (98%) rename {enterprise/dev => dev}/ci/scripts/wolfi/build-package.sh (97%) rename {enterprise/dev => dev}/ci/scripts/wolfi/build-repo-index.sh (100%) rename {enterprise/dev => dev}/ci/scripts/wolfi/upload-package.sh (95%) delete mode 100644 enterprise/.gitignore delete mode 100644 enterprise/README.md delete mode 100644 enterprise/dev/ci/OWNERS delete mode 100644 enterprise/dev/ci/images/go.mod delete mode 100644 enterprise/dev/ci/internal/ci/operations/BUILD.bazel diff --git a/.buildkite/hooks/post-checkout b/.buildkite/hooks/post-checkout index 30ac47d02ff..20d17ae5dc3 100644 --- a/.buildkite/hooks/post-checkout +++ b/.buildkite/hooks/post-checkout @@ -10,7 +10,7 @@ git fetch echo "Running git fetch... done" # Link command wrapper scripts so we can have more readable steps in the buildkite UI -ln -s "$(pwd)/enterprise/dev/ci/scripts/annotated-command.sh" an 2>/dev/null || true +ln -s "$(pwd)/dev/ci/scripts/annotated-command.sh" an 2>/dev/null || true # Provides secrets to the client integration tests target. -echo -e "build --define=GH_TOKEN=$GH_TOKEN\nbuild --define=PERCY_TOKEN=$PERCY_TOKEN" > .aspect/bazelrc/ci.generated.bazelrc +echo -e "build --define=GH_TOKEN=$GH_TOKEN\nbuild --define=PERCY_TOKEN=$PERCY_TOKEN" >.aspect/bazelrc/ci.generated.bazelrc diff --git a/.buildkite/hooks/pre-exit b/.buildkite/hooks/pre-exit index d7eaaeb527c..4efee4f1233 100644 --- a/.buildkite/hooks/pre-exit +++ b/.buildkite/hooks/pre-exit @@ -60,7 +60,7 @@ if [ "$BUILDKITE_BRANCH" == "main" ]; then echo "--- ⚠️A TEMPORARILY DISABLED: Logs will not be uploaded to Grafana. Please reach out to #discuss-dev-experience" # Non-zero exit code and not a soft fail: upload the logs. # echo "--- Uploading build logs: this only runs if your build has already failed, check the logs above, NOT below!" - # ./enterprise/dev/ci/scripts/upload-build-logs.sh + # ./dev/ci/scripts/upload-build-logs.sh fi # upload raw annotations as artifacts if they are available for easier access diff --git a/.buildkite/pipeline.app.yml b/.buildkite/pipeline.app.yml index 89af67022a7..6f39dd1ed95 100644 --- a/.buildkite/pipeline.app.yml +++ b/.buildkite/pipeline.app.yml @@ -8,14 +8,14 @@ steps: env: PLATFORM: x86_64-unknown-linux-gnu command: - - './enterprise/dev/app/build-backend.sh' + - './dev/app/build-backend.sh' - label: ':bazel::mac: Build for MacOS arm64' key: 'build-sourcegraph-app-macos-arm64' agents: { queue: macos } env: PLATFORM: aarch64-apple-darwin command: - - './enterprise/dev/app/build-backend.sh' + - './dev/app/build-backend.sh' - label: ':go::mac:Build for MacOS x86_64' key: 'build-sourcegraph-app-macos-x86_64' depends_on: 'build-sourcegraph-app-macos-arm64' @@ -25,7 +25,7 @@ steps: CROSS_COMPILE_X86_64_MACOS: 1 command: - './dev/ci/pnpm-install-with-retry.sh' - - './enterprise/dev/app/build-backend.sh' + - './dev/app/build-backend.sh' - group: ":tauri: Bundle and sign using Tauri" key: "tauri-bundles" depends_on: "backend-builds" @@ -35,7 +35,7 @@ steps: agents: { queue: stateless } command: - './dev/ci/pnpm-install-with-retry.sh' - - './enterprise/dev/app/tauri-build.sh' + - './dev/app/tauri-build.sh' env: SRC_APP_UPDATER_BUILD: 1 AWS_CONFIG_FILE: /buildkite/.aws/config @@ -63,7 +63,7 @@ steps: SRC_APP_UPDATER_BUILD: 1 command: - './dev/ci/pnpm-install-with-retry.sh' - - './enterprise/dev/app/tauri-build.sh' + - './dev/app/tauri-build.sh' - label: ':macos::tauri: (intel x86_64) Bundle and sign with Tauri' depends_on: 'mac-build-arm64-tauri-sourcegraph-app' key: 'mac-build-x86_64-tauri-sourcegraph-app' @@ -74,7 +74,7 @@ steps: SRC_APP_UPDATER_BUILD: 1 command: - './dev/ci/pnpm-install-with-retry.sh' - - './enterprise/dev/app/tauri-build.sh' + - './dev/app/tauri-build.sh' - group: ":github: Create release and update manifest" depends_on: "tauri-bundles" steps: @@ -82,5 +82,5 @@ steps: agents: { queue: stateless } key: create-github-release command: - - './enterprise/dev/app/create-github-release.sh' - - './enterprise/dev/app/create-update-manifest.sh' + - './dev/app/create-github-release.sh' + - './dev/app/create-update-manifest.sh' diff --git a/.github/test.CODEOWNERS b/.github/test.CODEOWNERS index 1e4f24f934f..0b4e6053d70 100644 --- a/.github/test.CODEOWNERS +++ b/.github/test.CODEOWNERS @@ -78,24 +78,24 @@ /cmd/worker/internal/executorqueue/**/* @eseliger -/enterprise/dev/ci/**/* @bobheadxi +/dev/ci/**/* @bobheadxi -/enterprise/internal/authz/**/* @unknwon +/internal/authz/**/* @unknwon /internal/batches/**/* @eseliger -/enterprise/internal/cloud/**/* @unknwon @michaellzc +/internal/cloud/**/* @unknwon @michaellzc /internal/codeintel/**/* @Strum355 -/enterprise/internal/database/external_services* @unknwon -/enterprise/internal/database/perms_store* @unknwon +/internal/database/external_services* @unknwon +/internal/database/perms_store* @unknwon -/enterprise/internal/insights/**/* @sourcegraph/code-insights-backend +/internal/insights/**/* @sourcegraph/code-insights-backend -/enterprise/internal/license/**/* @unknwon +/internal/license/**/* @unknwon -/enterprise/internal/licensing/**/* @unknwon +/internal/licensing/**/* @unknwon /internal/authz/**/* @unknwon @@ -161,8 +161,8 @@ /monitoring/**/* @bobheadxi @slimsag /monitoring/precise_code_intel_* @sourcegraph/code-intelligence -/enterprise/internal/own/ @sourcegraph/own -/enterprise/internal/database/codeowners* @sourcegraph/own +/internal/own/ @sourcegraph/own +/internal/database/codeowners* @sourcegraph/own /cmd/frontend/internal/own/ @sourcegraph/own /client/web/src/**/own/ @sourcegraph/own /cmd/frontend/graphqlbackend/own* @sourcegraph/own diff --git a/.github/workflows/scip-go.yml b/.github/workflows/scip-go.yml index 21d869a9472..3914d0e1d6a 100644 --- a/.github/workflows/scip-go.yml +++ b/.github/workflows/scip-go.yml @@ -17,7 +17,7 @@ jobs: - '' - lib - monitoring - - enterprise/dev/ci/images + - dev/ci/images steps: # Setup - name: Checkout diff --git a/.github/workflows/sg-binary-release.yml b/.github/workflows/sg-binary-release.yml index 6c62469a7db..12681fdaea6 100644 --- a/.github/workflows/sg-binary-release.yml +++ b/.github/workflows/sg-binary-release.yml @@ -13,7 +13,7 @@ on: - 'lib/errors/**' - 'lib/group/**' # Important things sg imports - - 'enterprise/dev/ci/images/**' # sg ops + - 'dev/ci/images/**' # sg ops - 'internal/database/migration/**' # sg migration - 'monitoring/**' # sg monitoring diff --git a/.gitignore b/.gitignore index 6b61856b721..baea654c957 100644 --- a/.gitignore +++ b/.gitignore @@ -213,3 +213,5 @@ result-* # JUnit execution reports junit.xml + +/enterprise/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 23172a17b69..86395a9b50e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,10 +4,6 @@ In short, we are open to nearly all contributions! We love feedback in all forms, issues, comments, PRs, etc! -## Contributing to `enterprise/` code - -Anyone is free to contribute changes to any file in this repository, including `enterprise/` code. Once you open a pull request, the CLA bot will require you sign our contributor CLA before we can accept the change. - ## Contributing large changes, new features, etc. Unless you feel confident your change will be accepted (trivial bug fixes, code cleanup, etc) you should first create an issue or a [Sourcegraph RFC](https://handbook.sourcegraph.com/communication/rfcs#external-contributors) (preferred for bigger changes) to discuss your change with us. This lets us all discuss the design and proposed implementation of your change, which helps ensure your time is well spent and that your contribution will be accepted. diff --git a/dev/check/go-dbconn-import.sh b/dev/check/go-dbconn-import.sh index b22414133b4..d81a4f7c4b4 100755 --- a/dev/check/go-dbconn-import.sh +++ b/dev/check/go-dbconn-import.sh @@ -36,7 +36,7 @@ allowed=$(printf "^(%s)" "${allowed:1}") # shellcheck disable=SC2016 template='{{with $pkg := .}}{{ range $pkg.Deps }}{{ printf "%s imports %s\n" $pkg.ImportPath .}}{{end}}{{end}}' -if go list ./cmd/... ./enterprise/cmd/... | +if go list ./cmd/... | grep -Ev "$allowed" | xargs go list -f "$template" | grep "github.com/sourcegraph/sourcegraph/internal/database/dbconn"; then diff --git a/enterprise/dev/ci/BUILD.bazel b/dev/ci/BUILD.bazel similarity index 69% rename from enterprise/dev/ci/BUILD.bazel rename to dev/ci/BUILD.bazel index 1ba5200cd3b..f37785fe2a0 100644 --- a/enterprise/dev/ci/BUILD.bazel +++ b/dev/ci/BUILD.bazel @@ -3,13 +3,13 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") go_library( name = "ci_lib", srcs = ["gen-pipeline.go"], - importpath = "github.com/sourcegraph/sourcegraph/enterprise/dev/ci", + importpath = "github.com/sourcegraph/sourcegraph/dev/ci", visibility = ["//visibility:private"], deps = [ + "//dev/ci/internal/buildkite", + "//dev/ci/internal/ci", + "//dev/ci/internal/ci/changed", "//dev/ci/runtype", - "//enterprise/dev/ci/internal/buildkite", - "//enterprise/dev/ci/internal/ci", - "//enterprise/dev/ci/internal/ci/changed", "//internal/hostname", "@com_github_getsentry_sentry_go//:sentry-go", "@com_github_grafana_regexp//:regexp", diff --git a/enterprise/dev/ci/CODENOTIFY b/dev/ci/CODENOTIFY similarity index 100% rename from enterprise/dev/ci/CODENOTIFY rename to dev/ci/CODENOTIFY diff --git a/dev/ci/OWNERS b/dev/ci/OWNERS index 95d01e1679c..427b908cdc9 100644 --- a/dev/ci/OWNERS +++ b/dev/ci/OWNERS @@ -1,4 +1,3 @@ # See https://github.com/sourcegraph/codenotify for documentation. -go-build.sh @sourcegraph/dev-experience -go-test.sh @sourcegraph/dev-experience +**/* @sourcegraph/dev-experience diff --git a/enterprise/dev/ci/README.md b/dev/ci/README.md similarity index 100% rename from enterprise/dev/ci/README.md rename to dev/ci/README.md diff --git a/enterprise/dev/ci/gen-pipeline.go b/dev/ci/gen-pipeline.go similarity index 93% rename from enterprise/dev/ci/gen-pipeline.go rename to dev/ci/gen-pipeline.go index 2e3a737bbb2..c68c6442d42 100644 --- a/enterprise/dev/ci/gen-pipeline.go +++ b/dev/ci/gen-pipeline.go @@ -15,10 +15,11 @@ import ( "github.com/grafana/regexp" "github.com/sourcegraph/log" + + "github.com/sourcegraph/sourcegraph/dev/ci/internal/buildkite" + "github.com/sourcegraph/sourcegraph/dev/ci/internal/ci" + "github.com/sourcegraph/sourcegraph/dev/ci/internal/ci/changed" "github.com/sourcegraph/sourcegraph/dev/ci/runtype" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/buildkite" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/ci" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/ci/changed" "github.com/sourcegraph/sourcegraph/internal/hostname" ) @@ -32,8 +33,8 @@ func init() { flag.BoolVar(&docs, "docs", false, "Render generated documentation") } -//go:generate sh -c "cd ../../../ && echo '\n' > doc/dev/background-information/ci/reference.md" -//go:generate sh -c "cd ../../../ && go run ./enterprise/dev/ci/gen-pipeline.go -docs >> doc/dev/background-information/ci/reference.md" +//go:generate sh -c "cd ../../ && echo '\n' > doc/dev/background-information/ci/reference.md" +//go:generate sh -c "cd ../../ && go run ./dev/ci/gen-pipeline.go -docs >> doc/dev/background-information/ci/reference.md" func main() { flag.Parse() diff --git a/dev/ci/gen-pipeline.sh b/dev/ci/gen-pipeline.sh index 02ce7820792..aca90b3b007 100755 --- a/dev/ci/gen-pipeline.sh +++ b/dev/ci/gen-pipeline.sh @@ -3,7 +3,7 @@ set -e echo "--- :books: Annotating build with Glossary" -buildkite-agent annotate --style info <./enterprise/dev/ci/glossary.md +buildkite-agent annotate --style info <./dev/ci/glossary.md echo "--- :bazel: Build pipeline generator" bazel \ @@ -11,9 +11,9 @@ bazel \ --bazelrc=.aspect/bazelrc/ci.bazelrc \ --bazelrc=.aspect/bazelrc/ci.sourcegraph.bazelrc \ build \ - //enterprise/dev/ci:ci + //dev/ci:ci -pipeline_gen="$(bazel cquery //enterprise/dev/ci:ci --output files)" +pipeline_gen="$(bazel cquery //dev/ci:ci --output files)" echo "--- :writing_hand: Generate pipeline" $pipeline_gen | tee generated-pipeline.yml diff --git a/enterprise/dev/ci/glossary.md b/dev/ci/glossary.md similarity index 100% rename from enterprise/dev/ci/glossary.md rename to dev/ci/glossary.md diff --git a/enterprise/dev/ci/images/BUILD.bazel b/dev/ci/images/BUILD.bazel similarity index 66% rename from enterprise/dev/ci/images/BUILD.bazel rename to dev/ci/images/BUILD.bazel index 353d69b48da..c32e8b3f031 100644 --- a/enterprise/dev/ci/images/BUILD.bazel +++ b/dev/ci/images/BUILD.bazel @@ -3,6 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "images", srcs = ["images.go"], - importpath = "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images", + importpath = "github.com/sourcegraph/sourcegraph/dev/ci/images", visibility = ["//visibility:public"], ) diff --git a/dev/ci/images/go.mod b/dev/ci/images/go.mod new file mode 100644 index 00000000000..8a1cb2f1718 --- /dev/null +++ b/dev/ci/images/go.mod @@ -0,0 +1,3 @@ +module github.com/sourcegraph/sourcegraph/dev/ci/images + +go 1.14 diff --git a/enterprise/dev/ci/images/images.go b/dev/ci/images/images.go similarity index 100% rename from enterprise/dev/ci/images/images.go rename to dev/ci/images/images.go diff --git a/enterprise/dev/ci/integration/executors/docker-compose.yml b/dev/ci/integration/executors/docker-compose.yml similarity index 100% rename from enterprise/dev/ci/integration/executors/docker-compose.yml rename to dev/ci/integration/executors/docker-compose.yml diff --git a/enterprise/dev/ci/integration/executors/run.sh b/dev/ci/integration/executors/run.sh similarity index 94% rename from enterprise/dev/ci/integration/executors/run.sh rename to dev/ci/integration/executors/run.sh index 5b1484e7e94..87ae3d81e95 100755 --- a/enterprise/dev/ci/integration/executors/run.sh +++ b/dev/ci/integration/executors/run.sh @@ -15,7 +15,7 @@ mkdir "${DATA}/data" mkdir "${DATA}/config" cleanup() { - pushd "$root_dir"/enterprise/dev/ci/integration/executors/ 1>/dev/null + pushd "$root_dir"/dev/ci/integration/executors/ 1>/dev/null docker-compose logs >"${root_dir}/docker-compose.log" docker-compose down --volumes --timeout 30 # seconds docker volume rm executors-e2e || true @@ -42,7 +42,7 @@ BATCHESHELPER_IMAGE="us.gcr.io/sourcegraph-dev/batcheshelper:${CANDIDATE_VERSION docker pull "${BATCHESHELPER_IMAGE}" echo "--- :terminal: Start server with executor" -pushd "enterprise/dev/ci/integration/executors" 1>/dev/null +pushd "dev/ci/integration/executors" 1>/dev/null # Temporary workaround, see https://github.com/sourcegraph/sourcegraph/issues/44816 envsubst >"${TMP_WORK_DIR}/site-config.json" <./tester/config/site-config.json diff --git a/enterprise/dev/ci/integration/executors/test.sh b/dev/ci/integration/executors/test.sh similarity index 71% rename from enterprise/dev/ci/integration/executors/test.sh rename to dev/ci/integration/executors/test.sh index c5b716963c6..05a563c8706 100755 --- a/enterprise/dev/ci/integration/executors/test.sh +++ b/dev/ci/integration/executors/test.sh @@ -7,4 +7,4 @@ set -e export SOURCEGRAPH_BASE_URL="${1:-"http://localhost:7080"}" export SRC_LOG_LEVEL=dbug -bazel run //enterprise/dev/ci/integration/executors/tester:tester +bazel run //dev/ci/integration/executors/tester:tester diff --git a/enterprise/dev/ci/integration/executors/tester/BUILD.bazel b/dev/ci/integration/executors/tester/BUILD.bazel similarity index 85% rename from enterprise/dev/ci/integration/executors/tester/BUILD.bazel rename to dev/ci/integration/executors/tester/BUILD.bazel index 476f872a723..739cc7fec74 100644 --- a/enterprise/dev/ci/integration/executors/tester/BUILD.bazel +++ b/dev/ci/integration/executors/tester/BUILD.bazel @@ -7,10 +7,10 @@ go_library( "main.go", "testinfra.go", ], - importpath = "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/integration/executors/tester", + importpath = "github.com/sourcegraph/sourcegraph/dev/ci/integration/executors/tester", visibility = ["//visibility:private"], deps = [ - "//enterprise/dev/ci/integration/executors/tester/config", + "//dev/ci/integration/executors/tester/config", "//internal/authz", "//internal/batches/store", "//internal/batches/types", diff --git a/enterprise/dev/ci/integration/executors/tester/config/BUILD.bazel b/dev/ci/integration/executors/tester/config/BUILD.bazel similarity index 57% rename from enterprise/dev/ci/integration/executors/tester/config/BUILD.bazel rename to dev/ci/integration/executors/tester/config/BUILD.bazel index 41bde4962ea..adb1f3734eb 100644 --- a/enterprise/dev/ci/integration/executors/tester/config/BUILD.bazel +++ b/dev/ci/integration/executors/tester/config/BUILD.bazel @@ -3,13 +3,13 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") filegroup( name = "testdata", srcs = glob(["*.json"]), - visibility = ["//enterprise/dev/ci/integration/executors:__subpackages__"], + visibility = ["//dev/ci/integration/executors:__subpackages__"], ) go_library( name = "config", srcs = ["config.go"], embedsrcs = ["repos.json"], - importpath = "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/integration/executors/tester/config", + importpath = "github.com/sourcegraph/sourcegraph/dev/ci/integration/executors/tester/config", visibility = ["//visibility:public"], ) diff --git a/enterprise/dev/ci/integration/executors/tester/config/config.go b/dev/ci/integration/executors/tester/config/config.go similarity index 100% rename from enterprise/dev/ci/integration/executors/tester/config/config.go rename to dev/ci/integration/executors/tester/config/config.go diff --git a/enterprise/dev/ci/integration/executors/tester/config/repos.json b/dev/ci/integration/executors/tester/config/repos.json similarity index 100% rename from enterprise/dev/ci/integration/executors/tester/config/repos.json rename to dev/ci/integration/executors/tester/config/repos.json diff --git a/enterprise/dev/ci/integration/executors/tester/config/site-config.json b/dev/ci/integration/executors/tester/config/site-config.json similarity index 100% rename from enterprise/dev/ci/integration/executors/tester/config/site-config.json rename to dev/ci/integration/executors/tester/config/site-config.json diff --git a/enterprise/dev/ci/integration/executors/tester/init.go b/dev/ci/integration/executors/tester/init.go similarity index 96% rename from enterprise/dev/ci/integration/executors/tester/init.go rename to dev/ci/integration/executors/tester/init.go index fd4829f0ffe..d02d8a7e42b 100644 --- a/enterprise/dev/ci/integration/executors/tester/init.go +++ b/dev/ci/integration/executors/tester/init.go @@ -7,7 +7,7 @@ import ( "net/url" "os" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/integration/executors/tester/config" + "github.com/sourcegraph/sourcegraph/dev/ci/integration/executors/tester/config" "github.com/sourcegraph/sourcegraph/internal/gqltestutil" "github.com/sourcegraph/sourcegraph/lib/errors" ) diff --git a/enterprise/dev/ci/integration/executors/tester/main.go b/dev/ci/integration/executors/tester/main.go similarity index 100% rename from enterprise/dev/ci/integration/executors/tester/main.go rename to dev/ci/integration/executors/tester/main.go diff --git a/enterprise/dev/ci/integration/executors/tester/testinfra.go b/dev/ci/integration/executors/tester/testinfra.go similarity index 100% rename from enterprise/dev/ci/integration/executors/tester/testinfra.go rename to dev/ci/integration/executors/tester/testinfra.go diff --git a/enterprise/dev/ci/internal/buildkite/BUILD.bazel b/dev/ci/internal/buildkite/BUILD.bazel similarity index 79% rename from enterprise/dev/ci/internal/buildkite/BUILD.bazel rename to dev/ci/internal/buildkite/BUILD.bazel index 059761541b5..2174d3398f9 100644 --- a/enterprise/dev/ci/internal/buildkite/BUILD.bazel +++ b/dev/ci/internal/buildkite/BUILD.bazel @@ -10,8 +10,8 @@ go_library( "feature_flags.go", "step_notify.go", ], - importpath = "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/buildkite", - visibility = ["//enterprise/dev/ci:__subpackages__"], + importpath = "github.com/sourcegraph/sourcegraph/dev/ci/internal/buildkite", + visibility = ["//dev/ci:__subpackages__"], deps = [ "//lib/errors", "@com_github_ghodss_yaml//:yaml", diff --git a/enterprise/dev/ci/internal/buildkite/agents.go b/dev/ci/internal/buildkite/agents.go similarity index 100% rename from enterprise/dev/ci/internal/buildkite/agents.go rename to dev/ci/internal/buildkite/agents.go diff --git a/enterprise/dev/ci/internal/buildkite/buildkite.go b/dev/ci/internal/buildkite/buildkite.go similarity index 100% rename from enterprise/dev/ci/internal/buildkite/buildkite.go rename to dev/ci/internal/buildkite/buildkite.go diff --git a/enterprise/dev/ci/internal/buildkite/buildkite_test.go b/dev/ci/internal/buildkite/buildkite_test.go similarity index 97% rename from enterprise/dev/ci/internal/buildkite/buildkite_test.go rename to dev/ci/internal/buildkite/buildkite_test.go index 0c3106b9404..379359e6369 100644 --- a/enterprise/dev/ci/internal/buildkite/buildkite_test.go +++ b/dev/ci/internal/buildkite/buildkite_test.go @@ -6,7 +6,8 @@ import ( "testing" "github.com/ghodss/yaml" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/buildkite" + + "github.com/sourcegraph/sourcegraph/dev/ci/internal/buildkite" ) func TestStepSoftFail(t *testing.T) { diff --git a/enterprise/dev/ci/internal/buildkite/cache.go b/dev/ci/internal/buildkite/cache.go similarity index 100% rename from enterprise/dev/ci/internal/buildkite/cache.go rename to dev/ci/internal/buildkite/cache.go diff --git a/enterprise/dev/ci/internal/buildkite/feature_flags.go b/dev/ci/internal/buildkite/feature_flags.go similarity index 100% rename from enterprise/dev/ci/internal/buildkite/feature_flags.go rename to dev/ci/internal/buildkite/feature_flags.go diff --git a/enterprise/dev/ci/internal/buildkite/step_notify.go b/dev/ci/internal/buildkite/step_notify.go similarity index 100% rename from enterprise/dev/ci/internal/buildkite/step_notify.go rename to dev/ci/internal/buildkite/step_notify.go diff --git a/enterprise/dev/ci/internal/ci/BUILD.bazel b/dev/ci/internal/ci/BUILD.bazel similarity index 66% rename from enterprise/dev/ci/internal/ci/BUILD.bazel rename to dev/ci/internal/ci/BUILD.bazel index e3d4ea8b971..7cd7ba219e2 100644 --- a/enterprise/dev/ci/internal/ci/BUILD.bazel +++ b/dev/ci/internal/ci/BUILD.bazel @@ -12,15 +12,15 @@ go_library( "web-integration-workloads.go", "wolfi_operations.go", ], - importpath = "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/ci", - visibility = ["//enterprise/dev/ci:__subpackages__"], + importpath = "github.com/sourcegraph/sourcegraph/dev/ci/internal/ci", + visibility = ["//dev/ci:__subpackages__"], deps = [ + "//dev/ci/images", + "//dev/ci/internal/buildkite", + "//dev/ci/internal/ci/changed", + "//dev/ci/internal/ci/operations", "//dev/ci/runtype", "//dev/sg/root", - "//enterprise/dev/ci/images", - "//enterprise/dev/ci/internal/buildkite", - "//enterprise/dev/ci/internal/ci/changed", - "//enterprise/dev/ci/internal/ci/operations", "//internal/lazyregexp", "//internal/oobmigration", "//lib/errors", @@ -37,7 +37,7 @@ go_test( "wolfi_operations_test.go", ], data = [ - "//enterprise/dev/ci/internal/ci/test:test-image-configs", + "//dev/ci/internal/ci/test:test-image-configs", ], embed = [":ci"], ) diff --git a/enterprise/dev/ci/internal/ci/bazel_operations.go b/dev/ci/internal/ci/bazel_operations.go similarity index 96% rename from enterprise/dev/ci/internal/ci/bazel_operations.go rename to dev/ci/internal/ci/bazel_operations.go index 57338da9e90..a98ddc90fc3 100644 --- a/enterprise/dev/ci/internal/ci/bazel_operations.go +++ b/dev/ci/internal/ci/bazel_operations.go @@ -8,10 +8,10 @@ import ( "strconv" "strings" + "github.com/sourcegraph/sourcegraph/dev/ci/images" + bk "github.com/sourcegraph/sourcegraph/dev/ci/internal/buildkite" + "github.com/sourcegraph/sourcegraph/dev/ci/internal/ci/operations" "github.com/sourcegraph/sourcegraph/dev/ci/runtype" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images" - bk "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/buildkite" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/ci/operations" "github.com/sourcegraph/sourcegraph/lib/errors" ) @@ -74,7 +74,7 @@ func bazelPushImagesCmd(version string, isCandidate bool, depKey string) func(*b bk.Env("CANDIDATE_ONLY", candidate), bazelApplyPrecheckChanges(), bk.Cmd(bazelStampedCmd(`build $$(bazel query 'kind("oci_push rule", //...)')`)), - bk.Cmd("./enterprise/dev/ci/push_all.sh"), + bk.Cmd("./dev/ci/push_all.sh"), ) } } @@ -303,11 +303,8 @@ func bazelBuildCandidateDockerImages(apps []string, version string, tag string, // TODO(blobstore): remove this when making Go blobstore the default folder = "blobstore" } - // If /enterprise/cmd/... does not exist, build just /cmd/... instead. - if _, err := os.Stat(filepath.Join("enterprise/cmd", folder)); err != nil { - return "cmd/" + folder - } - return "enterprise/cmd/" + folder + + return "cmd/" + folder }() buildScriptPath := filepath.Join(cmdDir, "build.sh") _, err := os.Stat(filepath.Join(cmdDir, "build-bazel.sh")) @@ -400,11 +397,8 @@ func bazelBuildCandidateDockerImage(app string, version string, tag string, rt r // TODO(blobstore): remove this when making Go blobstore the default folder = "blobstore" } - // If /enterprise/cmd/... does not exist, build just /cmd/... instead. - if _, err := os.Stat(filepath.Join("enterprise/cmd", folder)); err != nil { - return "cmd/" + folder - } - return "enterprise/cmd/" + folder + + return "cmd/" + folder }() buildScriptPath := filepath.Join(cmdDir, "build.sh") _, err := os.Stat(filepath.Join(cmdDir, "build-bazel.sh")) diff --git a/enterprise/dev/ci/internal/ci/bazel_operations_test.go b/dev/ci/internal/ci/bazel_operations_test.go similarity index 100% rename from enterprise/dev/ci/internal/ci/bazel_operations_test.go rename to dev/ci/internal/ci/bazel_operations_test.go diff --git a/enterprise/dev/ci/internal/ci/cache_helpers.go b/dev/ci/internal/ci/cache_helpers.go similarity index 91% rename from enterprise/dev/ci/internal/ci/cache_helpers.go rename to dev/ci/internal/ci/cache_helpers.go index 93d89183207..a50f926d4e9 100644 --- a/enterprise/dev/ci/internal/ci/cache_helpers.go +++ b/dev/ci/internal/ci/cache_helpers.go @@ -1,6 +1,6 @@ package ci -import "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/buildkite" +import "github.com/sourcegraph/sourcegraph/dev/ci/internal/buildkite" func withPnpmCache() buildkite.StepOpt { return buildkite.Cache(&buildkite.CacheOptions{ diff --git a/enterprise/dev/ci/internal/ci/changed/BUILD.bazel b/dev/ci/internal/ci/changed/BUILD.bazel similarity index 75% rename from enterprise/dev/ci/internal/ci/changed/BUILD.bazel rename to dev/ci/internal/ci/changed/BUILD.bazel index 320a8c1d9b6..83010c16ecc 100644 --- a/enterprise/dev/ci/internal/ci/changed/BUILD.bazel +++ b/dev/ci/internal/ci/changed/BUILD.bazel @@ -8,8 +8,8 @@ go_library( "files.go", "linters.go", ], - importpath = "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/ci/changed", - visibility = ["//enterprise/dev/ci:__subpackages__"], + importpath = "github.com/sourcegraph/sourcegraph/dev/ci/internal/ci/changed", + visibility = ["//dev/ci:__subpackages__"], ) go_test( diff --git a/enterprise/dev/ci/internal/ci/changed/diff.go b/dev/ci/internal/ci/changed/diff.go similarity index 98% rename from enterprise/dev/ci/internal/ci/changed/diff.go rename to dev/ci/internal/ci/changed/diff.go index e62d9056d9b..42deb115545 100644 --- a/enterprise/dev/ci/internal/ci/changed/diff.go +++ b/dev/ci/internal/ci/changed/diff.go @@ -51,8 +51,6 @@ func ForEachDiffType(callback func(d Diff)) { // in these directories as a go change. var topLevelGoDirs = []string{ "cmd", - "enterprise/cmd", - "enterprise/internal", "internal", "lib", "migrations", @@ -154,7 +152,7 @@ func ParseDiff(files []string) (diff Diff, changedFiles ChangedFiles) { } // Affects CI scripts - if strings.HasPrefix(p, "enterprise/dev/ci/scripts") { + if strings.HasPrefix(p, "dev/ci/scripts") { diff |= CIScripts } diff --git a/enterprise/dev/ci/internal/ci/changed/diff_test.go b/dev/ci/internal/ci/changed/diff_test.go similarity index 100% rename from enterprise/dev/ci/internal/ci/changed/diff_test.go rename to dev/ci/internal/ci/changed/diff_test.go diff --git a/enterprise/dev/ci/internal/ci/changed/files.go b/dev/ci/internal/ci/changed/files.go similarity index 100% rename from enterprise/dev/ci/internal/ci/changed/files.go rename to dev/ci/internal/ci/changed/files.go diff --git a/enterprise/dev/ci/internal/ci/changed/linters.go b/dev/ci/internal/ci/changed/linters.go similarity index 100% rename from enterprise/dev/ci/internal/ci/changed/linters.go rename to dev/ci/internal/ci/changed/linters.go diff --git a/enterprise/dev/ci/internal/ci/changed/linters_test.go b/dev/ci/internal/ci/changed/linters_test.go similarity index 100% rename from enterprise/dev/ci/internal/ci/changed/linters_test.go rename to dev/ci/internal/ci/changed/linters_test.go diff --git a/enterprise/dev/ci/internal/ci/config.go b/dev/ci/internal/ci/config.go similarity index 98% rename from enterprise/dev/ci/internal/ci/config.go rename to dev/ci/internal/ci/config.go index 5783ebb93a5..eea79a0bfb6 100644 --- a/enterprise/dev/ci/internal/ci/config.go +++ b/dev/ci/internal/ci/config.go @@ -8,9 +8,9 @@ import ( "strings" "time" + "github.com/sourcegraph/sourcegraph/dev/ci/images" + "github.com/sourcegraph/sourcegraph/dev/ci/internal/ci/changed" "github.com/sourcegraph/sourcegraph/dev/ci/runtype" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/ci/changed" "github.com/sourcegraph/sourcegraph/internal/oobmigration" "github.com/sourcegraph/sourcegraph/lib/errors" ) diff --git a/enterprise/dev/ci/internal/ci/operations.go b/dev/ci/internal/ci/operations.go similarity index 97% rename from enterprise/dev/ci/internal/ci/operations.go rename to dev/ci/internal/ci/operations.go index 85b3ac1640e..222cb76f15c 100644 --- a/enterprise/dev/ci/internal/ci/operations.go +++ b/dev/ci/internal/ci/operations.go @@ -10,11 +10,11 @@ import ( "github.com/Masterminds/semver" + "github.com/sourcegraph/sourcegraph/dev/ci/images" + bk "github.com/sourcegraph/sourcegraph/dev/ci/internal/buildkite" + "github.com/sourcegraph/sourcegraph/dev/ci/internal/ci/changed" + "github.com/sourcegraph/sourcegraph/dev/ci/internal/ci/operations" "github.com/sourcegraph/sourcegraph/dev/ci/runtype" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images" - bk "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/buildkite" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/ci/changed" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/ci/operations" ) // CoreTestOperationsOptions should be used ONLY to adjust the behaviour of specific steps, @@ -416,7 +416,7 @@ func addAppReleaseSteps(c Config, insiders bool) operations.Operation { withPnpmCache(), bk.Cmd("pnpm install --frozen-lockfile --fetch-timeout 60000"), bk.Env("VERSION", version), - bk.Cmd("enterprise/dev/ci/scripts/release-app.sh")) + bk.Cmd("dev/ci/scripts/release-app.sh")) } } @@ -501,11 +501,11 @@ func executorsE2E(candidateTag string) operations.Operation { bk.Env("SOURCEGRAPH_SUDO_USER", "admin"), bk.Env("TEST_USER_EMAIL", "test@sourcegraph.com"), bk.Env("TEST_USER_PASSWORD", "supersecurepassword"), - // See enterprise/dev/ci/integration/executors/docker-compose.yaml + // See dev/ci/integration/executors/docker-compose.yaml // This enable the executor to reach the dind container // for docker commands. bk.Env("DOCKER_GATEWAY_HOST", "172.17.0.1"), - bk.Cmd("enterprise/dev/ci/integration/executors/run.sh"), + bk.Cmd("dev/ci/integration/executors/run.sh"), bk.ArtifactPaths("./*.log"), ) } @@ -634,11 +634,8 @@ func buildCandidateDockerImage(app, version, tag string, uploadSourcemaps bool) // TODO(blobstore): remove this when making Go blobstore the default folder = "blobstore" } - // If /enterprise/cmd/... does not exist, build just /cmd/... instead. - if _, err := os.Stat(filepath.Join("enterprise/cmd", folder)); err != nil { - return "cmd/" + folder - } - return "enterprise/cmd/" + folder + + return "cmd/" + folder }() preBuildScript := cmdDir + "/pre-build.sh" if _, err := os.Stat(preBuildScript); err == nil { @@ -807,7 +804,7 @@ func buildExecutorVM(c Config, skipHashCompare bool) operations.Operation { bk.Env("EXECUTOR_IS_TAGGED_RELEASE", strconv.FormatBool(c.RunType.Is(runtype.TaggedRelease))), } if !skipHashCompare { - compareHashScript := "./enterprise/dev/ci/scripts/compare-hash.sh" + compareHashScript := "./dev/ci/scripts/compare-hash.sh" stepOpts = append(stepOpts, // Soft-fail with code 222 if nothing has changed bk.SoftFail(222), @@ -846,7 +843,7 @@ func publishExecutorVM(c Config, skipHashCompare bool) operations.Operation { } if !skipHashCompare { // Publish iff not soft-failed on previous step - checkDependencySoftFailScript := "./enterprise/dev/ci/scripts/check-dependency-soft-fail.sh" + checkDependencySoftFailScript := "./dev/ci/scripts/check-dependency-soft-fail.sh" stepOpts = append(stepOpts, // Soft-fail with code 222 if nothing has changed bk.SoftFail(222), diff --git a/dev/ci/internal/ci/operations/BUILD.bazel b/dev/ci/internal/ci/operations/BUILD.bazel new file mode 100644 index 00000000000..c85bf97cac4 --- /dev/null +++ b/dev/ci/internal/ci/operations/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "operations", + srcs = ["operations.go"], + importpath = "github.com/sourcegraph/sourcegraph/dev/ci/internal/ci/operations", + visibility = ["//dev/ci:__subpackages__"], + deps = [ + "//dev/ci/internal/buildkite", + "@com_github_grafana_regexp//:regexp", + ], +) diff --git a/enterprise/dev/ci/internal/ci/operations/operations.go b/dev/ci/internal/ci/operations/operations.go similarity index 97% rename from enterprise/dev/ci/internal/ci/operations/operations.go rename to dev/ci/internal/ci/operations/operations.go index b85a5322f5a..20445844de1 100644 --- a/enterprise/dev/ci/internal/ci/operations/operations.go +++ b/dev/ci/internal/ci/operations/operations.go @@ -5,7 +5,7 @@ import ( "github.com/grafana/regexp" - bk "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/buildkite" + bk "github.com/sourcegraph/sourcegraph/dev/ci/internal/buildkite" ) // Operation defines a function that adds something to a Buildkite pipeline, such as one diff --git a/enterprise/dev/ci/internal/ci/pipeline.go b/dev/ci/internal/ci/pipeline.go similarity index 98% rename from enterprise/dev/ci/internal/ci/pipeline.go rename to dev/ci/internal/ci/pipeline.go index 48089f43c1d..42b99942b9f 100644 --- a/enterprise/dev/ci/internal/ci/pipeline.go +++ b/dev/ci/internal/ci/pipeline.go @@ -10,11 +10,11 @@ import ( "strings" "time" + "github.com/sourcegraph/sourcegraph/dev/ci/images" + bk "github.com/sourcegraph/sourcegraph/dev/ci/internal/buildkite" + "github.com/sourcegraph/sourcegraph/dev/ci/internal/ci/changed" + "github.com/sourcegraph/sourcegraph/dev/ci/internal/ci/operations" "github.com/sourcegraph/sourcegraph/dev/ci/runtype" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images" - bk "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/buildkite" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/ci/changed" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/ci/operations" "github.com/sourcegraph/sourcegraph/lib/errors" ) diff --git a/enterprise/dev/ci/internal/ci/test/BUILD.bazel b/dev/ci/internal/ci/test/BUILD.bazel similarity index 57% rename from enterprise/dev/ci/internal/ci/test/BUILD.bazel rename to dev/ci/internal/ci/test/BUILD.bazel index 7bd950228e1..42e0c0168c3 100644 --- a/enterprise/dev/ci/internal/ci/test/BUILD.bazel +++ b/dev/ci/internal/ci/test/BUILD.bazel @@ -1,5 +1,5 @@ filegroup( name = "test-image-configs", srcs = glob(["wolfi-images/*"]), - visibility = ["//enterprise/dev/ci/internal/ci:__pkg__"], + visibility = ["//dev/ci/internal/ci:__pkg__"], ) diff --git a/enterprise/dev/ci/internal/ci/test/wolfi-images/wolfi-test-image-1.yaml b/dev/ci/internal/ci/test/wolfi-images/wolfi-test-image-1.yaml similarity index 100% rename from enterprise/dev/ci/internal/ci/test/wolfi-images/wolfi-test-image-1.yaml rename to dev/ci/internal/ci/test/wolfi-images/wolfi-test-image-1.yaml diff --git a/enterprise/dev/ci/internal/ci/test/wolfi-images/wolfi-test-image-2.yaml b/dev/ci/internal/ci/test/wolfi-images/wolfi-test-image-2.yaml similarity index 100% rename from enterprise/dev/ci/internal/ci/test/wolfi-images/wolfi-test-image-2.yaml rename to dev/ci/internal/ci/test/wolfi-images/wolfi-test-image-2.yaml diff --git a/enterprise/dev/ci/internal/ci/web-integration-workloads.go b/dev/ci/internal/ci/web-integration-workloads.go similarity index 100% rename from enterprise/dev/ci/internal/ci/web-integration-workloads.go rename to dev/ci/internal/ci/web-integration-workloads.go diff --git a/enterprise/dev/ci/internal/ci/wolfi_operations.go b/dev/ci/internal/ci/wolfi_operations.go similarity index 95% rename from enterprise/dev/ci/internal/ci/wolfi_operations.go rename to dev/ci/internal/ci/wolfi_operations.go index 6366bfa398c..068173f95de 100644 --- a/enterprise/dev/ci/internal/ci/wolfi_operations.go +++ b/dev/ci/internal/ci/wolfi_operations.go @@ -10,9 +10,9 @@ import ( "github.com/sourcegraph/log" "gopkg.in/yaml.v2" + bk "github.com/sourcegraph/sourcegraph/dev/ci/internal/buildkite" + "github.com/sourcegraph/sourcegraph/dev/ci/internal/ci/operations" "github.com/sourcegraph/sourcegraph/dev/sg/root" - bk "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/buildkite" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/ci/operations" "github.com/sourcegraph/sourcegraph/internal/lazyregexp" ) @@ -73,7 +73,7 @@ func buildPackage(target string) (func(*bk.Pipeline), string) { return func(pipeline *bk.Pipeline) { pipeline.AddStep(fmt.Sprintf(":package: Package dependency '%s'", target), - bk.Cmd(fmt.Sprintf("./enterprise/dev/ci/scripts/wolfi/build-package.sh %s", target)), + bk.Cmd(fmt.Sprintf("./dev/ci/scripts/wolfi/build-package.sh %s", target)), // We want to run on the bazel queue, so we have a pretty minimal agent. bk.Agent("queue", "bazel"), bk.Key(stepKey), @@ -85,7 +85,7 @@ func buildPackage(target string) (func(*bk.Pipeline), string) { func buildRepoIndex(packageKeys []string) func(*bk.Pipeline) { return func(pipeline *bk.Pipeline) { pipeline.AddStep(":card_index_dividers: Build and sign repository index", - bk.Cmd("./enterprise/dev/ci/scripts/wolfi/build-repo-index.sh"), + bk.Cmd("./dev/ci/scripts/wolfi/build-repo-index.sh"), // We want to run on the bazel queue, so we have a pretty minimal agent. bk.Agent("queue", "bazel"), // Depend on all previous package building steps @@ -101,7 +101,7 @@ func buildWolfiBaseImage(target string, tag string, dependOnPackages bool) (func return func(pipeline *bk.Pipeline) { opts := []bk.StepOpt{ - bk.Cmd(fmt.Sprintf("./enterprise/dev/ci/scripts/wolfi/build-base-image.sh %s %s", target, tag)), + bk.Cmd(fmt.Sprintf("./dev/ci/scripts/wolfi/build-base-image.sh %s %s", target, tag)), // We want to run on the bazel queue, so we have a pretty minimal agent. bk.Agent("queue", "bazel"), bk.Env("DOCKER_BAZEL", "true"), diff --git a/enterprise/dev/ci/internal/ci/wolfi_operations_test.go b/dev/ci/internal/ci/wolfi_operations_test.go similarity index 100% rename from enterprise/dev/ci/internal/ci/wolfi_operations_test.go rename to dev/ci/internal/ci/wolfi_operations_test.go diff --git a/enterprise/dev/ci/push_all.sh b/dev/ci/push_all.sh similarity index 100% rename from enterprise/dev/ci/push_all.sh rename to dev/ci/push_all.sh diff --git a/enterprise/dev/ci/scripts/annotate.sh b/dev/ci/scripts/annotate.sh similarity index 100% rename from enterprise/dev/ci/scripts/annotate.sh rename to dev/ci/scripts/annotate.sh diff --git a/enterprise/dev/ci/scripts/annotated-command.sh b/dev/ci/scripts/annotated-command.sh similarity index 94% rename from enterprise/dev/ci/scripts/annotated-command.sh rename to dev/ci/scripts/annotated-command.sh index 11587725428..d6b8a1fe44f 100755 --- a/enterprise/dev/ci/scripts/annotated-command.sh +++ b/dev/ci/scripts/annotated-command.sh @@ -71,7 +71,7 @@ if [ -n "${ANNOTATE_OPTS-''}" ]; then annotate_file_opts="$annotate_file_opts -t success" human_level="✅" ;; - *) + *) annotate_file_opts="$annotate_file_opts -t error" human_level="❌" ;; @@ -85,7 +85,7 @@ if [ -n "${ANNOTATE_OPTS-''}" ]; then fi # Generate annotation from file contents - eval "./enterprise/dev/ci/scripts/annotate.sh $annotate_file_opts <'$file'" + eval "./dev/ci/scripts/annotate.sh $annotate_file_opts <'$file'" done fi @@ -101,7 +101,7 @@ if [ -n "${TEST_REPORT_OPTS-''}" ]; then fi echo "handling $file" - eval "./enterprise/dev/ci/scripts/upload-test-report.sh $file $test_report_opts" + eval "./dev/ci/scripts/upload-test-report.sh $file $test_report_opts" done fi diff --git a/enterprise/dev/ci/scripts/app-token/BUILD.bazel b/dev/ci/scripts/app-token/BUILD.bazel similarity index 86% rename from enterprise/dev/ci/scripts/app-token/BUILD.bazel rename to dev/ci/scripts/app-token/BUILD.bazel index 95faec59ddd..3aa238a7bf7 100644 --- a/enterprise/dev/ci/scripts/app-token/BUILD.bazel +++ b/dev/ci/scripts/app-token/BUILD.bazel @@ -4,7 +4,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") go_library( name = "app-token_lib", srcs = ["main.go"], - importpath = "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/scripts/app-token", + importpath = "github.com/sourcegraph/sourcegraph/dev/ci/scripts/app-token", visibility = ["//visibility:private"], deps = [ "//lib/errors", @@ -26,7 +26,7 @@ go_test( embed = [":app-token_lib"], env = {"BUILDKITE": "true"}, tags = [ - # ==================== Test output for //enterprise/dev/ci/scripts/app-token:app-token_test: + # ==================== Test output for //dev/ci/scripts/app-token:app-token_test: # 2023/02/23 01:51:39 GET https://api.github.com/orgs/sourcegraph/installation: 401 A JSON web token could not be decoded [] # TODO(bazel): fix test; failing due to missing auth token "manual", diff --git a/enterprise/dev/ci/scripts/app-token/main.go b/dev/ci/scripts/app-token/main.go similarity index 100% rename from enterprise/dev/ci/scripts/app-token/main.go rename to dev/ci/scripts/app-token/main.go diff --git a/enterprise/dev/ci/scripts/app-token/main_test.go b/dev/ci/scripts/app-token/main_test.go similarity index 100% rename from enterprise/dev/ci/scripts/app-token/main_test.go rename to dev/ci/scripts/app-token/main_test.go diff --git a/enterprise/dev/ci/scripts/app-token/tests/testdata/TestGetInstallAccessToken.yaml b/dev/ci/scripts/app-token/tests/testdata/TestGetInstallAccessToken.yaml similarity index 100% rename from enterprise/dev/ci/scripts/app-token/tests/testdata/TestGetInstallAccessToken.yaml rename to dev/ci/scripts/app-token/tests/testdata/TestGetInstallAccessToken.yaml diff --git a/enterprise/dev/ci/scripts/buildevent_file b/dev/ci/scripts/buildevent_file similarity index 100% rename from enterprise/dev/ci/scripts/buildevent_file rename to dev/ci/scripts/buildevent_file diff --git a/enterprise/dev/ci/scripts/check-dependency-soft-fail.sh b/dev/ci/scripts/check-dependency-soft-fail.sh similarity index 100% rename from enterprise/dev/ci/scripts/check-dependency-soft-fail.sh rename to dev/ci/scripts/check-dependency-soft-fail.sh diff --git a/enterprise/dev/ci/scripts/compare-hash.sh b/dev/ci/scripts/compare-hash.sh similarity index 100% rename from enterprise/dev/ci/scripts/compare-hash.sh rename to dev/ci/scripts/compare-hash.sh diff --git a/enterprise/dev/ci/scripts/release-app.sh b/dev/ci/scripts/release-app.sh similarity index 100% rename from enterprise/dev/ci/scripts/release-app.sh rename to dev/ci/scripts/release-app.sh diff --git a/enterprise/dev/ci/scripts/sentry-capture.sh b/dev/ci/scripts/sentry-capture.sh similarity index 100% rename from enterprise/dev/ci/scripts/sentry-capture.sh rename to dev/ci/scripts/sentry-capture.sh diff --git a/enterprise/dev/ci/scripts/upload-build-logs.sh b/dev/ci/scripts/upload-build-logs.sh similarity index 88% rename from enterprise/dev/ci/scripts/upload-build-logs.sh rename to dev/ci/scripts/upload-build-logs.sh index 3225679e2af..2a68259a4db 100755 --- a/enterprise/dev/ci/scripts/upload-build-logs.sh +++ b/dev/ci/scripts/upload-build-logs.sh @@ -39,7 +39,7 @@ echo "~~~ :file_cabinet: Uploading logs" # Passing --state="" just overrides the default. It's not set to any specific state because this script caller # is responsible of making sure the job has failed. export SG_DISABLE_OUTPUT_DETECTION=true -./enterprise/dev/ci/scripts/sentry-capture.sh ./sg ci logs --out="$BUILD_LOGS_LOKI_URL" --state="" --overwrite-state="failed" --build="$BUILDKITE_BUILD_NUMBER" --job="$BUILDKITE_JOB_ID" +./dev/ci/scripts/sentry-capture.sh ./sg ci logs --out="$BUILD_LOGS_LOKI_URL" --state="" --overwrite-state="failed" --build="$BUILDKITE_BUILD_NUMBER" --job="$BUILDKITE_JOB_ID" local_exit_code=$? if [[ $local_exit_code -ne 0 ]]; then echo -e "\033[33m┌────────────────────────────────────────────────────────────────────┐\033[0m" diff --git a/enterprise/dev/ci/scripts/upload-buildevent-report.sh b/dev/ci/scripts/upload-buildevent-report.sh similarity index 71% rename from enterprise/dev/ci/scripts/upload-buildevent-report.sh rename to dev/ci/scripts/upload-buildevent-report.sh index e9605db79e3..d0984a463d7 100755 --- a/enterprise/dev/ci/scripts/upload-buildevent-report.sh +++ b/dev/ci/scripts/upload-buildevent-report.sh @@ -7,5 +7,5 @@ export BUILDEVENT_DATASET traceURL=$(buildevents build "$BUILDKITE_BUILD_ID" "$BUILD_START_TIME" success) - echo "View the [**build trace**]($traceURL)" | ./enterprise/dev/ci/scripts/annotate.sh -m -t info + echo "View the [**build trace**]($traceURL)" | ./dev/ci/scripts/annotate.sh -m -t info ) diff --git a/enterprise/dev/ci/scripts/upload-test-report.sh b/dev/ci/scripts/upload-test-report.sh similarity index 100% rename from enterprise/dev/ci/scripts/upload-test-report.sh rename to dev/ci/scripts/upload-test-report.sh diff --git a/enterprise/dev/ci/scripts/wolfi/build-base-image.sh b/dev/ci/scripts/wolfi/build-base-image.sh similarity index 98% rename from enterprise/dev/ci/scripts/wolfi/build-base-image.sh rename to dev/ci/scripts/wolfi/build-base-image.sh index a6706b2476c..c1a18be1940 100755 --- a/enterprise/dev/ci/scripts/wolfi/build-base-image.sh +++ b/dev/ci/scripts/wolfi/build-base-image.sh @@ -151,6 +151,6 @@ if [[ "$IS_MAIN" != "true" ]]; then echo -e "Run the \`${name}\` base image locally using: \`\`\` docker pull us.gcr.io/sourcegraph-dev/wolfi-${name}-base:${tag} - \`\`\`" | "$REPO_DIR/enterprise/dev/ci/scripts/annotate.sh" -m -t "info" + \`\`\`" | "$REPO_DIR/dev/ci/scripts/annotate.sh" -m -t "info" fi fi diff --git a/enterprise/dev/ci/scripts/wolfi/build-package.sh b/dev/ci/scripts/wolfi/build-package.sh similarity index 97% rename from enterprise/dev/ci/scripts/wolfi/build-package.sh rename to dev/ci/scripts/wolfi/build-package.sh index 127823c3af4..89ab68b9dc1 100755 --- a/enterprise/dev/ci/scripts/wolfi/build-package.sh +++ b/dev/ci/scripts/wolfi/build-package.sh @@ -67,5 +67,5 @@ buildkite-agent artifact upload packages/*/* # Upload package to repo, and finish with same exit code popd -./enterprise/dev/ci/scripts/wolfi/upload-package.sh +./dev/ci/scripts/wolfi/upload-package.sh exit $? diff --git a/enterprise/dev/ci/scripts/wolfi/build-repo-index.sh b/dev/ci/scripts/wolfi/build-repo-index.sh similarity index 100% rename from enterprise/dev/ci/scripts/wolfi/build-repo-index.sh rename to dev/ci/scripts/wolfi/build-repo-index.sh diff --git a/enterprise/dev/ci/scripts/wolfi/upload-package.sh b/dev/ci/scripts/wolfi/upload-package.sh similarity index 95% rename from enterprise/dev/ci/scripts/wolfi/upload-package.sh rename to dev/ci/scripts/wolfi/upload-package.sh index ce52eb57231..fbda980dabe 100755 --- a/enterprise/dev/ci/scripts/wolfi/upload-package.sh +++ b/dev/ci/scripts/wolfi/upload-package.sh @@ -53,7 +53,7 @@ for apk in "${apks[@]}"; do if gsutil -q -u "$GCP_PROJECT" stat "${dest_path_main}${apk}"; then echo -e "The production package repository already contains the package '$package_name' version '$package_version' at '${dest_path_main}${apk}'.\n\n Resolve this issue by incrementing the 'epoch' field in the package's YAML file." | - ../../../enterprise/dev/ci/scripts/annotate.sh -t "error" + ../../../dev/ci/scripts/annotate.sh -t "error" # Soft fail at the end - we still want to allow the package to be uploaded for cases like a Buildkite pipeline being rerun error="true" @@ -81,7 +81,7 @@ contents: - '@branch https://packages.sgdev.org/${BRANCH_PATH}' packages: $package_usage_list - \`\`\`" | ../../../enterprise/dev/ci/scripts/annotate.sh -m -t "info" + \`\`\`" | ../../../dev/ci/scripts/annotate.sh -m -t "info" fi fi diff --git a/dev/codecov.yml b/dev/codecov.yml index 7204e832601..bda2fcbb842 100644 --- a/dev/codecov.yml +++ b/dev/codecov.yml @@ -8,8 +8,8 @@ coverage: informational: true paths: - cmd/symbols - - enterprise/cmd/precise-code-intel-* - - enterprise/internal/codeintel + - cmd/precise-code-intel-* + - internal/codeintel batches: informational: true paths: diff --git a/dev/release/src/release.ts b/dev/release/src/release.ts index a8a1060850d..eced941ca7b 100644 --- a/dev/release/src/release.ts +++ b/dev/release/src/release.ts @@ -724,7 +724,7 @@ cc @${release.captainGitHubUsername} // Support current release as the "previous release" going forward notPatchRelease - ? `comby -in-place 'const minimumUpgradeableVersion = ":[1]"' 'const minimumUpgradeableVersion = "${release.version.version}"' enterprise/dev/ci/internal/ci/*.go` + ? `comby -in-place 'const minimumUpgradeableVersion = ":[1]"' 'const minimumUpgradeableVersion = "${release.version.version}"' dev/ci/internal/ci/*.go` : 'echo "Skipping minimumUpgradeableVersion bump on patch release"', updateUpgradeGuides(release.previous.version, release.version.version), `comby -in-place 'git_versions=(:[1])' 'git_versions=(:[1] v${release.version.version})' cmd/migrator/generate.sh`, diff --git a/dev/sg/ci/subcommands.go b/dev/sg/ci/subcommands.go index 519670e5f91..0af6ac7ba99 100644 --- a/dev/sg/ci/subcommands.go +++ b/dev/sg/ci/subcommands.go @@ -68,7 +68,7 @@ var previewCommand = &cli.Command{ } switch cmd.String("format") { case "markdown": - previewCmd = usershell.Command(cmd.Context, "go run ./enterprise/dev/ci/gen-pipeline.go -preview"). + previewCmd = usershell.Command(cmd.Context, "go run ./dev/ci/gen-pipeline.go -preview"). Env(env) out, err := root.Run(previewCmd).String() if err != nil { @@ -76,7 +76,7 @@ var previewCommand = &cli.Command{ } return std.Out.WriteMarkdown(out) case "json": - previewCmd = usershell.Command(cmd.Context, "go run ./enterprise/dev/ci/gen-pipeline.go"). + previewCmd = usershell.Command(cmd.Context, "go run ./dev/ci/gen-pipeline.go"). Env(env) out, err := root.Run(previewCmd).String() if err != nil { @@ -84,7 +84,7 @@ var previewCommand = &cli.Command{ } return std.Out.WriteCode("json", out) case "yaml": - previewCmd = usershell.Command(cmd.Context, "go run ./enterprise/dev/ci/gen-pipeline.go -yaml"). + previewCmd = usershell.Command(cmd.Context, "go run ./dev/ci/gen-pipeline.go -yaml"). Env(env) out, err := root.Run(previewCmd).String() if err != nil { @@ -615,7 +615,7 @@ var docsCommand = &cli.Command{ Usage: "Render reference documentation for build pipeline types", Description: "An online version of the rendered documentation is also available in https://docs.sourcegraph.com/dev/background-information/ci/reference.", Action: func(ctx *cli.Context) error { - cmd := exec.Command("go", "run", "./enterprise/dev/ci/gen-pipeline.go", "-docs") + cmd := exec.Command("go", "run", "./dev/ci/gen-pipeline.go", "-docs") out, err := run.InRoot(cmd) if err != nil { return err diff --git a/dev/sg/internal/images/BUILD.bazel b/dev/sg/internal/images/BUILD.bazel index 5cf603c3e6d..5cecb7314e7 100644 --- a/dev/sg/internal/images/BUILD.bazel +++ b/dev/sg/internal/images/BUILD.bazel @@ -15,9 +15,9 @@ go_library( importpath = "github.com/sourcegraph/sourcegraph/dev/sg/internal/images", visibility = ["//dev/sg:__subpackages__"], deps = [ + "//dev/ci/images", "//dev/sg/internal/docker", "//dev/sg/internal/std", - "//enterprise/dev/ci/images", "//lib/errors", "//lib/output", "@com_github_distribution_distribution_v3//reference", @@ -36,5 +36,5 @@ go_test( timeout = "short", srcs = ["images_test.go"], embed = [":images"], - deps = ["//enterprise/dev/ci/images"], + deps = ["//dev/ci/images"], ) diff --git a/dev/sg/internal/images/images_test.go b/dev/sg/internal/images/images_test.go index 9e7a9d29238..7cbbd605e74 100644 --- a/dev/sg/internal/images/images_test.go +++ b/dev/sg/internal/images/images_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images" + "github.com/sourcegraph/sourcegraph/dev/ci/images" ) func mustTime() time.Time { diff --git a/dev/sg/internal/images/registry.go b/dev/sg/internal/images/registry.go index 8107315dc13..59de8d760d9 100644 --- a/dev/sg/internal/images/registry.go +++ b/dev/sg/internal/images/registry.go @@ -6,7 +6,8 @@ import ( "github.com/distribution/distribution/v3/reference" "github.com/opencontainers/go-digest" - "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images" + + "github.com/sourcegraph/sourcegraph/dev/ci/images" "github.com/sourcegraph/sourcegraph/lib/errors" ) diff --git a/dev/sg/internal/sgconf/config_test.go b/dev/sg/internal/sgconf/config_test.go index 84ebfefedf8..fe2f939e0b5 100644 --- a/dev/sg/internal/sgconf/config_test.go +++ b/dev/sg/internal/sgconf/config_test.go @@ -88,7 +88,6 @@ commands: - lib - internal - cmd/frontend - - enterprise/internal ` config, err := parseConfig([]byte(a)) if err != nil { @@ -124,7 +123,6 @@ commands: "lib", "internal", "cmd/frontend", - "enterprise/internal", }, } diff --git a/dev/sg/linters/go_checks.go b/dev/sg/linters/go_checks.go index 3e87362da0d..1ca9bba08b4 100644 --- a/dev/sg/linters/go_checks.go +++ b/dev/sg/linters/go_checks.go @@ -62,7 +62,7 @@ func lintLoggingLibraries() *linter { }, AllowedFiles: []string{ // Let everything in dev use whatever they want - "dev", "enterprise/dev", + "dev", // Banned imports will match on the linter here "dev/sg/linters", // We allow one usage of a direct zap import here diff --git a/dev/sg/linters/linters.go b/dev/sg/linters/linters.go index 58ed839b78e..cefdd15c9c7 100644 --- a/dev/sg/linters/linters.go +++ b/dev/sg/linters/linters.go @@ -22,7 +22,7 @@ type linter = check.Check[*repo.State] // Targets lists all available linter targets. Each target consists of multiple linters. // -// These should align with the names in 'enterprise/dev/ci/internal/ci/changed' +// These should align with the names in 'dev/ci/internal/ci/changed' var Targets = []Target{ { Name: "urls", diff --git a/doc/admin/updates/migrator/migrator-operations.md b/doc/admin/updates/migrator/migrator-operations.md index c82092a5046..1d1459b1c0a 100644 --- a/doc/admin/updates/migrator/migrator-operations.md +++ b/doc/admin/updates/migrator/migrator-operations.md @@ -416,6 +416,6 @@ The log output of the `migrator` should include `INFO`-level logs and successful ### Local development -To run the migrator locally, simply run `go run ./cmd/migrator` or `go run ./cmd/migrator`. +To run the migrator locally, simply run `go run ./cmd/migrator`. Many of the commands detailed above are also available via `sg`. Replace `migrator` with `sg migration ...`. There are a few command registered on the `migrator` but not on `sg` (e.g., `upgrade` and `downgrade`), as local environments are a bit of a different beast than environments performing upgrades only along tagged releases. diff --git a/doc/code_navigation/references/precise_examples.md b/doc/code_navigation/references/precise_examples.md index 41ec4786208..d882659185c 100644 --- a/doc/code_navigation/references/precise_examples.md +++ b/doc/code_navigation/references/precise_examples.md @@ -3,7 +3,7 @@ The following repositories have precise code navigation enabled: ## Go -- [sourcegraph/sourcegraph](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@1757b34fab070301db5cd221eaf7d6bf039d16d3/-/blob/enterprise/cmd/executor/internal/apiclient/client.go?L230:18&popover=pinned) +- [sourcegraph/sourcegraph](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@1757b34fab070301db5cd221eaf7d6bf039d16d3/-/blob/cmd/executor/internal/apiclient/client.go?L230:18&popover=pinned) - [kubernetes/kubernetes](https://sourcegraph.com/github.com/kubernetes/kubernetes@f4abde9e57cc30efcc8f79c9ebd791d15f4164c4/-/blob/cmd/cloud-controller-manager/main.go?L45:2&popover=pinned) - [gohugoio/hugo](https://sourcegraph.com/github.com/gohugoio/hugo@d1278f696aa062950471587bf3dc4a1604cf5d5b/-/blob/common/hugo/hugo.go?L63:15&popover=pinned) - [gin-gonic/gin](https://sourcegraph.com/github.com/gin-gonic/gin@6de2245e6265a077326d13cb249378b2d27ad781/-/blob/routergroup.go?L33:6&popover=pinned) @@ -36,4 +36,4 @@ The following repositories have precise code navigation enabled: ## Rust - [rust-lang/cargo](https://sourcegraph.com/github.com/rust-lang/cargo/-/blob/src/cargo/core/compiler/compilation.rs?L15:12&popover=pinned#tab=references) -- [rust-lang/rustlings](https://sourcegraph.com/github.com/rust-lang/rustlings@c923e7af73a91970d2e63e03babbca9cc0817551/-/blob/src/verify.rs?L147:15&popover=pinned) \ No newline at end of file +- [rust-lang/rustlings](https://sourcegraph.com/github.com/rust-lang/rustlings@c923e7af73a91970d2e63e03babbca9cc0817551/-/blob/src/verify.rs?L147:15&popover=pinned) diff --git a/doc/dependency_decisions.yml b/doc/dependency_decisions.yml index 03a8708aaee..58dc68318ab 100644 --- a/doc/dependency_decisions.yml +++ b/doc/dependency_decisions.yml @@ -2,7 +2,7 @@ - - :restrict - unknown - &1 - :who: + :who: :why: Import licenses-npm.sh FAIL_ON :versions: [] :when: 2020-06-05 18:25:53.630259000 Z @@ -30,7 +30,7 @@ - - :permit - 0BSD - &2 - :who: + :who: :why: Import approved licenses from ThirdPartyLicensesNpm.csv :versions: [] :when: 2020-06-05 19:02:14.987331000 Z @@ -105,7 +105,7 @@ - *2 - - :ignore_group - devDependencies - - :who: + - :who: :why: Exclude development dependencies that are not included in bundles :versions: [] :when: 2020-06-05 21:28:58.197862000 Z @@ -113,8 +113,8 @@ - sourcegraph - Apache-2.0 - &3 - :who: - :why: + :who: + :why: :versions: [] :when: 2020-06-15 06:45:58.540797000 Z - - :homepage @@ -303,25 +303,25 @@ - *3 - - :ignore - github.com/OpenPeeDeeP/depguard - - :who: + - :who: :why: Development dependency :versions: [] :when: 2020-06-16 02:19:49.896604000 Z - - :ignore - github.com/golangci/check - - :who: + - :who: :why: Development dependency :versions: [] :when: 2020-06-16 02:20:06.274998000 Z - - :name_project - sourcegraph/sourcegraph - - :who: - :why: + - :who: + :why: :versions: [] :when: 2020-06-16 02:20:33.870044000 Z - - :approve - mdi-react - - :who: + - :who: :why: Seems to be a bug approving this dependency, despite its license already being on the approvelist :versions: [] @@ -329,95 +329,95 @@ - - :license - github.com/sourcegraph/gosaml2 - Apache 2.0 - - :who: - :why: + - :who: + :why: :versions: [] :when: 2020-08-12 08:03:13.360476000 Z - - :permit - CC-BY-4.0 - - :who: + - :who: :why: Used by caniuse-lite :when: 2020-09-23 12:14:34.205000000 Z - - :ignore - - "./enterprise/dev/ci/images" - - :who: + - "./dev/ci/images" + - :who: :why: Internal module :versions: [] :when: 2020-11-29 06:02:35.623296000 Z - - :ignore - "./lib" - - :who: + - :who: :why: Internal module :versions: [] :when: 2021-03-09 19:42:12.214862934 Z - - :license - github.com/aws/smithy-go - Apache 2.0 - - :who: + - :who: :why: Inference broken, LICENSE file lives at https://github.com/aws/smithy-go/blob/main/LICENSE :versions: [] :when: 2021-04-14 12:51:19.503802000 Z - - :permit - Python-2.0 - - :who: + - :who: :why: Used by argparse :versions: [] :when: 2021-10-12 11:17:37.706276000 Z - - :license - github.com/DataDog/sketches-go - Apache 2.0 - - :who: - :why: + - :who: + :why: :versions: [] :when: 2022-02-18 21:09:06.289293214 Z - - :license - github.com/layeh/gopher-json - Public domain - - :who: - :why: + - :who: + :why: :versions: [] :when: 2022-04-18 21:25:36.854878000 Z - - :ignore - root-workspace-0b6124 - - :who: - :why: + - :who: + :why: :versions: [] :when: 2022-12-05 09:54:08.112251000 Z - - :ignore - trim - - :who: - :why: + - :who: + :why: :versions: [] :when: 2022-12-05 09:54:31.944623000 Z - - :ignore - "./monitoring" - - :who: + - :who: :why: Internal module :versions: [] :when: 2022-12-16 22:04:46.864944000 Z - - :license - "@atlassian/aui" - Apache 2.0 - - :who: + - :who: :why: Inference broken, LICENSE file lives at https://bitbucket.org/atlassian/aui/src/master/packages/core/LICENSE.md :versions: [] :when: 2023-01-09 04:35:08.321179000 Z - - :license - browser-assert - MIT - - :who: + - :who: :why: Inference broken, LICENSE file lives at https://github.com/socialally/browser-assert/blob/master/LICENSE :versions: [] :when: 2023-01-09 04:44:39.507826000 Z - - :ignore - buffers - - :who: + - :who: :why: No LICENSE file, see https://www.npmjs.com/package/buffers :versions: [] :when: 2023-01-09 04:47:26.508863000 Z - - :permit - MIT/X11 - - :who: + - :who: :why: The MIT license and the MIT/X11 license are actually the same thing. The MIT/X11 license is just an older name for the MIT license, which was adopted in the 1980s when the X Window System (also known as X11) was popular. @@ -425,120 +425,120 @@ :when: 2023-01-09 04:50:14.994464000 Z - - :permit - Public Domain - - :who: + - :who: :why: The Public Domain license is a legal designation that indicates that a work is not protected by copyright and can be used freely by anyone, for any purpose. :versions: [] :when: 2023-01-09 04:53:01.534607000 Z - - :ignore - language-tags - - :who: + - :who: :why: Used by the `eslint-plugin-jsx-a11y` dependency. :versions: [] :when: 2023-01-09 04:55:27.641853000 Z - - :ignore - language-subtag-registry - - :who: + - :who: :why: Used by the `eslint-plugin-jsx-a11y` dependency. :versions: [] :when: 2023-01-09 04:55:27.641853000 Z - - :license - skatejs-template-html - MIT - - :who: + - :who: :why: Inference broken, LICENSE file lives at https://www.npmjs.com/package/skatejs-template-html#license :versions: [] :when: 2023-01-09 04:56:45.936694000 Z - - :license - stdin - MIT - - :who: + - :who: :why: Inference broken, LICENSE file lives at https://www.npmjs.com/package/stdin#license :versions: [] :when: 2023-01-09 04:58:41.642155000 Z - - :ignore - eslint-plugin-deprecation - - :who: + - :who: :why: dependency from backstage :versions: [] :when: 2023-01-19 20:03:11.764982000 Z - - :ignore - fast-shallow-equal - - :who: + - :who: :why: dependency from backstage :versions: [] :when: 2023-01-19 20:03:33.000495000 Z - - :ignore - pako - - :who: + - :who: :why: dependency from backstage :versions: [] :when: 2023-01-19 20:03:51.213298000 Z - - :ignore - react-universal-interface - - :who: + - :who: :why: dependency from backstage :versions: [] :when: 2023-01-19 20:04:06.690991000 Z - - :ignore - tosource - - :who: + - :who: :why: dependency from backstage :versions: [] :when: 2023-01-19 20:25:48.126482000 Z - - :ignore - rollup-plugin-dts - - :who: + - :who: :why: dependency from backstage :versions: [] :when: 2023-01-19 20:26:01.138835000 Z - - :license - github.com/xi2/xz - Public domain - - :who: - :why: + - :who: + :why: :versions: [] :when: 2023-01-12 01:20:17.504279000 Z - - :license - github.com/hashicorp/cronexpr - Apache 2.0 - - :who: - :why: + - :who: + :why: :versions: [] :when: 2023-06-02 13:33:29.979046000 Z - - :license - "@jspm/core" - Apache 2.0 - - :who: - :why: + - :who: + :why: :versions: [] :when: 2023-06-19 14:46:26.158816000 Z - - :license - require-like - MIT - - :who: - :why: + - :who: + :why: :versions: [] :when: 2023-06-19 14:47:16.005983000 Z - - :license - github.com/ricochet2200/go-disk-usage/du - Unlicense - - :who: - :why: + - :who: + :why: :versions: [] :when: 2023-06-19 19:11:34.298774000 Z - - :license - github.com/hashicorp/go-retryablehttp - MPL-2.0 - - :who: - :why: + - :who: + :why: :versions: [] :when: 2023-07-17 17:10:16.265371000 Z - - :approve - github.com/hashicorp/go-retryablehttp - &4 - :who: - :why: + :who: + :why: :versions: [] :when: 2023-07-17 18:09:46.313307000 Z - - :approve @@ -546,21 +546,21 @@ - *4 - - :permit - BlueOak-1.0.0 - - :who: + - :who: :why: Approved permissive license (https://handbook.sourcegraph.com/departments/engineering/dev/process/licenses/#allowed-licenses-permissive-licenses) :versions: [] :when: 2023-07-27 21:22:46.362043095 Z - - :license - github.com/hashicorp/terraform-cdk-go/cdktf - MPL-2.0 - - :who: - :why: + - :who: + :why: :versions: [] :when: 2023-08-23 22:45:52.736440000 Z - - :license - github.com/hashicorp/go-tfe - MPL-2.0 - - :who: - :why: + - :who: + :why: :versions: [] :when: 2023-09-06 22:04:27.722891000 Z diff --git a/doc/dev/background-information/ci/development.md b/doc/dev/background-information/ci/development.md index 9bbcc80f7fe..89f88053814 100644 --- a/doc/dev/background-information/ci/development.md +++ b/doc/dev/background-information/ci/development.md @@ -4,7 +4,7 @@ This document covers information about contributing to [Sourcegraph's continuous ## Pipeline generator -The source code of [Sourcegraph's Buildkite pipelines](./index.md#buildkite-pipelines) generator is in [`/enterprise/dev/ci`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@main/-/tree/enterprise/dev/ci). +The source code of [Sourcegraph's Buildkite pipelines](./index.md#buildkite-pipelines) generator is in [`/dev/ci`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@main/-/tree/dev/ci). Internally, the pipeline generator determines what gets run over contributions based on: 1. [Run types](#run-types), determined by branch naming conventions, tags, and environment variables @@ -51,14 +51,14 @@ If you are looking to modify the pipeline, some good rules of thumbs for which c To create a new check that can run on pull requests on relevant files, refer to how [diff types](#diff-types) work to get started. -Then, you can add a new check to [`CoreTestOperations`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Eenterprise/dev/ci/internal/ci+CoreTestOperations+type:symbol+&patternType=literal). +Then, you can add a new check to [`CoreTestOperations`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Edev/ci/internal/ci+CoreTestOperations+type:symbol+&patternType=literal). Make sure to follow the best practices outlined in docstring. For more advanced pipelines, see [Run types](#run-types). ### Step options -Each [operation](#operations) is composed of steps that are built via step options, defined as [implementations of the `StepOpt` interface](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/enterprise/dev/ci/internal/buildkite/buildkite.go?L229:6#tab=implementations_go). The core step option is `Cmd`, which defines a command to run when added to a pipeline via `AddStep`: +Each [operation](#operations) is composed of steps that are built via step options, defined as [implementations of the `StepOpt` interface](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/dev/ci/internal/buildkite/buildkite.go?L229:6#tab=implementations_go). The core step option is `Cmd`, which defines a command to run when added to a pipeline via `AddStep`: ```go func addGoBuild(pipeline *bk.Pipeline) { @@ -105,7 +105,7 @@ An annotation can be rendered as Markdown instead by using the `.md` extension, echo -e "$OUT" >./annotations/docsite.md ``` -For more details about best practices and additional features and capabilities, please refer to [the `bk.AnnotatedCmd` docstring](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Eenterprise/dev/ci/internal/buildkite+AnnotatedCmd+type:symbol&patternType=literal). +For more details about best practices and additional features and capabilities, please refer to [the `bk.AnnotatedCmd` docstring](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Edev/ci/internal/buildkite+AnnotatedCmd+type:symbol&patternType=literal). #### Caching build artefacts @@ -119,7 +119,7 @@ Cached artefacts are *automatically expired after 30 days* (by an object lifecyc #### Failure logs -Every failure in the `sourcegraph/sourcegraph` CI pipeline for `main` also [uploads logs using `sg` to Loki](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/enterprise/dev/upload-build-logs.sh). +Every failure in the `sourcegraph/sourcegraph` CI pipeline for `main` also [uploads logs using `sg` to Loki](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/dev/upload-build-logs.sh). We do not publish data for successful builds or branch builds (for those, you can refer to our [build traces](https://docs.sourcegraph.com/dev/background-information/ci/development#pipeline-command-tracing)). For a brief overview, check out the [CI dashboard](https://sourcegraph.grafana.net/d/iBBWbxFnk/ci?orgId=1), which is a set of graphs based on the contents of uploaded logs. @@ -175,7 +175,7 @@ The pipeline generator provides an API for this that, at a high level, works lik 4. That's it! -For more details about best practices and additional features and capabilities, please refer to [the `bk.AnnotatedCmd` docstring](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Eenterprise/dev/ci/internal/buildkite+AnnotatedCmd+type:symbol&patternType=literal). +For more details about best practices and additional features and capabilities, please refer to [the `bk.AnnotatedCmd` docstring](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Edev/ci/internal/buildkite+AnnotatedCmd+type:symbol&patternType=literal). > WARNING: The Buildkite API is not finalized and neither are the configuration options for `TestReportOpts`. > To get started with Buildkite Analytics please reach out to the `#dev-experience` channel for assistance. @@ -196,7 +196,7 @@ Also see [Flaky infrastructure](#flaky-infrastructure), [Continous integration i To set up Buildkite to use the rendered pipeline, add the following step in the [pipeline settings](https://buildkite.com/sourcegraph/sourcegraph/settings): ```shell -go run ./enterprise/dev/ci/gen-pipeline.go | buildkite-agent pipeline upload +go run ./dev/ci/gen-pipeline.go | buildkite-agent pipeline upload ``` #### Managing secrets diff --git a/doc/dev/background-information/ci/index.md b/doc/dev/background-information/ci/index.md index 05fe76c7707..b3b4fa09bf5 100644 --- a/doc/dev/background-information/ci/index.md +++ b/doc/dev/background-information/ci/index.md @@ -32,7 +32,7 @@ Sourcegraph also maintains a variety of tooling on [GitHub Actions](#github-acti ## Buildkite pipelines [Tests](../../how-to/testing.md) are automatically run in our [various Buildkite pipelines](https://buildkite.com/sourcegraph) when you push your changes (i.e. when you run `git push`) to the `sourcegraph/sourcegraph` GitHub repository. -Pipeline steps are generated on the fly using the [pipeline generator](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@main/-/tree/enterprise/dev/ci) - a complete reference of all available pipeline types and steps is available in the generated [Pipeline reference](./reference.md). To keep the repository tidy, consider deleting the branch after the pipeline has completed. The build results will be available even after the branch is deleted. +Pipeline steps are generated on the fly using the [pipeline generator](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@main/-/tree/dev/ci) - a complete reference of all available pipeline types and steps is available in the generated [Pipeline reference](./reference.md). To keep the repository tidy, consider deleting the branch after the pipeline has completed. The build results will be available even after the branch is deleted. You can also see these docs locally with `sg ci docs`. To see what checks will get run against your current branch, use [`sg`](../../setup/quickstart.md): @@ -64,7 +64,7 @@ In the Buildkite UI, soft failures currently look like the following, with a _tr We use soft failures for the following reasons only: - Steps that determine whether a subsequent step should run, where soft failures are the only technical way to communicate that a later step should be skipped in this manner using Buildkite. - - Examples: [hash comparison steps that determine if a build should run](https://sourcegraph.com/search?q=context:%40sourcegraph/all+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Eenterprise/dev/ci/internal/ci/operations%5C.go+compare-hash.sh&patternType=literal) + - Examples: [hash comparison steps that determine if a build should run](https://sourcegraph.com/search?q=context:%40sourcegraph/all+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Edev/ci/internal/ci/operations%5C.go+compare-hash.sh&patternType=literal) - Regular analysis tasks, where soft failures serve as an monitoring indicator to warn the team responsible for fixing issues. - Examples: [image vulnerability scanning](#image-vulnerability-scanning), linting tasks for catching deprecation warnings - Temporary exceptions to accommodate experimental or in-progress work. @@ -144,8 +144,8 @@ If a step is flaky we need to get the build back to reliable as soon as possible An example use of `Skip`: ```diff ---- a/enterprise/dev/ci/internal/ci/operations.go -+++ b/enterprise/dev/ci/internal/ci/operations.go +--- a/dev/ci/internal/ci/operations.go ++++ b/dev/ci/internal/ci/operations.go @@ -260,7 +260,9 @@ func addGoBuild(pipeline *bk.Pipeline) { func addDockerfileLint(pipeline *bk.Pipeline) { pipeline.AddStep(":docker: Lint", diff --git a/doc/dev/background-information/ci/reference.md b/doc/dev/background-information/ci/reference.md index d0ebcc05def..ad3c7161b68 100644 --- a/doc/dev/background-information/ci/reference.md +++ b/doc/dev/background-information/ci/reference.md @@ -1,4 +1,4 @@ - + # Pipeline types reference diff --git a/doc/dev/background-information/testing_principles.md b/doc/dev/background-information/testing_principles.md index 13923add0aa..c686a64d19f 100644 --- a/doc/dev/background-information/testing_principles.md +++ b/doc/dev/background-information/testing_principles.md @@ -139,7 +139,6 @@ The list below designates source code exempt from the testing guidelines because - [sourcegraph/sourcegraph](https://github.com/sourcegraph/sourcegraph) - `dev/*`: internal tools, scripts for the local environment and continuous integration. - - `enterprise/dev/*`: internal tools, scripts for the local environment and continuous integration that fall under the [Sourcegraph Enterprise license](https://github.com/sourcegraph/sourcegraph/blob/main/LICENSE.enterprise). - Dev environment configuration (e.g. `.editorconfig`, `shell.nix`, etc.) To indicate exceptions like these, simply write `n/a` within your pull request's [test plan](#test-plans). diff --git a/doc/dev/how-to/ci_soft_failure_and_still_notify.md b/doc/dev/how-to/ci_soft_failure_and_still_notify.md index 74ecee1f587..9962321c806 100644 --- a/doc/dev/how-to/ci_soft_failure_and_still_notify.md +++ b/doc/dev/how-to/ci_soft_failure_and_still_notify.md @@ -8,7 +8,7 @@ Therefore a good solution for that is to also enable custom step notifications, ## Editing your step to make it soft failing -In the [CI pipeline generator](../background-information/ci/development.md), you'll find the code that declare all steps, usually located in [ci/operations.go](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/enterprise/dev/ci/internal/ci/operations.go) +In the [CI pipeline generator](../background-information/ci/development.md), you'll find the code that declare all steps, usually located in [ci/operations.go](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/dev/ci/internal/ci/operations.go) A good way to find all of them is the following search query: @@ -21,8 +21,8 @@ A good way to find all of them is the following search query: Let's use as an example the following: ```diff ---- a/enterprise/dev/ci/internal/ci/operations.go -+++ b/enterprise/dev/ci/internal/ci/operations.go +--- a/dev/ci/internal/ci/operations.go ++++ b/dev/ci/internal/ci/operations.go func addJetBrainsUnitTests(pipeline *bk.Pipeline) { pipeline.AddStep(":jest::java: Test (client/jetbrains)", withPnpmCache(), @@ -43,8 +43,8 @@ Now we want to add a custom notification as well: > NOTE: You don't need to provide `buildkite.SlackStepNotifyConfigPayload.SlackTokenEnvVarName`, a default value will be injected. ```diff ---- a/enterprise/dev/ci/internal/ci/operations.go -+++ b/enterprise/dev/ci/internal/ci/operations.go +--- a/dev/ci/internal/ci/operations.go ++++ b/dev/ci/internal/ci/operations.go func addJetBrainsUnitTests(pipeline *bk.Pipeline) { pipeline.AddStep(":jest::java: Test (client/jetbrains)", withPnpmCache(), @@ -70,8 +70,8 @@ And that's it! > NOTE: If you want to test your changes before merging your code, so you can see how the notification will look like, you can modify the step as following: ```diff ---- a/enterprise/dev/ci/internal/ci/operations.go -+++ b/enterprise/dev/ci/internal/ci/operations.go +--- a/dev/ci/internal/ci/operations.go ++++ b/dev/ci/internal/ci/operations.go unc addJetBrainsUnitTests(pipeline *bk.Pipeline) { pipeline.AddStep(":jest::java: Test (client/jetbrains)", withPnpmCache(), diff --git a/doc/dev/how-to/deploy_executor_image.md b/doc/dev/how-to/deploy_executor_image.md index 98a625b4d9e..c2226a5f162 100644 --- a/doc/dev/how-to/deploy_executor_image.md +++ b/doc/dev/how-to/deploy_executor_image.md @@ -15,7 +15,7 @@ This guide documents how to deploy a new image of [executors](../../../admin/exe ## Steps -1. Make a change to the `executor` code so that the buildkite build results in new `executor` AWS/GCP images being built & published. Or push to a branch with the [`executor-patch-notest/`](https://github.com/sourcegraph/sourcegraph/blob/882ed49014bc470a3be17ce74764a856f82bee4e/enterprise/dev/ci/internal/ci/runtype.go#L65-L67) prefix to trigger the build. +1. Make a change to the `executor` code so that the buildkite build results in new `executor` AWS/GCP images being built & published. Or push to a branch with the [`executor-patch-notest/`](https://github.com/sourcegraph/sourcegraph/blob/882ed49014bc470a3be17ce74764a856f82bee4e/dev/ci/internal/ci/runtype.go#L65-L67) prefix to trigger the build. 1. Look at the buildkite build. Example: https://buildkite.com/sourcegraph/sourcegraph/builds/116966 There are two steps with `executor-image` in here. The first one builds and uploads image. Second step releases it. diff --git a/doc/dev/how-to/receive_slack_notification_on_a_failed_ci_step.md b/doc/dev/how-to/receive_slack_notification_on_a_failed_ci_step.md index 93b89bae2cd..64d4914a722 100644 --- a/doc/dev/how-to/receive_slack_notification_on_a_failed_ci_step.md +++ b/doc/dev/how-to/receive_slack_notification_on_a_failed_ci_step.md @@ -23,8 +23,8 @@ In the [CI pipeline generator](../background-information/ci/development.md), whe > NOTE: You don't need to provide `buildkite.SlackStepNotifyConfigPayload.SlackTokenEnvVarName`, a default value will be injected. ```diff ---- a/enterprise/dev/ci/internal/ci/operations.go -+++ b/enterprise/dev/ci/internal/ci/operations.go +--- a/dev/ci/internal/ci/operations.go ++++ b/dev/ci/internal/ci/operations.go pipeline.AddStep(":camel: Crossing the desert", + bk.SlackStepNotify(&bk.SlackStepNotifyConfigPayload{ + Message: "Camel are thursty :water_wave: cc <@teamate>", // Can also reference a Slack user group diff --git a/doc/dev/how-to/update_ci_glossary.md b/doc/dev/how-to/update_ci_glossary.md index 2563a9881b7..391fb8919af 100644 --- a/doc/dev/how-to/update_ci_glossary.md +++ b/doc/dev/how-to/update_ci_glossary.md @@ -22,7 +22,7 @@ Why? This description covers both general context as well as Sourcegraph specifi ## Steps to update 1. Check out a new branch. -1. Edit `./enterprise/dev/ci/glossary.md`. +1. Edit `./dev/ci/glossary.md`. 1. Sort the entries by alphabetical order. 1. Commit and push. The CI build will show the newly edited annotation. 1. Submit the PR as usual. Set the DevX team as reviewers. diff --git a/doc/dev/how-to/wolfi/add_update_packages.md b/doc/dev/how-to/wolfi/add_update_packages.md index 0e981eb08fa..663dbf985e6 100644 --- a/doc/dev/how-to/wolfi/add_update_packages.md +++ b/doc/dev/how-to/wolfi/add_update_packages.md @@ -97,7 +97,7 @@ It is not necessary to change the package version in `wolfi-packages/.y We maintain our own package repository for custom dependencies that aren't in the Wolfi repository. -This is implemented as a GCP bucket. Buildkite is used to build and upload packages, as well as to [build and sign](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/enterprise/dev/ci/scripts/wolfi/build-repo-index.sh) the repository index. +This is implemented as a GCP bucket. Buildkite is used to build and upload packages, as well as to [build and sign](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/dev/ci/scripts/wolfi/build-repo-index.sh) the repository index. The package repository is segmented by production and development: diff --git a/docker-images/README.md b/docker-images/README.md index 9a9befbd46b..9c811653e1d 100644 --- a/docker-images/README.md +++ b/docker-images/README.md @@ -5,7 +5,7 @@ This directory contains Sourcegraph docker images which are derivatives of an ex - `sourcegraph/alpine` handles setting up a `sourcegraph` user account, installing common packages. - `sourcegraph/postgres-11.4` is `postgres-11.4` but with some Sourcegraph defaults. -If you are looking for our non-derivative Docker images, see e.g. `/cmd/.../Dockerfile` and `/enterprise/cmd/.../Dockerfile` instead. +If you are looking for our non-derivative Docker images, see e.g. `/cmd/.../Dockerfile` instead. ## Building @@ -18,4 +18,4 @@ All images in this directory are built and published automatically on CI: 1. Create a `build.sh` and add your publishing script to it - the script should end with `docker tag ... "$IMAGE"`. See the scripts in this directory for examples. 2. Ensure your new script is executable with `chmod +x build.sh` (you can try it via e.g. `IMAGE=fake-repo/cadvisor:latest docker-images/$SERVICE/build.sh`, or by [building a test image](https://handbook.sourcegraph.com/engineering/deployments#building-docker-images-for-a-specific-branch)) -3. Add an image to the automated builds pipeline by adding it to [`SourcegraphDockerImages`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Eenterprise/dev/ci/images/images%5C.go+SourcegraphDockerImages&patternType=literal). +3. Add an image to the automated builds pipeline by adding it to [`SourcegraphDockerImages`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Edev/ci/images/images%5C.go+SourcegraphDockerImages&patternType=literal). diff --git a/enterprise/.gitignore b/enterprise/.gitignore deleted file mode 100644 index 8b4e9c0fd48..00000000000 --- a/enterprise/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -# Web -.nyc_output/ -coverage/ -node_modules/ -out/ -package-lock.json -package-lock.json -puppeteer/ -src/backend/graphqlschema.ts -yarn-error.log -/ui/assets/* -!/ui/assets/img -!/ui/assets/img/* -/.bin -/vendor/.bin -/cmd/embeddings/shared/testdata/ diff --git a/enterprise/README.md b/enterprise/README.md deleted file mode 100644 index 2cd8fd4e17b..00000000000 --- a/enterprise/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Sourcegraph Enterprise - -[![codecov](https://codecov.io/gh/sourcegraph/enterprise/branch/master/graph/badge.svg?token=itk6ydR7l3)](https://codecov.io/gh/sourcegraph/enterprise) -[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) - -This directory contains Sourcegraph Enterprise code. - -## Dev - -See [Local development: For Sourcegraph employees](https://docs.sourcegraph.com/dev/setup/quickstart) for how to work on this code. diff --git a/enterprise/dev/ci/OWNERS b/enterprise/dev/ci/OWNERS deleted file mode 100644 index 427b908cdc9..00000000000 --- a/enterprise/dev/ci/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -# See https://github.com/sourcegraph/codenotify for documentation. - -**/* @sourcegraph/dev-experience diff --git a/enterprise/dev/ci/images/go.mod b/enterprise/dev/ci/images/go.mod deleted file mode 100644 index 7f2756d1400..00000000000 --- a/enterprise/dev/ci/images/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images - -go 1.14 diff --git a/enterprise/dev/ci/internal/ci/operations/BUILD.bazel b/enterprise/dev/ci/internal/ci/operations/BUILD.bazel deleted file mode 100644 index 17d6c82f526..00000000000 --- a/enterprise/dev/ci/internal/ci/operations/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "operations", - srcs = ["operations.go"], - importpath = "github.com/sourcegraph/sourcegraph/enterprise/dev/ci/internal/ci/operations", - visibility = ["//enterprise/dev/ci:__subpackages__"], - deps = [ - "//enterprise/dev/ci/internal/buildkite", - "@com_github_grafana_regexp//:regexp", - ], -) diff --git a/go.mod b/go.mod index 9c671f21cd2..2accab3830f 100644 --- a/go.mod +++ b/go.mod @@ -14,9 +14,9 @@ replace ( // We use a fork of Alertmanager to allow prom-wrapper to better manipulate Alertmanager configuration. // See https://docs.sourcegraph.com/dev/background-information/observability/prometheus github.com/prometheus/alertmanager => github.com/sourcegraph/alertmanager v0.21.1-0.20211110092431-863f5b1ee51b - // We publish 'enterprise/dev/ci/images' as a package for import in other tooling. + // We publish 'dev/ci/images' as a package for import in other tooling. // When developing Sourcegraph itself, this replace uses the local package instead of a pushed version. - github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images => ./enterprise/dev/ci/images + github.com/sourcegraph/sourcegraph/dev/ci/images => ./dev/ci/images // We publish 'lib' as a package for import in other tooling. // When developing Sourcegraph itself, this replace uses the local package instead of a pushed version. github.com/sourcegraph/sourcegraph/lib => ./lib @@ -188,7 +188,7 @@ require ( github.com/sourcegraph/log v0.0.0-20230918165208-4a174e4ec4cf github.com/sourcegraph/run v0.12.0 github.com/sourcegraph/scip v0.3.1-0.20230627154934-45df7f6d33fc - github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images v0.0.0-20220203145655-4d2a39d3038a + github.com/sourcegraph/sourcegraph/dev/ci/images v0.0.0-20220203145655-4d2a39d3038a github.com/sourcegraph/sourcegraph/lib v0.0.0-20230810200548-f8a32bcbd9e3 github.com/stretchr/testify v1.8.4 github.com/temoto/robotstxt v1.1.2 diff --git a/lib/api/version_check.go b/lib/api/version_check.go index 567cae8991b..a5c1000bdc0 100644 --- a/lib/api/version_check.go +++ b/lib/api/version_check.go @@ -29,7 +29,7 @@ func CheckSourcegraphVersion(version, constraint, minDate string) (bool, error) // Since we don't actually care about the abbreviated commit hash at the end of the // version string, we match on 7 or more characters. Currently, the Sourcegraph version // is expected to return 12: - // https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/enterprise/dev/ci/internal/ci/config.go?L96. + // https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/dev/ci/internal/ci/config.go?L96. matches := BuildDateRegex.FindStringSubmatch(version) if len(matches) > 1 { return matches[1] >= minDate, nil diff --git a/monitoring/definitions/containers.go b/monitoring/definitions/containers.go index 3c4db83d515..e0221701d9e 100644 --- a/monitoring/definitions/containers.go +++ b/monitoring/definitions/containers.go @@ -10,8 +10,9 @@ import ( func Containers() *monitoring.Dashboard { var ( // HACK: + // TODO: This is no longer true, we can clean this up. // Image names are defined in enterprise package - // github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images + // github.com/sourcegraph/sourcegraph/dev/ci/images // Hence we can't use the exported names in OSS here. // Also, the exported names do not cover edge cases such as `pgsql`, `codeintel-db`, and `codeinsights-db`. // We cannot use "wildcard" to cover all running containers: