Repository navigation
gsdml: configurable submodules (--plug-submodule, gsdml config); go-profinet v0.24.0 - #54
Merged
Merged
Conversation
…; go-profinet v0.24.0 go-profinet v0.24.0's gsdml.Configuration configures configurable submodules. profinetctl builds the model with it for --plug-submodule, for a device access point whose defaults need configurable submodules (ToModel refuses it), and for a --plug of a module that has them; otherwise the model is ToModel's, as before, so --plug-any-slot and the replacement of a module a generated file fixes keep working. - --plug-submodule SLOT:SUBSLOT=SUBMODULE (AR commands, gsdml plan): a SubmoduleItem ID, an ident number only one submodule has, or - to leave the subslot empty. - gsdml config: the resolved configuration and the configurable submodules of the DAP and of each plugged module. - gsdml modules lists modules with configurable submodules (with their number); omitted_modules keeps those go-profinet cannot place. - --gsdml, inspect and check take the default configuration of a DAP ToModel refuses; a default that needs a choice is invalid_input, and unvalidated in check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Tests for a malformed configurable submodule (listed with why in gsdml config, invalid_gsdml for --plug-submodule), an ident number no configurable submodule has, --plug with --model, and the reasons gsdml modules gives: the module's own error, and two submodules used in one subslot by default, which the reason now names. slotOptions and gsdml modules lose their unreachable branches; gsdml config no longer checks for cancellation before a local, bounded step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on go-profinet v0.24.0's
gsdml.Configuration, so profinetctl can configure configurable GSDML submodules (UseableSubmodules).When the configuration is used
profinetctl builds the model with
gsdml.Configurationin three cases:--plug-submoduleis given.ToModelrefuses the device access point because its defaults need configurable submodules.--plugnames a module that has configurable submodules.Otherwise the model is
ToModel's, exactly as before. That matters because a file fromgsdml generatewritesFixedInSlotsfor every plugged module. Today--plugreplaces those modules, and--plug-any-slotbypasses the slot lists; the configuration allows neither.Changes
--plug-submodule SLOT:SUBSLOT=SUBMODULE, forconnect, the AR commands andgsdml plan:--plug; slot 0 is the DAP.-to leave the subslot empty.gsdml config FILEshows:gsdml modules:configurable_submodulescount.omitted_moduleskeeps only the modules go-profinet cannot place.--gsdml,gsdml modules,submodules,inspectandcheckuse the default configuration for a DAP that v0.21.0 refused withunsupported_gsdml.invalid_inputwith a hint.checkreports it as unvalidated, rulemodel.Exit codes and JSON are documented in docs/exitcodes.md and docs/json-output.md. RELEASE.md has a v0.22.0 section, including a Breaking list.
Tests
Tests are in
cmd/omitted_test.go. The fixture is the test model's generated GSDML with a SubmoduleList (SM_WIDE and SM_ALT), and module 0x40 allowed in slots 3–5 with configurable submodules in subslots 2–3. The tests cover:gsdml config: the default;--plug; choosing by ID and by ident number; clearing a subslot; text and table output; nine error cases.connectagainst a device that serves the resolved model: it reaches Running with no module diff.gsdml planwith configurable submodules.--plug-any-slotand--modelcombinations, and the unchangedToModelpath.ToModelrefuses, throughmodules,submodules,inspect,checkandconnect.Results:
make checkpasses (coverage 94.9%), and so domake e2eandmake cross.🤖 Generated with Claude Code