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

Add a sunburst internal endpoint #1164

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Add a sunburst internal endpoint #1164

wants to merge 2 commits into from

Conversation

JerrySentry
Copy link
Contributor

Make a copy of tree endpoint that returns a slightly different response structure:

  • renamed coverage to value
  • dropped the following: 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.

@codecov-notifications
Copy link

codecov-notifications bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 45.45455% with 12 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
api/shared/report/serializers.py 43.75% 9 Missing ⚠️
api/internal/coverage/views.py 50.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 45.45455% with 12 lines in your changes missing coverage. Please review.

Project coverage is 95.86%. Comparing base (de5e284) to head (81643ce).

✅ All tests successful. No failed tests found.

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 45.45455% with 12 lines in your changes missing coverage. Please review.

Project coverage is 96.01%. Comparing base (de5e284) to head (81643ce).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
api/shared/report/serializers.py 43.75% 9 Missing ⚠️
api/internal/coverage/views.py 50.00% 3 Missing ⚠️
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     
Flag Coverage Δ
unit 95.86% <45.45%> (-0.07%) ⬇️
unit-latest-uploader 95.86% <45.45%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JerrySentry
Copy link
Contributor Author

@ai-review-prompt-prod

@JerrySentry
Copy link
Contributor Author

@codecov-ai-reviewer

@JerrySentry
Copy link
Contributor Author

@codecov-ai-reviewer review

Copy link

codecov-ai bot commented Feb 24, 2025

On it! We are reviewing the PR and will provide feedback shortly.

Comment on lines +70 to +75

@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)
Copy link

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.

Suggested change
@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)

Copy link

codecov-ai bot commented Feb 24, 2025

No changes requiring review at this time.

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

Successfully merging this pull request may close these issues.

1 participant