Skip to content

Improve parameter display in VS Code extension - #17881

Merged
Adam Ratzman (adamint) merged 8 commits into
microsoft:mainfrom
ellahathaway:ellahathaway/improve-vscode-parameter-display
Jun 5, 2026
Merged

Improve parameter display in VS Code extension#17881
Adam Ratzman (adamint) merged 8 commits into
microsoft:mainfrom
ellahathaway:ellahathaway/improve-vscode-parameter-display

Conversation

@ellahathaway

@ellahathaway Ella Hathaway (ellahathaway) commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #17193

Parameters now display consistently in both the resource tree and the inline apphost CodeLens, matching the Aspire dashboard.

What changed

  • Missing values show as Value missing with a warning icon, instead of the
    raw ValueMissing state string.
  • Parameter values are shown inline next to the resource state:
    • Secret parameters display a masked value (●●●●●●●●).
    • Non-secret values display their text, truncated to 80 characters with an
      ellipsis so a row stays readable.
    • Parameters with no value show no value (just the "Value missing" state).
  • Command order matches the dashboardset-parameter now appears before
    delete-parameter instead of being alphabetically sorted.

Before / after

Before After
Missing value ValueMissing ⚠️ Value missing
Secret value (no value shown) ●●●●●●●●
Long value (no value shown) the-value… (≤80 chars)
Command order delete-parameter, set-parameter set-parameter, delete-parameter
image

Show parameter values in the resource tree consistently with the dashboard:
mask secrets with a fixed 8-bullet string, truncate long non-secret values,
and surface a "Value missing" state. Preserve AppHost command registration
order in the CLI include-disabled stream so set-parameter shows before
delete-parameter.

Fixes microsoft#17193
@github-actions

github-actions Bot commented Jun 3, 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 -- 17881

Or

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

Mirror the tree-view parameter improvements on the inline apphost CodeLens:
- ValueMissing renders as "Value missing" with a warning icon.
- Add a value lens showing the parameter value (secrets masked, long values
  truncated to 80 chars) inline next to the state.
- Reuse the exported getParameterValueDescription so masking/truncation matches
  the tree and dashboard.
- Preserve command registration order in the tree Commands node (set-parameter
  before delete-parameter) to match the dashboard.
…text

The CodeLens tooltip was using the raw state string (e.g. 'ValueMissing') while
the title already used the localized label. Export getResourceStateDescription and
use it in the tooltip so it shows 'Value missing' consistently.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ellahathaway Ella Hathaway (ellahathaway) changed the title Improve parameter display in VS Code extension tree Improve parameter display in VS Code extension Jun 3, 2026
@ellahathaway
Ella Hathaway (ellahathaway) marked this pull request as ready for review June 3, 2026 21:14
Copilot AI review requested due to automatic review settings June 3, 2026 21: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

Note

Copilot was unable to run its full agentic suite in this review.

Updates command ordering semantics between API/UI backchannel streams and improves parameter UX in the VS Code extension (new ValueMissing state + inline parameter value display with masking/truncation).

Changes:

  • Preserve AppHost registration order for commands when includeDisabledCommands: true, while keeping default/API stream alphabetically sorted.
  • Add ValueMissing resource state support and humanized display text in tree/tooltips/code lenses.
  • Display Parameter values inline (tree + code lens), masking secrets and truncating long values.

Reviewed changes

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

Show a summary per file
File Description
tests/Aspire.Cli.Tests/Backchannel/ResourceSnapshotMapperTests.cs Updates/extends tests to validate different command ordering contracts per stream.
src/Aspire.Cli/Backchannel/ResourceSnapshotMapper.cs Implements conditional command ordering depending on includeDisabledCommands.
extension/src/views/AspireAppHostTreeProvider.ts Humanizes ValueMissing, shows/masks/truncates parameter values, and preserves command order in the tree.
extension/src/editor/AspireCodeLensProvider.ts Adds ValueMissing label and an additional parameter value code lens.
extension/src/editor/resourceConstants.ts Adds ValueMissing state and constants for parameter command/property names.
extension/src/loc/strings.ts Adds localized strings for “Value missing” (tree) and code lens label (with warning icon).
extension/package.nls.json Adds NLS entry for parameterValueMissing.
extension/loc/xlf/aspire-vscode.xlf Adds XLF entry for parameterValueMissing.
extension/src/test/codeLens.test.ts Adds unit coverage for ValueMissing code lens label.
extension/src/test/aspireCodeLensProvider.test.ts Adds coverage for parameter value code lens behavior (mask/truncate/missing).
extension/src/test/appHostTreeView.test.ts Adds coverage for warning icon, parameter description behavior, tooltip state, and command ordering in quick pick.

Comment thread src/Aspire.Cli/Backchannel/ResourceSnapshotMapper.cs Outdated
Comment thread src/Aspire.Cli/Backchannel/ResourceSnapshotMapper.cs Outdated
Comment thread extension/src/views/AspireAppHostTreeProvider.ts Outdated
Comment thread extension/src/editor/AspireCodeLensProvider.ts Outdated
Comment thread extension/src/editor/AspireCodeLensProvider.ts
Comment thread extension/src/editor/AspireCodeLensProvider.ts
Move getResourceStateDescription/getParameterValueDescription and the mask/truncation constants out of the AspireAppHostTreeProvider view module into a new extension/src/utils/resourceDisplay.ts, so AspireCodeLensProvider no longer depends on the view layer. Pure move; no behavior change.
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 1 job was 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.

Comment thread src/Aspire.Cli/Backchannel/ResourceSnapshotMapper.cs Outdated
@adamint

Copy link
Copy Markdown
Member

