Skip to content

[release/13.5] Respect project server ready action overrides - #19451

Closed
aspire-repo-bot[bot] wants to merge 1 commit into
release/13.5from
backport/pr-19200-to-release/13.5
Closed

[release/13.5] Respect project server ready action overrides#19451
aspire-repo-bot[bot] wants to merge 1 commit into
release/13.5from
backport/pr-19200-to-release/13.5

Conversation

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Backport of #19200 to release/13.5

/cc Ella Hathaway (@ellahathaway)

Customer Impact

Testing

Risk

Regression?

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 17, 2026 23:22

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

Note

Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.

This PR updates the .NET project debugger extension to preserve an explicitly configured serverReadyAction (instead of overriding it from launchSettings.json) and adds a regression test to validate that behavior.

Changes:

  • Only derive serverReadyAction from launchSettings.json when one is not already provided via debugger settings.
  • Add a test ensuring a project debugger’s serverReadyAction is preserved.
  • Broaden DebugLaunchSettings typing to allow additional/unknown keys.

Reviewed changes

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

File Description
extension/src/test/dotnetDebugger.test.ts Adds a regression test to ensure serverReadyAction from debugger settings is not overridden.
extension/src/debugger/languages/dotnet.ts Adjusts logic to only set serverReadyAction from launch settings when not already set.
extension/src/dcp/types.ts Allows extra keys on DebugLaunchSettings via an index signature.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1750 to +1800
const projectDir = path.join(tempDir, 'WebProject');
const propertiesDir = path.join(projectDir, 'Properties');
fs.mkdirSync(propertiesDir, { recursive: true });

const projectPath = path.join(projectDir, 'WebProject.csproj');
fs.writeFileSync(projectPath, '<Project></Project>');
fs.writeFileSync(path.join(propertiesDir, 'launchSettings.json'), JSON.stringify({
profiles: {
Development: {
commandName: 'Project',
launchBrowser: true,
applicationUrl: 'https://localhost:5001'
}
}
}, null, 2));

const outputPath = path.join(projectDir, 'bin', 'Debug', 'net7.0', 'WebProject.dll');
const { extension } = createDebuggerExtension(outputPath, null, true, true);
const launchConfig: ProjectLaunchConfiguration = {
type: 'project',
project_path: projectPath,
launch_profile: 'Development'
};
const serverReadyAction = {
action: 'openIntegratedBrowser',
pattern: 'Now listening on:\\s+\\[?(https?://[^\\]\\s]+)'
};
const debugSessionConfig: AspireExtendedDebugConfiguration = {
type: 'aspire',
request: 'launch',
name: 'Aspire',
program: projectPath,
debuggers: {
project: {
serverReadyAction
}
}
};
const fakeAspireDebugSession = sinon.createStubInstance(AspireDebugSession);

const debugConfig = await createDebugSessionConfiguration(
debugSessionConfig,
launchConfig,
undefined,
[],
{ debug: true, runId: '1', debugSessionId: '1', isApphost: false, debugSession: fakeAspireDebugSession },
extension);

assert.deepStrictEqual(debugConfig.serverReadyAction, serverReadyAction);

fs.rmSync(tempDir, { recursive: true, force: true });
Comment on lines +1750 to +1800
const projectDir = path.join(tempDir, 'WebProject');
const propertiesDir = path.join(projectDir, 'Properties');
fs.mkdirSync(propertiesDir, { recursive: true });

const projectPath = path.join(projectDir, 'WebProject.csproj');
fs.writeFileSync(projectPath, '<Project></Project>');
fs.writeFileSync(path.join(propertiesDir, 'launchSettings.json'), JSON.stringify({
profiles: {
Development: {
commandName: 'Project',
launchBrowser: true,
applicationUrl: 'https://localhost:5001'
}
}
}, null, 2));

const outputPath = path.join(projectDir, 'bin', 'Debug', 'net7.0', 'WebProject.dll');
const { extension } = createDebuggerExtension(outputPath, null, true, true);
const launchConfig: ProjectLaunchConfiguration = {
type: 'project',
project_path: projectPath,
launch_profile: 'Development'
};
const serverReadyAction = {
action: 'openIntegratedBrowser',
pattern: 'Now listening on:\\s+\\[?(https?://[^\\]\\s]+)'
};
const debugSessionConfig: AspireExtendedDebugConfiguration = {
type: 'aspire',
request: 'launch',
name: 'Aspire',
program: projectPath,
debuggers: {
project: {
serverReadyAction
}
}
};
const fakeAspireDebugSession = sinon.createStubInstance(AspireDebugSession);

const debugConfig = await createDebugSessionConfiguration(
debugSessionConfig,
launchConfig,
undefined,
[],
{ debug: true, runId: '1', debugSessionId: '1', isApphost: false, debugSession: fakeAspireDebugSession },
extension);

assert.deepStrictEqual(debugConfig.serverReadyAction, serverReadyAction);

fs.rmSync(tempDir, { recursive: true, force: true });
}

export interface DebugLaunchSettings {
[key: string]: unknown;
@github-actions

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 -- 19451

Or

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

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

0 / 100 test projects · 2 jobs, from 3 changed files.

Selected test projects (0 / 100)

none — no .NET test projects run for this change.

Selected jobs (2)

extension-e2e, extension-unit


How these were chosen — grouped by what changed

Job reasons

Job Triggered by
extension-e2e extension/src/dcp/types.ts, extension/src/debugger/languages/dotnet.ts, extension/src/test/dotnetDebugger.test.ts
extension-unit extension/src/dcp/types.ts, extension/src/debugger/languages/dotnet.ts, extension/src/test/dotnetDebugger.test.ts

Selection computed for commit 5347034.

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.

Customer reported, scoped to the extension, low risk. APproved.

@adamint

Copy link
Copy Markdown
Member

We are not releasing extension off of this release branch. There are no CLI or other package changes, so we should not backport. going to close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants