Skip to content

chore(aci): add flag to GET OrganizationIncidentIndex#112400

Merged
klochek merged 1 commit intomasterfrom
christopherklochek/iswf-2379-roll-out-organizationincidentindexendpoint-get
Apr 8, 2026
Merged

chore(aci): add flag to GET OrganizationIncidentIndex#112400
klochek merged 1 commit intomasterfrom
christopherklochek/iswf-2379-roll-out-organizationincidentindexendpoint-get

Conversation

@klochek
Copy link
Copy Markdown
Contributor

@klochek klochek commented Apr 7, 2026

No description provided.

@klochek klochek requested a review from a team as a code owner April 7, 2026 20:07
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 7, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 7, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: New feature flag not registered in feature registry
    • Added organizations:workflow-engine-orgincidentindex-get to src/sentry/features/temporary.py with the same FLAGPOLE and api_expose=False configuration used by neighboring workflow-engine endpoint flags.

Create PR

Or push these changes by commenting:

@cursor push f51b1b3b18
Preview (f51b1b3b18)
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
@@ -452,6 +452,9 @@
     # Use workflow engine exclusively for OrganizationCombinedRuleIndexEndpoint.get results.
     # See src/sentry/workflow_engine/docs/legacy_backport.md for context.
     manager.add("organizations:workflow-engine-combinedruleindex-get", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
+    # Use workflow engine exclusively for OrganizationIncidentIndexEndpoint.get results.
+    # See src/sentry/workflow_engine/docs/legacy_backport.md for context.
+    manager.add("organizations:workflow-engine-orgincidentindex-get", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
     # Use workflow engine exclusively for OrganizationIncidentDetailsEndpoint.get results.
     # See src/sentry/workflow_engine/docs/legacy_backport.md for context.
     manager.add("organizations:workflow-engine-orgincidentdetails-get", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d448834. Configure here.

Comment thread src/sentry/incidents/endpoints/organization_incident_index.py
use_workflow_engine = features.has(
"organizations:workflow-engine-rule-serializers", organization
)
) or features.has("organizations:workflow-engine-orgincidentindex-get", organization)
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.

Bug: The feature flag organizations:workflow-engine-orgincidentindex-get is used without being registered, causing features.has() to always return False and making the flag non-functional.
Severity: MEDIUM

Suggested Fix

Register the feature flag organizations:workflow-engine-orgincidentindex-get in the feature flag definitions, likely in src/sentry/features/temporary.py, to match the pattern used by other similar workflow engine flags.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/sentry/incidents/endpoints/organization_incident_index.py#L84

Potential issue: The feature flag `organizations:workflow-engine-orgincidentindex-get`
is used in the code but has not been registered. The `features.has()` method is designed
to handle unregistered flags by catching a `FeatureNotRegistered` exception and silently
returning `False`. Consequently, the check for this flag will always fail, and the new
per-endpoint flag will be non-functional. This prevents the intended independent rollout
of the workflow engine for this specific endpoint, as the code path can never be
activated via this new flag.

Did we get this right? 👍 / 👎 to inform future reviews.

@klochek klochek force-pushed the christopherklochek/iswf-2379-roll-out-organizationincidentindexendpoint-get branch from d448834 to 78c52f8 Compare April 7, 2026 20:19
@klochek klochek merged commit e6b5a74 into master Apr 8, 2026
79 checks passed
@klochek klochek deleted the christopherklochek/iswf-2379-roll-out-organizationincidentindexendpoint-get branch April 8, 2026 15:52
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants