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: get_repo_appropriate_bot_token returning None #403

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

joseph-sentry
Copy link
Contributor

@joseph-sentry joseph-sentry commented Apr 22, 2024

get_repo_appropriate_bot_token is returning None in some cases which is causing issues because it's expected to return a:
Tuple[Dict, Optional[Owner]].

I think the only way it can possibly return None is if get_public_token returns None, which is possible if we don't enter the if statement in get_public_token. So, if we don't enter it now, we now return a RepositoryWithoutValidBotError exception.

Fixes: https://codecov.sentry.io/issues/5238383824/?project=4505562667089920&referrer=github-pr-bot

get_repo_appropriate_bot_token is returning None in some cases which is
causing issues because it's expected to return a:
Tuple[Dict, Optional[Owner]].

I think the only way it can possibly return None is if get_public_token
returns None, which is possible if we don't enter the if statement in
get_public_token. So, if we don't enter it now, we now return a
RepositoryWithoutValidBotError exception.

Signed-off-by: joseph-sentry <[email protected]>
@codecov-notifications
Copy link

codecov-notifications bot commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #403      +/-   ##
==========================================
- Coverage   97.49%   97.48%   -0.01%     
==========================================
  Files         395      395              
  Lines       33370    33372       +2     
==========================================
  Hits        32533    32533              
- Misses        837      839       +2     
Flag Coverage Δ
integration 97.48% <0.00%> (-0.01%) ⬇️
latest-uploader-overall 97.48% <0.00%> (-0.01%) ⬇️
unit 97.48% <0.00%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 94.85% <0.00%> (-0.02%) ⬇️
OutsideTasks 97.53% <0.00%> (-0.01%) ⬇️
Files Coverage Δ
services/bots.py 98.37% <0.00%> (-1.63%) ⬇️

@codecov-qa
Copy link

codecov-qa bot commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 97.48%. Comparing base (0f97086) to head (ef71a74).

✅ All tests successful. No failed tests found ☺️

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #403      +/-   ##
==========================================
- Coverage   97.49%   97.48%   -0.01%     
==========================================
  Files         395      395              
  Lines       33370    33372       +2     
==========================================
  Hits        32533    32533              
- Misses        837      839       +2     
Flag Coverage Δ
integration 97.48% <0.00%> (-0.01%) ⬇️
latest-uploader-overall 97.48% <0.00%> (-0.01%) ⬇️
unit 97.48% <0.00%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 94.85% <0.00%> (-0.02%) ⬇️
OutsideTasks 97.53% <0.00%> (-0.01%) ⬇️
Files Coverage Δ
services/bots.py 98.37% <0.00%> (-1.63%) ⬇️

Copy link

codecov-public-qa bot commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 97.48%. Comparing base (0f97086) to head (ef71a74).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #403      +/-   ##
==========================================
- Coverage   97.49%   97.48%   -0.01%     
==========================================
  Files         395      395              
  Lines       33370    33372       +2     
==========================================
  Hits        32533    32533              
- Misses        837      839       +2     
Flag Coverage Δ
integration 97.48% <0.00%> (-0.01%) ⬇️
latest-uploader-overall 97.48% <0.00%> (-0.01%) ⬇️
unit 97.48% <0.00%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 94.85% <0.00%> (-0.02%) ⬇️
OutsideTasks 97.53% <0.00%> (-0.01%) ⬇️
Files Coverage Δ
services/bots.py 98.37% <0.00%> (-1.63%) ⬇️

Copy link

codecov bot commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 97.50%. Comparing base (0f97086) to head (ef71a74).

Changes have been made to critical files, which contain lines commonly executed in production. Learn more

✅ All tests successful. No failed tests found ☺️

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #403      +/-   ##
==========================================
- Coverage   97.51%   97.50%   -0.01%     
==========================================
  Files         426      426              
  Lines       34070    34072       +2     
==========================================
  Hits        33223    33223              
- Misses        847      849       +2     
Flag Coverage Δ
integration 97.48% <0.00%> (-0.01%) ⬇️
latest-uploader-overall 97.48% <0.00%> (-0.01%) ⬇️
unit 97.48% <0.00%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 94.86% <0.00%> (-0.02%) ⬇️
OutsideTasks 97.53% <0.00%> (-0.01%) ⬇️
Files Coverage Δ
services/bots.py Critical 98.37% <0.00%> (-1.63%) ⬇️

This change has been scanned for critical changes. Learn more

@joseph-sentry joseph-sentry requested a review from a team April 23, 2024 13:52
@joseph-sentry joseph-sentry added this pull request to the merge queue Apr 24, 2024
Merged via the queue into main with commit 303521d Apr 24, 2024
14 of 30 checks passed
@joseph-sentry joseph-sentry deleted the joseph/fix-get-repo-token-None branch April 24, 2024 15:15
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