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

DM-39944: Replace Butler.registry with registry shim #864

Merged
merged 6 commits into from
Jul 14, 2023

Commits on Jul 12, 2023

  1. Rename Butler.registry attribute to _registry

    This is a trivial change, internally Butler uses `_registry` but it is also
    exposed as `registry` property. In the next commits `registry` property
    will return a special shim object, this will allow us to transparently
    update registry implementation without breaking client-visible interfaces.
    andy-slac committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    d4f7541 View commit details
    Browse the repository at this point in the history
  2. Split Registry interface into two classes.

    `Registry` ABC now contains methods used by regular registry clients, this
    interface is exposed via `Butler.registry` property. `ButlerRegistry` ABC
    extends `Registry` with methods that are used by Butler, this includes
    factory methods and a couple of internal methods. SQL and remote
    implementations now inherit `ButlerRegistry`, they are not changed otherwise.
    
    Also dropped `Registry.datasetIdFactory` attribute, we now have more transparent
    method for generating dataset IDs and this attribute is not used.
    andy-slac committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    c0f1526 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2023

  1. Add RegistryShim class.

    This new class implements `Registry` interface and forwards all methods
    to other objects. Everything is forwarded to `Butler._registry` now, but
    this will change as we start refactoring ButlerRegistry implementation.
    andy-slac committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    1e82440 View commit details
    Browse the repository at this point in the history
  2. Move registry factory methods to a separate class.

    Trying to further separate concerns into independent classes. Re-introduced
    `Registry.createFromConfig` to avoid updating tests in many other packages.
    andy-slac committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    020fe5b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6e3cf8a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5b07c4d View commit details
    Browse the repository at this point in the history