-
Notifications
You must be signed in to change notification settings - Fork 28
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: Add comparison endpoint for impacted files #212
Conversation
Codecov Report
@@ Coverage Diff @@
## main #212 +/- ##
=======================================
+ Coverage 95.51 95.58 +0.07
=======================================
Files 716 716
Lines 15713 15832 +119
=======================================
+ Hits 15008 15132 +124
+ Misses 705 700 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know!. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #212 +/- ##
==========================================
+ Coverage 95.60% 95.66% +0.05%
==========================================
Files 602 602
Lines 15307 15426 +119
==========================================
+ Hits 14635 14757 +122
+ Misses 672 669 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov Report
@@ Coverage Diff @@
## main #212 +/- ##
==========================================
+ Coverage 95.60% 95.66% +0.05%
==========================================
Files 602 602
Lines 15307 15426 +119
==========================================
+ Hits 14635 14757 +122
+ Misses 672 669 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
||
return Response( | ||
ImpactedFilesComparisonSerializer( | ||
comparison, |
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.
I think you could just pass in a ComparisonReport
here. I don't think this comparison is actually used anywhere inside?
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.
The comparison
object is still used in the ComparisonSerializer
for displaying the head/base coverage and some other things.
def impacted_files(self, request, *args, **kwargs): | ||
comparison = self.get_object() | ||
|
||
return Response( |
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.
If the commit comparison is still being processed should we fallback to computing the impacted files on-the-fly?
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.
Alternatively maybe the serializer includes the state and we update the docs (the docstring comment in the child view) to explain that this state might change after the initial request.
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.
I see, right now if the comparison is still being computed it would return an empty object for the impacted files. I think the most consistent thing to do during pending state is to compute on-the-fly the files similar to what's already happening when the CommitComparison
object doesn't exist yet.
* main: Test ats run (#229) Release 23.11.2 (#228) feat: Add comparison endpoint for impacted files (#212) Update shared version (#226) feat: add a filter for public/private repo filter for viewableRepositories (#224) fix: speedup flag filtering in GraphQL API (#223) fix: Disable early notify comment (#219) Add 'value' key to the plan representation resolver (#216) 713 adjust available plans in plan service (#214) feat: Allow upload requests originating from Shelter to set storage path (#172)
Purpose/Motivation
Adding two new endpoints to public v2 API
Overall these endpoints improve response times compared to the two equivalent public v2 endpoints since data retrieved are precomputed by worker and payload is much less since not all files in the repo is returned in the response.
This also refactors some code with the GraphQL data loader to share the same query.
Links to relevant tickets
codecov/engineering-team#654
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.