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

CreateSubscriptionRequest endpoint cant be called from snuba admin #6617

Open
kylemumma opened this issue Dec 4, 2024 · 0 comments
Open

Comments

@kylemumma
Copy link
Member

Steps to Reproduce

In RPC Endpoints admin tool running the example request for CreateSubscriptionEndpoint.

Expected Result

Expect it to successfully execute

Actual Result

But it fails due to missing meta
Image

This failure is bc the request protobuf definition doesnt include meta
https://github.com/getsentry/sentry-protos/blob/main/proto/sentry_protos/snuba/v1/endpoint_create_subscription.proto

but snuba admin currently requires it at the top level

validate_request_meta(request_proto)

kylemumma added a commit that referenced this issue Dec 6, 2024
this closes getsentry/eap-planning#98

I added an example request to each of the following endpoints that were
missing it.
## used to look like
<img width="1036" alt="Screenshot 2024-12-04 at 3 37 22 PM"
src="https://github.com/user-attachments/assets/441e3428-5e16-42a1-bede-fce430a9ab5f">

## now it looks like
<img width="791" alt="Screenshot 2024-12-04 at 3 37 39 PM"
src="https://github.com/user-attachments/assets/e124a3a0-1cc9-4dab-b97f-e238e155ba0d">

I got the example request for each endpoint from one of its unit tests,
I tried to pick a basic representative one. Here are all the endpoints I
added example requests for, and a link to the test that I got the
request from:
*
[CreateSubscriptionRequest](https://github.com/getsentry/snuba/blob/b03c40e91c7b10af6d9794b576055eb9a6027b22/tests/subscriptions/test_scheduler_consumer.py#L165)
*
[EndpointTraceItemAttributeNames](https://github.com/getsentry/snuba/blob/b03c40e91c7b10af6d9794b576055eb9a6027b22/tests/web/rpc/v1/test_endpoint_trace_item_attribute_names.py#L89)
*
[EndpointTimeSeries](https://github.com/getsentry/snuba/blob/b03c40e91c7b10af6d9794b576055eb9a6027b22/tests/web/rpc/v1/test_endpoint_time_series/test_endpoint_time_series.py#L167)
*
[SpanSamplesRequest](https://github.com/getsentry/snuba/blob/b03c40e91c7b10af6d9794b576055eb9a6027b22/tests/web/rpc/v1alpha/test_span_samples.py#L150)

All the new example RPC calls successfully send except for
CreateSubscriptionRequest.
It has a 400 error due to no meta field:
<img width="1014" alt="Screenshot 2024-12-04 at 3 19 48 PM"
src="https://github.com/user-attachments/assets/4dc4e998-74d7-42c4-8bd6-9350831d6ede">
This is a bug that has been revealed by this PR but is unrelated to it
so I plan to solve this as a follow up in a separate PR.
#6617

The PR diff makes it look like the entire file changed but thats just bc
I ran a formatter on the JSON. Actually the only real changes are the
additions from line 87 to the end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant