stitchยถ
Walks the per-source detail rows for each tracked app and projects them into the canonical apps table. Inputs are heterogeneous (Installomator labels, Homebrew Cask JSON, AutoPkg recipes, Jamf App Installers metadata, Mac App Store entries); outputs are normalized fields the public catalog serves. For the conceptual overview see Stitching.
- async stitch_catalog(session: AsyncSession) tuple[int, int, int, int, int, int, int, int][source]ยถ
Run the stitch process. Builds unified
appsrows from ingested Installomator labels, Homebrew Cask records, Mac App Store metadata, AutoPkg recipe-index entries, and Jamf App Installers catalog rows.Phases:
Installomator-led. For each label, try to match a Cask (token or artifact app-name), a MAS record (by
packageID), any AutoPkg recipes (by normalized display name), and any JAI catalog row (by normalized display name). Upsert oneappsrow per label. Sources land in canonical ordering[installomator, homebrew_cask, autopkg, jamf_app_installer, mas]regardless of which combination is present.Cask-only. Walk Casks not claimed in phase 1. Cask records donโt expose
bundle_id, so no MAS join is attempted, but AutoPkg + JAI name matching is still attempted.MAS-only with merge-on-collision. Walk MAS records not joined in phase 1. Slug derived from MAS
trackNamevia_slugify(). If the slug collides with an existing phase-1 or phase-2 row, merge the MAS payload into that row via_attach_mas_to_existing_app()rather than skipping (Microsoft Office + Apple Pro Suite are typical collision cases). Otherwise create a new MAS-only row. AutoPkg + JAI name matching still applies for newly-created rows.
AutoPkg and JAI never create new apps. Both are coverage indicators attached to existing apps when their normalized name matches the appโs display name.
- Parameters:
session (sqlalchemy.ext.asyncio.AsyncSession) โ Async SQLAlchemy session bound to the target DB.
- Returns:
(installomator_apps, cask_only_apps, both_sources, mas_only_apps, mas_merged_apps, autopkg_attached_apps, jai_attached_apps, failed).installomator_appsis the count of apps with an Installomator sourcecask_only_appsis the count of apps with only a Cask sourceboth_sourcesis the subset ofinstallomator_appsthat also matched a Caskmas_only_appsis the count of newly-created MAS-only rows from phase 3mas_merged_appsis the count of MAS records merged into an existing row via slug collision in phase 3autopkg_attached_appsis the count of apps with one or more AutoPkg recipes attached (across all phases)jai_attached_appsis the count of apps with a JAI catalog row attached (across all phases)failedis the count of records that raised an unexpected error
- Return type: