fix: field bus forwarder CIM profile, argument order, and mrid option (GPY-003)#222
Open
craigpnnl wants to merge 2 commits into
Open
fix: field bus forwarder CIM profile, argument order, and mrid option (GPY-003)#222craigpnnl wants to merge 2 commits into
craigpnnl wants to merge 2 commits into
Conversation
Replace the module-level import of cimgraph.data_profile.cimhub_ufls, which no longer exists in the pinned cim-graph release, with a configurable cim_profile constructor parameter defaulting to cimhub_2023, mirroring the resolution pattern already used in agents.py. Verified against the pinned cim-graph package that cimhub_2023 exposes both DistributionArea and Substation. Adds a unit smoke test asserting the module imports cleanly and the default profile exposes DistributionArea and Substation.
…tion The forwarder CLI called FieldProxyForwarder(username, password, connection_url, None) against a constructor signature of (connection_url, username, password, mrid), so username landed in the connection_url slot and no mrid was ever supplied, which broke substation discovery. Fixed the call to pass each value into the correct keyword slot. Also add a --mrid click option (with a GRIDAPPSD_FIELD_BUS_MRID environment fallback, matching the existing option style) so the CLI has a way to supply the mrid the constructor requires.
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.
Summary
Three related fixes to the field bus proxy forwarder, all surfaced during the GPY-003 investigation.
cimgraph.data_profile.cimhub_uflsunconditionally at module scope. That profile no longer exists in the pinned cim-graph release, so any import of the module raised ModuleNotFoundError. Replaced it with a configurablecim_profileconstructor parameter (defaultcimhub_2023), resolved dynamically viaimportlib.import_module, mirroring the pattern already used inagents.py. Verifiedcimhub_2023exposes bothDistributionAreaandSubstation, which is everything the constructor needs.forwarder.pycalledFieldProxyForwarder(username, password, connection_url, None)against a constructor signature of(connection_url, username, password, mrid). Username landed in the connection_url slot, and no mrid was ever passed, so substation discovery could not work even once the import bug above is fixed. The call now passes each value by keyword into the correct slot.--mridclick option (with aGRIDAPPSD_FIELD_BUS_MRIDenvironment fallback, matching the existing option style) and threaded it into the corrected constructor call.Added a unit smoke test that imports the forwarder module and asserts the resolved default CIM profile exposes
DistributionAreaandSubstation, so a future profile default swap that regresses this cannot merge silently. The test does not instantiateFieldProxyForwarderand does not stand up any broker or Blazegraph instance, since the constructor connects to live infrastructure.Test plan
test_field_proxy_forwarder_cim_profile.pypassesstart-field-bus-forwarder --helpshows the new--mridoption