Skip to content

feat(aci): Update API to allow filter monitors by assignee #95501

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 2 commits into
base: master
Choose a base branch
from

Conversation

leedongwei
Copy link
Member

@leedongwei leedongwei commented Jul 14, 2025

Allows filtering with assignee: /api/0/organizations/sentry/detectors/?query=assignee%3A{me|my_teams|none|team_slug|user_email}&...

@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Jul 14, 2025
Copy link
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 #discuss-dev-infra channel.

Copy link

codecov bot commented Jul 14, 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   #95501       +/-   ##
===========================================
+ Coverage   36.17%   76.33%   +40.16%     
===========================================
  Files        9960    10589      +629     
  Lines      557832   610119    +52287     
  Branches    23990    23990               
===========================================
+ Hits       201783   465733   +263950     
+ Misses     355640   142454   -213186     
- Partials      409     1932     +1523     

@leedongwei leedongwei marked this pull request as ready for review July 15, 2025 20:57
@leedongwei leedongwei requested a review from a team as a code owner July 15, 2025 20:57
cursor[bot]

This comment was marked as outdated.

const query = typeof location.query.query === 'string' ? location.query.query : '';

const filterKeys: TagCollection = Object.fromEntries(
Object.keys(DETECTOR_FILTER_KEYS).map(key => {
Copy link
Member

Choose a reason for hiding this comment

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

nit: IMO we should convert the constant DETECTOR_FILTER_KEYS into a hook useDetectorFilterKeys() so that we can use the useAssignedSearchValues() hook inside of it. That way all the logic stays together

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated in #95930

cursor[bot]

This comment was marked as outdated.

elif actor is None:
assignee_query |= Q(owner_team_id__isnull=True, owner_user_id__isnull=True)
else:
# Unknown actor type, return a query that matches nothing
Copy link
Member

Choose a reason for hiding this comment

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

I think we want to raise here or otherwise report an error if there are types coming back from convert_actor_or_none_value that we don't support.
I think officially the right thing is assert_never.

status_code=400,
)
assert "owner" in response.data
def setUp(self):
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible for us to have a test that actually filters by assignee?

@leedongwei leedongwei changed the title feat(aci): Allow user to filter monitors by assignee feat(aci): Update API to allow filter monitors by assignee Jul 18, 2025
cursor[bot]

This comment was marked as outdated.

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 Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants