Skip to content

Commit c0edbdf

Browse files
committed
fix(crons): Don't drop invalid schema when writing checkin rows
We had a bug where we accidentally didn't save all the required fields for the monitor config. This causes a bug when we copy the config over to the monitor checkin where we end up storing a null value. We should instead treat this as a warning - if the config is already stored in the monitor, it should be replicated regardless of whether it's valid or not. The validation should happen at mutation time, which is being fixed in #97943 Fixes SENTRY-4DDN
1 parent 6597345 commit c0edbdf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sentry/monitors/models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,11 @@ def update_config(self, config_payload, validated_config):
370370
def get_validated_config(self):
371371
try:
372372
jsonschema.validate(self.config, MONITOR_CONFIG)
373-
return self.config
374373
except jsonschema.ValidationError:
375-
logging.exception("Monitor: %s invalid config: %s", self.id, self.config)
374+
logging.warning("Monitor: %s invalid config: %s", self.id, self.config, exc_info=True)
375+
# We should always return the config here - just log an error if we detect that it doesn't
376+
# match the schema
377+
return self.config
376378

377379
def get_issue_alert_rule(self):
378380
issue_alert_rule_id = self.config.get("alert_rule_id")

0 commit comments

Comments
 (0)