chore(ACI): Add warning banner to old alerts#111344
Conversation
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
| export function WorkflowEngineAlert() { | ||
| const organization = useOrganization(); | ||
|
|
||
| if (!organization.features.includes('workflow-engine-rule-serializers')) { |
There was a problem hiding this comment.
We've been releasing individual backwards compatible endpoints behind different flags but this is the main control one
| <Alert.Container> | ||
| <Alert variant="warning"> | ||
| {tct( | ||
| "Some aspects of alerts may not be visible if you've used the [link:new monitors and alerts UI].", |
There was a problem hiding this comment.
I'm open to wording changes here - usage of the new API could also result in this but I didn't necessarily want to push users to it in this view.
There was a problem hiding this comment.
🤔 we can probably assume they don't have access to the new UI here, otherwise we should be redirecting them to it.
Maybe we can just say "The legacy alerts UI does not support all features. If you've modified the alert using the new API, those settings will be used during evaluation but aren't fully reflected in the UI." -- or something along those lines, basically saying "hey - we are evaluating this the way you expected, but you're using an experimental API so it caused a mismatch."
| manager.add("organizations:workflow-engine-redirect-opt-out", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) | ||
| # Use workflow engine serializers to return data for old rule / incident endpoints | ||
| manager.add("organizations:workflow-engine-rule-serializers", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False) | ||
| manager.add("organizations:workflow-engine-rule-serializers", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) |
There was a problem hiding this comment.
I know we're supposed to decouple fe and be changes but given this flag isn't widely enabled I think it's ok.
| )} | ||
| <Layout.Body> | ||
| <Layout.Main> | ||
| <WorkflowEngineAlert /> |
There was a problem hiding this comment.
can we check the api results for a flag to see if we need to render the warning?
There was a problem hiding this comment.
I have unsupported conditions in the errors results of the response but there are other situations (like if they used an if/then block) that would take more effort to identify.
There was a problem hiding this comment.
Ok kinda went down a rabbithole here, I think for now what I'm going to do is add the if/then block condition to the errors response and conditionally render the banner if any of the known error cases are hit for issue alerts. For metric alerts we might have more proverbial fish to fry, but this is at least a starting point that covers the majority of cases in an already edge case problem set.
| </Layout.Header> | ||
| <Layout.Body> | ||
| <Layout.Main> | ||
| <WorkflowEngineAlert /> |
There was a problem hiding this comment.
same question about being able to read the rule value to determine if we need to render the banner or not.
33d37a6 to
b9fad53
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Feature flag default=True enables serializers for all orgs
- Removed the
default=Trueoverride fromorganizations:workflow-engine-rule-serializersso orgs only use workflow serializer paths when explicitly enabled.
- Removed the
Or push these changes by commenting:
@cursor push 442257f1f4
Preview (442257f1f4)
diff --git a/src/sentry/features/temporary.py b/src/sentry/features/temporary.py
--- a/src/sentry/features/temporary.py
+++ b/src/sentry/features/temporary.py
@@ -418,7 +418,7 @@
# Disable redirects from alert rules to the new workflow_engine UI
manager.add("organizations:workflow-engine-redirect-opt-out", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True, default=True)
# Use workflow engine serializers to return data for old rule / incident endpoints
- manager.add("organizations:workflow-engine-rule-serializers", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True, default=True)
+ manager.add("organizations:workflow-engine-rule-serializers", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Use workflow engine exclusively for ProjectRulesEndpoint.get results.
# See src/sentry/workflow_engine/docs/legacy_backport.md for context.
manager.add("organizations:workflow-engine-projectrulesendpoint-get", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
e206341 to
90429a7
Compare
saponifi3d
left a comment
There was a problem hiding this comment.
lgtm, thanks for updating!
Backend Test FailuresFailures on
|
90429a7 to
292ea5d
Compare
Backend Test FailuresFailures on
|
292ea5d to
c99770e
Compare


Add a warning banner to the old issue alerts pages if the workflow engine serializers flag is enabled letting users know there could be parts of the alert we cannot render in the old UI if they've created or edited alerts or monitors in the new UI. For issue alerts this is filtered down to alerts where there are unsupported conditions or the new alert uses multiple if/then conditions which can't be shown in the old UI.