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 :)
This commit is contained in:
Erik Seliger 2023-10-05 22:15:40 +02:00 committed by GitHub
parent 5571852e2a
commit 58fe87f6b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
107 changed files with 232 additions and 274 deletions

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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

View File

@ -17,7 +17,7 @@ jobs:
- ''
- lib
- monitoring
- enterprise/dev/ci/images
- dev/ci/images
steps:
# Setup
- name: Checkout

View File

@ -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

2
.gitignore vendored
View File

@ -213,3 +213,5 @@ result-*
# JUnit execution reports
junit.xml
/enterprise/

View File

@ -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.

View File

@ -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

View File

@ -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",

View File

@ -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

View File

@ -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 '<!-- DO NOT EDIT: generated via: go generate ./enterprise/dev/ci -->\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 '<!-- DO NOT EDIT: generated via: go generate ./dev/ci -->\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()

View File

@ -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

View File

@ -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"],
)

3
dev/ci/images/go.mod Normal file
View File

@ -0,0 +1,3 @@
module github.com/sourcegraph/sourcegraph/dev/ci/images
go 1.14

View File

@ -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

View File

@ -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

View File

@ -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",

View File

@ -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"],
)

View File

@ -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"
)

View File

@ -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",

View File

@ -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) {

View File

@ -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"],
)

View File

@ -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"))

View File

@ -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{

View File

@ -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(

View File

@ -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
}

View File

@ -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"
)

View File

@ -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),

View File

@ -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",
],
)

View File

@ -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

View File

@ -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"
)

View File

@ -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__"],
)

View File

@ -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"),

View File

@ -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

View File

@ -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",

View File

@ -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"

View File

@ -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
)

View File

@ -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

View File

@ -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 $?

View File

@ -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

View File

@ -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:

View File

@ -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`,

View File

@ -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

View File

@ -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"],
)

View File

@ -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 {

View File

@ -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"
)

View File

@ -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",
},
}

View File

@ -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

View File

@ -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",

View File

@ -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.

View File

@ -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)
- [rust-lang/rustlings](https://sourcegraph.com/github.com/rust-lang/rustlings@c923e7af73a91970d2e63e03babbca9cc0817551/-/blob/src/verify.rs?L147:15&popover=pinned)

View File

@ -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

View File

@ -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

View File

@ -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",

View File

@ -1,4 +1,4 @@
<!-- DO NOT EDIT: generated via: go generate ./enterprise/dev/ci -->
<!-- DO NOT EDIT: generated via: go generate ./dev/ci -->
# Pipeline types reference

View File

@ -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).

View File

@ -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(),

View File

@ -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.

View File

@ -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

View File

@ -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.

View File

@ -97,7 +97,7 @@ It is not necessary to change the package version in `wolfi-packages/<package>.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:

View File

@ -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).

16
enterprise/.gitignore vendored
View File

@ -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/

Some files were not shown because too many files have changed in this diff Show More