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

Revert "feat: use GithubAppInstallation in api (#347)" #355

Merged
merged 1 commit into from Jan 24, 2024

Conversation

giovanni-guidini
Copy link
Contributor

This reverts commit 86178ba.

This commit caused auth issues with /graphql endpoint in which users were not authenticated and couldn't see source code.

Revertign for now while we figure out the exact issue and fix it.

Purpose/Motivation

What is the feature? Why is this being done?

Links to relevant tickets

What does this PR do?

Include a brief description of the changes in this PR. Bullet points are your friend.

Notes to Reviewer

Anything to note to the team? Any tips on how to review, or where to start?

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.

This reverts commit 86178ba.

This commit caused auth issues with `/graphql` endpoint in which
users were not authenticated and couldn't see source code.

Revertign for now while we figure out the exact issue and fix it.
@codecov-staging
Copy link

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Files Patch % Lines
utils/github.py 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Jan 24, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (86178ba) 96.06% compared to head (ca500c5) 96.05%.

Files Patch % Lines
utils/github.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #355      +/-   ##
==========================================
- Coverage   96.06%   96.05%   -0.01%     
==========================================
  Files         628      628              
  Lines       16357    16307      -50     
==========================================
- Hits        15713    15664      -49     
+ Misses        644      643       -1     
Flag Coverage Δ
unit 96.05% <92.30%> (-0.01%) ⬇️
unit-latest-uploader 96.05% <92.30%> (-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.

Copy link

Codecov Report

Merging #355 (ca500c5) into main (86178ba) will decrease coverage by 0.01%.
The diff coverage is 92.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #355      +/-   ##
==========================================
- Coverage   96.06%   96.05%   -0.01%     
==========================================
  Files         628      628              
  Lines       16357    16307      -50     
==========================================
- Hits        15713    15664      -49     
+ Misses        644      643       -1     
Flag Coverage Δ
unit 96.05% <92.30%> (-0.01%) ⬇️
unit-latest-uploader 96.05% <92.30%> (-0.01%) ⬇️

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

Files Coverage Δ
services/repo_providers.py 97.91% <100.00%> (+1.42%) ⬆️
upload/helpers.py 94.02% <100.00%> (-0.23%) ⬇️
webhook_handlers/views/github.py 98.88% <100.00%> (-0.12%) ⬇️
utils/github.py 80.00% <50.00%> (ø)

Impacted file tree graph

@giovanni-guidini giovanni-guidini merged commit 226f73d into main Jan 24, 2024
11 of 17 checks passed
@giovanni-guidini giovanni-guidini deleted the fix/revert-ghapp-usage-pr branch January 24, 2024 18:47
giovanni-guidini added a commit that referenced this pull request Jan 25, 2024
giovanni-guidini added a commit that referenced this pull request Jan 30, 2024
* Revert "Revert "feat: use GithubAppInstallation in api (#347)" (#355)"

This reverts commit 226f73d.

* fix: logged in users can't see coverage bug

This bug caused a little incident in Codecov.

The actual issue is that we can't make DB queries syncronously from an
async context.

When getting the file content we have to get an adapter,
and that - since the GithubAppInstallation work - required a query to
the database to get the default GithubAppInstallation for an `owner`.
That was the actual error that caused the incident.

Error surfacing was terrible in that endpoint so I changed the `info` log
from an `exception` one so we can have a stacktrace.

To actually fix the error I actually created an async version of `get_adapter`.
I scanned the code, but it seems that this instance is the only place where we
actually use this.

* fix tests

Tests for the interactor (which is async) are now marked as `async`.

I believe that marking them with `@async_to_sync` instead of `pytest.mark.async`
may have hidden the bug that we faced about running the DB query in the async context.
Not tested this theory tho.

* add more unit tests to async paths
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