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

Fix call to commit_components to use the right type #660

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

michelletran-codecov
Copy link
Contributor

@michelletran-codecov michelletran-codecov commented Jul 5, 2024

Purpose/Motivation

Fix call to commit_components to use the Owner type

Links to relevant tickets

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

What does this PR do?

It was originally passing in a User object, but actually needed an Owner object. Getting the commit was (silently) failing on service not found because a service is not associated with a User.

I tested this locally and it seems to get the YAML components for the commit now. Previously, it would default to the repo YAML, which would be unstable based on whether the repo YAML is set (or updated during sync).

I also added a log so that this shouldn't silently fail.

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

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.94%. Comparing base (2261c6d) to head (e4503f7).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##               main       #660   +/-   ##
===========================================
  Coverage   95.94000   95.94000           
===========================================
  Files           799        799           
  Lines         17896      17902    +6     
===========================================
+ Hits          17170      17176    +6     
  Misses          726        726           
Flag Coverage Δ
unit 91.55% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 91.55% <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.

@codecov-qa
Copy link

codecov-qa bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.55%. Comparing base (2261c6d) to head (e4503f7).

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main     #660   +/-   ##
=======================================
  Coverage   91.54%   91.55%           
=======================================
  Files         621      621           
  Lines       16579    16585    +6     
=======================================
+ Hits        15178    15184    +6     
  Misses       1401     1401           
Flag Coverage Δ
unit 91.55% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 91.55% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
graphql_api/types/commit/commit.py 100.00% <100.00%> (ø)
services/components.py 98.73% <100.00%> (ø)
services/yaml.py 100.00% <100.00%> (ø)

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@codecov-notifications
Copy link

codecov-notifications bot commented Jul 5, 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-public-qa bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.55%. Comparing base (2261c6d) to head (e4503f7).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #660   +/-   ##
=======================================
  Coverage   91.54%   91.55%           
=======================================
  Files         621      621           
  Lines       16579    16585    +6     
=======================================
+ Hits        15178    15184    +6     
  Misses       1401     1401           
Flag Coverage Δ
unit 91.55% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 91.55% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
graphql_api/types/commit/commit.py 100.00% <100.00%> (ø)
services/components.py 98.73% <100.00%> (ø)
services/yaml.py 100.00% <100.00%> (ø)

Impacted file tree graph

@michelletran-codecov michelletran-codecov force-pushed the 452_fix_commit_components_api branch 3 times, most recently from 7c5ec47 to fed4300 Compare July 5, 2024 16:01
It was originally passing in a `User` object, but actually needed an `Owner` object.
Getting the commit was (silently) failing on `service not found` because a service
is not associated with a `User`.

I tested this locally and it seems to get the YAML components for the commit now.
Previously, it would default to the repo YAML, which would be unstable based on
whether the repo YAML is set (or updated during sync).
This is because the `owner` doesn't _actually_ have to exist for
the sequence of code to work. So, updating this on the reality.
@michelletran-codecov michelletran-codecov marked this pull request as ready for review July 5, 2024 16:08
@michelletran-codecov michelletran-codecov requested a review from a team as a code owner July 5, 2024 16:08
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

1 participant