feat(api): Support monitor upserts#1807
Conversation
|
None of the cron parsing crates I could find seemed very good, so I wrote my own cron parser and opened a draft PR for it here: getsentry/sentry-rust#625. I probably need to do some polishing up on that PR, but once we are able to merge it, we can use that code to validate the crontab schedule provided by the user |
|
I agree with the decision to do this ourselves, though I'm normally more inclined to just grab something off the rack, as it were. But all the crates for this crontab stuff are ancient. |
100% agree with your point; I would have also preferred to use a crate if a suitable one existed. Maybe we can consider publishing the cron validator I wrote as its own crate so others can use it |
Co-authored-by: Sebastian Zivota <loewenheim@users.noreply.github.com>
Cargo.toml
Outdated
| # TODO: Revert back to crates.io version prior to merge | ||
| sentry = {git = "https://github.com/getsentry/sentry-rust.git", rev = "refs/pull/625/head", default-features = false, features = [ |
There was a problem hiding this comment.
I have pinned here my pull request on sentry-rust, which adds the crontab validation, so that we can test this PR before the sentry-rust changes are merged.
We need to merge the sentry-rust PR before merging this PR and release a new sentry-rust version, and we should pin the new version here before merging.
loewenheim
left a comment
There was a problem hiding this comment.
Looks good apart from my one comment :)
Co-authored-by: Sebastian Zivota <loewenheim@users.noreply.github.com>
|
@szokeasaurusrex would you also be able to update the CLI documentation to include details about how to use this |
|
@evanpurkhiser I opened an issue so I remember to add these docs; I should get around to adding it later this week. |
|
Perfect. Thank you! |
The Sentry CLI can now support creating cron monitors while executing the
monitors runcommand via the new--scheduleor the equivalent abbreviated-sargument. The argument expects to receive the schedule in crontab syntax, which the CLI validates. This PR also introduces the--check-in-margin,--max-runtime, and--timezonearguments to allow for additional configuration of the cron monitor.Closes #1801