-
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
Log all type of "owner" arg for fetch_commit_yaml #818
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #818 +/- ##
===========================================
Coverage 96.23000 96.23000
===========================================
Files 812 812
Lines 18544 18544
===========================================
Hits 17845 17845
Misses 699 699
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I believe this change is not needed? Or was this a separate issue? |
services/yaml.py
Outdated
@@ -39,11 +39,21 @@ def fetch_commit_yaml(commit: Commit, owner: Owner | None) -> Dict | None: | |||
# have various exceptions, which we do not care about to get the final | |||
# yaml used for a commit, as any error here, the codecov.yaml would not | |||
# be used, so we return None here | |||
|
|||
if isinstance(owner, Owner): | |||
owner_arg = owner.ownerid |
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.
does owner.pk
not work here? I thought that it would...
services/yaml.py
Outdated
log.warning( | ||
f"Was not able to fetch yaml file for commit. Ignoring error and returning None. Exception: {e}", | ||
extra={ | ||
"commit_id": commit.commitid, | ||
"owner": owner.ownerid if owner else None, | ||
"owner_arg": owner_arg, |
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.
while we're logging things, do you want to log the object type? so when you have the id you know which table to .get()
from?
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.
could you add tests?
just gonna log the type of the arg, don't really need to know any details of what the owner is. |
The call from this function is coming from a lot of places, while it's only expecting a
Owner
type there has been other types being passed in.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.