-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add ProviderManager, make provider deletion generic #3162
Conversation
Relates to #2845 Change the `ProviderFactory` to `ProviderManager`. Add new method for deleting provider instances. This hides provider-specific cleanup behind an appropriate interface, and removes some duplication of logic (with slightly different implementations) in different parts of the codebase.
@@ -38,7 +38,7 @@ func CleanUpUnmanagedProjects( | |||
proj uuid.UUID, | |||
querier db.Querier, | |||
authzClient authz.Client, | |||
providerService service.GitHubProviderService, | |||
providerManager manager.ProviderManager, |
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.
In future, I might investigate creating a ProjectService
or similar - right now we end up having to pass around a bunch of dependencies through the controlplane for the project creation logic.
This is nice! I haven't tested manually, but the code is looking good. Is there anything in particular you're looking for to take this out of draft? |
@eleftherias I need to add some test coverage, and also do some manual verification of the changes. |
@@ -22,6 +22,7 @@ import ( | |||
"github.com/google/uuid" |
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.
I decided to reuse these test cases to test the deletion codepath in GitHubProviderClassManager
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.
Ran some manual testing, everything is working as expected.
Relates to #2845
Change the
ProviderFactory
toProviderManager
. Add new method for deleting provider instances. This hides provider-specific cleanup behind an appropriate interface, and removes some duplication of logic (with slightly different implementations) in different parts of the codebase.Most of the code changes relate to wiring this new logic into the rest of the codebase and replacing what was there.
Summary
Provide a brief overview of the changes and the issue being addressed.
Explain the rationale and any background necessary for understanding the changes.
List dependencies required by this change, if any.
Fixes #(related issue)
Change Type
Mark the type of change your PR introduces:
Testing
Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.
Review Checklist: