-
Notifications
You must be signed in to change notification settings - Fork 4
Fix live reporting pipeline and release 1.6.30 #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| { | ||
| "version": "1.6.29", | ||
| "version": "1.6.30", | ||
| "channel": "stable", | ||
| "platform": "windows-x64", | ||
| "primaryAsset": "ARSAS-Windows-x64-Setup.exe", | ||
| "publicationRequest": 17 | ||
| "publicationRequest": 18 | ||
| } |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| <Project> | ||
| <PropertyGroup> | ||
| <Version>1.6.29</Version> | ||
| <AssemblyVersion>1.6.29.0</AssemblyVersion> | ||
| <FileVersion>1.6.29.0</FileVersion> | ||
| <InformationalVersion>1.6.29</InformationalVersion> | ||
| <Version>1.6.30</Version> | ||
| <AssemblyVersion>1.6.30.0</AssemblyVersion> | ||
| <FileVersion>1.6.30.0</FileVersion> | ||
| <InformationalVersion>1.6.30</InformationalVersion> | ||
| </PropertyGroup> | ||
| </Project> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| namespace ArIED61850Tester.Models; | ||
|
|
||
| /// <summary> | ||
| /// ARSAS projection of an ARIEC-owned hybrid report acquisition plan. | ||
| /// The application never infers report capability from these counters; they only expose | ||
| /// the typed decision already returned by the engine planner. | ||
| /// </summary> | ||
| public sealed class NativeHybridReportPlanningResult | ||
| { | ||
| public bool IsAuthoritative { get; init; } | ||
| public string Authority { get; init; } = string.Empty; | ||
| public string Status { get; init; } = string.Empty; | ||
| public string Summary { get; init; } = string.Empty; | ||
| public IReadOnlyList<ReportControlPlan> ReportPlans { get; init; } = Array.Empty<ReportControlPlan>(); | ||
| public IReadOnlyList<string> PollingPointKeys { get; init; } = Array.Empty<string>(); | ||
| public IReadOnlyList<string> UncoveredPointKeys { get; init; } = Array.Empty<string>(); | ||
| public IReadOnlyList<string> UnmappedPointKeys { get; init; } = Array.Empty<string>(); | ||
| public IReadOnlyList<string> Warnings { get; init; } = Array.Empty<string>(); | ||
| public int RequestedPointCount { get; init; } | ||
| public int CatalogMappedPointCount { get; init; } | ||
| public int StaticBrcbSignalCount { get; init; } | ||
| public int StaticUrcbSignalCount { get; init; } | ||
| public int DynamicBrcbSignalCount { get; init; } | ||
| public int DynamicUrcbSignalCount { get; init; } | ||
| public int PollingFallbackSignalCount { get; init; } | ||
| public int UncoveredSignalCount { get; init; } | ||
|
|
||
| public bool HasReportPlans => ReportPlans.Count > 0; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Physical-validation evidence collected by ARSAS after executing an engine-authoritative | ||
| /// report plan against a real IED. Silence is never interpreted as signal absence. | ||
| /// </summary> | ||
| public sealed class HybridReportPhysicalValidationSnapshot | ||
| { | ||
| public DateTimeOffset CapturedAtUtc { get; init; } = DateTimeOffset.UtcNow; | ||
| public string DeviceId { get; init; } = string.Empty; | ||
| public string DeviceName { get; init; } = string.Empty; | ||
| public string Endpoint { get; init; } = string.Empty; | ||
| public int PlannedStaticBrcbCount { get; init; } | ||
| public int PlannedStaticUrcbCount { get; init; } | ||
| public int PlannedDynamicBrcbCount { get; init; } | ||
| public int PlannedDynamicUrcbCount { get; init; } | ||
| public int ActivatedReportPlanCount { get; init; } | ||
| public int FailedActivationCount { get; init; } | ||
| public int ReportFrameCount { get; init; } | ||
| public int ReportUpdateCount { get; init; } | ||
| public int ChangeVerifiedPointCount { get; init; } | ||
| public int PollingFallbackPointCount { get; init; } | ||
| public int UncoveredPointCount { get; init; } | ||
| public IReadOnlyList<HybridReportPhysicalValidationPlan> Plans { get; init; } = Array.Empty<HybridReportPhysicalValidationPlan>(); | ||
| public IReadOnlyList<string> Warnings { get; init; } = Array.Empty<string>(); | ||
|
|
||
| public bool HasPhysicalReportEvidence => ReportFrameCount > 0 || ReportUpdateCount > 0; | ||
| } | ||
|
|
||
| public sealed class HybridReportPhysicalValidationPlan | ||
| { | ||
| public string PlanId { get; init; } = string.Empty; | ||
| public string AcquisitionKind { get; init; } = string.Empty; | ||
| public string ReportControlReference { get; init; } = string.Empty; | ||
| public string DataSetReference { get; init; } = string.Empty; | ||
| public int PlannedSignalCount { get; init; } | ||
| public bool ActivationSucceeded { get; init; } | ||
| public string ActivationMessage { get; init; } = string.Empty; | ||
| public string SubscriptionSummary { get; init; } = string.Empty; | ||
| public int MemberCount { get; init; } | ||
| public int SetupWriteStepCount { get; init; } | ||
| public bool UsedDynamicDataSet { get; init; } | ||
| public int ReportFrameCount { get; init; } | ||
| public int ReportUpdateCount { get; init; } | ||
| public int ChangeVerifiedPointCount { get; init; } | ||
| public DateTimeOffset? FirstReportAtUtc { get; init; } | ||
| public DateTimeOffset? LastReportAtUtc { get; init; } | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| using System.Runtime.CompilerServices; | ||
|
|
||
| [assembly: InternalsVisibleTo("ARSAS.Tests")] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,166 @@ | ||
| using ArIED61850Tester.Models; | ||
|
|
||
| namespace ArIED61850Tester.Services; | ||
|
|
||
| /// <summary> | ||
| /// Collects application-side physical evidence after ARIEC has produced an authoritative | ||
| /// hybrid report plan. The tracker records only observations from actual start/slice | ||
| /// results. A lack of report traffic is intentionally not converted into signal absence. | ||
| /// </summary> | ||
| internal sealed class HybridReportPhysicalValidationTracker | ||
| { | ||
| private sealed class PlanState | ||
| { | ||
| public required ReportControlPlan Plan { get; init; } | ||
| public bool ActivationAttempted { get; set; } | ||
| public bool ActivationSucceeded { get; set; } | ||
| public string ActivationMessage { get; set; } = "Not attempted"; | ||
| public string SubscriptionSummary { get; set; } = string.Empty; | ||
| public int MemberCount { get; set; } | ||
| public int SetupWriteStepCount { get; set; } | ||
| public bool UsedDynamicDataSet { get; set; } | ||
| public int ReportFrameCount { get; set; } | ||
| public int ReportUpdateCount { get; set; } | ||
| public HashSet<string> ChangeVerifiedPointKeys { get; } = new(StringComparer.OrdinalIgnoreCase); | ||
| public DateTimeOffset? FirstReportAtUtc { get; set; } | ||
| public DateTimeOffset? LastReportAtUtc { get; set; } | ||
| } | ||
|
|
||
| private readonly Dictionary<string, PlanState> _plans = new(StringComparer.OrdinalIgnoreCase); | ||
| private readonly List<string> _warnings = new(); | ||
| private NativeHybridReportPlanningResult? _planning; | ||
|
|
||
| public void Reset(NativeHybridReportPlanningResult? planning) | ||
| { | ||
| _planning = planning; | ||
| _plans.Clear(); | ||
| _warnings.Clear(); | ||
|
|
||
| if (planning is null) | ||
| return; | ||
|
|
||
| foreach (var warning in planning.Warnings) | ||
| AddWarning(warning); | ||
|
|
||
| foreach (var plan in planning.ReportPlans) | ||
| _plans[plan.PlanId] = new PlanState { Plan = plan }; | ||
| } | ||
|
|
||
| public void RecordActivation(ReportControlPlan plan, NativeReportMonitorStartResult result) | ||
| { | ||
| if (!plan.IsEngineAuthoritative) | ||
| return; | ||
|
|
||
| if (!_plans.TryGetValue(plan.PlanId, out var state)) | ||
| { | ||
| state = new PlanState { Plan = plan }; | ||
| _plans[plan.PlanId] = state; | ||
| } | ||
|
|
||
| state.ActivationAttempted = true; | ||
| state.ActivationSucceeded = result.IsSuccess; | ||
| state.ActivationMessage = result.Message; | ||
| state.SubscriptionSummary = result.SubscriptionSummary; | ||
| state.MemberCount = result.MemberCount; | ||
| state.SetupWriteStepCount = result.WriteStepCount; | ||
| state.UsedDynamicDataSet = result.UsedDynamicDataSet; | ||
| foreach (var warning in result.Warnings) | ||
| AddWarning(warning); | ||
| } | ||
|
|
||
| public void RecordSlice( | ||
| ReportControlPlan plan, | ||
| NativeReportMonitorSliceResult slice, | ||
| IEnumerable<string>? changeVerifiedPointKeys = null) | ||
| { | ||
| if (!plan.IsEngineAuthoritative || !_plans.TryGetValue(plan.PlanId, out var state)) | ||
| return; | ||
|
|
||
| state.ReportFrameCount += slice.ReportFrames.Count; | ||
| state.ReportUpdateCount += slice.Updates.Count; | ||
|
|
||
| var observedTimes = slice.ReportFrames | ||
| .Select(frame => frame.ReceivedAt) | ||
| .Where(value => value != default) | ||
| .OrderBy(value => value) | ||
| .ToArray(); | ||
| if (observedTimes.Length > 0) | ||
| { | ||
| state.FirstReportAtUtc ??= observedTimes[0]; | ||
| state.LastReportAtUtc = observedTimes[^1]; | ||
| } | ||
| else if (slice.ReportFrames.Count > 0 || slice.Updates.Count > 0) | ||
| { | ||
| var now = DateTimeOffset.UtcNow; | ||
| state.FirstReportAtUtc ??= now; | ||
| state.LastReportAtUtc = now; | ||
| } | ||
|
|
||
| if (changeVerifiedPointKeys is not null) | ||
| { | ||
| foreach (var key in changeVerifiedPointKeys.Where(key => !string.IsNullOrWhiteSpace(key))) | ||
| state.ChangeVerifiedPointKeys.Add(key); | ||
| } | ||
|
|
||
| foreach (var warning in slice.Warnings) | ||
| AddWarning(warning); | ||
| } | ||
|
|
||
| public HybridReportPhysicalValidationSnapshot Capture(Iec61850MonitorDevice device) | ||
| { | ||
| ArgumentNullException.ThrowIfNull(device); | ||
| var planning = _planning; | ||
| var plans = _plans.Values | ||
| .OrderBy(state => state.Plan.EngineAcquisitionKind, StringComparer.OrdinalIgnoreCase) | ||
| .ThenBy(state => state.Plan.ReportControlReference, StringComparer.OrdinalIgnoreCase) | ||
| .Select(state => new HybridReportPhysicalValidationPlan | ||
| { | ||
| PlanId = state.Plan.PlanId, | ||
| AcquisitionKind = state.Plan.EngineAcquisitionKind, | ||
| ReportControlReference = state.Plan.ReportControlReference, | ||
| DataSetReference = state.Plan.DataSetReference, | ||
| PlannedSignalCount = state.Plan.Bindings.Count, | ||
| ActivationSucceeded = state.ActivationSucceeded, | ||
| ActivationMessage = state.ActivationMessage, | ||
| SubscriptionSummary = state.SubscriptionSummary, | ||
| MemberCount = state.MemberCount, | ||
| SetupWriteStepCount = state.SetupWriteStepCount, | ||
| UsedDynamicDataSet = state.UsedDynamicDataSet, | ||
| ReportFrameCount = state.ReportFrameCount, | ||
| ReportUpdateCount = state.ReportUpdateCount, | ||
| ChangeVerifiedPointCount = state.ChangeVerifiedPointKeys.Count, | ||
| FirstReportAtUtc = state.FirstReportAtUtc, | ||
| LastReportAtUtc = state.LastReportAtUtc | ||
| }) | ||
| .ToArray(); | ||
|
|
||
| return new HybridReportPhysicalValidationSnapshot | ||
| { | ||
| CapturedAtUtc = DateTimeOffset.UtcNow, | ||
| DeviceId = device.DeviceId, | ||
| DeviceName = device.Name, | ||
| Endpoint = device.EndpointText, | ||
| PlannedStaticBrcbCount = planning?.StaticBrcbSignalCount ?? 0, | ||
| PlannedStaticUrcbCount = planning?.StaticUrcbSignalCount ?? 0, | ||
| PlannedDynamicBrcbCount = planning?.DynamicBrcbSignalCount ?? 0, | ||
| PlannedDynamicUrcbCount = planning?.DynamicUrcbSignalCount ?? 0, | ||
| ActivatedReportPlanCount = _plans.Values.Count(state => state.ActivationAttempted && state.ActivationSucceeded), | ||
| FailedActivationCount = _plans.Values.Count(state => state.ActivationAttempted && !state.ActivationSucceeded), | ||
| ReportFrameCount = plans.Sum(plan => plan.ReportFrameCount), | ||
| ReportUpdateCount = plans.Sum(plan => plan.ReportUpdateCount), | ||
| ChangeVerifiedPointCount = plans.Sum(plan => plan.ChangeVerifiedPointCount), | ||
| PollingFallbackPointCount = planning?.PollingFallbackSignalCount ?? 0, | ||
| UncoveredPointCount = planning?.UncoveredSignalCount ?? 0, | ||
| Plans = plans, | ||
| Warnings = _warnings.ToArray() | ||
| }; | ||
| } | ||
|
|
||
| private void AddWarning(string? warning) | ||
| { | ||
| var text = (warning ?? string.Empty).Trim(); | ||
| if (text.Length == 0 || _warnings.Contains(text, StringComparer.OrdinalIgnoreCase)) | ||
| return; | ||
| _warnings.Add(text); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
CaptureHybridReportPhysicalValidationis called while monitoring is active, this enumeration can race withReset,RecordActivation, orRecordSliceon the monitor task. Those methods mutate the sameDictionary,List,HashSet, counters, and timestamps without synchronization, so capture can throw a collection-modified exception or return a torn snapshot. Protect tracker state with a lock or capture immutable copies under synchronization.Useful? React with 👍 / 👎.