Skip to content
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

Validate --timezone argument #1845

Closed
szokeasaurusrex opened this issue Nov 28, 2023 · 0 comments · Fixed by #1847
Closed

Validate --timezone argument #1845

szokeasaurusrex opened this issue Nov 28, 2023 · 0 comments · Fixed by #1847
Assignees

Comments

@szokeasaurusrex
Copy link
Member

szokeasaurusrex commented Nov 28, 2023

For context, see getsentry/relay#2718, which was closed as not planned in favor of this issue.

We should add validation for the sentry-cli monitors run command's --timezone argument. The validation should check that the --timezone is a valid IANA time zone database string. The Sentry backend also checks against the IANA time zone database, so we would expect any arguments which pass this validation within the Sentry CLI to also pass validation on the Sentry backend. We can perform this validation using the chrono_tz library.

After adding the validation, we should remove the warning from the docs which states that the --timezone argument is not validated.

@szokeasaurusrex szokeasaurusrex self-assigned this Nov 28, 2023
szokeasaurusrex added a commit that referenced this issue Nov 29, 2023
…1847)

The `sentry-cli monitors run` command's `--timezone` argument will now be validated against a list of valid IANA time zone database identifiers. If the user provides a `--timezone` argument, which does not match a valid IANA time zone identifier, the command will fail with an error. Previously, the command would appear to run successfully, but the monitor upsert would silently fail in the Sentry backend, since the backend rejects monitor upserts that have an invalid timezone string.

Fixes GH-1845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant