-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add a sunburst internal endpoint #1164
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
📢 Thoughts on this report? Let us know! |
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #1164 +/- ##
==========================================
- Coverage 96.07% 96.01% -0.06%
==========================================
Files 836 836
Lines 19723 19742 +19
==========================================
+ Hits 18948 18955 +7
- Misses 775 787 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@ai-review-prompt-prod |
@codecov-ai-reviewer |
@codecov-ai-reviewer review |
On it! We are reviewing the PR and will provide feedback shortly. |
|
||
@action(detail=False, methods=["get"], url_path="sunburst") | ||
def sunburst(self, request: HttpRequest, *args: Any, **kwargs: Any) -> Response: | ||
paths = self.get_object() | ||
serializer = SunburstSerializer(paths.single_directory(), many=True) | ||
return Response(serializer.data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve readability and maintainability, consider refactoring the sunburst
method to avoid code duplication with the tree
method. You can create a helper method to handle the common logic.
@action(detail=False, methods=["get"], url_path="sunburst") | |
def sunburst(self, request: HttpRequest, *args: Any, **kwargs: Any) -> Response: | |
paths = self.get_object() | |
serializer = SunburstSerializer(paths.single_directory(), many=True) | |
return Response(serializer.data) | |
def serialize_paths(self, serializer_class): | |
paths = self.get_object() | |
serializer = serializer_class(paths.single_directory(), many=True) | |
return Response(serializer.data) | |
@action(detail=False, methods=["get"], url_path="sunburst") | |
def sunburst(self, request: HttpRequest, *args: Any, **kwargs: Any) -> Response: | |
return self.serialize_paths(SunburstSerializer) |
No changes requiring review at this time. |
Make a copy of tree endpoint that returns a slightly different response structure:
coverage
tovalue
lines
,hits
,partials
,misses
Once this new endpoint is proven effectively by the frontend we will delete /tree endpoint and migrate the tests to this endpoint as well
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.