Skip to content

pass in registry id if more than one #43

Open

Description

@ndamania00
No description provided.

Activity

  1. added a commit that references this issue on Oct 22, 2026
    5dc144d
  2. mghent commented on Oct 22, 2026

    @mghent
    Contributor

    We ran across this on a tenant with 6 organizations / registries. There are also repeat entity names across registries (e.g. Plasmid). Today get_one returns the first schema whose warehouse name matches, so an operation on plasmid could act on a different registry inadvertently. Creating a dropdown or schema also trips the assert partway through a migration.

    #262 adds an optional registry_id to BenchlingConnection, resolved with GET /api/v3/registry/{id}. When it's set, schema and dropdown lists are filtered to that registry, and results schemas to its organization. Without it, single-registry tenants behave exactly as before. On multi-registry tenants, Liminal raises an error instead of guessing, and creates fail during validation before anything runs.

    Some notes on the approach:

    • By ID. Registry names are case sensitive but shown in capitals in the UI, so they're easy to get wrong. A connection is already per tenant, so the ID sits naturally beside its credentials, and the registry never appears in model or revision files.
    • Separate revision histories. Each registry finds and creates its own liminal_remote, so on a multi-registry tenant each registry gets its own Liminal directory (env.py and versions/).
    • Error, not warning. An ambiguous lookup raises AmbiguousRegistryError, a ValueError subclass, so Liminal never changes a schema in the wrong registry.

    We tested it live on that tenant. Reads were scoped correctly, and generate-files then diff came back clean for two registries. A scoped dropdown, schema and liminal_remote were created in the chosen registry, and unscoped creates were blocked before any request. One thing we learned is that the App needs registry admin on the target registry. Organization admin alone returns a 403. Happy to adjust any of this.

  3. nirmitdamania-benchling commented on Oct 28, 2026

    @nirmitdamania-benchling

    @mghent Thanks for taking this on!! I'll review this shortly but at a high-level, this is definitely aligned with how I was thinking about this.

    Sounds like the multiple revision histories per registry has been working well for you so far? This was something I was unsure about

  4. mghent commented on Oct 28, 2026

    @mghent
    Contributor

    Thanks, happy to help. Our setup is a bit non-standard, with multiple registries in a single tenant. We've set it up with one Liminal project per registry, each with its own versions/ chain and its own remote in that registry.

    We've tested:

    • recording a baseline on one registry, and generating a second against the same tenant, with each diff clean on its own
    • applying a revision on one registry, then checking that the other registry's remote and diff didn't change

    The registries are fully independent, with nothing linking across them, so separate histories have been a natural fit. The registry scoping in #262 keeps the registries isolated.

  5. nirmitdamania-benchling commented on Nov 2, 2026

    @nirmitdamania-benchling

    I want to confirm if a modification to this implementation would work in your case. I think in the case where tenant has multiple registries and registry_id is not set, BenchlingService itself will validate in its __init__ whether it has ambiguous registries len(self._registries) > 1 and self.connection.registry_id is None.

    This simplifies the implementation and validation a lot around the codebase, where we can now validate in the generic api call helpers instead of in various functions around the codebase. It will also warn the user earlier on.

    I committed some changes here to this follow up PR #274. I'm still waiting to setup my tenant with multiple tenants, but if you're able to test them, that would be super helpful!!

    Let me know your thoughts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions