Skip to content

IHA: add support for in-house apps to list host software - #34588

Merged
mna merged 17 commits into
feat-in-house-appsfrom
mna-34001-list-filter-ipa-2
Oct 22, 2025
Merged

IHA: add support for in-house apps to list host software#34588
mna merged 17 commits into
feat-in-house-appsfrom
mna-34001-list-filter-ipa-2

Conversation

@mna

@mna mna commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

Related issue: (partially) Resolves #34001

Checklist for submitter

  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements)

Testing

@codecov

codecov Bot commented Oct 21, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.46629% with 75 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (feat-in-house-apps@e403c74). Learn more about missing BASE report.

Files with missing lines Patch % Lines
server/datastore/mysql/software.go 89.40% 51 Missing and 24 partials ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##             feat-in-house-apps   #34588   +/-   ##
=====================================================
  Coverage                      ?   64.37%           
=====================================================
  Files                         ?     2065           
  Lines                         ?   209506           
  Branches                      ?     7032           
=====================================================
  Hits                          ?   134878           
  Misses                        ?    64078           
  Partials                      ?    10550           
Flag Coverage Δ
backend 65.51% <89.46%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +9809 to +9810
// TODO: should an in-house app fill the InstallUUID instead? For frontend?
require.Equal(t, sw[2].SoftwarePackage.LastInstall.CommandUUID, inhouse1InstallCmd)

@mna mna Oct 21, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking especially of when clicking on details in the software library for the last install status? Won't that try to open an installer's script outputs vs an MDM command results? rachaelshaw (meant @RachelElysia )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it currently reports the in-house app UUID in the command_uuid field, not the install_uuid, just wondering if that's ok for the frontend - i.e. it should open an MDM command result modal when clicking on details in list host software library, not the installer's results.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, meant to ping @RachelElysia ^

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mna I think this is right. VPP & in-house apps want command_uuid for the MDM command results modal.


// create some in-house apps for no-team (this creates both iOS and iPadOS,
// but returns the iOS ids)
inHouseID1, inHouseTitleID1, err := ds.MatchOrCreateSoftwareInstaller(ctx, &fleet.UploadSoftwareInstallerPayload{

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This turned out ok for this test, but it's a bit awkward/error-prone API to create 2 entries for the installer payload but return (~arbitrarily) the iOS in-house and title ids.

require.Len(t, sw, 4)
require.Equal(t, []string{"inhouse1", "inhouse2", "inhouse3", "inhouseincl"}, pluckSoftwareNames(sw))

// Useful for debugging:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking of leaving it there to help future us adding cases or debugging issues, unless y'all hate it.

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.

that's fine by me!

@mna
mna marked this pull request as ready for review October 21, 2025 20:31
@mna
mna requested a review from a team as a code owner October 21, 2025 20:31
DumpTable(t, tx, "nano_commands")
DumpTable(t, tx, "nano_command_results")
return nil
})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has passed the last few times, and locally too, but I'd leave this here so if we do see it failing before we merge the feature branch, it might help with debugging. If not, we can always remove it before merging to main (or leave it there a while longer).

Comment thread server/datastore/mysql/software.go Outdated
for _, s := range installedInHouseAppIDs {
if s.InHouseAppID != nil {
if tmpByInHouseID[*s.InHouseAppID] == nil {
// inventoried by osquery, but not installed by fleet

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.

nit: in-house apps can't be inventoried by osquery rn, because they're mobile device only

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, true, I was caught up in duplicating the most accurately possible the VPP logic. Are we confident enough in the comment so that I remove this part?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually it may just be the comment that need adjusted, and the code needs to stay there (i.e. inventoried by MDM command, but not installed by Fleet)...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update it this PM.

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.

@mna yeah that sounds right to me 👍

@jahzielv

Copy link
Copy Markdown
Contributor

this lgtm overall!

@mna mna mentioned this pull request Oct 22, 2025
2 tasks
Comment on lines +9809 to +9810
// TODO: should an in-house app fill the InstallUUID instead? For frontend?
require.Equal(t, sw[2].SoftwarePackage.LastInstall.CommandUUID, inhouse1InstallCmd)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mna I think this is right. VPP & in-house apps want command_uuid for the MDM command results modal.

@mna
mna merged commit 84cd57e into feat-in-house-apps Oct 22, 2025
36 checks passed
@mna
mna deleted the mna-34001-list-filter-ipa-2 branch October 22, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants