Skip to content

Conversation

@cathteng
Copy link
Member

@cathteng cathteng commented Jul 9, 2025

Add a new feature flag to toggle single processing of issue alerts through workflow engine.

We currently have 2 feature flags: 1 that controls dual processing, and 1 that controls where the notifications fire from (the current system or workflow engine).

The new flag will act as an override of the two flags such that only a single system will process and notify about events. If the new flag is disabled, then we will revert to the dual processing flag logic.

image

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 9, 2025
@cathteng cathteng force-pushed the cathy/aci/setup-single-processing branch from c41fe6c to 5b0885c Compare July 10, 2025 16:23
@cathteng cathteng marked this pull request as ready for review July 10, 2025 16:27
@cathteng cathteng requested review from a team as code owners July 10, 2025 16:27
cursor[bot]

This comment was marked as outdated.

Copy link
Collaborator

@iamrajjoshi iamrajjoshi left a comment

Choose a reason for hiding this comment

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

lgtm

@cathteng cathteng requested a review from kcons July 10, 2025 22:22
Copy link
Member

@kcons kcons left a comment

Choose a reason for hiding this comment

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

This looks functionally correct as far as I can see, but I think we're probably doing it wrong. I'm not sure if we have the tools to do it right, though.

There's an argument that our flags should be shallowly behaviorally based, so or logic involving two flags is usually wrong; the flag should already encode that OR. And I guess that pushes the complexity to maintaining the YAML, which has some added benefit in that we could write tests to ensure that the YAML groups we define are coherent.

Another thought here is that if our flags are somewhat related, we should be exposing a sentry.workflow_engine.gating module or something that provides the interface we'd want (eg if alert_execution(org).enables(Processing.Workflow): or whatever) and ensures that all the correct flags are honored, so that we can bake in an test the proper combining of flags and callsites just ask the right question. That's sort of a runtime version of the other idea, but with better ergonomics and type safety, and this seems a step in that direction.

My larger point here is that the gating stuff seems one of our higher risk things, and it's already kind of confusing, so we should take every step toward more complexity as a chance to seriously consider our alternatives.

manager.add("organizations:workflow-engine-process-metric-issue-workflows", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
# Enable workflow engine for issue alerts
manager.add("organizations:workflow-engine-process-workflows", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
# Enable single processing through workflow engine for issue alerts
Copy link
Member

Choose a reason for hiding this comment

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

I'd love a better name here, but I realize it's tricky given that consistency with existing naming is valuable.

@codecov
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #95178      +/-   ##
==========================================
- Coverage   76.42%   76.35%   -0.08%     
==========================================
  Files       10509    10511       +2     
  Lines      606347   606410      +63     
  Branches    23728    23728              
==========================================
- Hits       463419   463007     -412     
+ Misses     142633   141509    -1124     
- Partials      295     1894    +1599     

@cathteng cathteng merged commit 2bf850f into master Jul 15, 2025
65 checks passed
@cathteng cathteng deleted the cathy/aci/setup-single-processing branch July 15, 2025 15:58
@iamrajjoshi iamrajjoshi restored the cathy/aci/setup-single-processing branch July 15, 2025 23:14
@github-actions github-actions bot locked and limited conversation to collaborators Jul 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants