Skip to content

Add BrowserLogs tracked browser sessions - #16565

Merged
David Fowler (davidfowl) merged 14 commits into
mainfrom
davidfowl/browserlogs-cdp-pipe
May 1, 2026
Merged

David Fowler (davidfowl) merged 14 commits into
mainfrom
davidfowl/browserlogs-cdp-pipe

Conversation

@davidfowl

@davidfowl David Fowler (davidfowl) commented Apr 29, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #16534.

Description

Adds experimental BrowserLogs support for browser-based Aspire resources. .WithBrowserLogs(...) attaches a child BrowserLogs resource so the dashboard can open tracked Chromium sessions, stream browser console/runtime/network diagnostics back to Aspire resource logs, capture screenshots, and publish browser-session health reports.

This change:

  • keeps the public API in the Aspire.Hosting namespace with .WithBrowserLogs(...) and BrowserUserDataMode;
  • ships the implementation from the new prerelease Aspire.Hosting.Browsers package;
  • launches AppHost-owned Chromium through a private CDP pipe instead of exposing a debug TCP port;
  • uses platform-specific pipe launchers, including posix_spawn on Unix and explicit handle inheritance/job cleanup on Windows;
  • keeps pipe-launched browsers session-scoped because Chromium exits when the CDP pipe closes;
  • keeps WebSocket/adopted-browser plumbing available internally for future explicit scenarios;
  • publishes dynamic pending/session/last-error health reports back to the dashboard through CustomResourceSnapshot.WithHealthReports(...);
  • removes BrowserLogs-specific IVT usage and moves BrowserLogs tests into Aspire.Hosting.Browsers.Tests;
  • updates polyglot codegen snapshots and playground validation coverage.

Validation:

  • dotnet build src/Aspire.Hosting.Browsers/Aspire.Hosting.Browsers.csproj --no-restore
  • dotnet test --project tests/Aspire.Hosting.Browsers.Tests/Aspire.Hosting.Browsers.Tests.csproj -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
  • dotnet test --project tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj -- --filter-method "*.PublishedHealthReportsUpdateHealthStatus" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
  • dotnet test --project tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj -- --filter-method "*.Scanner_BrowsersAssembly_WithBrowserLogsCapability" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
  • Code generation snapshot tests for TypeScript, Python, Go, Java, and Rust using TwoPassScanning_GeneratesWithEnvironmentOnTestRedisBuilder.
  • dotnet pack src/Aspire.Hosting.Browsers/Aspire.Hosting.Browsers.csproj -c Release /p:SkipNativeBuild=true
  • BrowserTelemetry playground E2E via aspire start --isolated, open-tracked-browser, and aspire logs web-browser-logs confirmed cdpEndpoint: "pipe", network logs, console logs, health reports, and browser cleanup on stop.

Checklist

  • Tests added or updated
  • Documentation updated

Switch owned tracked-browser launches to a private CDP pipe, keep WebSocket adoption as an opt-in seam, and add session/persistent process lifetime configuration.

Co-authored-by: Copilot <[email protected]>
BrowserLogs pipe-launched browsers are always session scoped because Chromium exits when the CDP pipe closes. Remove the public lifetime option and mark public BrowserLogs types experimental.

Co-authored-by: Copilot <[email protected]>
@github-actions

github-actions Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16565

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16565"

Move platform-specific native launch logic into Windows and Unix partial classes while keeping the shared launcher entry points in the common file.

Co-authored-by: Copilot <[email protected]>
Replace the managed fork/exec launcher with posix_spawn file actions so Chromium still receives CDP pipe fds 3 and 4 without running managed code in a forked child.

Co-authored-by: Copilot <[email protected]>

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

Adds a new Aspire.Hosting.Browsers package and associated tests/resources to support tracked browser sessions (BrowserLogs) that the dashboard can open/monitor, including launching AppHost-owned Chromium via a private CDP pipe (instead of a TCP debugging port), streaming diagnostics into resource logs, and capturing screenshots.

