[release/13.5] Respect project server ready action overrides - #19451
[release/13.5] Respect project server ready action overrides#19451aspire-repo-bot[bot] wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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
serverReadyActionfromlaunchSettings.jsonwhen one is not already provided via debugger settings. - Add a test ensuring a project debugger’s
serverReadyActionis preserved. - Broaden
DebugLaunchSettingstyping 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.
| 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 }); |
| 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; |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19451Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19451" |
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)
How these were chosen — grouped by what changedJob reasons
Selection computed for commit |
Jose Perez Rodriguez (joperezr)
left a comment
There was a problem hiding this comment.
Customer reported, scoped to the extension, low risk. APproved.
|
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 |
Backport of #19200 to release/13.5
/cc Ella Hathaway (@ellahathaway)
Customer Impact
Testing
Risk
Regression?