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

Implement ProviderFactory and ProviderClassFactory #3131

Merged
merged 2 commits into from
Apr 19, 2024
Merged

Commits on Apr 19, 2024

  1. Implement ProviderFactory and ProviderClassFactory

    Relates to #2845
    
    Introduce two new constructs for creating providers. The top-level
    ProviderFactory takes the name/project or ID of a provider and
    instantiates it. In order to instantiate it, it checks the class of the
    provider, and delegates it to a ProviderClassFactory, which is
    responsible for creating it. This split exists so that we can register
    new types of provider while minimizing changes to existing code.
    
    This PR does not make use of the new interfaces. Instead, it just adds
    the implementations. This is to simplify review - the process of getting
    rid of the ProviderBuilder will involve a large number of small changes
    to many parts of code, and that will happen in another PR.
    
    Some points worth noting:
    
    1) This does not provide a ProviderClassFactory for REST or Git since we
       do not use standalone instances of those providers at this point in
       time. It should be trivial to write factories for those at the point
       in time when we need them.
    2) Based on discussion with Ozz and Jakub, I have decided to assume that
       the provider class column of the providers table will not be null for
       valid providers. This approach uses the class to figure out which
       concrete type is used to instantiate the provider, and is orthogonal
       to the traits, which describe the set of interfaces which that
       provider can support. In a future PR, I will make the class column
       non-nullable.
    dmjb committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    b3ffada View commit details
    Browse the repository at this point in the history
  2. fix conflict

    dmjb committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    b62306e View commit details
    Browse the repository at this point in the history