Changes:

  • Introduces Aspire.Hosting.Browsers (packable, prerelease) with the experimental .WithBrowserLogs(...) API and BrowserUserDataMode, plus session/host/process plumbing (pipe-backed CDP).
  • Moves BrowserLogs-related localized strings from Aspire.Hosting resources into Aspire.Hosting.Browsers resources (and updates tests/usages accordingly).
  • Adds a new Aspire.Hosting.Browsers.Tests test project and updates TypeScript capability scanning tests to scan the new browsers assembly.
Show a summary per file
File Description
tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/AtsTypeScriptCodeGeneratorTests.cs Updates ATS capability scanning to validate BrowserLogs capability from browsers assembly.
tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj Adds project reference to Aspire.Hosting.Browsers for capability scanning.
tests/Aspire.Hosting.Browsers.Tests/ChromiumDevToolsActivePortParserTests.cs Moves tests into new Browsers test namespace.
tests/Aspire.Hosting.Browsers.Tests/BrowserPageSessionTests.cs Updates CDP connection factory shape to match new host-owned connection API.
tests/Aspire.Hosting.Browsers.Tests/BrowserLogsSessionManagerTests.cs Updates tests for new adoption-toggle behavior and new warnings/namespace.
tests/Aspire.Hosting.Browsers.Tests/BrowserLogsRunningSessionTests.cs Updates tests for new CDP endpoint nullability and warnings/namespace.
tests/Aspire.Hosting.Browsers.Tests/BrowserLogsPipeBrowserProcessLauncherTests.cs Adds unit coverage for pipe-argument building and POSIX fd mapping behavior.
tests/Aspire.Hosting.Browsers.Tests/BrowserLogsCdpProtocolTests.cs Moves tests into new Browsers test namespace.
tests/Aspire.Hosting.Browsers.Tests/BrowserLogsBuilderExtensionsTests.cs Updates command string resources to the new Browsers resource set and namespaces/usings.
tests/Aspire.Hosting.Browsers.Tests/BrowserHostTests.cs Adds tests validating owned host pipe transport and endpoint metadata cleanup.
tests/Aspire.Hosting.Browsers.Tests/BrowserConnectionDiagnosticsLoggerTests.cs Moves diagnostics logger tests into new Browsers test namespace.
tests/Aspire.Hosting.Browsers.Tests/Aspire.Hosting.Browsers.Tests.csproj New test project for Aspire.Hosting.Browsers.
src/Aspire.Hosting/Resources/xlf/MessageStrings.zh-Hant.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/xlf/MessageStrings.zh-Hans.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/xlf/MessageStrings.tr.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/xlf/MessageStrings.ru.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/xlf/MessageStrings.pt-BR.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/xlf/MessageStrings.pl.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/xlf/MessageStrings.ko.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/xlf/MessageStrings.ja.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/xlf/MessageStrings.it.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/xlf/MessageStrings.fr.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/xlf/MessageStrings.es.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/xlf/MessageStrings.de.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/xlf/MessageStrings.cs.xlf Removes BrowserLogs strings from Hosting localization file (moved to Browsers).
src/Aspire.Hosting/Resources/MessageStrings.resx Removes BrowserLogs strings from Hosting resx (moved to Browsers).
src/Aspire.Hosting/Resources/MessageStrings.Designer.cs Removes generated BrowserLogs string accessors from Hosting designer.
src/Aspire.Hosting/Resources/CommandStrings.resx Removes BrowserLogs command strings from Hosting resx (moved to Browsers).
src/Aspire.Hosting/Aspire.Hosting.csproj Adds InternalsVisibleTo for Browsers assembly and its tests.
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.zh-Hant.xlf Adds Browsers localization file for BrowserLogs messages (zh-Hant).
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.zh-Hans.xlf Adds Browsers localization file for BrowserLogs messages (zh-Hans).
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.tr.xlf Adds Browsers localization file for BrowserLogs messages (tr).
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.ru.xlf Adds Browsers localization file for BrowserLogs messages (ru).
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.pt-BR.xlf Adds Browsers localization file for BrowserLogs messages (pt-BR).
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.pl.xlf Adds Browsers localization file for BrowserLogs messages (pl).
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.ko.xlf Adds Browsers localization file for BrowserLogs messages (ko).
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.ja.xlf Adds Browsers localization file for BrowserLogs messages (ja).
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.it.xlf Adds Browsers localization file for BrowserLogs messages (it).
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.fr.xlf Adds Browsers localization file for BrowserLogs messages (fr).
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.es.xlf Adds Browsers localization file for BrowserLogs messages (es).
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.de.xlf Adds Browsers localization file for BrowserLogs messages (de).
src/Aspire.Hosting.Browsers/Resources/xlf/BrowserMessageStrings.cs.xlf Adds Browsers localization file for BrowserLogs messages (cs).
src/Aspire.Hosting.Browsers/Resources/BrowserMessageStrings.resx Adds BrowserLogs message resources in Browsers package.
src/Aspire.Hosting.Browsers/Resources/BrowserMessageStrings.Designer.cs Adds generated designer accessor for Browsers message resources.
src/Aspire.Hosting.Browsers/Resources/BrowserCommandStrings.resx Adds BrowserLogs command resources in Browsers package.
src/Aspire.Hosting.Browsers/Resources/BrowserCommandStrings.Designer.cs Adds generated designer accessor for Browsers command resources.
src/Aspire.Hosting.Browsers/IBrowserLogsSessionManager.cs Introduces internal session manager contract and screenshot result model.
src/Aspire.Hosting.Browsers/IBrowserHost.cs Extends browser host abstraction to support pipe-backed CDP connections and nullable debug endpoints.
src/Aspire.Hosting.Browsers/ChromiumDevToolsActivePortParser.cs Adds parser for Chromium DevToolsActivePort file (WebSocket attach scenarios).
src/Aspire.Hosting.Browsers/ChromiumBrowserResolver.cs Switches BrowserLogs-related messages to Browsers resource set.
src/Aspire.Hosting.Browsers/BrowserUserDataPathResolver.cs Switches messages to Browsers resource set and updates behavioral comments.
src/Aspire.Hosting.Browsers/BrowserUserDataMode.cs Marks enum experimental and updates remarks for new pipe-backed ownership semantics.
src/Aspire.Hosting.Browsers/BrowserPageSession.cs Routes CDP connection creation through the host (supports pipe-backed transports).
src/Aspire.Hosting.Browsers/BrowserLogsUserDataDirectory.cs Adds user-data directory wrapper with persistent/temporary lifetime handling.
src/Aspire.Hosting.Browsers/BrowserLogsSessionManager.cs Updates session snapshot/formatting for nullable debug endpoints and pipe transport.
src/Aspire.Hosting.Browsers/BrowserLogsRunningSession.cs Makes browser debug endpoint nullable and updates diagnostics formatting.
src/Aspire.Hosting.Browsers/BrowserLogsResource.cs Adds BrowserLogs child resource model and configuration resolution logic.
src/Aspire.Hosting.Browsers/BrowserLogsProcessResult.cs Adds process-result model for pipe-launched browser processes.
src/Aspire.Hosting.Browsers/BrowserLogsPipeBrowserProcessLauncher.cs Adds cross-platform entrypoint for launching Chromium with a private CDP pipe.
src/Aspire.Hosting.Browsers/BrowserLogsPipeBrowserProcess.cs Adds pipe process wrapper and lifetime/disposal shape.
src/Aspire.Hosting.Browsers/BrowserLogsConfigurationStore.cs Adds in-memory config store for dashboard-chosen settings in the current AppHost run.
src/Aspire.Hosting.Browsers/BrowserLogsBuilderExtensions.cs Introduces experimental .WithBrowserLogs(...) API and updates commands/messages to Browsers resources.
src/Aspire.Hosting.Browsers/BrowserLogsArtifacts.cs Adds artifact writing for screenshots/other BrowserLogs outputs.
src/Aspire.Hosting.Browsers/BrowserHostRegistry.cs Updates host acquisition to default to pipe-owned browser and optionally allow endpoint-metadata adoption.
src/Aspire.Hosting.Browsers/BrowserEndpointDiscovery.cs Updates WebSocket attach/adoption metadata descriptions and switches to Browsers resources.
src/Aspire.Hosting.Browsers/BrowserConnectionDiagnosticsLogger.cs Adds central diagnostics logger for connection/setup/reconnect issues.
src/Aspire.Hosting.Browsers/BrowserConfiguration.cs Switches messages to Browsers resource set and updates configuration modeling.
src/Aspire.Hosting.Browsers/Aspire.Hosting.Browsers.csproj Adds new packable Aspire.Hosting.Browsers project with resource generation and IVTs.
playground/BrowserTelemetry/BrowserTelemetry.AppHost/BrowserTelemetry.AppHost.csproj Adds reference to Aspire.Hosting.Browsers for the playground sample.
Aspire.slnx Adds Aspire.Hosting.Browsers project and its test project to the solution.

