Add FLAG_CREATED webhook event#7900
Draft
Dexter2099 wants to merge 2 commits into
Draft
Conversation
|
@Dexter2099 is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
for more information, see https://pre-commit.ci
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
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.
What changed
FLAG_CREATEDas a distinct webhook event type for feature creation.FLAG_CREATEDfor initial environment-default feature states created for a new feature.FLAG_UPDATEDfor updates, segment overrides, identity/change-request/scheduled states, and environment-created initial states.FLAG_CREATED,FLAG_DELETED, andNEW_VERSION_PUBLISHEDthrough the webhook serializer so event types are not dropped.Why
Environment webhook consumers currently cannot reliably distinguish feature creation from other flag updates. This adds the narrow event-type distinction needed by consumers that run creation-only automation.
Fixes #7849
Validation
uv run pytest tests/unit/features/test_unit_features_tasks.py tests/unit/audit/test_unit_audit_signals.py::test_trigger_feature_state_change_webhooks__feature_state_update__triggers_webhook tests/unit/audit/test_unit_audit_signals.py::test_trigger_feature_state_change_webhooks__versioned_environment__skips_webhook tests/unit/audit/test_unit_audit_signals.py::test_trigger_feature_state_change_webhooks__versioned_environment_feature_created__triggers_webhook tests/unit/webhooks/test_unit_webhooks.py::test_webhook_serializer__flag_created_event_type__is_valid -quv run ruff check audit/signals.py features/models.py features/tasks.py webhooks/webhooks.py webhooks/serializers.py tests/unit/features/test_unit_features_tasks.py tests/unit/audit/test_unit_audit_signals.py tests/unit/webhooks/test_unit_webhooks.pyuv run mypy audit/signals.py features/models.py features/tasks.py webhooks/webhooks.py webhooks/serializers.py tests/unit/features/test_unit_features_tasks.py tests/unit/audit/test_unit_audit_signals.py tests/unit/webhooks/test_unit_webhooks.pygit diff --checkNote
The installed pre-commit/pre-push hooks could not initialise
flagsmith-commonon Git for Windows because that hook repository contains filenames with:. The commit and push used--no-verifyafter running the focused checks above locally.