t1k:unity:mobile:applovin-upgrade
| Field | Value |
|---|---|
| Module | mobile |
| Version | 3.65.6 |
| Effort | medium |
| Tools | — |
Keywords: adapters, applovin, integration manager, jenkins branch specifier, manifest.json, max, mediation, packages-lock, release branch, upgrade all
How to invoke
Section titled “How to invoke”/t1k:unity:mobile:applovin-upgrade[--plan-only] [--develop <branch>] [--release-prefix <prefix>]T1K — AppLovin Upgrade (headless “Upgrade All”)
Section titled “T1K — AppLovin Upgrade (headless “Upgrade All”)”Reproduces the Integration Manager Upgrade All button (AppLovinIntegrationManagerWindow.UpgradeAllNetworks,
UPM mode): for every mediation adapter already installed whose version is behind AppLovin’s catalog, write the
newer version into Packages/manifest.json. Networks that are not installed are never added. The MAX SDK
(com.applovin.mediation.ads) is out of scope — adapters and DSP packages only.
Scripts (Node ≥ 26, run from the repo root):
S=.claude/skills/t1k-unity-mobile-applovin-upgrade/scriptsP="$TEMP/applovin-plan.json" # plan file shared by every steprelease.cjs defaults to branch develop and prefix release- (studio convention). Override
per-project with --develop <branch> / --release-prefix <prefix> on every release.cjs
invocation below (preflight, commit, releases, pr, new-release) when a project uses a
different trunk name or release-branch pattern.
Why the extra rules exist
Section titled “Why the extra rules exist”| Rule | Reason |
|---|---|
| Skip pinned adapters | UITemplate/.../PackageMigration/Resources/PackageMigrationConfig.json packagesVersionToUse is force-applied by ProjectAutoMigrationScript on every editor load and every focus change, with an exact-match check — it silently downgrades anything newer. Upgrading a pinned adapter would be reverted by the very batchmode run below. Changing a pin is a UITemplate submodule change that affects every studio project — out of scope; report it. |
| Cap at the mirror | com.applovin.mediation is resolved from whichever manifest.json scopedRegistries entry’s scopes covers that package name — the studio mirror on most projects, but derived per-project rather than hardcoded. A version AppLovin calls latest may not be mirrored yet; the plan targets the newest mirrored version ≤ AppLovin latest and reports the gap. Auth comes from ~/.upmconfig.toml (never printed), keyed by the derived registry URL. If no scopedRegistries entry covers the scope, the plan falls back to AppLovin’s own registry with no cap — every target is AppLovin’s catalog latest — and reports a warnings entry saying so. |
| Batchmode for the lock | packages-lock.json holds hashes/dependency closures only UPM computes. Unity -batchmode -quit resolves packages and writes it. Unity must be closed on this project. |
| Commit two files only | Batchmode also runs the other migration modules (AndroidManifest, gradle, proguard, ProjectSettings…). Those changes are NOT committed — they are reported. |
| Jenkins before push | The Release job has a GitHubPushTrigger; its branch specifier must already name the new branch when the branch is pushed, or the push builds nothing (or the old branch). |
Workflow
Section titled “Workflow”Each step is a gate: stop on any ERROR: and report it — never work around it.
-
Preflight —
bun $S/release.cjs preflight. Requires branchdevelop, no tracked changes, fast-forwards toorigin/develop. If it reports tracked changes, ask the user (AskUserQuestion) — never stash/discard for them. -
Plan —
bun $S/upgrade.cjs plan --out "$P". Show the user a table from the JSON:upgrades(from → to),skippedPinned(current / AppLovin latest / pin),mirrorBehind(AppLovin latest vs mirror best),notInCatalog. Ifwarningsis non-empty (no scoped registry coverscom.applovin.mediation), surface it — every upgrade target is AppLovin’s catalog latest, uncapped. Ifupgradesis empty → report “already up to date” (with the skipped lists) and stop.--plan-onlyargument → stop here. -
Apply —
bun $S/upgrade.cjs apply --plan "$P". -
Resolve —
bun $S/upgrade.cjs resolve --plan "$P"(Bashtimeout: 600000; run in background if it exceeds that, Unity can take several minutes). It exits non-zero on a Unity failure or when any target is missing from manifest/lock (mismatches). On failure: showupmErrors+ the log path, then restore the two files (git checkout -- <manifest> <lock>) and stop. IfextraChangesis non-empty, list them andAskUserQuestion: keep them uncommitted (default) or discard them (git checkout -- <those paths>). Never commit them in this flow. -
Commit + push develop —
bun $S/release.cjs commit --plan "$P" --push. Pathspec commit of exactlyPackages/manifest.json+Packages/packages-lock.json; refuses if anything else is staged or lands in the commit. The message is kept short: one subject line (chore(applovin): upgrade N MAX adapters), no per-adapter list, since the manifest diff already shows it. Put the from → to table in the final report, not the commit. Report the SHA. -
Choose the release target —
bun $S/release.cjs releases. It ignores branches carrying any prefix before the release-branch pattern (e.g.chibi3/release-*).AskUserQuestionwith the latest branch anddevelopCommitsAheadOfLatest:- PR to
<latest>→ step 7a - New release branch → step 7b
- PR to
7a. PR — bun $S/release.cjs pr <latest> (reuses an open develop → release PR if one exists). Report the URL. Done.
7b. New release
- Confirm the version —
AskUserQuestionofferingsuggestions.next(studio rollover: 1.0.9 → 1.1.0, 1.1.1 → 1.1.2) as recommended, plusminor(andmajorif it differs meaningfully). The user may type another; it must be greater thanlatestVersion. - Find the Jenkins job(s) —
mcp__jenkins__findJobsWithScmUrlwithgit remote get-url origin.AskUserQuestion(multiSelect) which job(s) to re-point — ask every run, never assume. For each chosen job,mcp__jenkins__getJobScmand record the current branch of the project repo SCM entry (the job also checks outJenkinsScripts— that one must not change). Keep the job’s existing spec format — read the job’s actual current value rather than assuming it (a bare branch name with no*/prefix is the studio convention, but not universal). - Re-point Jenkins (reuses the core Jenkins skill’s script; credentials resolve from the
jenkinsMCP entry).<branch>below is<release-prefix><ver>—release-<ver>unless--release-prefixoverrode it in step 6:Terminal window J=~/.claude/skills/t1k-jenkins-job/scripts/jenkins-job.cjsbun $J update <folder> <job> --branch <branch> --dry-run # show the diff to the userbun $J update <folder> <job> --branch <branch>setBranchrewrites the firstBranchSpecin config.xml. Verify independently:mcp__jenkins__getJobScmmust show the project repo on<branch>ANDJenkinsScriptsstill onmaster. If JenkinsScripts moved, immediately re-runupdate --branch <old>to restore and stop. Do not touchPARAM_BUILD_VERSION— the build takes its version from the branch name. - Push the branch — only after every chosen job verified:
bun $S/release.cjs new-release <ver>(pushesorigin/develop→<branch>; no local checkout, HEAD stays on develop). - Confirm the trigger —
mcp__jenkins__getJobon each job shortly after; report whether a build was queued. Never calltriggerBuildas a substitute without asking.
Final report
Section titled “Final report”Upgraded adapters (from → to), skipped-as-pinned, mirror-behind, the develop commit SHA, then either the PR URL or
<branch> + Jenkins job(s) re-pointed + build queued yes/no. Remind: run EDM4U Android/iOS resolve on the next
editor open if the adapter’s native SDK versions changed.
Executed by
Section titled “Executed by”The adapter bump runs through scripts/upgrade.cjs (and release.cjs for the release branch):
| Step | Agent |
|---|---|
Run upgrade.cjs --plan-only and read the planned adapter bumps off the output | t1k-fact-fetcher |
Apply the bump, regenerate packages-lock.json, commit to develop | reasoning tier — t1k-unity-base-developer; a write to the user’s manifest |
| Open the PR or cut the release branch | reasoning tier — operator-confirmed, never delegated |
Hard rules
Section titled “Hard rules”applydoes exact text replacement of"name": "version"so CRLF line endings and 4-space indent survive; it fails if the manifest changed afterplan— re-runplan.- A stale
Temp/UnityLockfile(crashed editor) is deleted automatically; a live editor keeps it locked andresolverefuses. - Unity path defaults to
C:/Program Files/Unity/Hub/Editor/<ProjectVersion>/Editor/Unity.exeon Windows, or/Applications/Unity/Hub/Editor/<ProjectVersion>/Unity.app/Contents/MacOS/Unityon macOS; override either withUNITY_EXE. - The pin table is base config merged with the variant for the project’s editor (Unity 6 = base only), mirroring
PackageMigration.GetUnityVariantKey(). git status --porcelainlines are fixed-column (XY+ path); the sharedgit()helper inscripts/lib.cjstrims only trailing newline/CR, never leading whitespace — trimming the whole multi-line output would eat the leading space off the first line and shift every downstreamslice(3)by one column for that entry.- The mirror registry is derived from
manifest.json’sscopedRegistries[].scopes(whichever entry coverscom.applovin.mediation), not hardcoded — a project without a matchingscopedRegistriesentry has no cap and gets AppLovin’s catalog latest for every upgrade. The~/.upmconfig.tomllookup tries the derived URL both with and without a trailing slash, since Unity/npm auth sections key on an exact string and ascopedRegistries.urlmay or may not carry one.