Copilot's findings

Files not reviewed (4)
  • src/Aspire.Hosting.Browsers/Resources/BrowserCommandStrings.Designer.cs: Language not supported
  • src/Aspire.Hosting.Browsers/Resources/BrowserMessageStrings.Designer.cs: Language not supported
  • src/Aspire.Hosting/Resources/CommandStrings.Designer.cs: Language not supported
  • src/Aspire.Hosting/Resources/MessageStrings.Designer.cs: Language not supported
  • Files reviewed: 94/107 changed files
  • Comments generated: 2

Comment on lines +36 to +44
<data name="ConfigureTrackedBrowserResourceScopeOption" xml:space="preserve">
<value>This resource only ({0})</value>
</data>
<data name="ConfigureTrackedBrowserGlobalScopeOption" xml:space="preserve">
<value>All BrowserLogs resources</value>
</data>
<data name="ConfigureTrackedBrowserGlobalScopeResult" xml:space="preserve">
<value>all BrowserLogs resources</value>
</data>

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

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

Several strings with format placeholders (e.g., "{0}" / "{1}") don't include metadata (translator notes) in the .resx. In this repo these comments are typically used to populate XLF entries and to clarify placeholder meaning for localization. Please add elements for the placeholder strings (for example, resource scope option, profile option with display name, applied/saved messages, save-failed message) and regenerate the XLF files.

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +35
<data name="BrowserLogsProfileRequiresSharedUserDataMode" xml:space="preserve">
<value>Tracked browser configuration set '{0}' to '{1}' while '{2}' is '{3}'. Profiles can only be selected when '{2}' is '{4}'.</value>
</data>
<data name="BrowserLogsInvalidUserDataModeConfiguration" xml:space="preserve">
<value>Tracked browser configuration value '{0}' is not a valid '{1}'. Expected '{2}' or '{3}'.</value>
</data>
<data name="BrowserLogsUnableToLocateBrowser" xml:space="preserve">
<value>Unable to locate browser '{0}'. Specify an installed Chromium-based browser or an explicit executable path.</value>
</data>
<data name="BrowserLogsAppHostPathShaNotAvailable" xml:space="preserve">
<value>Cannot resolve the isolated browser user data directory because the AppHost path identifier is not available. Use '{0}' user data mode or run from a configured AppHost.</value>
</data>

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

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

Several localized messages with format placeholders (e.g., "{0}", "{1}") are missing metadata in the .resx (for example BrowserLogsProfileRequiresSharedUserDataMode, BrowserLogsInvalidUserDataModeConfiguration, BrowserLogsAppHostPathShaNotAvailable, etc.). Without these comments the generated XLF files end up with empty elements, which makes translation error-prone. Please add the placeholder descriptions as elements (similar to how these strings were previously annotated) and regenerate the XLF files.

Copilot uses AI. Check for mistakes.
Remove the BrowserLogs capability from the Hosting assembly scanner snapshot now that BrowserLogs lives in Aspire.Hosting.Browsers.

Co-authored-by: Copilot <[email protected]>
Stop relying on InternalsVisibleTo for the Browsers package and its tests by source-sharing the BrowserLogs implementation into the test assembly and replacing Hosting-internal runtime dependencies with public-compatible behavior.

Co-authored-by: Copilot <[email protected]>
Add a public CustomResourceSnapshot helper for publishing health reports without InternalsVisibleTo and use it to restore BrowserLogs session and last-error health report rows.

Co-authored-by: Copilot <[email protected]>
Add translator comments for BrowserLogs resource strings with format placeholders and regenerate XLF files.

Co-authored-by: Copilot <[email protected]>

@mitchdenny Mitch Denny (mitchdenny) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed 116 changed files across the new Aspire.Hosting.Browsers package and related changes. Found 4 issues (2 bugs, 1 defense-in-depth, 1 minor).

