feat(backup): add inventory preload CSV export and app store app backup#202
Merged
Merged
Conversation
Add backup support for three resource types: - Inventory preload records via single CSV download (GET /v2/inventory-preload/csv) rather than paginated JSON list+get, writing inventory-preloads/inventory-preload-all.csv - Mac App Store apps (classic-mac-apps → mac-apps/) - Mobile device apps (classic-mobile-apps → mobile-apps/) Also fixes the filter guard in runBackup to allow non-standard filter names (inventory-preloads, blueprints, compliance-benchmarks) that are handled outside BackupResources. Adds isKnownBackupFilter and nonStandardBackupFilters to pro_resources.go so BackupFilterNames stays accurate for shell completion. Adds serialNumber as the name field override for inventory-preloads so --name <serial> lookups work on the generated command. Closes #200 Closes #201 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ktn-jamf
approved these changes
May 12, 2026
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.
Summary
GET /v2/inventory-preload/csv→inventory-preloads/inventory-preload-all.csv. The API provides the full dataset in one request; per-record JSON list+get is not the right approach here.classic-mac-appsandclassic-mobile-appswere already generated and wired — this PR adds them to the backup resource list so they appear inbackupoutput undermac-apps/andmobile-apps/.serialNumbername field forinventory-preloads: enables--name <serial>lookups on the generated command and correct file naming in future JSON-based operations.runBackup's "no resources match filter" guard now callsisKnownBackupFilterso--resources inventory-preloads(andblueprints,compliance-benchmarks) no longer false-errors before those handlers run.BackupFilterNamesupdated to include non-standard filter names for accurate shell completion.Tested on live instance (
platform-nmartin)Output:
inventory-preloads/inventory-preload-all.csvwith correct CSV headers and data.Output:
mac-apps/andmobile-apps/directories with per-app YAML files.Test plan
TestBackupInventoryPreloadCSV_Success— CSV written to correct path with correct contentTestBackupInventoryPreloadCSV_HTTPError— HTTP 403 produces failure record, not silent bad fileTestBackup_InventoryPreloadFilter—runBackupwithResources: "inventory-preloads"completes without errorTestBackupFilterNames— assertsmac-apps,mobile-apps,inventory-preloads,blueprints,compliance-benchmarksall presentTestBackupResources_AllKeysRegistered— catchesclassic-mac-apps/classic-mobile-appskey driftmake testpassesCloses #200
Closes #201
🤖 Generated with Claude Code