Repository navigation
Follow-up fix for FMA counts - #48818
Conversation
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.
|
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 (3)
WalkthroughThis PR corrects the 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #48818 +/- ##
=======================================
Coverage 68.03% 68.03%
=======================================
Files 3687 3687
Lines 234180 234190 +10
Branches 12485 12485
=======================================
+ Hits 159319 159335 +16
+ Misses 60545 60541 -4
+ Partials 14316 14314 -2
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.
Pull request overview
This PR adjusts the Fleet-maintained apps (FMA) listing “count” semantics to count installable platform entries (distinct fleet_maintained_apps.id) instead of counting distinct app tokens (slug prefix), while keeping the token-based row-combining and pagination behavior introduced in #48783.
Changes:
- Update MySQL datastore count query for available FMAs to
COUNT(DISTINCT fma.id)(platform entries). - Update datastore and integration tests to expect the new count semantics.
- Update inline test/documentation comments to describe the new meaning of “count”.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| server/service/integration_enterprise_test.go | Updates integration test expectation/documentation so response count equals number of returned platform rows for the unfiltered fixture. |
| server/datastore/mysql/maintained_apps.go | Changes the filtered count query from distinct token to distinct fma.id and updates function-level documentation accordingly. |
| server/datastore/mysql/maintained_apps_test.go | Updates unit tests and comments to reflect platform-entry counting instead of token counting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
**Related issue:** Resolves #48528 Follow-up to #48783, which changed the Fleet-maintained apps "items" count from per-platform entries to per-app, dropping it from 1,263 to 1,023. This restores the count to `COUNT(DISTINCT fma.id)`: macOS and Windows entries are separately installable (each its own Add button), so each counts (1,263 / 960 macOS / 303 Windows). The token-based row-combining and pagination from #48783 are kept. # Checklist for submitter - [x] Input data is properly validated, `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 - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually For unreleased bug fixes in a release candidate, one of: - [x] Confirmed that the fix is not expected to adversely impact load test results <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Corrected available-app counts in listings so pagination totals now match what users can actually add. * Improved pagination consistency for apps with multiple platform variants, reducing confusion where totals did not align with visible entries. * Updated team-based filtering so already-added apps are excluded more accurately from available results. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Related issue: Resolves #48528
Follow-up to #48783, which changed the Fleet-maintained apps "items" count from per-platform entries to per-app, dropping it from 1,263 to 1,023. This restores the count to
COUNT(DISTINCT fma.id): macOS and Windows entries are separately installable (each its own Add button), so each counts (1,263 / 960 macOS / 303 Windows). The token-based row-combining and pagination from #48783 are kept.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