ci(cli): add a cross-compile smoke build for the four release targets - #356
Merged
Merged
Conversation
Every CLI issue is blocked on this module existing. Add cli/ as a standalone Go module (go 1.25, no cgo) alongside the pnpm workspace, building a signet binary via cobra: cmd/signet/main.go is the entrypoint, internal/cmd holds the command tree, and internal/link, internal/keys, internal/spec are placeholder packages for the wallet-linking, key-management, and API-spec work that follows. signet --version carries a version and commit string injected via ldflags. signet --help and a bare `signet` invocation both print real usage text — cobra only renders the Usage: section when a command is Runnable() or has subcommands, so the root command needed an explicit RunE (falling through to cmd.Help()) to show it before any subcommand exists. golangci-lint is configured via cli/.golangci.yml, and a new CI job builds, vets, tests, and lints the module. Verified go build/go vet/go test all pass, and the binary cross-compiles with CGO_ENABLED=0 for linux/amd64 and darwin/arm64.
…entity Self-hosters and testnet users need to point the CLI at a deployment other than the default, and repeat runs shouldn't re-ask which identity to use. Every invocation needing --url and --source made self-hosted deployments second-class. Add internal/config: Load/Save a JSON file under os.UserConfigDir()/ signet (baseUrl, source), and Resolve combines flag > env (SIGNET_URL, baseUrl only) > config file > built-in default per field. Wire --url/ --source as persistent flags on the root command, resolved in PersistentPreRunE and attached to the command context via config.WithResolved/FromContext for subcommands to read once they exist. An explicit --source is saved back to the config file (RememberSource) so the next run without it picks the same identity back up. No config file is required for the default deployment. Document the precedence and file location in cli/README.md, and add SIGNET_URL to check-docs.mjs's ENV_ALLOW list — it's the cli/ module's own shell env, not part of the pnpm workspace's .env.
CI pipelines that link a deploy wallet need to parse the result, and
without structured output automation scrapes human-formatted text
that's free to change between releases.
Add internal/link.Link(handle, publicKey, network), validating the
handle (mirroring HANDLE_PATTERN from packages/types) and the public
key's charset/length, returning a Result{Handle, PublicKey, Network,
Status}. This doesn't yet perform a real on-chain claim or call a
deployment's HTTP API — internal/keys and internal/spec, which it
would need for that, are themselves still scaffolded — but the output
contract is real and stable now.
Wire it up as `signet link <handle> --public-key ... [--network]
[--json]`. Without --json, prints a human summary to stdout. With
--json, encodes exactly one JSON object to stdout via encoding/json
and nothing else; on a validation error, stdout stays empty in both
modes and the error reaches the user via stderr (main.go's existing
error handling), never stdout.
Covered by cmd/link_test.go (asserting --json's stdout decodes as the
expected JSON and is exactly one line, non-json output is not JSON,
and an invalid input leaves stdout empty) and link/link_test.go (the
validation logic in isolation).
… hygiene The CLI orchestrates the developer's deploy identity and ships as a prebuilt binary with no preview deploy or browser console — a regression surfaces on a user's machine, not in a PR check. - internal/keys.ResolvePublicKey(binary, source) resolves a named local identity to its public key by shelling out to `stellar keys address <source>`, rather than the CLI owning key storage or signing itself. Tested against a real faked `stellar` binary (internal/keys/testdata /fakestellar, compiled on first use — the standard Go helper-binary pattern), not just a swapped-out Go function, so the actual exec.Command wiring is exercised. - internal/exitcode + internal/cmd.ExitCode(err) map an error to a process exit code (0 ok, 1 generic, 2 invalid input) via an ExitCoder interface — link.ValidationError is the first implementer. exitcode lives in its own leaf package so internal/link's error type and internal/cmd's classifier can both depend on it without a cycle (cmd already imports link for the `link` command). - secrets_test.go asserts no secret-shaped value (a Stellar S... key) ever reaches stdout, stderr, or an error string, across --json and non-json runs — which caught a real issue while writing it: the invalid-public-key error echoed the raw value back, which would leak a real secret key a user passed to the wrong flag by mistake. Fixed in link.go to report the shape problem without repeating the value. - go test -race now runs in CI (needs cgo — a C toolchain, which ubuntu-latest has — unrelated to the production binary's CGO_ENABLED=0 requirement, since the test binary is never shipped). Not runnable in this environment for lack of a local C compiler. - Config precedence (flag > env > config > default) and --json stdout purity were already covered by blockchain-maxis#262/blockchain-maxis#264's tests; unchanged here. Scoping note: this does not cover "loopback single-use and timeout behaviour" or a "state mismatch" — no loopback HTTP server exists in the CLI's architecture today (neither blockchain-maxis#269 nor blockchain-maxis#263 needed one; the CLI-link challenge exchange is a plain two-request HTTP round trip, not a browser callback flow), so there is nothing yet to write that test against. Documented here rather than fabricated.
The cli lane already ran go build/vet/test -race/golangci-lint on the pinned Go version (go-version-file: cli/go.mod), but the CLI is consumed as a prebuilt binary from a release, not from this repo — a build break for a platform nobody's local dev machine matches (e.g. linux/arm64 built from an amd64 box) would otherwise stay invisible until it broke on a stranger's machine. Add a smoke-build step covering linux/amd64, linux/arm64, darwin/arm64, and windows/amd64 — no cgo (per go.mod's requirement), so each target needs only GOOS/GOARCH env vars on the one ubuntu-latest runner already running the rest of the lane, no per-platform runner or cross toolchain. A deliberately broken build fails the step (and the workflow) same as any other `go build`. Verified the same four-target loop locally before adding it to CI.
✅ Deploy Preview for stellar-signet ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@Otfrugger is attempting to deploy a commit to the blockchainmaxis-8449's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Otfrugger Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This was referenced Aug 30, 2026
This PR's only real change is the cross-compile smoke build; everything else in the diff is cherry-picked blockchain-maxis#335/blockchain-maxis#336/blockchain-maxis#342/blockchain-maxis#345, all now squashed onto main. Took main's version of every one of those files. ci.yml keeps all three improvements rather than either side: - `go test -race ./...` from this branch (issue blockchain-maxis#252 asks for -race; main still had a plain `go test`), - the golangci-lint action v8 + pinned v2.13.2 from main, - the four-target cross-compile smoke build this PR adds. Noted in the comment that the target set matches what release-cli.yml publishes, so the two cannot silently diverge. Verified locally: all four targets build with CGO_ENABLED=0, and go test -race ./... is clean across all 7 packages.
blockchain-maxis
merged commit Sep 2, 2026
26ae9b6
into
blockchain-maxis:main
10 of 11 checks passed
blockchain-maxis
added a commit
to Otfrugger/signet
that referenced
this pull request
Sep 2, 2026
Everything except cli/internal/browser/ and its docs was a cherry-pick of blockchain-maxis#335/blockchain-maxis#336/blockchain-maxis#342/blockchain-maxis#345/blockchain-maxis#356/blockchain-maxis#357/blockchain-maxis#358, all now on main — took main's for all of those. scripts/check-docs.mjs keeps all three allowlist entries rather than either side's pair (WAYLAND_DISPLAY from this branch, CLI_RELEASE_ENABLED and NPM_TOKEN from blockchain-maxis#346). Verified the fallback behaves as issue blockchain-maxis#257 requires, by driving OpenOrPrint with DISPLAY and WAYLAND_DISPLAY unset: headless, browser allowed -> prints 'Open this URL to continue: <url>', returns nil --no-browser -> same so the opener's failure is absorbed rather than propagated, and both paths reach the developer at the same URL. Left unwired deliberately, unlike blockchain-maxis#357's CheckStellarCLI: there is no call site to attach it to yet — `signet link` performs no approval flow (that lands with the loopback server and the pairing endpoints), so wiring it now would mean inventing the flow rather than connecting to one. Both the package doc and cli/README say so plainly. go build/vet, gofmt, golangci-lint v2.13.2 (0 issues), go test -race ./... and check-docs all clean.
blockchain-maxis
added a commit
that referenced
this pull request
Sep 4, 2026
…on main (#384) No apps/cli or cli/ package exists on main yet. The CLI is mid-rewrite from a stale TypeScript scaffold (#354, apps/cli/) to an in-progress Go rewrite (#369 landed identity resolution; #370/#358/#357/#359/#356/ #371/#380 build out the rest, all still open). There is no link/sign command yet for --sign-with-key / STELLAR_SIGN_WITH_KEY to attach to. Empty tracking PR so the issue shows linked work in progress. Real commits land once the Go CLI's sign path exists. Co-authored-by: Tobiz <232918735+DevTobis@users.noreply.github.com> Co-authored-by: blockchain-maxis <267648998+blockchain-maxis@users.noreply.github.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.
closes #252
Stacked on #335, #336, #342, #345 (the CLI scaffold, config,
link/--json, and unit tests) — cherry-picked (authorship preserved) since a CI lane needs acli/module to lint/test/build. Top commit (1c00925) is the one to review.Summary
The Go module in
cli/needed its own CI lane. That lane already exists (added in #335 and extended with-racein #345) and coversgo build,go vet,go test -race ./..., andgolangci-lint runon the pinned Go version (go-version-file: cli/go.mod). What was still missing, and what this issue specifically calls out: a cross-compile smoke build across the four actual release targets.Changes
.github/workflows/ci.yml: added a "Cross-compile smoke build" step to the existingclijob, loopingCGO_ENABLED=0 GOOS=... GOARCH=... go build -o /dev/null ./cmd/signetoverlinux/amd64,linux/arm64,darwin/arm64, andwindows/amd64. All four cross-compile cleanly from the oneubuntu-latestrunner already running the rest of the lane — Go needs only the env vars, no per-platform runner or cross toolchain, since the module has no cgo dependency (a requirement from Scaffold thecli/Go module — the @signet/cli binary #251, and now also enforced by CI itself: a build break on any of these targets fails the workflow same as any othergo build).Verification
ci.yml's YAML syntax (python3 -c 'import yaml; yaml.safe_load(...)').node scripts/check-docs.mjs— passes, unaffected.