Skip to content

Fix spec dashboard overview grouping for C# management emitter - #11709

Open
Wei Hu (live1206) wants to merge 8 commits into
microsoft:mainfrom
live1206:fix/spec-dashboard-coverage-overview-csharp
Open

Fix spec dashboard overview grouping for C# management emitter#11709
Wei Hu (live1206) wants to merge 8 commits into
microsoft:mainfrom
live1206:fix/spec-dashboard-coverage-overview-csharp

Conversation

@live1206

@live1206 Wei Hu (live1206) commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #11699

Group coverage overview entries by their configured display name rather than by raw emitter package name. This allows data-plane and management-plane emitters configured with the same language label to contribute to one overview card without counting a scenario more than once within a summary.

The explicit management C# display-name mapping is added by Azure/typespec-azure#5291.

Validation

  • Added a regression test that configures both C# emitter packages with the C# display name and verifies the overview renders one combined C# card.
  • Verified the combined changes against live dashboard coverage data; the overview renders one C# card with aggregated coverage.

@github-actions

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

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

This PR updates the spec dashboard’s coverage overview to aggregate coverage by a logical emitter “display name” (e.g., grouping data-plane and management-plane C# emitters together) and adds a regression test intended to prevent the C# management emitter from appearing as a separate language card.

Changes:

  • Group overview cards by a logical key derived from the emitter display name rather than the raw emitter package name.
  • Track/display a grouped display name per overview entry.
  • Add a regression test for the C# management/data-plane grouping scenario.

Reviewed changes

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

File Description
packages/spec-dashboard/src/components/coverage-overview.tsx Changes overview aggregation from per-emitter-package to per-display-name grouping.
packages/spec-dashboard/src/apis.test.ts Adds a regression test rendering CoverageOverview to validate grouping behavior.

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

Comment thread packages/spec-dashboard/src/components/coverage-overview.tsx
Comment thread packages/spec-dashboard/src/apis.test.ts Outdated
Comment thread packages/spec-dashboard/src/components/coverage-overview.tsx
Copilot AI review requested due to automatic review settings August 18, 2026 06:05

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

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

Suppressed comments (2)

packages/spec-dashboard/src/components/coverage-overview.tsx:72

  • The PR description (and linked issue) also calls out the management-plane table header showing a raw package name. This change only affects the overview grouping; DashboardTable header rendering is unchanged, so the table header may still fall back to the emitter package name when generatorMetadata.name/emitterDisplayNames aren’t available. Either update the PR description to scope it to the overview-only fix, or include a table-header fix (e.g., derive a friendly name for *-mgmt packages or ensure the mgmt emitter is always mapped via emitterDisplayNames).
    // Aggregate scenarios per logical emitter language across all summaries.
    // This keeps emitters that share the same display name (for example C# data-plane
    // and management-plane emitters) grouped into a single overview card.

packages/spec-dashboard/src/components/coverage-overview.tsx:134

  • The overview aggregation does two linear scans over summary.generatorReports per groupKey (to compute firstReport and then again to compute displayName). This makes the grouping work O(n²) per summary and adds avoidable complexity. Since groupKey is already the resolved display name, you can initialize the entry without re-scanning the reports.
          const firstReport = Object.entries(summary.generatorReports).find(
            ([emitterName, report]) =>
              getEmitterOverviewKey(emitterName, report, emitterDisplayNames) === groupKey,
          )?.[1];

@azure-sdk-automation

azure-sdk-automation Bot commented Aug 18, 2026

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

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

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

Suppressed comments (1)

packages/spec-dashboard/src/components/coverage-overview.tsx:133

  • Inside the if (!emitterMap.has(groupKey)) block, Object.entries(summary.generatorReports).find(...) is executed twice with the same predicate. This adds unnecessary work and makes the code harder to follow; hoist the result into a single variable and reuse it for both the firstReport and the emitter name used to compute displayName.
          const firstReport = Object.entries(summary.generatorReports).find(
            ([emitterName, report]) =>
              getEmitterOverviewKey(emitterName, report, emitterDisplayNames) === groupKey,
          )?.[1];

Copilot AI review requested due to automatic review settings August 24, 2026 05:25

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

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

Suppressed comments (1)

packages/spec-dashboard/src/apis.test.ts:269

  • This regression test currently provides both emitterDisplayNames and generatorMetadata.name, so it doesn't cover the failure mode reported in #11699 where the management emitter can fall back to the raw package name (missing metadata and no friendly-name mapping). Consider removing emitterDisplayNames and omitting generatorMetadata.name so the test verifies the default display-name derivation + grouping behavior end-to-end.
  const html = renderToStaticMarkup(
    createElement(CoverageOverview, {
      coverageSummaries,
      emitterDisplayNames: {
        "@azure-typespec/http-client-csharp": "C#",

Comment thread packages/spec-dashboard/src/components/coverage-overview.tsx
Comment thread packages/spec-dashboard/src/apis.test.ts Outdated
Copilot AI review requested due to automatic review settings August 25, 2026 01:39

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

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

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

packages/spec-dashboard/src/components/coverage-overview.tsx:111

  • This block scans Object.entries(summary.generatorReports) twice with the same predicate to discover the first emitter for a groupKey. This is redundant work and makes the logic harder to follow. Consider extracting [firstEmitterName, firstReport] with a single find() and reuse those values when setting displayName.
          const firstReport = Object.entries(summary.generatorReports).find(
            ([emitterName, report]) =>
              getEmitterOverviewKey(emitterName, report, emitterDisplayNames) === groupKey,
          )?.[1];

Copilot AI review requested due to automatic review settings August 25, 2026 01:46

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

packages/spec-dashboard/src/apis.test.ts:231

  • The PR description/linked issue state this change also fixes the management-plane table header showing a raw package name, but this PR only changes CoverageOverview grouping and adds an overview-only regression test. DashboardTable/GeneratorHeaderCell still render displayName ?? report?.generatorMetadata?.name ?? language, so without an emitterDisplayNames entry for @azure-typespec/http-client-csharp-mgmt (or a code change there) the header can still fall back to the package name.
it("should group overview coverage by logical display name across emitter packages", () => {

Comment thread packages/spec-dashboard/src/components/coverage-overview.tsx
Copilot AI review requested due to automatic review settings August 25, 2026 01:58

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

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

expect(defaultTable!.manifest.scenarios[0].name).toBe("unique_scenario");
});

it("should group overview coverage by logical display name across emitter packages", () => {

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.

a little confused here by what you are trying to achieve, why do we wantt o merge both emitters into a single one by displayName, this feels very nasty

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The thing is we have an coverage overview on the top of the dashboard, C# should contain the coverage data from 2 emitters, that's what the PR is trying to fix.
And there are separate tables for ARM and DPG, which should only use mgmt emitter and the dpg emitter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Check the current dashboard, there are 2 C# coverage in the coverage overview
image

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.

but this is still pretty nasty, each of the emitters don't support everything here which is what this portrayes.
Are you not doing the test at all for one of the emitters?

@live1206 Wei Hu (live1206) Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's the current situation for C#, we have 2 emitters:

Their combination support everything, each single of them can't cover all the scenarios.
What is your suggestion for this fix?

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.

But here for example you don't test anything against the mgmt emitter, it has 1% support in arm category and I assume 0 in all the others?
The way the dashboard should be seen is what does an emitter support. If we group by something else it doesn't really reflect that.
I do understand though you do want a way to show the total coverage of all c# emitters for tracking, I'll think of something.

Copilot AI review requested due to automatic review settings August 28, 2026 04: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

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

Maor Leger (maorleger) pushed a commit to maorleger/typespec-azure that referenced this pull request Aug 28, 2026
## Summary

- map `@azure-typespec/http-client-csharp-mgmt` to the `C#` dashboard
display name
- ensure the Azure Management Plane table uses the same language label
as the data-plane C# emitter
- allow the display-name grouping from microsoft/typespec#11709 to
aggregate both C# emitters into one overview card

## Validation

- Verified the combined changes against live coverage data: the
management-plane table header displays `C#`, the raw management emitter
package name is absent, and the overview contains one aggregated C#
card.

Co-authored-by: live1206 <live1206@users.noreply.github.com>
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.

[Bug]: Management emitter leaks into Coverage Overview and lacks a C# table header

4 participants