Skip to content

ref(crons): Support alternative schedule format - #46346

Merged
evanpurkhiser merged 1 commit into
masterfrom
evanpurkhiser/ref-crons-support-alternative-schedule-format
Mar 27, 2023
Merged

evanpurkhiser merged 1 commit into
masterfrom
evanpurkhiser/ref-crons-support-alternative-schedule-format

Conversation

@evanpurkhiser

Copy link
Copy Markdown
Member

This is how SDKs will send the monitor schedule configuration with
checkins for upserts

Mirrors what has been implemented for relay getsentry/relay#1962

@evanpurkhiser
evanpurkhiser requested a review from a team as a code owner March 24, 2023 22:00
@evanpurkhiser
evanpurkhiser requested a review from a team March 24, 2023 22:00
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 24, 2023
Comment thread src/sentry/monitors/validators.py Resolved
Comment thread src/sentry/monitors/validators.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you hit a KeyError here if some one put a type of lol?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👍 I'll clean that up

This is how SDKs will send the monitor schedule configuration with
checkins for upserts
@evanpurkhiser
evanpurkhiser force-pushed the evanpurkhiser/ref-crons-support-alternative-schedule-format branch from 9d9e18b to 1e4f0d4 Compare March 27, 2023 17:12

@rjo100 rjo100 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

probably want to throw in a test or two for invalid/missing schedule

Comment on lines +101 to +102
schedule_type = schedule.get("type")
schedule_type = SCHEDULE_TYPES.get(schedule_type)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: ideally make this one line or don't overwrite variable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

don't think we support assignment expressions yet though otherwise could assign schedule.get("type") in the if statement

@evanpurkhiser

Copy link
Copy Markdown
Member Author

Yeah I'll toss in some extra tests, but would like to get this out asap

@evanpurkhiser
evanpurkhiser merged commit c44bf29 into master Mar 27, 2023
@evanpurkhiser
evanpurkhiser deleted the evanpurkhiser/ref-crons-support-alternative-schedule-format branch March 27, 2023 18:11
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 12, 2023

This branch was successfully deployed

1 active deployment
Preview — 1e4f0d48 Deployed Mar 27, 2023 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants