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

ref: fix types for monitor_consumer #83831

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

asottile-sentry
Copy link
Member

No description provided.

@asottile-sentry asottile-sentry requested review from a team January 22, 2025 16:34
@asottile-sentry asottile-sentry requested review from a team as code owners January 22, 2025 16:34
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 22, 2025
Comment on lines -504 to +514
params["duration"] = (
if params.get("duration") is not None:
# Duration is specified in seconds from the client, it is
# stored in the checkin model as milliseconds
int(params["duration"] * 1000)
if params.get("duration") is not None
else None
)
params["duration"] = int(params["duration"] * 1000)
Copy link
Member

Choose a reason for hiding this comment

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

There's a small behavior change here right, since before it was setting params["duration"] to none even if it wasn't part of the dict. Now it will leave it not part of the dict.

not sure if this is actually important.

Copy link
Member Author

Choose a reason for hiding this comment

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

there is yeah, but the types forbid None in this dict -- params are passed through a validator which normalizes it to None

afaict this still works since duration is only read from the validated params

@asottile-sentry asottile-sentry enabled auto-merge (squash) January 22, 2025 16:54
@asottile-sentry asottile-sentry merged commit 6b69f76 into master Jan 22, 2025
49 checks passed
@asottile-sentry asottile-sentry deleted the asottile-typing-monitor-consumer branch January 22, 2025 17:02
Copy link

sentry-io bot commented Jan 22, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ValidationError sentry.monitors.consumers.monitor_consumer in p... View Issue

Did you find this useful? React with a 👍 or 👎

@IanWoodard IanWoodard added the Trigger: Revert Add to a merged PR to revert it (skips CI) label Jan 22, 2025
@getsentry-bot
Copy link
Contributor

PR reverted: 6ff0bb7

getsentry-bot added a commit that referenced this pull request Jan 22, 2025
@@ -501,13 +508,10 @@ def _process_checkin(item: CheckinItem, txn: Transaction | Span):

monitor_config = params.pop("monitor_config", None)

params["duration"] = (
if params.get("duration") is not None:
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm I'm not so sure -- the error is before that line 🤔 this might be the schemas update I made? though afaict it should be fine with string there

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah this was the schemas bump instead and actually not this patch. suspect commits blamed this before it had even gone out

andrewshie-sentry pushed a commit that referenced this pull request Jan 22, 2025
<!-- Describe your PR here. -->
andrewshie-sentry pushed a commit that referenced this pull request Jan 22, 2025
asottile-sentry added a commit that referenced this pull request Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components Trigger: Revert Add to a merged PR to revert it (skips CI)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants