Skip to content

[PM-17562] Add feature flag for event-based organization integrations #5710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

brant-livefront
Copy link
Contributor

@brant-livefront brant-livefront commented Apr 25, 2025

🎟️ Tracking

PM-17562

📔 Objective

This PR adds a feature flag for event-based organization integrations that allows the queuing to be turned on/off. When the feature flag is disabled, the events should be written as they were previously (i.e. to the Azure queue in cloud, or the Repository in self-hosted). In addition, the API around creating/updating/deleting integrations and integration configurations will simply return 404s. When the feature flag is enabled and the queue is configured, it will write to the RabbitMQ or Azure service bus queues, which also enables all the integrations to be run.

Without the feature flag in place, we had to configure either the repository or the event queue. The goal of this PR is to have both the previous model and the event queues configured and ready to go. The feature flag can then allow us to toggle between the two if there's anything that we need to address without having to restart things to un-configure the event queues.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@brant-livefront brant-livefront requested a review from a team as a code owner April 25, 2025 12:27
@brant-livefront brant-livefront requested a review from r-tome April 25, 2025 12:27
Copy link
Contributor

LaunchDarkly flag references

🔍 1 flag added or modified

Name Key Aliases found Info
Event-based organization integrations event-based-organization-integrations

Copy link
Contributor

github-actions bot commented Apr 25, 2025

Logo
Checkmarx One – Scan Summary & Detailsb8df53d6-0d2c-465b-aef0-00545407082c

New Issues (4)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 164
detailsMethod Put at line 164 of /src/Api/AdminConsole/Controllers/GroupsController.cs gets a parameter from a user request from model. This parameter val...
ID: O%2BHxUDVmhn4DDWQtZQFQAhiT9ZY%3D
Attack Vector
MEDIUM CSRF /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs: 96
detailsMethod Patch at line 96 of /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs gets a parameter from a user request from model. This par...
ID: qOrS%2Bmn6Gg1L4tTtOw7xqc0462I%3D
Attack Vector
MEDIUM CSRF /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs: 86
detailsMethod Put at line 86 of /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs gets a parameter from a user request from model. This param...
ID: tdBhFufVwEv2BYlT6X8qz8sKXeo%3D
Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Public/Controllers/GroupsController.cs: 133
detailsMethod Put at line 133 of /src/Api/AdminConsole/Public/Controllers/GroupsController.cs gets a parameter from a user request from model. This parame...
ID: En5BEJJONHFvKUkaerwROu5tjB0%3D
Attack Vector
Fixed Issues (3)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/AdminConsole/Public/Controllers/MembersController.cs: 95
MEDIUM CSRF /src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs: 73
MEDIUM CSRF /src/Api/Billing/Controllers/OrganizationSponsorshipsController.cs: 202

Copy link

codecov bot commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 31.03448% with 20 lines in your changes missing coverage. Please review.

Project coverage is 47.19%. Comparing base (9a7fddd) to head (2475013).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...SharedWeb/Utilities/ServiceCollectionExtensions.cs 26.66% 11 Missing ⚠️
src/Events/Startup.cs 35.71% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5710      +/-   ##
==========================================
- Coverage   47.20%   47.19%   -0.01%     
==========================================
  Files        1633     1633              
  Lines       74165    74184      +19     
  Branches     6676     6678       +2     
==========================================
+ Hits        35008    35014       +6     
- Misses      37706    37719      +13     
  Partials     1451     1451              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

withinfocus
withinfocus previously approved these changes Apr 25, 2025
Copy link

Copy link
Contributor

@withinfocus withinfocus left a comment

Choose a reason for hiding this comment

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

Excellent optimization -- thanks @justindbaur!

@brant-livefront brant-livefront merged commit ad19d3d into main Apr 28, 2025
53 checks passed
@brant-livefront brant-livefront deleted the brant/PM-17562-feature-flag-for-event-integrations branch April 28, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants