diff --git a/federation/service/exposed_module_actions.gen.go b/federation/service/exposed_module_actions.gen.go index f42952729..2221e6b24 100644 --- a/federation/service/exposed_module_actions.gen.go +++ b/federation/service/exposed_module_actions.gen.go @@ -119,6 +119,7 @@ func (p exposedModuleActionProps) serialize() actionlog.Meta { if p.module != nil { m.Set("module.ID", p.module.ID, true) m.Set("module.ComposeModuleID", p.module.ComposeModuleID, true) + m.Set("module.NodeID", p.module.NodeID, true) } if p.changed != nil { m.Set("changed.ID", p.changed.ID, true) @@ -180,10 +181,12 @@ func (p exposedModuleActionProps) tr(in string, err error) string { fns( p.module.ID, p.module.ComposeModuleID, + p.module.NodeID, ), ) pairs = append(pairs, "{module.ID}", fns(p.module.ID)) pairs = append(pairs, "{module.ComposeModuleID}", fns(p.module.ComposeModuleID)) + pairs = append(pairs, "{module.NodeID}", fns(p.module.NodeID)) } if p.changed != nil { @@ -611,7 +614,7 @@ func ExposedModuleErrNotUnique(props ...*exposedModuleActionProps) *exposedModul error: "notUnique", action: "error", message: "node not unique", - log: "used duplicate node TODO - module.node_id for this compose module TODO - module.rel_compose_module", + log: "used duplicate node TODO - {module.NodeID} for this compose module TODO - module.rel_compose_module", severity: actionlog.Warning, props: func() *exposedModuleActionProps { if len(props) > 0 { diff --git a/federation/service/exposed_module_actions.yaml b/federation/service/exposed_module_actions.yaml index c7bfb5322..9f59ad6b9 100644 --- a/federation/service/exposed_module_actions.yaml +++ b/federation/service/exposed_module_actions.yaml @@ -15,7 +15,7 @@ import: props: - name: module type: "*types.ExposedModule" - fields: [ ID, ComposeModuleID ] + fields: [ ID, ComposeModuleID, NodeID ] - name: changed type: "*types.ExposedModule" fields: [ ID, ComposeModuleID ] @@ -62,7 +62,7 @@ errors: - error: notUnique message: "node not unique" - log: "used duplicate node TODO - module.node_id for this compose module TODO - module.rel_compose_module" + log: "used duplicate node TODO - {module.NodeID} for this compose module TODO - module.rel_compose_module" severity: warning - error: composeModuleNotFound diff --git a/federation/types/type_set.gen.go b/federation/types/type_set.gen.go index 218361283..1dc9ef0d0 100644 --- a/federation/types/type_set.gen.go +++ b/federation/types/type_set.gen.go @@ -117,32 +117,6 @@ func (set ModuleMappingSet) Filter(f func(*ModuleMapping) (bool, error)) (out Mo return } -// FindByID finds items from slice by its ID property -// -// This function is auto-generated. -func (set ModuleMappingSet) FindByID(ID uint64) *ModuleMapping { - // for i := range set { - // if set[i].ID == ID { - // return set[i] - // } - // } - - return nil -} - -// IDs returns a slice of uint64s from all items in the set -// -// This function is auto-generated. -func (set ModuleMappingSet) IDs() (IDs []uint64) { - IDs = make([]uint64, len(set)) - - // for i := range set { - // IDs[i] = set[i].ID - // } - - return -} - // Walk iterates through every slice item and calls w(Node) err // // This function is auto-generated. diff --git a/federation/types/type_set.gen_test.go b/federation/types/type_set.gen_test.go index d178d7a45..e1767861b 100644 --- a/federation/types/type_set.gen_test.go +++ b/federation/types/type_set.gen_test.go @@ -160,40 +160,6 @@ func TestModuleMappingSetFilter(t *testing.T) { } } -func TestModuleMappingSetIDs(t *testing.T) { - var ( - value = make(ModuleMappingSet, 3) - req = require.New(t) - ) - - // construct objects - value[0] = new(ModuleMapping) - value[1] = new(ModuleMapping) - value[2] = new(ModuleMapping) - // set ids - value[0].ID = 1 - value[1].ID = 2 - value[2].ID = 3 - - // Find existing - { - val := value.FindByID(2) - req.Equal(uint64(2), val.ID) - } - - // Find non-existing - { - val := value.FindByID(4) - req.Nil(val) - } - - // List IDs from set - { - val := value.IDs() - req.Equal(len(val), len(value)) - } -} - func TestNodeSetWalk(t *testing.T) { var ( value = make(NodeSet, 3) diff --git a/federation/types/types.yaml b/federation/types/types.yaml index e0920659f..6ff7de46a 100644 --- a/federation/types/types.yaml +++ b/federation/types/types.yaml @@ -3,3 +3,4 @@ types: ExposedModule: SharedModule: ModuleMapping: + noIdField: true