-
Notifications
You must be signed in to change notification settings - Fork 28
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: carefully assign ghapp names #467
Conversation
webhook_handlers/views/github.py
Outdated
installation_default_app_id = get_config("github", "integration", "id") | ||
# `app_id` and `installation_default_app_id` should both be ints | ||
# But just to avoid differences parsing either the YAML or the request data | ||
# Casting them to str for the comparison (str has less change of failing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to check if pem_path is set here. If it is, we can also not change the name. Otherwise we are enforcing only one default app.
The configuration for ghapps need to be done carefully before they can be used. And that process is _manual_. However it's very simple for a user to simply go and install an app to their organization and point it's webhooks to us. In this case we would think it's the default app and break the app. So now we update the app's names everytime we get a new webhook for it. Only the configured default app may use the default name, all others, unless they manually receive a custom name, will be 'unconfigured_app'. Closes: codecov/engineering-team#1445
6ef8b6b
to
2ac7094
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #467 +/- ##
=======================================
Coverage 96.05% 96.05%
=======================================
Files 643 643
Lines 17120 17127 +7
=======================================
+ Hits 16444 16451 +7
Misses 676 676
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## main #467 +/- ##
=======================================
Coverage 96.05% 96.05%
=======================================
Files 643 643
Lines 17120 17127 +7
=======================================
+ Hits 16444 16451 +7
Misses 676 676
Flags with carried forward coverage won't be shown. Click here to find out more.
|
2ac7094
to
64f6aeb
Compare
Allows for multiple apps with the default name, as long as they are configured. Basically for an app to have a custom name (including the default one), it needs to be configured. Otherwise it's moved to the "unconfigured_app" category.
64f6aeb
to
76dbd20
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Changes have been made to critical files, which contain lines commonly executed in production. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #467 +/- ##
=====================================
Coverage 95.78 95.78
=====================================
Files 765 765
Lines 17706 17713 +7
=====================================
+ Hits 16958 16965 +7
Misses 748 748
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
The configuration for ghapps need to be done carefully before they can
be used. And that process is manual.
However it's very simple for a user to simply go and install an app to
their organization and point it's webhooks to us. In this case we would
think it's the default app and break the app.
So now we update the app's names everytime we get a new webhook for it.
Only the configured default app may use the default name, all others,
unless they manually receive a custom name, will be 'unconfigured_app'.
Closes: codecov/engineering-team#1445
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.