Repository navigation
Conversation
ClearModellingRules removed the modelling rule from the instance state of a type and from all of its children. The instance state is emitted as the InitializationString of the generated class, so children without a strongly typed property (e.g. AddIns below Identification) were decoded without a ModellingRuleId and pruned at runtime by the stack (1.5.378.152). Only clear the modelling rule of the instance itself and keep the rules of the instance declarations below it. Standalone instances are unchanged. Also removes leftover debug output. Fixes OPCFoundation/UA-.NETStandard#3972 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1.5.378.152 is no longer available on nuget.org, which breaks restore (NU1603). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Secrets are not available to workflows triggered from forks, so checkout failed with 'Input required and not supplied: token'. 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.
Description
Fixes the ModelCompiler part of OPCFoundation/UA-.NETStandard#3972: AddIns such as
BuildingBlock1/BuildingBlock2from the repro in OPCFoundation/UA-.NETStandard#3843 were missing at runtime with 1.5.378.152.Root cause
ClearModellingRulesremoved theModellingRuleIdfrom the instance state of a type and from all of its children. That instance state becomes theInitializationStringof the generated class. Some children don't get a generated property, such as AddIns belowIdentification. The stack stores those as extra, dynamic children. Because their modelling rule had been stripped, the pruning in 1.5.378.152 (OPCFoundation/UA-.NETStandard#3843) removed them, since it only keeps dynamic children with a Mandatory/Optional rule.Fix
Console.WriteLine("x")blocks inModelDesignerValidator.ClearModellingRulesandModelGenerator2.ConstructInitializer.With the repro NodeSet, the generated
DemoMachineTypeStateinitializer now carriesModellingRuleId = i=78forIdentification,BuildingBlock1andBuildingBlock2. The instance itself still has no modelling rule.Behavior change
Children of instances created from generated classes now expose a
HasModellingRulereference when browsed. The 2.0 (master) source generator already emitsModellingRuleIdon every generated child, so this matches it.Tests
InstanceModellingRuleTestsgenerates code from a small NodeSet (type → MandatoryFolderTypechild → Mandatory child unknown toFolderState). It decodes theInitializationStringand checks the modelling rules. It fails without the fix (Expected: i=78, Actual: null) and passes with it.Notes
OPCFoundation.NetStandard.Opc.Ua.Core/Typesfrom 1.5.378.152 (no longer on nuget.org, restore failed with NU1603) to 1.5.378.176, the version of theStacksubmodule.buildworkflow fails at checkout for PRs from forks (Input required and not supplied: token), because the fork doesn't get the repository secrets.VirtualFileSystem*tests fail locally with anObjectDisposedException(memory-mapped file). That code is unrelated to this change.🤖 Generated with Claude Code