Skip to content

feat(aci): Set ownership on detector #93745

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
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

scttcper
Copy link
Member

Should update owner on creation and on update

Should update owner on creation and on update
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 17, 2025
@scttcper scttcper requested a review from a team as a code owner June 17, 2025 19:57
Copy link

codecov bot commented Jun 17, 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   #93745      +/-   ##
==========================================
+ Coverage   85.65%   88.03%   +2.38%     
==========================================
  Files       10331    10331              
  Lines      596456   596402      -54     
  Branches    23169    23140      -29     
==========================================
+ Hits       510888   525061   +14173     
+ Misses      85109    70890   -14219     
+ Partials      459      451       -8     

@@ -33,6 +34,7 @@ class BaseDetectorTypeValidator(CamelSnakeSerializer):
)
type = serializers.CharField()
config = serializers.JSONField(default={})
owner = ActorField(required=False, allow_null=True)
Copy link
Member

Choose a reason for hiding this comment

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

Should it be possible to create a detector without an owner? Right now in the UI we assume that detectors without an owner are created by Sentry

Copy link
Member Author

Choose a reason for hiding this comment

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

🤷‍♂️

@@ -60,6 +62,22 @@ def data_conditions(self) -> BaseDataConditionValidator:
def update(self, instance: Detector, validated_data: dict[str, Any]):
instance.name = validated_data.get("name", instance.name)
instance.type = validated_data.get("detector_type", instance.group_type).slug

# Handle owner field update
if "owner" in validated_data:
Copy link
Member

Choose a reason for hiding this comment

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

Is this initial if statement necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes because they could omit it entirely from a partial update

# Conflicts:
#	src/sentry/workflow_engine/endpoints/validators/base/detector.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants