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

Log all type of "owner" arg for fetch_commit_yaml #818

Merged
merged 5 commits into from
Sep 13, 2024
Merged

Conversation

JerrySentry
Copy link
Contributor

@JerrySentry JerrySentry commented Sep 12, 2024

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.

@codecov-notifications
Copy link

codecov-notifications bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.23%. Comparing base (177d212) to head (78ee760).
Report is 2 commits behind head on main.

✅ 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           
Flag Coverage Δ
unit 92.45% <ø> (ø)
unit-latest-uploader 92.45% <ø> (ø)

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.

@drazisil-codecov
Copy link
Contributor

I believe this change is not needed? Or was this a separate issue?

@JerrySentry JerrySentry changed the title fix owner.ownerid to owner.pk Check and log all scenarios of "owner" arg for fetch_commit_yaml Sep 12, 2024
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
Copy link
Contributor

@nora-codecov nora-codecov Sep 12, 2024

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,
Copy link
Contributor

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?

Copy link
Contributor

@nora-codecov nora-codecov left a 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?

@JerrySentry JerrySentry changed the title Check and log all scenarios of "owner" arg for fetch_commit_yaml Log all type of "owner" arg for fetch_commit_yaml Sep 13, 2024
@JerrySentry
Copy link
Contributor Author

just gonna log the type of the arg, don't really need to know any details of what the owner is.

@JerrySentry JerrySentry added this pull request to the merge queue Sep 13, 2024
Merged via the queue into main with commit 822487b Sep 13, 2024
18 of 19 checks passed
@JerrySentry JerrySentry deleted the sep_12_fix branch September 13, 2024 13:02
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.

3 participants