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 conditional based on upload type #452

Merged
merged 4 commits into from
Dec 12, 2024

Conversation

adrian-codecov
Copy link
Contributor

The copilot AI button appears in every PR comment but should not appear in the BA PR comment. This solution adds a way to specify the upload type and manipulate the data being sent to GH.

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.

Copy link
Contributor

@giovanni-guidini giovanni-guidini left a comment

Choose a reason for hiding this comment

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

Interesting choice to extend the whole TorngitInstanceData instead of just the function. I suppose we can benefit from that additional_data tho.

I was surprised we didn't have an UploadType enum already.

@@ -25,9 +30,13 @@ class GithubInstallationInfo(TypedDict):
app_id: Optional[int]
pem_path: Optional[str]

class AdditionalData(TypedDict):
upload_type: Optional[UploadType]
Copy link
Contributor

Choose a reason for hiding this comment

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

When you say "Optional" this indicates that the key will always be there.
Looking above the initialization is just {} (no key).

If the key may or may not be present then use NotRequired (https://docs.python.org/3/whatsnew/3.11.html#pep-655-marking-individual-typeddict-items-as-required-or-not-required)

I'm sure other fields in this file suffer from the same problem 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have an UploadType that's the DB Enum. We do have a ReportType in Worker that has what I'm looking for, so I'll add that to this change

And will add the NotRequired, TIL

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.98%. Comparing base (1c4ca00) to head (889173f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #452      +/-   ##
==========================================
- Coverage   90.58%   89.98%   -0.60%     
==========================================
  Files         400      324      -76     
  Lines       12487     9214    -3273     
  Branches     2102     1634     -468     
==========================================
- Hits        11311     8291    -3020     
+ Misses       1068      860     -208     
+ Partials      108       63      -45     
Flag Coverage Δ
shared-docker-uploader ?

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.

@adrian-codecov adrian-codecov added this pull request to the merge queue Dec 12, 2024
Merged via the queue into main with commit b9d7171 Dec 12, 2024
6 checks passed
@adrian-codecov adrian-codecov deleted the 2876-remove-copilot-btn-from-ba-pr-comment-fr branch December 12, 2024 17:09
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.

2 participants