Skip to content

Commit b10838c

Browse files
Merge pull request #50 from diffo-dev/48-update-to-diffo-041
0.2.3 — adopt diffo 0.4.1 changes, BaseCharacteristic auto-actions, a…
2 parents 5f29dff + 02970f9 commit b10838c

41 files changed

Lines changed: 88 additions & 505 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
1111

1212
<!-- changelog -->
1313

14+
## [v0.2.3](https://github.com/diffo-dev/diffo/compare/v0.2.2..v0.2.3) (2026-05-22)
15+
16+
### Maintenance:
17+
* updated to diffo 0.4.1 (issue #48)
18+
* refreshed agent guidance via `mix usage_rules.sync`
19+
20+
### Refactors:
21+
* adopted upstream `Diffo.Provider.Changes.{Define,Relate,Assign}` across 11 instance resources; deleted the local `DiffoExample.Changes.*` trio now that the same modules ship in diffo proper ([diffo#170](https://github.com/diffo-dev/diffo/pull/170))
22+
* slimmed 16 `BaseCharacteristic`-derived resources by relying on the auto-generated `:create`/`:update` actions ([diffo#171](https://github.com/diffo-dev/diffo/pull/171)) — ~360 lines removed; custom `:update` retained on `cable`, `path`, `circuit`, `constraints` where unit/bandwidth-profile composition is needed
23+
* `Cable.relate` inline `after_action` (which referenced an unaliased `Relationship` module) folded into `change Diffo.Provider.Changes.Relate`
24+
25+
### Resolved workarounds:
26+
* `DslAccess.qualify_result` now transitions to `:feasibilityChecked` — restores correct TMF form following [diffo#168](https://github.com/diffo-dev/diffo/pull/168) broadening the Assigner lifecycle gate to include `:feasibilityChecked`
27+
* `Util.summarise_characteristics/2` no longer called from tests — typed characteristic + pool records now surface in TMF JSON by default ([diffo#169](https://github.com/diffo-dev/diffo/pull/169)). The projection function is retained in [lib/diffo_example/util.ex](lib/diffo_example/util.ex) for future projection demonstrations. Expected JSON strings updated across `cable`, `card`, `cable`, `path`, `shelf`, `dsl_access`, `nbn_ethernet` tests to reflect the real typed/pool surfacing
28+
1429
## [v0.2.2](https://github.com/diffo-dev/diffo/compare/v0.2.1..v0.2.2) (2026-05-21)
1530

1631
### Maintenance:

lib/access/resources/cable.ex

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,21 @@ defmodule DiffoExample.Access.Cable do
7070
argument :characteristic_value_updates, {:array, :term}
7171

7272
change set_attribute(:resource_state, :operating)
73-
change DiffoExample.Changes.Define
73+
change Diffo.Provider.Changes.Define
7474
end
7575

7676
update :relate do
7777
description "relates the cable with other instances"
7878
argument :relationships, {:array, :struct}
7979

80-
change after_action(fn changeset, result, _context ->
81-
with {:ok, result} <- Relationship.relate_instance(result, changeset),
82-
{:ok, result} <- Access.get_cable_by_id(result.id),
83-
do: {:ok, result}
84-
end)
80+
change Diffo.Provider.Changes.Relate
8581
end
8682

8783
update :assign_pair do
8884
description "relates the cable with an instance by assigning a pair"
8985
argument :assignment, :struct, constraints: [instance_of: Assignment]
9086

91-
change {DiffoExample.Changes.Assign, pool: :pairs}
87+
change {Diffo.Provider.Changes.Assign, pool: :pairs}
9288
end
9389
end
9490
end

lib/access/resources/card.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,21 @@ defmodule DiffoExample.Access.Card do
7070
argument :characteristic_value_updates, {:array, :term}
7171

7272
change set_attribute(:resource_state, :operating)
73-
change DiffoExample.Changes.Define
73+
change Diffo.Provider.Changes.Define
7474
end
7575

7676
update :relate do
7777
description "relates the card with other instances"
7878
argument :relationships, {:array, :struct}
7979

80-
change DiffoExample.Changes.Relate
80+
change Diffo.Provider.Changes.Relate
8181
end
8282

8383
update :assign_port do
8484
description "relates the card with an instance by assigning a port"
8585
argument :assignment, :struct, constraints: [instance_of: Assignment]
8686

87-
change {DiffoExample.Changes.Assign, pool: :ports}
87+
change {Diffo.Provider.Changes.Assign, pool: :ports}
8888
end
8989
end
9090

lib/access/resources/characteristic_values/cable_characteristic.ex

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ defmodule DiffoExample.Access.CableCharacteristic do
1616
end
1717

1818
actions do
19-
create :create do
20-
accept [:name, :pairs, :length_amount, :length_unit, :loss_amount, :loss_unit, :technology]
21-
argument :instance_id, :uuid
22-
argument :feature_id, :uuid
23-
change manage_relationship(:instance_id, :instance, type: :append)
24-
change manage_relationship(:feature_id, :feature, type: :append)
25-
end
26-
2719
update :update do
2820
accept [:pairs, :technology, :length_amount, :length_unit, :loss_amount, :loss_unit]
2921
argument :length, :term, allow_nil?: true

lib/access/resources/characteristic_values/card_characteristic.ex

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,6 @@ defmodule DiffoExample.Access.CardCharacteristic do
1313
plural_name :card_characteristics
1414
end
1515

16-
actions do
17-
create :create do
18-
accept [:name, :family, :model, :technology]
19-
argument :instance_id, :uuid
20-
argument :feature_id, :uuid
21-
change manage_relationship(:instance_id, :instance, type: :append)
22-
change manage_relationship(:feature_id, :feature, type: :append)
23-
end
24-
25-
update :update do
26-
accept [:family, :model, :technology]
27-
end
28-
end
29-
3016
attributes do
3117
attribute :family, :atom, public?: true
3218
attribute :model, :string, public?: true

lib/access/resources/characteristic_values/path_characteristic.ex

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,6 @@ defmodule DiffoExample.Access.PathCharacteristic do
1616
end
1717

1818
actions do
19-
create :create do
20-
accept [
21-
:name,
22-
:device_name,
23-
:sections,
24-
:length_amount,
25-
:length_unit,
26-
:loss_amount,
27-
:loss_unit,
28-
:technology
29-
]
30-
31-
argument :instance_id, :uuid
32-
argument :feature_id, :uuid
33-
change manage_relationship(:instance_id, :instance, type: :append)
34-
change manage_relationship(:feature_id, :feature, type: :append)
35-
end
36-
3719
update :update do
3820
accept [
3921
:device_name,

lib/access/resources/characteristic_values/shelf_characteristic.ex

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,6 @@ defmodule DiffoExample.Access.ShelfCharacteristic do
1313
plural_name :shelf_characteristics
1414
end
1515

16-
actions do
17-
create :create do
18-
accept [:name, :device_name, :family, :model, :technology]
19-
argument :instance_id, :uuid
20-
argument :feature_id, :uuid
21-
change manage_relationship(:instance_id, :instance, type: :append)
22-
change manage_relationship(:feature_id, :feature, type: :append)
23-
end
24-
25-
update :update do
26-
accept [:device_name, :family, :model, :technology]
27-
end
28-
end
29-
3016
attributes do
3117
attribute :device_name, :string, public?: true
3218
attribute :family, :atom, public?: true

lib/access/resources/path.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ defmodule DiffoExample.Access.Path do
6464
description "defines the path"
6565
argument :characteristic_value_updates, {:array, :term}
6666

67-
change DiffoExample.Changes.Define
67+
change Diffo.Provider.Changes.Define
6868
end
6969

7070
update :relate do
7171
description "relates the path with other instances"
7272
argument :relationships, {:array, :struct}
7373

74-
change DiffoExample.Changes.Relate
74+
change Diffo.Provider.Changes.Relate
7575
end
7676
end
7777

lib/access/resources/shelf.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,21 @@ defmodule DiffoExample.Access.Shelf do
7070
argument :characteristic_value_updates, {:array, :term}
7171

7272
change set_attribute(:resource_state, :operating)
73-
change DiffoExample.Changes.Define
73+
change Diffo.Provider.Changes.Define
7474
end
7575

7676
update :relate do
7777
description "relates the shelf with cards"
7878
argument :relationships, {:array, :struct}
7979

80-
change DiffoExample.Changes.Relate
80+
change Diffo.Provider.Changes.Relate
8181
end
8282

8383
update :assign_slot do
8484
description "relates the shelf with an instance by assigning a slot"
8585
argument :assignment, :struct, constraints: [instance_of: Assignment]
8686

87-
change {DiffoExample.Changes.Assign, pool: :slots}
87+
change {Diffo.Provider.Changes.Assign, pool: :slots}
8888
end
8989
end
9090

lib/access/services/characteristic_values/aggregate_characteristic.ex

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,6 @@ defmodule DiffoExample.Access.AggregateCharacteristic do
1313
plural_name :aggregate_characteristics
1414
end
1515

16-
actions do
17-
create :create do
18-
accept [
19-
:name,
20-
:interface_name,
21-
:physical_interface,
22-
:physical_layer,
23-
:link_layer,
24-
:svlan_id,
25-
:vpi
26-
]
27-
28-
argument :instance_id, :uuid
29-
argument :feature_id, :uuid
30-
change manage_relationship(:instance_id, :instance, type: :append)
31-
change manage_relationship(:feature_id, :feature, type: :append)
32-
end
33-
34-
update :update do
35-
accept [:interface_name, :physical_interface, :physical_layer, :link_layer, :svlan_id, :vpi]
36-
end
37-
end
38-
3916
attributes do
4017
attribute :interface_name, :string, public?: true
4118
attribute :physical_interface, :string, public?: true

0 commit comments

Comments
 (0)