Most findings are on lines that existed before the move and aren't in the diff hunks, so they're described here rather than as inline comments.


1. Bug: Null-forgiveness on screenshot data causes uncaught exception
📁 src/Aspire.Hosting.Browsers/BrowserLogsRunningSession.cs:183

result.Data is string? (see BrowserLogsCdpProtocol.cs:437), but result.Data! suppresses the nullable warning. If Data is null, Convert.FromBase64String(null!) throws ArgumentNullException, which escapes the catch (FormatException) block — the caller gets a misleading ArgumentNullException instead of the intended InvalidOperationException.

Suggested fix:

var data = result.Data ?? throw new InvalidOperationException("Tracked browser screenshot capture returned no image data.");
return Convert.FromBase64String(data);

2. Bug: StopAsync can call Cancel() on a disposed CancellationTokenSource
📁 src/Aspire.Hosting.Browsers/BrowserLogsRunningSession.cs:193

If a session completes naturally (e.g., user closes the tab), MonitorAsync's finally block calls CleanupAsync() → _stopCts.Dispose() (line 326). If StopAsync() is called afterwards (e.g., during AppHost shutdown via BrowserLogsSessionManager.DisposeAsync at line 283), _stopCts.Cancel() at line 193 throws ObjectDisposedException.

The session manager catches this (line 281-288), so it won't crash the process, but it masks the real completion and logs a misleading debug error.

Suggested fix — guard the cancel:

try { _stopCts.Cancel(); } catch (ObjectDisposedException) { }

Or check _cleanupState before canceling.


3. Defense-in-depth: SanitizePathSegment does not block .. path traversal
📁 src/Aspire.Hosting.Browsers/BrowserLogsArtifacts.cs:137-158

SanitizePathSegment replaces invalid filename chars and spaces, but . is a valid filename character. A resourceName or artifactType of ".." would pass through unchanged. Combined with Path.Combine at line 58-62, this constructs a path that traverses up.

In practice, resourceName comes from Aspire's own resource model (not untrusted user input), so the risk is low. As defense-in-depth for this file-writing API:

var sanitized = hasValidCharacter ? new string(buffer) : fallback;
return sanitized is "." or ".." ? fallback : sanitized;

4. Minor: SemaphoreSlim _lock never disposed on error path
📁 src/Aspire.Hosting.Browsers/BrowserHostRegistry.cs:23

SemaphoreSlim _lock is only disposed via DisposeLockAsync(), which is only called from DisposeAsync(). If the registry is constructed but never properly disposed, the semaphore leaks. This is minor since the registry is a long-lived singleton.

- Fix null-forgiveness on screenshot Data property to throw
  InvalidOperationException instead of ArgumentNullException
- Guard _stopCts.Cancel() against ObjectDisposedException when
  MonitorAsync cleanup races with StopAsync
- Block '..' path traversal in SanitizePathSegment

Co-authored-by: Copilot <[email protected]>
@IEvangelist

Copy link
Copy Markdown
Member

How many browsers have you tested this on?

@mitchdenny Mitch Denny (mitchdenny) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the full 116-file PR. Found and fixed 3 issues (null-forgiveness bug, CTS race condition, path traversal defense-in-depth). The 2 CI failures (CLI locale timeout on macOS, K8s E2E deployment timeout) are unrelated infrastructure/flaky issues. LGTM.

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

🎬 CLI E2E Test Recordings — 76 recordings uploaded (commit 28cca25)

