Skip to content

Add channel readiness with dynamic per-channel access detection - #660

Merged
jschick04 merged 6 commits into
mainfrom
feat/channel-readiness
Jul 21, 2026
Merged

Add channel readiness with dynamic per-channel access detection#660
jschick04 merged 6 commits into
mainfrom
feat/channel-readiness

Conversation

@jschick04

@jschick04 jschick04 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds channel readiness with dynamic per-channel access detection. For each channel referenced by a scenario, the app now determines presence, enablement, and accessibility - including access-denied detection via native Win32 channel access evaluation - and surfaces that state in the scenario UI and the live-logs menu.

Highlights:

  • Native channel access evaluation (Win32ChannelAccessNative / NativeChannelAccessEvaluator, IChannelAccessEvaluator) probes whether the current user can actually read each channel, distinguishing access-denied from not-present / disabled.
  • Channel config readers (EventLogChannelConfigReader / EventLogChannelConfigPropertyReader) expose channel enablement + property snapshots.
  • Readiness model (ChannelReadiness, ChannelPresence, ChannelEnablement, ChannelOutcome, ChannelLaunchOutcome) drives per-channel launch outcomes; a scenario with any degraded required channel (access-denied / not-present / failed) is treated as non-launchable, the same as a missing log.
  • UI surfacing in ScenarioDetail / EmptyStateDashboard and the live-logs menu (MenuBar): each channel shows a readiness status tag; live-log menu items stay clickable and, when access is denied, surface an inline "Log requires elevation" alert guiding the user to relaunch as Administrator. The "Other Logs" submenu is the full channel directory and intentionally lists the Application/System/Security live channels that also appear in the top-level Live quick-access.

Testing

  • Unit suites green: Scenarios 674, Eventing 716, Runtime 1995, UI 1160, Windows 46.
  • Integration tests for the new channel readers (ChannelAccessEvaluatorIntegrationTests, ChannelConfigReaderIntegrationTests) are deferred to a follow-up test audit after the eventing library update - flagged here so reviewers expect them.

Stack