Tested with the PR CLI artifact 13.5.0-pr.17881.gb318ea0e (matches b318ea0e). aspire new aspire-starter against the PR hive completed successfully, and ResourceSnapshotMapperTests passed locally (17 tests). No new review comments from me.

@adamint Adam Ratzman (adamint) 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 with four dedicated passes. I did not find any new, non-duplicate high-confidence issues to raise.

Add a RegistrationOrder field to the command JSON contract carrying each command's AppHost registration index, and sort commands in the VS Code extension by (RegistrationOrder, Name). This makes the resource tree, command quick pick, and CodeLens follow the dashboard's registration ordering instead of the alphabetical JSON key order.
Consolidate the resource command comparator alongside the other resource display helpers and remove the standalone resourceCommands.ts module.
@adamint
Adam Ratzman (adamint) merged commit cad60c6 into microsoft:main Jun 5, 2026
660 of 663 checks passed
@github-actions github-actions Bot added this to the 13.5 milestone Jun 5, 2026
/// The zero-based index at which the command was registered.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? RegistrationOrder { get; set; }

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.

Rename this to SortOrder. That's the name we use in other places, e.g. urls

.OrderBy(c => c.Name)
.Select((command, index) => (command, index))
.Where(c => IsCommandVisibleForConsumer(c.command.Visibility, includeDisabledCommands) && IsCommandVisibleToConsumer(c.command.State, includeDisabledCommands))
.OrderBy(c => c.command.Name)

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.

This orderby seems redundent.

Copilot AI added a commit that referenced this pull request Jun 5, 2026
…der and remove redundant OrderBy

Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com>
Copilot AI mentioned this pull request Jun 5, 2026
14 tasks
@davidfowl

Copy link
Copy Markdown
Collaborator

This is pretty slick

Ankit Jain (radical) added a commit that referenced this pull request Jun 9, 2026
…ilename globs match nested paths

Three automated PRs in the last 14d fired more tests than they needed to:

  #17672, #17263  [Automated] Update ATS API Surface Area
  #17534          Move repository skills to .agents

They each touched only api/*.txt or only README/skill markdown, but were
firing trigger_all or selective:integrations — burning the full ~25min
CI critical path. Audit-replay over 161 merged PRs found them, plus a
latent C# glob bug where bare-filename patterns silently ignored
nested matches.

Root causes — two independent bugs:

1. The category-trigger rescue logic in RescueCategoryTriggerFiles built
   a synthetic union of all category triggerPaths without consulting
   per-category excludePaths. An ignored file that textually matched some
   category's glob but was excluded from that category got rescued back
   to active and then hit fallback_unmatched (worse than staying
   ignored). For src/Aspire.Hosting.Foundry/api/*.txt this meant ATS-only
   PRs fired integrations even after `**/api/*.txt` was added to
   ignorePaths.

2. The four glob analyzers (CriticalFileDetector, IgnorePathFilter,
   CategoryMapper.CompiledCategory, ProjectMappingResolver.CompiledMapping)
   handed user-facing patterns directly to FileSystemGlobbing.Matcher.
   The Matcher anchors bare-filename patterns at the repo root, so
   `Directory.Build.props` matched only the root file, not
   `src/Directory.Build.props` or `tests/Directory.Build.props`. The
   Python audit-replay evaluator (eval_rules.py) already documented and
   applied a "prepend **/ to bare-filename patterns" rule; the C#
   analyzers did not, so the two evaluators silently disagreed on
   ~5 patterns across ignorePaths, triggerAllPaths, and sourceToTestMappings.

The fix:

- Rescue now passes config.Categories directly to CategoryMapper so
  CompiledCategory.Matches honors per-category excludes. A file is
  rescued only when at least one category would actually fire on it.
- New PatternNormalization.NormalizeGlob prepends `**/` to any pattern
  without a path separator. Every glob entry point applies it: the four
  analyzers above plus ProjectMappingResolver's regex compiler.
- Rules: integrations.excludePaths gains `tests/Aspire.Acquisition.Tests/**`,
  `tests/Infrastructure.Tests/**`, `**/*.md`, `**/api/*.txt`. The same
  `**/api/*.txt` exclude is added to every category so an ignored ATS
  file can't be rescued back by any category. ignorePaths gains
  `**/api/*.txt`. Acquisition mapping's source list gains the missing
  self-mapping `tests/Aspire.Acquisition.Tests/**` (Templates and
  Infrastructure mappings already had this; Acquisition was an oversight
  exposed only after the new exclude was added).

Verification:

- Audit replay over 161 merged PRs: 4 outcomes change (#17263, #17534,
  #17549, #17672 all move to `skip`); zero regressions; zero
  fallback_unmatched.
- New AuditFixtureTests xUnit [Theory] replays 28 hand-validated PRs
  against the live audit rules. Each row is a separate test, so any
  future rule edit that changes a row's outcome shows up as a visible
  CI failure. Coverage includes templates (#16447), CLI native build
  (#17567), extension multi-category (#17881/17698/17772), Hosting-core
  trigger_all (#17879), polyglot (#17948), and the regression canaries
  for previous fallback_unmatched cases.
- Per-component regression tests pin both bugs: two new tests in
  EndToEndEvaluationTests for rescue+excludes; two more for
  bare-filename matching at nested paths.
- Three pre-existing analyzer tests had asserted the buggy bare-filename
  behavior as expected (e.g. `*.md` not matching `docs/guide.md`).
  Updated with comments explaining the user-intent rule.
- Full TestSelector namespace: 290 tests, all pass. No collateral damage
  on the wider Infrastructure.Tests suite (5 pre-existing baseline
  failures unchanged).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve parameter display in VS Code extension

5 participants