View all recordings
Status Test Recording
❔ AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
❔ AddPackageWhileAppHostRunningDetached ▶️ View Recording
❔ AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
❔ AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
❔ AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
❔ AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
❔ AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
❔ Banner_DisplayedOnFirstRun ▶️ View Recording
❔ Banner_DisplayedWithExplicitFlag ▶️ View Recording
❔ Banner_NotDisplayedWithNoLogoFlag ▶️ View Recording
❔ CertificatesClean_RemovesCertificates ▶️ View Recording
❔ CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
❔ CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
❔ ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
❔ CreateAndRunAspireStarterProject ▶️ View Recording
❔ CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
❔ CreateAndRunEmptyAppHostProject ▶️ View Recording
❔ CreateAndRunJavaEmptyAppHostProject ▶️ View Recording
❔ CreateAndRunJsReactProject ▶️ View Recording
❔ CreateAndRunPythonReactProject ▶️ View Recording
❔ CreateAndRunTypeScriptEmptyAppHostProject ▶️ View Recording
❔ CreateAndRunTypeScriptStarterProject ▶️ View Recording
❔ CreateJavaAppHostWithViteApp ▶️ View Recording
❔ CreateTypeScriptAppHostWithViteApp_UsesConfiguredToolchain ▶️ View Recording
❔ DashboardRunWithOtelTracesReturnsNoTraces ▶️ View Recording
❔ DeployK8sBasicApiService ▶️ View Recording
❔ DeployK8sWithGarnet ▶️ View Recording
❔ DeployK8sWithMongoDB ▶️ View Recording
❔ DeployK8sWithMySql ▶️ View Recording
❔ DeployK8sWithPostgres ▶️ View Recording
❔ DeployK8sWithRabbitMQ ▶️ View Recording
❔ DeployK8sWithRedis ▶️ View Recording
❔ DeployK8sWithSqlServer ▶️ View Recording
❔ DeployK8sWithValkey ▶️ View Recording
❔ DeployTypeScriptAppToKubernetes ▶️ View Recording
❔ DescribeCommandResolvesReplicaNames ▶️ View Recording
❔ DescribeCommandShowsRunningResources ▶️ View Recording
❔ DetachFormatJsonProducesValidJson ▶️ View Recording
❔ DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance ▶️ View Recording
❔ DoListStepsShowsPipelineSteps ▶️ View Recording
❔ DocsCommand_RendersInteractiveMarkdownFromLocalSource ▶️ View Recording
❔ DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
❔ DoctorCommand_TypeScriptAppHostReportsMissingConfiguredToolchain ▶️ View Recording
❔ DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
❔ DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
❔ GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
❔ GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
❔ GlobalMigration_PreservesAllValueTypes ▶️ View Recording
❔ GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
❔ GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
❔ InitTypeScriptAppHost_AugmentsExistingViteRepoAtRoot ▶️ View Recording
❔ InteractiveCSharpInitCreatesExpectedFiles ▶️ View Recording
❔ InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
❔ LegacySettingsMigration_AdjustsRelativeAppHostPath ▶️ View Recording
❔ LogsCommandShowsResourceLogs ▶️ View Recording
❔ OtelLogsReturnsStructuredLogsFromStarterAppCore ▶️ View Recording
❔ PsCommandListsRunningAppHost ▶️ View Recording
❔ PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
❔ PublishWithConfigureEnvFileUpdatesEnvOutput ▶️ View Recording
❔ PublishWithDockerComposeServiceCallbackSucceeds ▶️ View Recording
❔ PublishWithoutOutputPathUsesAppHostDirectoryDefault ▶️ View Recording
❔ RestoreGeneratesSdkFiles ▶️ View Recording
❔ RestoreGeneratesSdkFiles_WithConfiguredToolchain ▶️ View Recording
❔ RestoreRefreshesGeneratedSdkAfterAddingIntegration ▶️ View Recording
❔ RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes ▶️ View Recording
❔ RunFromParentDirectory_UsesExistingConfigNearAppHost ▶️ View Recording
❔ SecretCrudOnDotNetAppHost ▶️ View Recording
❔ SecretCrudOnTypeScriptAppHost ▶️ View Recording
❔ StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
❔ StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets ▶️ View Recording
❔ StopAllAppHostsFromAppHostDirectory ▶️ View Recording
❔ StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
❔ StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
❔ StopNonInteractiveSingleAppHost ▶️ View Recording
❔ StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
❔ UnAwaitedChainsCompileWithAutoResolvePromises ▶️ View Recording

📹 Recordings uploaded automatically from CI run #25197362665

@davidfowl
David Fowler (davidfowl) merged commit 8d44f52 into main May 1, 2026
567 of 571 checks passed
@github-actions github-actions Bot added this to the 13.4 milestone May 1, 2026
@davidfowl

Copy link
Copy Markdown
Collaborator Author

/backport to release/13.3

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Started backporting to release/13.3 (link to workflow run)

aspire-repo-bot Bot added a commit to microsoft/aspire.dev that referenced this pull request May 1, 2026
Documents the new Aspire.Hosting.Browsers package and WithBrowserLogs API
introduced in microsoft/aspire#16565.

Co-authored-by: Copilot <[email protected]>
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #791

Generated by PR Documentation Check

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

A draft documentation PR has been opened on microsoft/aspire.dev to document the BrowserLogs integration introduced by this PR.

Target branch: main (falling back from release/13.4 because that branch does not yet exist on microsoft/aspire.dev)

Summary of documentation changes:

  • New page — integrations/devtools/browser-logs.mdx: a full integration guide for Aspire.Hosting.Browsers covering:
    • Package installation
    • .WithBrowserLogs(...) usage and parameters
    • BrowserUserDataMode (Shared vs Isolated)
    • Configuration via appsettings.json (Aspire:Hosting:BrowserLogs:*)
    • Dashboard commands (Open Tracked Browser, Configure, Capture Screenshot)
    • Health reports and streamed diagnostic channels
    • Experimental API warning (ASPIREBROWSERLOGS001)
  • Sidebar updated — Browser logs entry added to the Dev tools & extensions section

The draft PR needs human review before merging.

Generated by PR Documentation Check for issue #16565 · ● 1.7M · ◷

Nell Shamrell-Harrington (nellshamrell) pushed a commit to nellshamrell/aspire that referenced this pull request May 18, 2026
* Add BrowserLogs CDP transport seam

Co-authored-by: Copilot <[email protected]>

* Use CDP pipe for BrowserLogs owned browsers

Switch owned tracked-browser launches to a private CDP pipe, keep WebSocket adoption as an opt-in seam, and add session/persistent process lifetime configuration.

Co-authored-by: Copilot <[email protected]>

* Remove BrowserLogs persistent lifetime

BrowserLogs pipe-launched browsers are always session scoped because Chromium exits when the CDP pipe closes. Remove the public lifetime option and mark public BrowserLogs types experimental.

Co-authored-by: Copilot <[email protected]>

* Split BrowserLogs pipe launcher partials

Move platform-specific native launch logic into Windows and Unix partial classes while keeping the shared launcher entry points in the common file.

Co-authored-by: Copilot <[email protected]>

* Use posix_spawn for BrowserLogs Unix pipe launches

Replace the managed fork/exec launcher with posix_spawn file actions so Chromium still receives CDP pipe fds 3 and 4 without running managed code in a forked child.

Co-authored-by: Copilot <[email protected]>

* Move BrowserLogs to Aspire.Hosting.Browsers

Co-authored-by: Copilot <[email protected]>

* Move BrowserLogs tests to Browsers assembly

Co-authored-by: Copilot <[email protected]>

* Update CI snapshots after BrowserLogs move

Co-authored-by: Copilot <[email protected]>

* Update TypeScript capabilities snapshot

Remove the BrowserLogs capability from the Hosting assembly scanner snapshot now that BrowserLogs lives in Aspire.Hosting.Browsers.

Co-authored-by: Copilot <[email protected]>

* Remove BrowserLogs friend assembly access

Stop relying on InternalsVisibleTo for the Browsers package and its tests by source-sharing the BrowserLogs implementation into the test assembly and replacing Hosting-internal runtime dependencies with public-compatible behavior.

Co-authored-by: Copilot <[email protected]>

* Restore BrowserLogs health report publishing

Add a public CustomResourceSnapshot helper for publishing health reports without InternalsVisibleTo and use it to restore BrowserLogs session and last-error health report rows.

Co-authored-by: Copilot <[email protected]>

* Address BrowserLogs localization feedback

Add translator comments for BrowserLogs resource strings with format placeholders and regenerate XLF files.

Co-authored-by: Copilot <[email protected]>

* Fix review findings in BrowserLogs

- Fix null-forgiveness on screenshot Data property to throw
  InvalidOperationException instead of ArgumentNullException
- Guard _stopCts.Cancel() against ObjectDisposedException when
  MonitorAsync cleanup races with StopAsync
- Block '..' path traversal in SanitizePathSegment

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Mitch Denny <[email protected]>
@github-actions github-actions Bot locked and limited conversation to collaborators May 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use CDP pipe transport for BrowserLogs remote debugging

4 participants