Conversation
| if not isinstance(comparison_value, str): | ||
| return False |
There was a problem hiding this comment.
is this to appease mypy for line 39? (i would expect the except block to catch the error from the interpreter at least)
| self.assert_passes(self.dc, self.event_data) | ||
| self.dc.update(comparison={"value": ErrorGroupType.type_id}) | ||
| self.assert_passes(self.dc, self.event_data) | ||
| self.dc.comparison = {"hello": "there", "include": True} |
| def get_all_valid_type_slugs() -> list[str]: | ||
| return list(gt.slug for gt in grouptype.registry.all()) |
There was a problem hiding this comment.
should we memoize the result of this method since we only need it to be a function call because the registry is dynamic at app load?
…dler-to-work-with-frontend
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| value = grouptype.registry.get_by_slug(comparison_value) | ||
| if value is None: | ||
| return False | ||
| except (TypeError, KeyError): |
There was a problem hiding this comment.
Breaks existing ISSUE_TYPE comparisons
Medium Severity
Changing comparison_json_schema to require a slug string and evaluate_value to reject non-str values makes any previously stored Condition.ISSUE_TYPE data conditions that used numeric type IDs permanently evaluate to False (and potentially fail schema validation), with no compatibility path.
There was a problem hiding this comment.
This is a new condition, no one is using it yet


Ref ISWF-1991
Followup to #108174
A couple of changes were needed to get this working with the frontend alerts code:
valueto accept group type slugs instead of IDs. The frontend only works with slugs so it's a lot simpler if we use those, and it's consistent with the use of category slugs as well.