Repository navigation
thirdshift update - #49
Merged
Merged
Conversation
`thirdshift update` reads the install receipt the shell installer wrote and replaces the binary with the latest stable GitHub Release, or says it is already on it. It refuses a copy the receipt isn't for (built from source, installed from crates.io or copied by hand) and names the command that updates it. Messages go to stderr; stdout stays empty. axoupdater's HTTPS goes through reqwest with rustls, so there is no OpenSSL in the tree. The tests run offline, against a receipt in the scenario's HOME and a local fake of the GitHub Releases API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Share the refusal text between the two refusals, drop the half-used app name constant, route every test's GitHub override through one helper, and run the no-receipt test with HOME and XDG_CONFIG_HOME on an empty directory, as the issue describes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
thirdshift updatenow works. It uses dist's axoupdater with the install receipt the shell installer writes.mvs the new binary into place. The rename leaves a running Run on the old inode.~/.cargo/bin/thirdshiftwhile an installer copy also exists). Without that check, axoupdater would quietly report "up to date".cargo tree -i openssl-sysandcargo tree -i native-tlsmatch nothing.thirdshift update. The rest of the README is left to README for the release, and ADR-0003 #36.Evidence
Before:
thirdshift updateprintedthirdshift: update is not yet availableand exited 1.After: with no receipt:
Against the real GitHub API, where no release exists yet:
thirdshift: can't update from GitHub Releases: There are no stable releases available for thirdshift, exit 1, stdout empty.tests/update.rsis all offline. GitHub is replaced by apython3 -m http.serverfake, reached through axoupdater'sTHIRDSHIFT_INSTALLER_GHE_BASE_URL:I checked that the stdout test can fail: without
disable_installer_stdout(), it fails withleft: "installing thirdshift 99.0.0\n".cargo fmt --check,cargo clippy --all-targets -D warningsand the fullcargo testpass locally, after merging the currentmain.Not verified locally: the musl build. aws-lc-sys (below) needs
musl-gcc, which this machine doesn't have. This PR touchesCargo.tomlandCargo.lock, so the release build job and the Rocky and WSL smoke jobs run on it. They are the check for the fourth acceptance criterion.Merge Danger
Door: two-way
Revert the commit to go back. Nothing is published by merging.
Blast Radius: release-build
reqwest's rustls uses the aws-lc-rs backend, which brings in
aws-lc-sys(C). So the static musl build now compiles C, where before its only native crates werelibcandsignal-hook. If CI's musl build or the Rocky smoke job fails, that is where to look. The lockfile also grows by about 180 crates, includingimage, which axoasset'sremotefeature pulls in. The Run path is unchanged apart from theupdatearm inmain.Unaddressed findings
Standards
tests/update.rs(code == 1, stdout empty): not fixed, because it matches how the other test files write their assertions.VERSIONrepeatsenv!("CARGO_PKG_VERSION"): not fixed, because the repo already does the same inmain.rsandplugin.rs.update()returns aStringrather than an outcome enum: not fixed, becausemainonly prints it. An enum would add a type that nothing branches on.run_with_envtakes a list of variables though most calls pass one: not fixed, because the no-receipt test passes two,HOMEandXDG_CONFIG_HOME.Spec
default-tls, which is rustls on aws-lc-rs, and Cargo features can't switch it toring. The spec's hard rule, rustls and never OpenSSL, still holds. This PR's musl build and smoke jobs are the check.THIRDSHIFT_INSTALLER_GHE_BASE_URLoverride can pointupdateat another server: not changed. It is axoupdater's (and dist's installer's) own documented override, and anyone who can set it can already changePATH.XDG_CONFIG_HOMEis now set for every Scenario: kept on purpose. It keeps every test away from a real receipt on the developer's machine.image): not fixed, because it comes with axoupdater'sgithub_releasesfeature, which the spec's choice of axoupdater requires.Closes #34
🤖 Generated with Claude Code