Skip to content

fix(scripts): every known flags should be shifted before executing the sentry <foo> command #3831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aldy505
Copy link
Collaborator

@aldy505 aldy505 commented Jul 25, 2025

Fixes #3526

Previously, if this was executed:

./scripts/backup.sh --no-report-self-hosted-issues

The final backup command that will be executed is:

docker compose run -v "${PWD}/sentry:/sentry-data/backup" --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web export --no-report-self-hosted-issues /sentry-data/backup/backup.json

Which is invalid. This PR strips all known flags specific to self-hosted before passing it onto Sentry.

One other option is to enable "ignore unknown options" on click (the CLI dependency) on Sentry, but I don't want to go to that route.

…e sentry <foo> command

Fixes #3526

Previously, if this was executed:
```bash
./scripts/backup.sh --no-report-self-hosted-issues
```

The final backup command that will be executed is:
```bash
docker compose run -v "${PWD}/sentry:/sentry-data/backup" --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web export --no-report-self-hosted-issues /sentry-data/backup/backup.json
```

Which is invalid. This PR strips all known flags specific to self-hosted before passing it onto Sentry.

One other option is to enable "ignore unknown options" on click (the CLI dependency) on Sentry, but I don't want to go to that route.
Copy link

codecov bot commented Jul 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.45%. Comparing base (79f18ee) to head (7e10624).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3831   +/-   ##
=======================================
  Coverage   99.45%   99.45%           
=======================================
  Files           3        3           
  Lines         183      183           
=======================================
  Hits          182      182           
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

MINIMIZE_DOWNTIME="${MINIMIZE_DOWNTIME:-}"
REPORT_SELF_HOSTED_ISSUES="${REPORT_SELF_HOSTED_ISSUES:-}"

while (($#)); do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just add --minimize-downtime to the scripts/_lib.sh? That way we don't need to maintain 3 areas of similar logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

--no-report-self-hosted-issues flag doesn't work in backup command
2 participants