diff --git a/build/teamcity/internal/release/process/trigger-sentry-panic.sh b/build/teamcity/internal/release/process/trigger-sentry-panic.sh new file mode 100755 index 000000000000..223a9f300421 --- /dev/null +++ b/build/teamcity/internal/release/process/trigger-sentry-panic.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# Copyright 2023 The Cockroach Authors. +# +# Use of this software is governed by the CockroachDB Software License +# included in the /LICENSE file. + + +set -euxo pipefail + +if [[ -n "${DRY_RUN}" ]] ; then + echo "Skipping this step in dry-run mode" + exit +fi + +dir="$(dirname $(dirname $(dirname $(dirname $(dirname "${0}")))))" +source "$dir/release/teamcity-support.sh" +version=$(grep -v "^#" "$dir/../pkg/build/version.txt" | head -n1) + +google_credentials="$GCS_CREDENTIALS_PROD" log_into_gcloud +gsutil cp "gs://cockroach-release-artifacts-staged-prod/cockroach-$version.linux-amd64.tgz" ./ +tar xf "cockroach-$version.linux-amd64.tgz" +echo "select crdb_internal.force_panic('testing');" | "./cockroach-${version}.linux-amd64/cockroach" demo --insecure || true +rm -rf "cockroach-$version.linux-amd64.tgz" "cockroach-${version}.linux-amd64" diff --git a/pkg/cmd/release/BUILD.bazel b/pkg/cmd/release/BUILD.bazel index cd29ccbf2279..455a9f5fd9af 100644 --- a/pkg/cmd/release/BUILD.bazel +++ b/pkg/cmd/release/BUILD.bazel @@ -12,7 +12,6 @@ go_library( "orchestration.go", "pick_sha.go", "sender.go", - "sentry.go", "set_cockroach_version.go", "templates.go", "update_brew.go", diff --git a/pkg/cmd/release/pick_sha.go b/pkg/cmd/release/pick_sha.go index ff16d1bfa432..714ab63c1237 100644 --- a/pkg/cmd/release/pick_sha.go +++ b/pkg/cmd/release/pick_sha.go @@ -151,9 +151,5 @@ func pickSHA(_ *cobra.Command, _ []string) error { if err := sendMailPickSHA(args, opts); err != nil { return fmt.Errorf("cannot send email: %w", err) } - fmt.Println("Generating panic") - if err := generatePanic(nextRelease.buildInfo.Tag); err != nil { - return fmt.Errorf("cannot generate panic: %w", err) - } return nil } diff --git a/pkg/cmd/release/sentry.go b/pkg/cmd/release/sentry.go deleted file mode 100644 index 8cd16e09d1a3..000000000000 --- a/pkg/cmd/release/sentry.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2019 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. - -package main - -import ( - "fmt" - "os/exec" -) - -// generatePanic downloads the cockroachdb binary and forces a panic crash in order to trigger a Sentry event, -// which should file a GitHub issue. -func generatePanic(tag string) error { - // the call usually exits non-zero on panic, but we don't need to fail in that case, thus "|| true" - // TODO: do not hardcode the URL - script := fmt.Sprintf(` -set -exuo pipefail -curl --retry-connrefused --retry 5 --fail --silent --show-error --output /dev/stdout --url https://storage.googleapis.com/cockroach-builds-artifacts-prod/cockroach-%s.linux-amd64.tgz | tar -xz -./cockroach-%s.linux-amd64/cockroach demo --insecure -e "select crdb_internal.force_panic('testing')" || true -`, tag, tag) - cmd := exec.Command("bash", "-c", script) - out, err := cmd.CombinedOutput() - if err != nil { - return fmt.Errorf("failed to generate panic. output was: %s, err: %w", string(out), err) - } - fmt.Println(string(out)) - return nil -}