Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ report_to_sentry() {
if ! require sentry-cli; then
curl -sL https://sentry.io/get-cli/ | bash
fi
# Report to sentry-dev-env
SENTRY_DSN="https://[email protected]/5723503" \
sentry-cli send-event -m "$error_message" --logfile "$_SENTRY_LOG_FILE" --level $log_level
# Report to sentry-dev-env project
sentry-cli send-event -m "$error_message" --logfile "$_SENTRY_LOG_FILE" --level $log_level
rm "$_SENTRY_LOG_FILE"
}

Expand Down Expand Up @@ -143,6 +142,8 @@ fi
if [ -n "${SENTRY_DEVENV_NO_REPORT+x}" ]; then
debug "No development environment errors will be reported (since you've defined SENTRY_DEVENV_NO_REPORT)."
else
# This is necessary for the bash-hook in lib.sh to work
export SENTRY_DSN="https://[email protected]/5723503"
# Since direnv traps the EXIT signal we place the temp file under /tmp for the odd time
# the script will use the EXIT path
_SENTRY_LOG_FILE=$(mktemp /tmp/sentry.envrc.$$.out || mktemp /tmp/sentry.envrc.XXXXXXXX.out)
Expand Down
11 changes: 4 additions & 7 deletions scripts/lib.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# NOTE: This file is sourced in CI across different repos (e.g. snuba),
# thus, renaming this file or any functions can break CI!
#
# Module containing code shared across various shell scripts
# Execute functions from this module via the script do.sh
# shellcheck disable=SC2034 # Unused variables
Expand All @@ -15,19 +18,13 @@ fi

venv_name=".venv"

# NOTE: This file is sourced in CI across different repos (e.g. snuba),
# so renaming this file or any functions can break CI!

# Check if a command is available
require() {
command -v "$1" >/dev/null 2>&1
}

configure-sentry-cli() {
# XXX: For version 1.70.1 there's a bug hitting SENTRY_CLI_NO_EXIT_TRAP: unbound variable
# We can remove this after it's fixed
# https://github.com/getsentry/sentry-cli/pull/1059
export SENTRY_CLI_NO_EXIT_TRAP=${SENTRY_CLI_NO_EXIT_TRAP-0}
# SENTRY_DSN is currently exported in .envrc
if [ -n "${SENTRY_DSN+x}" ] && [ -z "${SENTRY_DEVENV_NO_REPORT+x}" ]; then
if ! require sentry-cli; then
curl -sL https://sentry.io/get-cli/ | bash
Expand Down