Count FMAs by slug#48783
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #48783 +/- ##
==========================================
- Coverage 68.02% 68.01% -0.01%
==========================================
Files 3681 3685 +4
Lines 233960 234094 +134
Branches 12457 12333 -124
==========================================
+ Hits 159145 159216 +71
- Misses 60496 60562 +66
+ Partials 14319 14316 -3
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:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
Pull request overview
This PR fixes a mismatch between the Fleet-maintained apps “items” count and the number of rows rendered in the UI by keying pagination, counts, and frontend row-combining on the app’s slug token (the slug prefix before /, shared across platform variants but unique across apps).
Changes:
- Updated MySQL listing logic to count and paginate by distinct slug token (instead of per-platform rows or by name).
- Updated frontend table row-combining to group by slug token (preventing name-colliding apps from collapsing into one row).
- Added/updated backend + frontend tests to lock in the new semantics (including shared-name apps like “Gemini”).
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 |
|---|---|
| server/service/integration_enterprise_test.go | Updates integration expectations so API count matches distinct app tokens rather than raw platform rows. |
| server/datastore/mysql/maintained_apps.go | Counts and paginates by slug token; selects all platform rows for tokens on the current page. |
| server/datastore/mysql/maintained_apps_test.go | Updates pagination/count assertions and adds a regression test for apps sharing the same name. |
| frontend/pages/SoftwarePage/SoftwareAddPage/SoftwareFleetMaintained/FleetMaintainedAppsTable/FleetMaintainedAppsTable.tsx | Combines API rows into UI rows by slug token (not name) and exports helper for testing. |
| frontend/pages/SoftwarePage/SoftwareAddPage/SoftwareFleetMaintained/FleetMaintainedAppsTable/FleetMaintainedAppsTable.tests.tsx | Adds unit tests for token-based combining and shared-name apps. |
| frontend/interfaces/software.ts | Adds required slug field to IFleetMaintainedApp. |
| frontend/components/TableContainer/DataTable/InstallerActionCell/InstallerActionCell.tests.tsx | Updates test fixtures to include required slug. |
| frontend/mocks/softwareMock.ts | Updates maintained-app mock to include required slug. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
WalkthroughThis PR adds a required Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.44.1)server/service/integration_enterprise_test.goast-grep timed out on this file 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 |
Related issue: Resolves #48528
This keys the count, pagination, and the frontend row-combining on the app's slug token (the prefix before
/, shared across an app's platform entries but distinct across apps). The count now equals the rows shown in every view (macOS, Windows, All), and name-colliding apps stay as separate rows.Checklist for submitter
SELECT *is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.Testing
For unreleased bug fixes in a release candidate, one of:
Summary by CodeRabbit
New Features
Bug Fixes