-
Notifications
You must be signed in to change notification settings - Fork 439
feat: trigger-webhook-events-on-commiting-change-requests #5464
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
Open
Zaimwa9
wants to merge
54
commits into
main
Choose a base branch
from
feat/implement-flag-update-webhook-on-change-request-commit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: trigger-webhook-events-on-commiting-change-requests #5464
Zaimwa9
wants to merge
54
commits into
main
from
feat/implement-flag-update-webhook-on-change-request-commit
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…agsmith into feat/backend-clone-segments
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…agsmith into feat/backend-clone-segments
for more information, see https://pre-commit.ci
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
Docker builds report
|
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…agsmith into feat/backend-clone-segments
Co-authored-by: Evandro Myller <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Zaimwa9
commented
May 27, 2025
@@ -129,7 +126,10 @@ const PermissionControl: React.FC<PermissionControlProps> = ({ | |||
|
|||
const isViewRequiredAndNotAllowed = | |||
isViewPermissionRequired && !isViewPermissionAllowed | |||
const isChecked = !disabled && isPermissionEnabled && (!isViewPermissionRequired || isViewPermissionAllowed) | |||
const isChecked = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pre-commit artifact
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes
Solves #2064
Webhook events for FLAG_UPDATED were not triggered when committing a Change Request. This PR resolves that issue.
There are two relevant cases:
Feature versioning v2:
Webhooks were intentionally skipped when environment_feature_version_id is present (cf in
test_webhooks_are_not_called_for_feature_state_with_environment_feature_version
)Uncommitted Change Requests (this PR's focus):
When creating a Change Request, associated FeatureState objects are created immediately. At this point,
post_save
triggers (now suppressed) were sending a half empty event while the state was not live. However, when the Change Request is committed, the associated feature states are bulk updated—bypassing signals—and no webhook is triggered.I intentionally avoided relying on the post_save signal during commit because Change Request FeatureStates are new records without version when initially created.
Their history reflect the draft state, meaning enabled matches the future committed values. This leads to new_state == old_state in the webhook payload. So resolving FeatureState based on the previous live version ensure that we pass in the correct diff
Fix:
On commit, we now fetch the latest live FeatureState (from DB, not history) and explicitly call trigger_feature_state_change_webhooks() with both the new and previous live state
How did you test this code?