Add installed and available versions to self-service#47526
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #47526 +/- ##
==========================================
- Coverage 67.20% 67.19% -0.01%
==========================================
Files 3393 3521 +128
Lines 228245 228549 +304
Branches 11898 11766 -132
==========================================
+ Hits 153385 153576 +191
- Misses 61033 61147 +114
+ Partials 13827 13826 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
WalkthroughAdds two columns to the Self-service software table: "Installed version" (from installed_versions) and "Available version" (from software_package or app_store_app). SelfServiceTableConfig imports VersionCell, defines CellProps for the new cells, and extends generateSoftwareTableHeaders with accessors and cell renderers that pass version arrays to VersionCell. Tests in SelfService.tests.tsx were added to verify behavior when installed_versions is null and when both installed_versions and software_package.version are present. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds version visibility to the host “Self-service” software table so end users can see both what’s installed on the host and what version will be installed from self-service.
Changes:
- Added Installed version column rendering
installed_versionsvia existingVersionCell. - Added Available version column rendering installer/app-store version via
VersionCell. - Added a user-visible change entry under
changes/.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| frontend/pages/hosts/details/cards/Software/SelfService/components/SelfServiceTable/SelfServiceTableConfig.tsx | Adds two new version-related columns to the self-service table config. |
| changes/45729-self-service-show-version | Release note entry for the UI change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@frontend/pages/hosts/details/cards/Software/SelfService/SelfService.tests.tsx`:
- Around line 309-331: Update the test "shows installed version and available
version when both are present" to assert exact counts instead of permissive
checks: replace the two expect(...) calls that use
screen.getAllByText("1.0.0").length.toBeGreaterThan(0) and
screen.getAllByText("1.1.0").length.toBeGreaterThan(0) with exact-length
assertions (expect(screen.getAllByText("1.0.0")).toHaveLength(2) and
expect(screen.getAllByText("1.1.0")).toHaveLength(2)) so they match
TooltipTruncatedTextCell's dual rendering; locate these in SelfService.tests.tsx
within the test for SelfService and update accordingly.
- Around line 284-307: Update the test in SelfService.tests.tsx to assert exact
duplicate counts for the installed/version cells instead of using
.toBeGreaterThan(0): when creating the mock software with installed_versions:
null and package version "1.1.0", expect screen.getAllByText("---").length to
equal 2 and expect screen.getAllByText("1.1.0").length to equal 2 (because
TooltipTruncatedTextCell renders each value twice); also update the nearby
comment to correctly state that "---" is the placeholder for the installed
version column when installed_versions is null (not the install status).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5506f4a1-e46a-42e4-a79e-77f9c34ca4fe
📒 Files selected for processing (1)
frontend/pages/hosts/details/cards/Software/SelfService/SelfService.tests.tsx
5781d5b to
f89d038
Compare
Related issue: Resolves #45729
Checklist for submitter
changes/,orbit/changes/oree/fleetd-chrome/changes.Testing
Summary by CodeRabbit