Skip to content

Disambiguate VS Code AppHost path labels#16518

Merged
adamint merged 3 commits intomicrosoft:mainfrom
adamint:dev/adamint/issue16200-extension-disambiguate-paths
Apr 29, 2026
Merged

Disambiguate VS Code AppHost path labels#16518
adamint merged 3 commits intomicrosoft:mainfrom
adamint:dev/adamint/issue16200-extension-disambiguate-paths

Conversation

@adamint
Copy link
Copy Markdown
Member

@adamint adamint commented Apr 28, 2026

Description

Fixes #16200

The VS Code extension now shortens AppHost paths as a batch so duplicate filenames gain enough parent segments to be unique in the tree, dashboard quick pick, and workspace AppHost label.

Validation:

  • npm run compile-tests && npm run unit-test -- --grep "shortenPath|AspireAppHostTreeProvider|AppHostDataRepository" --timeout 10000

Before:
image

After:
image

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 28, 2026 07:23
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

🚀 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 -- 16518

Or

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the VS Code extension’s AppHost labeling to disambiguate duplicate AppHost filenames by computing shortened labels across the full set of paths (rather than shortening each path independently). This addresses duplicate labels appearing in the tree view, dashboard quick pick, and workspace AppHost label.

Changes:

  • Replace single-path shortenPath usage in global tree rendering and dashboard quick pick with batched shortenPaths.
  • Implement shortenPaths in AppHostDataRepository to expand parent segments until labels are unique (with platform-aware comparisons).
  • Add/extend unit tests covering label disambiguation for global tree items, dashboard quick pick, and workspace AppHost naming.

Reviewed changes

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

File Description
extension/src/views/AspireAppHostTreeProvider.ts Uses shortenPaths to generate disambiguated labels for global tree items and dashboard quick pick entries.
extension/src/views/AppHostDataRepository.ts Adds shortenPaths (and refactors shortenPath to delegate) and uses candidate sets to disambiguate the workspace AppHost label.
extension/src/test/appHostTreeView.test.ts Adds unit tests validating disambiguation behavior in the tree provider, quick pick, and workspace AppHost name resolution.

@adamint adamint marked this pull request as draft April 28, 2026 07:42
@adamint adamint marked this pull request as ready for review April 29, 2026 04:49
Copy link
Copy Markdown
Member

@JamesNK JamesNK left a comment

Choose a reason for hiding this comment

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

I did this in the aspire ps results. Did you copy that? If not, make the results line up.

I added a bunch of unit tests so they can be used to check they're the same.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@adamint adamint enabled auto-merge (squash) April 29, 2026 05:16
@github-actions
Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 3 jobs were identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

Matched test failure patterns (1 test)
  • Aspire.Cli.EndToEnd.Tests.JavaCodegenValidationTests.RestoreGeneratesSdkFiles — MCR registry rate limiting (HTTP 403)

@adamint adamint merged commit 06c90e5 into microsoft:main Apr 29, 2026
564 of 567 checks passed
@github-actions github-actions Bot added this to the 13.3 milestone Apr 29, 2026
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.

Disambiguate duplicate paths in VS Code extension shortenPath

3 participants