Add "ExcludeFleetMaintainedApps" option to software titles query#25649
Merged
Add "ExcludeFleetMaintainedApps" option to software titles query#25649
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #25649 +/- ##
========================================
Coverage 63.59% 63.60%
========================================
Files 1622 1625 +3
Lines 155091 155466 +375
Branches 4051 4051
========================================
+ Hits 98637 98886 +249
- Misses 48684 48779 +95
- Partials 7770 7801 +31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
sgress454
commented
Jan 24, 2025
Comment on lines
+871
to
+882
| // Testing with Platform filter | ||
| titles, count, _, err = ds.ListSoftwareTitles( | ||
| context.Background(), fleet.SoftwareTitleListOptions{ | ||
| ListOptions: fleet.ListOptions{}, | ||
| Platform: string(fleet.MacOSPlatform), | ||
| AvailableForInstall: true, | ||
| TeamID: &team1.ID, | ||
| }, globalTeamFilter, | ||
| ) | ||
| require.NoError(t, err) | ||
| require.Len(t, titles, 1) | ||
| require.Equal(t, "installer1", titles[0].Name) |
Contributor
Author
There was a problem hiding this comment.
Not directly related, but this would have caught an issue with the code that another test suite failed on (thankfully).
Contributor
Author
|
@dantecatalfamo all linting accounted for, tests are 🟢 |
dantecatalfamo
previously approved these changes
Jan 28, 2025
Member
dantecatalfamo
left a comment
There was a problem hiding this comment.
Looks good! I added a comment that you might want to consider, but otherwise good 2 go
Contributor
Author
|
@dantecatalfamo made the suggested change |
dantecatalfamo
approved these changes
Jan 29, 2025
sgress454
added a commit
that referenced
this pull request
Jan 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
for #25427
Checklist for submitter
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
SELECT *is avoided, SQL injection is prevented (using placeholders for values in statements)This PR adds a new
ExcludeFleetMaintainedAppsoption to the ListSoftwareTitles datastore method, and the equivalentexclude_fleet_maintained_appsto theGET /api/v1/fleet/software/titlesAPI.The new functionality works by doing a left join from the
software_titlestable to thefleet_library_appstable by bundle identifier, and excluding any rows that are present in thefleet_library_appstable.New tests verify that the filtering works as expected and doesn't interfere with other functions of the method.