Skip to content
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

feat(flags): Update issues search box to search for feature flags #83639

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

cmanallen
Copy link
Member

@cmanallen cmanallen commented Jan 17, 2025

When a tags query is provided implicitly query feature flags as well.

This is temporary, proof-of-concept code. Contents subject to change :)

Only src/sentry/search/snuba/executors.py works. The code in base.py apparently doesn't. Not sure if its a testing failure on my part.

Primary goal is to make the search box work which is what executors.py seems to have done. Need to figure out what supplementary files need to be modified (there may be other endpoints the UI relies on to drive product experience and the flag conditions should probably be represented there).

Leander's advice:

So the issue details page uses the discover endpoints for querying graph data and user/event counts. That means this change would need to be made on:

- organization_events_stats.py (for graph data)
- organization_events.py (for table data)

This also means that anywhere discover search is used will be affected, so issue stream, discover pages, etc.

Another location that will need to be updated:

- group_event_details.py, specifically issue_search_query_to_conditions (for recommended events)

That way if someone searches for a feature flag, we swap the current event with one that contains the feature flag they’ve entered.

executors.py wasn't suggested. I found it by tracing the code. Not sure if that's right.

I'm relying on the entity in executors.py but that field is nullable which means I could miss valid queries. Is there a location where I know with certainty I'm making an errors query and can rewrite conditions?

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 17, 2025
Copy link

codecov bot commented Jan 17, 2025

❌ 16 Tests Failed:

Tests completed Failed Passed Skipped
23608 16 23592 276
View the top 3 failed tests by shortest run time
tests.sentry.issues.endpoints.test_organization_group_index.GroupListTest::test_snuba_heavy_advanced_search_errors
Stack Traces | 3.49s run time
#x1B[1m#x1B[.../issues/endpoints/test_organization_group_index.py#x1B[0m:3811: in test_snuba_heavy_advanced_search_errors
    assert response.status_code == 200, response.data
#x1B[1m#x1B[31mE   AssertionError: {'detail': 'Internal Error', 'errorId': None}#x1B[0m
#x1B[1m#x1B[31mE   assert 500 == 200#x1B[0m
#x1B[1m#x1B[31mE    +  where 500 = <Response status_code=500, "application/json">.status_code#x1B[0m
tests.sentry.issues.endpoints.test_organization_group_index.GroupListTest::test_advanced_search_errors
Stack Traces | 3.51s run time
#x1B[1m#x1B[.../issues/endpoints/test_organization_group_index.py#x1B[0m:895: in test_advanced_search_errors
    assert response.status_code == 200, response.data
#x1B[1m#x1B[31mE   AssertionError: {'detail': 'Internal Error', 'errorId': None}#x1B[0m
#x1B[1m#x1B[31mE   assert 500 == 200#x1B[0m
#x1B[1m#x1B[31mE    +  where 500 = <Response status_code=500, "application/json">.status_code#x1B[0m
tests.snuba.api.endpoints.test_project_tags.ProjectTagsTest::test_simple_flags
Stack Traces | 4.14s run time
#x1B[1m#x1B[.../api/endpoints/test_project_tags.py#x1B[0m:105: in test_simple_flags
    response = self.get_success_response(
#x1B[1m#x1B[.../sentry/testutils/cases.py#x1B[0m:688: in get_success_response
    assert_status_code(response, status.HTTP_200_OK)
#x1B[1m#x1B[.../sentry/testutils/asserts.py#x1B[0m:40: in assert_status_code
    assert minimum <= response.status_code < maximum, (
#x1B[1m#x1B[31mE   AssertionError: (500, b'{"detail":"Internal Error","errorId":null}')#x1B[0m
#x1B[1m#x1B[31mE   assert 500 < 201#x1B[0m
#x1B[1m#x1B[31mE    +  where 500 = <Response status_code=500, "application/json">.status_code#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 22, 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.

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.

1 participant