Skip to content

0049: frontend: Support distribution product versions - #7287

Open
illume wants to merge 3 commits into
kubernetes-sigs:mainfrom
illume:upstream-product-version-0049
Open

0049: frontend: Support distribution product versions#7287
illume wants to merge 3 commits into
kubernetes-sigs:mainfrom
illume:upstream-product-version-0049

Conversation

@illume

@illume illume commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Add an optional distribution product version for branded Headlamp builds while
retaining the underlying Headlamp version and Git commit in the version dialog.
The top-bar menu uses the distribution version when configured and keeps the
existing Headlamp version fallback otherwise.

This is independent and does not depend on another Headlamp PR.

Changes

  • read REACT_APP_HEADLAMP_PRODUCT_VERSION through documented product-info
    helpers
  • show distinct product and Headlamp versions only when they differ
  • preserve the existing single-version dialog when the product version is
    absent or empty
  • translate complete product-version labels with product-name interpolation
  • widen the dialog so product labels and commit identifiers remain readable
  • add focused unit and end-to-end coverage before the implementation commit

Improvements over the existing changes

The downstream patch covered only the configured helper value. This version
adds tests for configured, absent, empty, matching, distinct, and unnamed
products so fallback behavior is explicit and changed decision modules reach
92.85% branch coverage. It also centralizes the top-bar fallback in
getDisplayVersion, translates labels without assuming English word order,
extracts the new keys across all 18 locale catalogs, adds TSDoc for the new
TypeScript API, verifies the user-visible dialog path in the e2e suite, and
widens the dialog because the added labels otherwise broke in the middle of
words.

Source history

The two original Azure commits are in rebased downstream history without an
originating Azure merge PR association, so unrelated PRs that later inherited
the commits are intentionally not listed.

Testing

  • npm test -- --run (213 files, 2,791 tests passed)
  • focused Istanbul coverage: 92.85% branches overall; 100% for
    getProductInfo.ts; 91.66% for VersionDialog.tsx
  • npm run tsc
  • npm run build
  • focused ESLint and Prettier checks
  • npx playwright test tests/headlamp.spec.ts --list (14 tests discovered,
    including the new version-dialog test)
  • Storybook before/after verification at 960 x 640

The Playwright test was compiled and discovered locally but not executed because
no Headlamp server was running and the local test Kubernetes API endpoint was
unavailable. CI provides the required e2e environment.

Screenshots

Before

Headlamp version dialog before product version configuration

After: configured distribution version

AKS Desktop version dialog with product and Headlamp versions

Assisted by copilot

@kubernetes-prow kubernetes-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 16, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: illume

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 16, 2026
@illume
illume force-pushed the upstream-product-version-0049 branch 2 times, most recently from 08c196c to d560663 Compare August 16, 2026 18:45
@illume
illume requested a balanced review from Copilot August 16, 2026 19:30
@illume
illume marked this pull request as draft August 16, 2026 19:30
@kubernetes-prow kubernetes-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 16, 2026

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

Adds distribution-specific product versions while retaining Headlamp build details.

Changes:

  • Adds product-version helpers and top-bar fallback behavior.
  • Displays distinct product and Headlamp versions in a wider dialog.
  • Adds unit, snapshot, and end-to-end coverage.

Two issues remain: empty product versions behave inconsistently, and the generic product label bypasses localization. Automated checks passed.

Reviewed changes

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

Show a summary per file
File Description
frontend/src/helpers/getProductInfo.ts Adds product and display-version helpers.
frontend/src/helpers/getProductInfo.test.ts Tests helper behavior.
frontend/src/components/App/VersionDialog.tsx Displays product and Headlamp versions.
frontend/src/components/App/VersionDialog.test.tsx Tests dialog variants.
frontend/src/components/App/TopBar.tsx Uses the display version.
frontend/src/components/App/TopBar.test.tsx Updates helper mocks.
frontend/src/components/App/__snapshots__/VersionDialog.VersionDialog.stories.storyshot Records the wider dialog.
e2e-tests/tests/headlamp.spec.ts Verifies the version-dialog path.

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

Comment thread frontend/src/helpers/getProductInfo.ts Outdated
Comment thread frontend/src/components/App/VersionDialog.tsx Outdated
@illume
illume force-pushed the upstream-product-version-0049 branch from d560663 to 7eac261 Compare August 16, 2026 22:13
@illume illume added this to the v0.45.0 milestone Aug 17, 2026
@kubernetes-prow kubernetes-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 17, 2026
@illume
illume force-pushed the upstream-product-version-0049 branch from 7eac261 to 64b1841 Compare August 17, 2026 11:55
@kubernetes-prow kubernetes-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 17, 2026
illume and others added 3 commits August 17, 2026 14:18
Preserve existing version details before distribution handling changes.
Cover the existing user path to Headlamp version and commit details.
Show a distribution version while retaining Headlamp build details.

Co-authored-by: Oleksandr Dubenko <oldubenko@microsoft.com>

Co-authored-by: René Dudfield <renedudfield@microsoft.com>
@illume
illume force-pushed the upstream-product-version-0049 branch from 64b1841 to a75e10e Compare August 17, 2026 12:23
@illume
illume marked this pull request as ready for review August 17, 2026 12:32
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 17, 2026
@kubernetes-prow
kubernetes-prow Bot requested a review from kahirokunn August 17, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants