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

feat: add function to get specific app's details #470

Merged
merged 1 commit into from
May 31, 2024

Conversation

giovanni-guidini
Copy link
Contributor

@giovanni-guidini giovanni-guidini commented May 28, 2024

Adds get_specific_github_app_details function to bots service.
This allows us to get GithubInstallationInfo for the app we want.

It fails with a new exception if the app can't be found.
This is because this feature will be used to get the app that made a comment
or status check. If we don't use the same app to edit said comment it won't work.

On top of that we need to start saving the ID of the apps we selected for Torngit adapter instances

👀 This commit is part 2/4 of a bigger change that is actually done, but I decided to break it up into multiple PRs so it's easier to review. See how it plays with the rest here: main...gio/pin-commit-to-ghapp

(I'll try to leave the original branch up to date best as I can)

@giovanni-guidini giovanni-guidini changed the base branch from gio/pin-commit-to-ghapp to main May 28, 2024 15:07
@giovanni-guidini giovanni-guidini force-pushed the gio/pin-commits/get-exact-app-info branch from 56c2677 to 8386477 Compare May 28, 2024 15:17
@codecov-notifications
Copy link

codecov-notifications bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #470   +/-   ##
=======================================
  Coverage   97.26%   97.26%           
=======================================
  Files         411      412    +1     
  Lines       34153    34187   +34     
=======================================
+ Hits        33218    33252   +34     
  Misses        935      935           
Flag Coverage Δ
integration 97.26% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.26% <100.00%> (+<0.01%) ⬆️
unit 97.26% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.37% <100.00%> (+<0.01%) ⬆️
OutsideTasks 97.52% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
database/models/core.py 97.10% <100.00%> (+<0.01%) ⬆️
helpers/exceptions.py 100.00% <100.00%> (ø)
services/bots/github_apps.py 97.43% <100.00%> (+0.29%) ⬆️
services/bots/tests/test_bots.py 100.00% <ø> (ø)
services/bots/tests/test_github_apps.py 100.00% <100.00%> (ø)
services/tests/test_bots.py 100.00% <ø> (ø)
services/tests/test_owner_service.py 100.00% <ø> (ø)
services/tests/test_repository_service.py 99.76% <ø> (ø)

@codecov-qa
Copy link

codecov-qa bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.26%. Comparing base (2492b5e) to head (6b8670d).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #470   +/-   ##
=======================================
  Coverage   97.26%   97.26%           
=======================================
  Files         411      412    +1     
  Lines       34153    34187   +34     
=======================================
+ Hits        33218    33252   +34     
  Misses        935      935           
Flag Coverage Δ
integration 97.26% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.26% <100.00%> (+<0.01%) ⬆️
unit 97.26% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.37% <100.00%> (+<0.01%) ⬆️
OutsideTasks 97.52% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
database/models/core.py 97.10% <100.00%> (+<0.01%) ⬆️
helpers/exceptions.py 100.00% <100.00%> (ø)
services/bots/github_apps.py 97.43% <100.00%> (+0.29%) ⬆️
services/bots/tests/test_bots.py 100.00% <ø> (ø)
services/bots/tests/test_github_apps.py 100.00% <100.00%> (ø)
services/tests/test_bots.py 100.00% <ø> (ø)
services/tests/test_owner_service.py 100.00% <ø> (ø)
services/tests/test_repository_service.py 99.76% <ø> (ø)

Copy link

codecov-public-qa bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.26%. Comparing base (2492b5e) to head (6b8670d).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #470   +/-   ##
=======================================
  Coverage   97.26%   97.26%           
=======================================
  Files         411      412    +1     
  Lines       34153    34187   +34     
=======================================
+ Hits        33218    33252   +34     
  Misses        935      935           
Flag Coverage Δ
integration 97.26% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.26% <100.00%> (+<0.01%) ⬆️
unit 97.26% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.37% <100.00%> (+<0.01%) ⬆️
OutsideTasks 97.52% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
database/models/core.py 97.10% <100.00%> (+<0.01%) ⬆️
helpers/exceptions.py 100.00% <100.00%> (ø)
services/bots/github_apps.py 97.43% <100.00%> (+0.29%) ⬆️
services/bots/tests/test_bots.py 100.00% <ø> (ø)
services/bots/tests/test_github_apps.py 100.00% <100.00%> (ø)
services/tests/test_bots.py 100.00% <ø> (ø)
services/tests/test_owner_service.py 100.00% <ø> (ø)
services/tests/test_repository_service.py 99.76% <ø> (ø)

Copy link

codecov bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.29%. Comparing base (2492b5e) to head (6b8670d).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #470   +/-   ##
=======================================
  Coverage   97.29%   97.29%           
=======================================
  Files         442      443    +1     
  Lines       34882    34916   +34     
=======================================
+ Hits        33938    33972   +34     
  Misses        944      944           
Flag Coverage Δ
integration 97.26% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.26% <100.00%> (+<0.01%) ⬆️
unit 97.26% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.43% <100.00%> (+<0.01%) ⬆️
OutsideTasks 97.52% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
database/models/core.py 97.10% <100.00%> (+<0.01%) ⬆️
helpers/exceptions.py 100.00% <100.00%> (ø)
services/bots/github_apps.py 97.43% <100.00%> (+0.29%) ⬆️
services/bots/tests/test_bots.py 100.00% <ø> (ø)
services/bots/tests/test_github_apps.py 100.00% <100.00%> (ø)
services/tests/test_bots.py 100.00% <ø> (ø)
services/tests/test_owner_service.py 100.00% <ø> (ø)
services/tests/test_repository_service.py 99.76% <ø> (ø)

This change has been scanned for critical changes. Learn more

@giovanni-guidini giovanni-guidini requested a review from a team May 28, 2024 15:31
Adds `get_specific_github_app_details` function to bots service.
This allows us to get `GithubInstallationInfo` for the app we want.

It fails with a new exception if the app can't be found.
This is because this feature will be used to get the app that made a comment
or status check. If we don't use the same to edit said comment it won't work.

On top of that we need to start saving the ID of the apps we selected for Torngit adapter instances
@giovanni-guidini giovanni-guidini force-pushed the gio/pin-commits/get-exact-app-info branch from 8386477 to 6b8670d Compare May 30, 2024 11:22
@giovanni-guidini giovanni-guidini added this pull request to the merge queue May 31, 2024
Merged via the queue into main with commit 4a0347d May 31, 2024
29 of 30 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/pin-commits/get-exact-app-info branch May 31, 2024 08:21
giovanni-guidini added a commit to codecov/shared that referenced this pull request Jun 7, 2024
I broke the GH fallback system again 😅
Fixes this issue: https://l.codecov.dev/dEsZeK

The problem is that since #225
(technically codecov/worker#470 actually) we include 1 extra piece of information in `GitHubAppInstallationInfo`, the `GitHubAppInstallation.id`.

This is breaking the function that gets tokens because we are destructuring the info dict
into the kwargs for the function (with the extra, unexpected `id` one).

To fix that we just pop it before calling the function.
github-merge-queue bot pushed a commit to codecov/shared that referenced this pull request Jun 10, 2024
I broke the GH fallback system again 😅
Fixes this issue: https://l.codecov.dev/dEsZeK

The problem is that since #225
(technically codecov/worker#470 actually) we include 1 extra piece of information in `GitHubAppInstallationInfo`, the `GitHubAppInstallation.id`.

This is breaking the function that gets tokens because we are destructuring the info dict
into the kwargs for the function (with the extra, unexpected `id` one).

To fix that we just pop it before calling the function.
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

2 participants