Skip to content

provider extension consolidation #103

@matt-beanland

Description

@matt-beanland

Goal

Replace the current per-fragment extensions (Instance.Extension, Party.Extension, Place.Extension) with a single Diffo.Provider.Extension used by all three base fragments.

New DSL shape

All provider resources declare a single top-level provider do section. The available entities inside it depend on which base fragment is in use, enforced by verifiers.

Instance resource:

provider do
  specification do
    id "da9b207a-..."
    name "DSL Access Service"
    major_version 1
  end

  characteristic :downstream_speed, MyApp.Speed

  feature :voice, is_enabled?: false

  party :provider, MyApp.RSP
  parties :installer, MyApp.Engineer, constraints: [min: 1, max: 3]
  party_ref :owner, MyApp.Organization

  place :site, MyApp.GeographicSite
  place_ref :billing_address, MyApp.Address

  behaviour do
    actions do
      create :build
    end
  end
end

Party or Place resource:

provider do
  role :provider, MyApp.BroadbandService
  role :operator, MyApp.Cluster
end

Key design decisions

  • party/parties and place/places declare direct edges (create a PartyRef/PlaceRef node). party_ref/party_refs and place_ref/place_refs declare reference relationships (no direct edge — replaces reference: true option). The intent is explicit in the keyword rather than an option.
  • behaviour do moves inside provider do rather than being a peer section.
  • role stays as the keyword for Party/Place resources declaring their participation in instances and other parties/places.
  • All base fragments (BaseInstance, BaseParty, BasePlace) reference the single Diffo.Provider.Extension.

What unifies

  • One extension module → one Diffo.Provider.Extension.Info introspection module
  • One cheat sheet (DSL-Diffo.Provider.Extension.md)
  • Verifiers collapse — verify_roles.ex currently duplicated across instance/party/place extension verifier directories becomes one set
  • mix.exs spark aliases, .formatter.exs spark_locals_without_parens, and igniter installer all reference a single extension
  • Transformers/persisters are already entity-driven; mostly path consolidation

Breaking change

This is a 0.3.0 breaking change. Migration is straightforward:

  • structure do ... end + behaviour do ... endprovider do ... end
  • instances do role ... end / parties do role ... endprovider do role ... end
  • party :x, M, reference: trueparty_ref :x, M

No igniter upgrade task for 0.3.0 (consumer base is small). Add one for the next breaking change after 0.3.0 to dogfood the igniter upgrade pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreMaintenancerefactoringImproving existing code without changing functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions