Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-45009

Move repository implementations to infrastructure

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • Unset
    • None

      Currently, what we'd consider "infrastructure" (as in the 5 layers) is spread around the codebase in various packages. Interfaces that should be core to the model are defined outside the model. We'll address this by moving code to packages following this pattern:

      infrastructure/

      {interface}

      /

      {kind}

      e.g.

      infrastructure/resourcerepository/gorm
      infrastructure/resourcerepository/memory
      infrastructure/relationrepository/spicedb

      First we'll start with the repository implementations. These should be moved out of "data" and to "infrastructure/resourcerepository/gorm" etc. This will consolidate migrations as well as the gorm data model.

      It is recommended that we first update the repository interface per above: removing "gorm" from it.

      As part of this, you'll notice that there are lots of dependencies on the repository details from other packages. A bunch of this is from tests setting up their own test db. We should refactor this out to a common "set up a test repository with test DB" routine that can be encapsulated inside the infrastructure layer, without exposing low level details like SQL migrations. (Then that can be used to use the gorm.DB if needed, though exposing this should not really be necessary. Just add a method to the repository.) This should probably be its own PR.

      Config types should be moved with the implementations they configure.

              Unassigned Unassigned
              rhit-ahenning Alec Henninger
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: