-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add conditional based on upload type #452
Conversation
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.
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.
shared/typings/torngit.py
Outdated
@@ -25,9 +30,13 @@ class GithubInstallationInfo(TypedDict): | |||
app_id: Optional[int] | |||
pem_path: Optional[str] | |||
|
|||
class AdditionalData(TypedDict): | |||
upload_type: Optional[UploadType] |
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.
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 😅
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.
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
…ilot-btn-from-ba-pr-comment-fr
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.