feat(inbound-filters): Add custom inbound filters CRUD endpoint#117797
Draft
shellmayr wants to merge 11 commits into
Draft
feat(inbound-filters): Add custom inbound filters CRUD endpoint#117797shellmayr wants to merge 11 commits into
shellmayr wants to merge 11 commits into
Conversation
Contributor
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
… log Per review: the list endpoint now exposes only GET, and create (POST) moves to the details endpoint alongside GET/PUT/DELETE. Collapse the three custom inbound filter audit log events (add/edit/remove) into a single CUSTOM_INBOUND_FILTER event that records the operation in its data. Rename get_feature_gate_response to feature_access_denied for clarity. Refs TET-2379 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…2-add-endpoint' into shellmayr/feat/inbound-filters-v2-add-endpoint
…hain Refs TET-2379 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
POST create belongs on the collection (/custom-inbound-filters/), not the detail route. Having it on the detail endpoint made a standard POST to the collection return 405 and forced create requests through /custom-inbound-filters/<id>/ with a meaningless, unused filter_id (also misdocumented in the OpenAPI schema). Move post and its schema back to CustomInboundFiltersEndpoint without the filter_id param, and drop POST from CustomInboundFilterDetailsEndpoint. Refs TET-2379 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…und-filters-v2-add-endpoint
Fold response serialization into CustomInboundFilterSerializer so a single DRF serializer handles both request validation and response output, removing the duplicate serialize_project_custom_inbound_filter helper. Allow duplicate condition types (combined with AND) and document the behavior instead of rejecting them. Set the owner to telemetry-experience and mark the endpoints EXPERIMENTAL ahead of graduation. Harden creation with a per-project filter cap (50) and a max conditions per filter (10). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the SerializerMethodField timestamp helpers with plain DateTimeField declarations. This drops boilerplate and emits the Z-suffixed format the rest of the Sentry API uses, instead of isoformat's +00:00 offset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the per-endpoint feature_access_denied helper with a has_feature method on a shared ProjectCustomInboundFilterEndpoint base, matching the convention used elsewhere (e.g. project service hooks). Callers now return the 400 response inline when the project feature is disabled. This also fixes a latent bug: every call site invoked feature_access_denied as a bare function, which only existed as a method on the list endpoint and was undefined on the details endpoint. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
CustomInboundFiltersEndpoint(GETlist,POSTcreate) andCustomInboundFilterDetailsEndpoint(GET,PUT,DELETE) at/projects/{org}/{project}/custom-inbound-filters/[{filter_id}/], backed by theCustomInboundFiltermodelLOG_MESSAGEandMETRIC_NAMEcondition types gated behind their own feature flagsprojects:custom-inbound-filters(returns 400 when not enabled)master(picks up the now-merged model + migration1116); net diff is backend-onlyContributes to TET-2379