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

feat: Add an endpoint to get all uploads of a given commit (#112 internal) #260

Merged
merged 9 commits into from
Nov 26, 2023

Conversation

JerrySentry
Copy link
Contributor

@JerrySentry JerrySentry commented Nov 21, 2023

Purpose/Motivation

What is the feature? Why is this being done?

Adds a new endpoint (/api/v2/{service}/{owner_username}/repos/{repo_name}/commits/{commitsha}/uploads) to return list of uploads for a given commit report by the commit SHA.

Links to relevant tickets

https://github.com/codecov/internal-issues/issues/112

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.

@@ -47,3 +53,39 @@ class CommitDetailSerializer(CommitSerializer):
class Meta:
model = Commit
fields = CommitSerializer.Meta.fields + ("report",)


Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A subset of fields of the ReportSession model, matching the contents of old v1 sessions endpoint, except keys are descriptive instead of single letters from before.

@codecov-staging
Copy link

codecov-staging bot commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (94314d0) 95.62% compared to head (baeb4b1) 95.63%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #260      +/-   ##
==========================================
+ Coverage   95.62%   95.63%   +0.01%     
==========================================
  Files         607      607              
  Lines       15600    15641      +41     
==========================================
+ Hits        14917    14958      +41     
  Misses        683      683              
Flag Coverage Δ
unit 95.63% <100.00%> (+0.01%) ⬆️
unit-latest-uploader 95.63% <100.00%> (+0.01%) ⬆️

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.

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (94314d0) 95.53% compared to head (baeb4b1) 95.54%.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #260     +/-   ##
=======================================
+ Coverage   95.53   95.54   +0.01     
=======================================
  Files        721     721             
  Lines      16007   16048     +41     
=======================================
+ Hits       15291   15332     +41     
  Misses       716     716             
Flag Coverage Δ
unit 95.63% <100.00%> (+0.01%) ⬆️
unit-latest-uploader 95.63% <100.00%> (+0.01%) ⬆️

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 JerrySentry changed the title [WIP] feat: Add an endpoint to get all uploads of a given commit (#112 internal) feat: Add an endpoint to get all uploads of a given commit (#112 internal) Nov 22, 2023
@@ -68,6 +71,10 @@ def get_complexity_ratio(self, totals) -> float:
)


class UploadTotalsSerializer(BaseTotalsSerializer):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically no, but I just do this to be more explicit about it. And BaseTotalsSerializer acts as a ABC even though it is not

@JerrySentry JerrySentry merged commit fb9fe94 into main Nov 26, 2023
19 of 20 checks passed
@JerrySentry JerrySentry deleted the api_i112 branch November 26, 2023 22:55
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.

None yet

3 participants