snuba icon indicating copy to clipboard operation
snuba copied to clipboard

fix(rpc): Correct config key for rpc endpoints

Open Zylphrex opened this issue 1 year ago • 1 comments

The config key should be based on the protobuf classes instead of the endpoint.

Zylphrex avatar Oct 11 '24 20:10 Zylphrex

:x: 1 Tests Failed:

Tests completed Failed Passed Skipped
690 1 689 1
View the top 1 failed tests by shortest run time
tests.clickhouse.optimize.test_optimize_scheduler test_get_next_schedule_raises_exception
Stack Traces | 0.001s run time
Traceback (most recent call last):
  File ".../clickhouse/optimize/test_optimize_scheduler.py", line 242, in test_get_next_schedule_raises_exception
    with pytest.raises(OptimizedSchedulerTimeout):
  File ".../local/lib/python3.11.../site-packages/_pytest/python_api.py", line 970, in __exit__
    fail(self.message)
  File ".../local/lib/python3.11.../site-packages/_pytest/outcomes.py", line 196, in fail
    raise Failed(msg=reason, pytrace=pytrace)
Failed: DID NOT RAISE <class 'snuba.clickhouse.optimize.optimize_scheduler.OptimizedSchedulerTimeout'>

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

codecov[bot] avatar Oct 11 '24 20:10 codecov[bot]

@Zylphrex

How strongly do you feel that this should be the case? I'm not super attached to it but also don't necessarily feel like updating all the tests. The current naming convention follows the endpoint_* file naming conventions stated here

volokluev avatar Oct 15 '24 20:10 volokluev

@Zylphrex

How strongly do you feel that this should be the case? I'm not super attached to it but also don't necessarily feel like updating all the tests. The current naming convention follows the endpoint_* file naming conventions stated here

I'm not attached to it but the names of the classes are now public interface as it determines the endpoint. So if we were to use the class names in snuba to decide the endpoint paths, we now have to

  1. ensure they do not change
  2. we now need to hard code a mapping from the rpc name to the snuba class name within the sentry code base for every rpc call as we can not rely on the rpc class to tell us which endpoint it needs to call

Zylphrex avatar Oct 15 '24 20:10 Zylphrex

we now need to hard code a mapping from the rpc name to the snuba class name within the sentry code base for every rpc call as we can not rely on the rpc class to tell us which endpoint it needs to call

@Zylphrex I see what you're saying. Here is what I will say. In gRPC, the definition of the RPC and request/response payload are separate (example) because they are separate things. When we switch to gRPC you'd have to do this anyways. What you are proposing would make that transition more difficult

volokluev avatar Oct 16 '24 17:10 volokluev

Closing this in favour of helper functions in sentry that maps to each rpc endpoint

Zylphrex avatar Oct 16 '24 17:10 Zylphrex