Final PR of the 3-part scenario-launch stack (after #657 folder-launch and #658 histogram enhancements, both merged to main). Based on main.

Copilot AI review requested due to automatic review settings July 20, 2026 21:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a new channel readiness model (presence/enablement/access) backed by native Win32 access evaluation, and wires it through scenario launch + UI surfaces (scenario detail, empty dashboard, and live-logs menu) so the app can distinguish access denied vs not present/disabled and guide users toward folder-based fallback when needed.

Changes:

  • Add runtime/readiness abstractions (IChannelReadinessService, ChannelReadiness, outcomes) and integrate them into scenario presence/launch behavior.
  • Add native channel access evaluation + channel config readers in the eventing layer (including unit + integration coverage).
  • Update UI components (MenuBar, ScenarioDetail, EmptyStateDashboard) and tests to surface readiness state and new launch outcomes.

Reviewed changes

Copilot reviewed 51 out of 51 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Unit/EventLogExpert.UI.Tests/Menu/MenuRendererTests.cs Adds coverage for menu item status text rendering/activation.
tests/Unit/EventLogExpert.UI.Tests/Menu/MenuBarGroupingTests.cs Tests live menu status tags and clickability based on readiness.
tests/Unit/EventLogExpert.UI.Tests/Dashboard/ScenarioDetailTests.cs Updates ScenarioDetail expectations for blocked/offline/readiness UI.
tests/Unit/EventLogExpert.UI.Tests/Dashboard/EmptyStateDashboardTests.cs Adds readiness-driven launch gating + fallback alert coverage.
tests/Unit/EventLogExpert.Runtime.Tests/Scenarios/ScenarioQueryServiceTests.cs Switches presence logic tests to readiness service.
tests/Unit/EventLogExpert.Runtime.Tests/Scenarios/ScenarioLaunchServiceTests.cs Validates degraded-channel rollback and outcome projection.
tests/Unit/EventLogExpert.Runtime.Tests/Scenarios/ChannelPresenceProbeTests.cs Adds readiness/config enrichment tests for ChannelPresenceProbe.
tests/Unit/EventLogExpert.Eventing.Tests/Readers/ChannelAccessEvaluatorTests.cs Unit tests for native access evaluation + config reader behavior.
tests/Integration/EventLogExpert.Eventing.IntegrationTests/Readers/ChannelConfigReaderIntegrationTests.cs Basic integration coverage for config reader.
tests/Integration/EventLogExpert.Eventing.IntegrationTests/Readers/ChannelAccessEvaluatorIntegrationTests.cs Integration coverage for access evaluator with real tokens/SDDL.
src/EventLogExpert/Adapters/Menu/MauiMenuActionService.cs Plumbs outcomes + inline-alert suppression; switches “other logs” to readiness.
src/EventLogExpert.UI/Menu/MenuRenderer.razor.css Styles new visible menu status tag.
src/EventLogExpert.UI/Menu/MenuRenderer.razor Renders optional per-item status text; normalizes ellipsis text.
src/EventLogExpert.UI/Menu/MenuBar.razor.cs Uses readiness to tag live channels and build other-logs tree.
src/EventLogExpert.UI/Dashboard/ScenarioDetail.razor.css Adds styling for readiness “chip” statuses.
src/EventLogExpert.UI/Dashboard/ScenarioDetail.razor.cs Adds ChannelReadiness parameter and label helpers.
src/EventLogExpert.UI/Dashboard/ScenarioDetail.razor Surfaces per-channel readiness and blocked note.
src/EventLogExpert.UI/Dashboard/ScenarioBrowserPanel.razor.cs Adds callback to provide readiness to ScenarioDetail.
src/EventLogExpert.UI/Dashboard/ScenarioBrowserPanel.razor Passes readiness into ScenarioDetail.
src/EventLogExpert.UI/Dashboard/EmptyStateDashboard.razor.cs Uses readiness for gating, messaging, and folder fallback alert behavior.
src/EventLogExpert.UI/Dashboard/EmptyStateDashboard.razor Uses readiness to disable/describe Security quick-launch; passes readiness callback.
src/EventLogExpert.Runtime/Scenarios/ScenarioQueryService.cs Builds LivePresence from readiness snapshot rather than presence probe.
src/EventLogExpert.Runtime/Scenarios/ScenarioLaunchService.cs Adds degraded-required-channel rollback; captures per-channel outcomes.
src/EventLogExpert.Runtime/Scenarios/ScenarioLaunchResult.cs Adds ChannelOutcomes to launch result model.
src/EventLogExpert.Runtime/Scenarios/IChannelReadinessService.cs New readiness service interface.
src/EventLogExpert.Runtime/Scenarios/IChannelPresenceProbe.cs Removes doc comments; keeps legacy presence probe contract.
src/EventLogExpert.Runtime/Scenarios/ChannelReadiness.cs New readiness record.
src/EventLogExpert.Runtime/Scenarios/ChannelPresenceProbe.cs Implements readiness service + config enrichment/caching.
src/EventLogExpert.Runtime/Scenarios/ChannelPresence.cs New presence enum.
src/EventLogExpert.Runtime/Scenarios/ChannelOutcome.cs New per-channel launch outcome record.
src/EventLogExpert.Runtime/Scenarios/ChannelLaunchOutcome.cs New launch outcome enum.
src/EventLogExpert.Runtime/Scenarios/ChannelEnablement.cs New enablement enum.
src/EventLogExpert.Runtime/Menu/OpenLogsBatchResult.cs Adds ChannelOutcomes to batch open results.
src/EventLogExpert.Runtime/Menu/MenuItem.cs Adds StatusText to menu items.
src/EventLogExpert.Runtime/Menu/IMenuActionService.cs Adds showInlineAlerts optional param to open methods.
src/EventLogExpert.Runtime/DependencyInjection/RuntimeServiceCollectionExtensions.cs Registers config reader + readiness service wiring.
src/EventLogExpert.Eventing/Readers/Win32ChannelAccessNative.cs Win32 access-check native wrapper.
src/EventLogExpert.Eventing/Readers/NativeChannelAccessEvaluator.cs Evaluates access via AccessCheck + Security privilege.
src/EventLogExpert.Eventing/Readers/IChannelConfigReader.cs New config reader interface.
src/EventLogExpert.Eventing/Readers/IChannelConfigPropertyReader.cs New internal property reader interface.
src/EventLogExpert.Eventing/Readers/IChannelAccessNative.cs New internal native access abstraction.
src/EventLogExpert.Eventing/Readers/IChannelAccessEvaluator.cs New internal access evaluator interface.
src/EventLogExpert.Eventing/Readers/EventLogChannelConfigReader.cs Reads enablement/type/access (skips access for Analytic/Debug).
src/EventLogExpert.Eventing/Readers/EventLogChannelConfigPropertyReader.cs Reads config properties via Evt APIs and converts variants.
src/EventLogExpert.Eventing/Readers/ChannelConfigPropertySnapshot.cs Snapshot record for property reads.
src/EventLogExpert.Eventing/Readers/ChannelConfig.cs Config record for enablement/access/type.
src/EventLogExpert.Eventing/Readers/ChannelAccess.cs New access enum.
src/EventLogExpert.Eventing/ProviderMetadata/RegistryProvider.cs Adjusts registry-skip channel set usage; simplifies exception type.
src/EventLogExpert.Eventing/Interop/NativeMethods.Access.cs Adds P/Invoke declarations for AccessCheck-related APIs.
src/EventLogExpert.Eventing/Interop/EvtEnums.cs Adds channel access/config enums and public EvtChannelType.
src/EventLogExpert.Eventing/Common/Channels/LogChannelNames.cs Adds RegistrySkipChannels; retains legacy admin-only set.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/EventLogExpert.UI/Menu/MenuBar.razor.cs
Comment thread src/EventLogExpert/Adapters/Menu/MauiMenuActionService.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 51 out of 51 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

src/EventLogExpert.UI/Menu/MenuBar.razor.cs:351

  • "Other Logs" is built from the full readiness snapshot, but the code no longer filters out LogChannelMethods.HardCodedLiveChannels (Application/System/Security). This can duplicate those entries under "Other Logs" even though they’re already listed directly under Live (and LogChannelMethods explicitly documents filtering to avoid duplicates).
    src/EventLogExpert/Adapters/Menu/MauiMenuActionService.cs:275
  • GetOtherLogNamesAsync() now returns all channel names from the readiness snapshot, including LogChannelMethods.HardCodedLiveChannels (Application/System/Security). That contradicts LogChannelMethods’ contract (“filter these … to avoid duplicates”) and can reintroduce duplicates in any UI that consumes this list as “other logs”.

Comment thread src/EventLogExpert.Runtime/Scenarios/ScenarioQueryService.cs Outdated
Comment thread src/EventLogExpert/Adapters/Menu/MauiMenuActionService.cs
Comment thread src/EventLogExpert.UI/Menu/MenuBar.razor.cs
Copilot AI review requested due to automatic review settings July 20, 2026 23:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 52 out of 52 changed files in this pull request and generated 2 comments.

Comment thread src/EventLogExpert.Runtime/Scenarios/ChannelPresenceProbe.cs
Comment thread src/EventLogExpert.Runtime/Scenarios/ChannelPresenceProbe.cs Outdated
Copilot AI review requested due to automatic review settings July 20, 2026 23:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 52 out of 52 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings July 21, 2026 00:02
@jschick04
jschick04 force-pushed the feat/channel-readiness branch from 903d242 to 0495664 Compare July 21, 2026 00:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 53 out of 53 changed files in this pull request and generated 1 comment.

Comment thread src/EventLogExpert.UI/Menu/MenuBar.razor.cs Outdated
Copilot AI review requested due to automatic review settings July 21, 2026 00:18
@jschick04
jschick04 force-pushed the feat/channel-readiness branch from 0495664 to a9bd301 Compare July 21, 2026 00:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 53 out of 53 changed files in this pull request and generated 1 comment.

Comment thread src/EventLogExpert.UI/Dashboard/EmptyStateDashboard.razor.cs
Copilot AI review requested due to automatic review settings July 21, 2026 01:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 3 comments.

Comment thread src/EventLogExpert.Runtime/Scenarios/ChannelPresenceProbe.cs Outdated
Copilot AI review requested due to automatic review settings July 21, 2026 01:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.

Comment thread src/EventLogExpert.Eventing/Readers/NativeChannelAccessEvaluator.cs
Copilot AI review requested due to automatic review settings July 21, 2026 02:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.

Comment thread src/EventLogExpert.UI/Dashboard/ScenarioDetail.razor Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.

Comment thread src/EventLogExpert.UI/Dashboard/ScenarioDetail.razor
Copilot AI review requested due to automatic review settings July 21, 2026 03:06
@jschick04
jschick04 force-pushed the feat/channel-readiness branch from 09f1723 to 0cf7a50 Compare July 21, 2026 03:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated no new comments.

@jschick04
jschick04 marked this pull request as ready for review July 21, 2026 03:12
@jschick04
jschick04 requested a review from a team as a code owner July 21, 2026 03:12

@ryanriesMSFT ryanriesMSFT left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jschick04
jschick04 merged commit 952fab7 into main Jul 21, 2026
8 checks passed
@jschick04
jschick04 deleted the feat/channel-readiness branch July 21, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants