Add ExtendedAttributes config toggle for system+user attributes

When GalaxyRepository.ExtendedAttributes is true, uses the extended
attributes query that includes both primitive (system) and dynamic
(user-defined) attributes. Default is false (dynamic only, preserving
existing behavior). Extended mode returns ~564 attributes vs ~48.

Adds PrimitiveName and AttributeSource fields to GalaxyAttributeInfo.
Includes 5 new unit tests and 6 new integration tests covering both
standard and extended attribute modes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-03-25 06:05:55 -04:00
parent e9a146d273
commit 72d7a21a9d
8 changed files with 333 additions and 16 deletions

View File

@@ -53,6 +53,27 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Configuration
config.GalaxyRepository.ConnectionString.ShouldContain("ZB");
config.GalaxyRepository.ChangeDetectionIntervalSeconds.ShouldBe(30);
config.GalaxyRepository.CommandTimeoutSeconds.ShouldBe(30);
config.GalaxyRepository.ExtendedAttributes.ShouldBe(false);
}
[Fact]
public void GalaxyRepository_ExtendedAttributes_DefaultsFalse()
{
var config = new GalaxyRepositoryConfiguration();
config.ExtendedAttributes.ShouldBe(false);
}
[Fact]
public void GalaxyRepository_ExtendedAttributes_BindsFromJson()
{
var configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", optional: false)
.AddInMemoryCollection(new[] { new System.Collections.Generic.KeyValuePair<string, string>("GalaxyRepository:ExtendedAttributes", "true") })
.Build();
var config = new GalaxyRepositoryConfiguration();
configuration.GetSection("GalaxyRepository").Bind(config);
config.ExtendedAttributes.ShouldBe(true);
}
[Fact]