Repository navigation
Conversation
…-22802) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
[coordinator] BLOCKED: plan ready for approval The plan is in the PR description. Summary:
Questions (my recommendation first):
|
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.
Status: plan only. No code yet. This draft PR has one empty commit. I will make the change after the plan gets approval.
Linear: TRUNK-22802 — trunk-action: get the new CLI instead of the legacy launcher
Summary
Today, trunk-action downloads the legacy bash launcher from
https://trunk.io/releases/trunkwhen the repo has notrunk. This plan changes that download: the action installs the new CLI at a pinned version withinstall.trunk.io. The new CLI sendscheck,fmt,install,upgradeand the other legacy commands to the frozen launcher, which runs the legacy binary. Thus customer behavior stays the same.On platforms that the new CLI does not support (Windows, Intel macOS), the action continues to download the legacy launcher.
Audit: each way that trunk-action gets or finds
trunktrunk-pathinputaction.yaml:10,setup/action.yaml:6,upgrade/action.yaml:10; alsotrunkPathin payload mode (action.yaml:195)TRUNK_PATH.setup/locate_trunk.sh:14-19:.trunk/bin/trunk, thentools/trunk, then./trunksetup,upgrade)setup/locate_trunk.sh:21curl https://trunk.io/releases/trunk(mutable, latest launcher) into$TRUNK_TMPDIR.installaction)install/get_trunk.sh:12$TRUNK_TMPDIRtoGITHUB_PATH, then runstrunk tools install --ci.setup/get_trunk.sh) that bothlocate_trunk.shandinstall/get_trunk.shcall.trunkalready on PATHaction.yaml:273(${TRUNK_PATH:-trunk} --ci init)locate_trunk.shnever looks at PATH. It always setsTRUNK_PATH, so the:-trunkfallback does not occur in practice.trunkfrom PATH, the binary can change for customers with no warning. I do not propose that.setup/locate_trunk.sh:28,install/get_trunk.sh:20trunk versiondownloads the legacy binary before later steps.versionis a built-in command, and it does not download the legacy binary. WhenTRUNK_PATHis the new CLI, runtrunk legacy version. This downloads the launcher and thecli.versionbinary in this step, as today.all.shall.sh:37trunk versiongives the legacy CLI version for the--upload-idminimum check (hold-the-line path only; the web app is shut down).trunk legacy versionwhenTRUNK_PATHis the new CLI. Otherwise the check comparestrunk 0.0.9with1.12.3and fails.action.yaml:224-225,actions/cacheataction.yaml:301~/.cache/trunk(legacy binaries and tools). Key:trunk-<cache-key>-<runner.os>-<hash of .trunk/trunk.yaml>.~/.cache/trunk/cli/<ver>-<platform>/(I tested this, see below), so cache hits are the same as today. The new CLI binary goes into$TRUNK_TMPDIR, which is not cached. Its 14 KB launcher copy goes into~/.cache/trunk-cli/and is fetched one time each run. I do not add it to the cache: it is small, and a new cache path changes the cache contents for all customers.$TRUNK_PATHpull_request.sh,push.sh,all.sh,trunk_merge.sh,annotate.sh,populate_cache_only.sh,setup-env/action.yaml:166,upgrade/upgrade.shcheck,install,check disable,upgrade,daemon shutdown.TRUNK_LAUNCHER_QUIETaction.yaml:132Version pin
cli-versionto the main action,setup,installandupgrade. Its default is a constant that each trunk-action release pins (start:0.0.9, the currentprodlatest). This is the same model astrunk-io/login(cli-version, default0.0.7).cli-channel(defaultprod), as intrunk-io/login. This lets us test with thestagingchannel.curl -fsSL https://install.trunk.io | sh -s -- --version "${CLI_VERSION}" --channel "${CLI_CHANNEL}" --install-dir "${TRUNK_TMPDIR}/bin". Inputs go throughenv, never into the script text.--versionwritestrunk.pinned, and GitHub runners setCI=true. Both stop self-update. I will also setTRUNK_NO_AUTO_UPDATE=1inGITHUB_ENVfor each later step, as a second guard.--install-dirmakesinstall.shskip its PATH probe, so a legacytrunkon PATH does not cause a warning or a stop.cliVersionandcliChannelfields, with the same defaults.Repos that pin
cli.versionintrunk.yamlThe new CLI sends legacy commands to its pinned launcher (1.3.4). That launcher reads
.trunk/trunk.yamlcli.versionand runs that exact legacy binary, as the old launcher does. I tested this on this repo (cli.version: 1.25.0) with CLI 0.0.9 andCI=true:A repo with no
.trunk/trunk.yamlgetstrunk --ci init(action.yaml:273).initis a legacy command, so it works the same way.Windows and Intel macOS
linux-x64,linux-arm64anddarwin-arm64only.install.shstops on other platforms.mingw/msys) and Intel macOS. The action runs every step withshell: bash, so Windows runners use the bash launcher today, nottrunk.ps1.uname -sanduname -mbefore it downloads. A supported platform gets the new CLI. All other platforms get the legacy launcher fromhttps://trunk.io/releases/trunk, as today. The script writes one::notice::line that tells which source it used.install.shfails on a supported platform. A silent fallback hides real failures and makes the version hard to know. The step fails with a clear error.Escape hatch
Add an input
launcherwith valuesnew(default) andlegacy.legacykeeps the old download on all platforms. A customer can use it if the new CLI causes a problem, without a pin to an old trunk-action tag. The README will document it.Tests
action_tests.yaml: add a job matrix onubuntu-latest,ubuntu-24.04-arm,macos-latest(arm64),macos-15-intel(Intel) andwindows-latest. Each job runs./setupin a fixture repo that pinscli.version, then checks:"$TRUNK_PATH" --versionistrunk <cli-version>for the new CLI;"$TRUNK_PATH" legacy version(orversionfor the launcher) equals the pinnedcli.version.launcher: legacyand a job for theinstallaction (trunkonPATHafter the step).TRUNK_PATH: stub.js) do not change, because they skip the download.repo_tests.yamlanddocker_repo_tests.yamluse./and will runtrunk checkthrough the new CLI on real repos. The docker job usesubuntu:runner-24.04. The linux build is static musl, so it runs there.README
trunk-pathtext in eachaction.yamland in the README: "Path to the trunk CLI".cli-version,cli-channelandlauncher, the supported platforms, and the fallback on Windows and Intel macOS.Risk for existing customers
v1tag moves to the new release, so all@v1users get the new CLI on the next run.cli.versionbinary). Thelauncher: legacyinput is the rollback for one repo. A human decides whether to release asv1.xor asv2; see the open questions.install.trunk.io.trunk.ioonly cannot getinstall.sh.launcher: legacyworks for them. Option B below removes this risk.trunk.io/releases/launcher/1.3.4/trunk.trunk.ioeach run.trunk versionoutput changes totrunk x.y.z.setupthat parse$TRUNK_PATH versionget a different string.trunk legacy versiongives the old output..trunk/bin/trunk,tools/trunk,./trunk).Open questions for approval
install.trunk.iowith--version, the same astrunk-io/login.trunk.io/releases/trunk-cli/<channel>/<ver>/and checks a sha256 for each platform that is pinned in the action. This removes the new host and the mutable installer script from customer CI, but each CLI bump must update the hashes too.v1(thev1tag moves to it), or release asv2so that customers opt in? I recommendv1with thelauncher: legacyescape hatch, because legacy commands do not change. A human does the release in both cases.launcherinput (recommended), or leave it out to keep the input list small?Out of scope
trunk.io/releases/trunk(decided 2026-10-24).🤖 Generated with Claude Code