Add Go-to-Ansible bridge program for v3.7.0 release#740
Add Go-to-Ansible bridge program for v3.7.0 release#740
Conversation
The 3.7.0 release is the end-of-life Canasta-CLI Go release. release.yml now builds the bridge from ./bridge (printing the migration notice) instead of the full Cobra CLI from build.sh. The full Cobra source remains in the repo as archived dead code. Bumping VERSION on merge triggers release.yml, which builds the four bridge binaries (linux/amd64, linux/arm64, darwin/amd64, darwin/arm64) and publishes them as release assets named canasta-<os>-<arch> — exactly the URL pattern the existing selfupdate code in installed binaries expects.
|
Reconsidered the bridge-binary approach. The issue: when a 3.x user runs Switching approach: instead of a bridge stub, publish the real v3.7.0 Go CLI (functional, with a deprecation warning printed to stderr on every command) and use a cross-repo release mirror so legacy clients hitting New PR: #741 (
Closing this PR without merging. |
|
Closing without merging — superseded by #741 (cross-repo release mirror) per the pivot discussion in the prior comment. Branch left unmerged for reference. |
… rename (#741) Print a deprecation warning to stderr from PersistentPreRun on every canasta invocation. The CLI continues to work normally; users see the warning and the migration command on each command. Suppressible via CANASTA_SUPPRESS_DEPRECATION_WARNING=1 for CI users who've intentionally pinned 3.x. Replaces the earlier bridge-binary plan (PR #740). The bridge approach would have replaced the working binary with a stub that only prints a message — bricking the user's wiki ops on the next 'canasta upgrade'. The new approach keeps a working canasta and gives users time to migrate. In the release workflow, add a step after the existing publish that mirrors the same release artifacts to CanastaWiki/Canasta-CLI. The mirror is gated on: - vars.RELEASE_BOT_APP_ID being set (skipped for forks and pre-rename, when no GitHub App is configured), and - github.repository != 'CanastaWiki/Canasta-CLI' (skipped when the workflow is running from Canasta-CLI itself, to prevent a self-mirror after the rename). After the rename (this repo becomes Canasta-Go and Canasta-Ansible becomes the new Canasta-CLI), the GitHub App needs to be installed on both repos and RELEASE_BOT_APP_ID / RELEASE_BOT_PRIVATE_KEY set at the org level. Bumping VERSION in a follow-up commit then triggers a v3.7.0 release that lands in both Canasta-Go and Canasta-CLI, so legacy 3.x clients hitting api.github.com/repos/CanastaWiki/Canasta-CLI/ releases/latest find a working v3.7.0 binary with the deprecation warning baked in.
Summary
Adds a minimal standalone Go program that prints a migration notice directing users to install the Ansible-based Canasta CLI 4.0.0+ via
get.canasta.wiki. Any invocation of the bridge prints the message — there's no half-functional state.No existing Cobra code is modified;
cmd/upgrade/upgrade.go,internal/selfupdate,build.sh, and the rest of the CLI implementation remain unchanged in this repo (which becomesCanasta-Goafter rename, archived).Files added/changed:
bridge/main.go(new) — the minimal program (onefunc main()withfmt.Println).Makefile— newbridgetarget cross-compiles todist/bridge/canasta-<os>-<arch>forlinux/amd64,linux/arm64,darwin/amd64,darwin/arm64. Uses-trimpath -ldflags="-s -w"..gitignore— addsdist/(build output, not committed)..github/workflows/release.yml— build step now compiles the bridge from./bridgeinstead of invokingbuild.sh. Output path and asset names unchanged, so the existing upload-artifact and publish steps work without further modification.VERSION— bumped to3.7.0. On merge, this triggersrelease.ymlwhich publishes the bridge binaries as release assets atgithub.com/CanastaWiki/Canasta-CLI/releases/v3.7.0.Closes #739.
Test plan
go vet ./bridge— OKgo test ./...— all existing tests pass (no regression)make bridge— 4 binaries produced, ~1.5–1.6 MB each (~6.2 MB total)dist/bridge/canasta-darwin-arm64on macOS — message prints correctlycanasta upgrade,canasta version --help foo bar) — same message regardlessGOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o build/canasta-linux-amd64 ./bridge) — produces 1.5 MB binary at the expected pathcanasta upgrade. selfupdate should follow the v3.7.0 download URL, install the bridge, and the nextcanastainvocation should print the migration message