Repository navigation
Conversation
Adds src/cli-binary/: platform detection, manifest fetch, download + sha256-verify + extract + cache, and a spawn wrapper for the tb binary published by gitlab.com/tinybird/analytics!23765 (PROTM-471). deployToMain() now submits deployments via `tb deployment create --no-wait --output json` instead of POSTing to /v1/deploy directly, then keeps the SDK's own status polling and progress callbacks (the binary's own --wait mode would block without giving us anything to drive callbacks from). Stale-deployment cleanup stays as a direct HTTP step since the CLI has no equivalent. No HTTP fallback: if the binary can't be resolved, deployToMain returns a clear, specific failure. build.ts and branches.ts are untouched — tb build/branch don't have confirmed --output json support yet, so there's nothing safe to move there. Draft: no tb binary is published yet (the MR above hasn't merged), so this is grounded in reading tinybird/analytics@master source and tested against a fake binary fixture, not a real one. Needs e2e-live verification once binaries exist. Co-Authored-By: Claude Sonnet 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
src/cli-binary/: platform detection, manifest fetch, download + sha256-verify + extract + cache, and a spawn wrapper for thetbCLI binary published by analytics!23765 (PROTM-471).deployToMain()now submits deployments viatb deployment create --no-wait --output jsoninstead of POSTing to/v1/deploydirectly. The SDK keeps its own status polling and progress callbacks (the binary's own--waitwould block without giving us anything to drive callbacks from), and keeps stale-deployment cleanup as a direct HTTP step (confirmed the CLI'screate_deployment()has no equivalent).deployToMainreturns a clear, specific failure.build.tsandbranches.tsare untouched on purpose —tb build/tb branchdon't have confirmed--output jsonstructured output in the CLI source today, so there's nothing safe to migrate there yet.Draft status
No
tbbinary is published yet — the MR that builds it hasn't merged. Everything here is grounded in readingtinybird/analytics@mastersource (manifest shape, CLI flags/output,deployment_common.pybehavior) and tested against a fake binary fixture (src/test/fixtures/fake-tb-cli.mjs, mirroring the Python side's ownfake_pyinstallertest pattern), not a real binary. Needs e2e-live verification once binaries are actually published.Two specific things called out inline in
deploy.tsas inferred-not-confirmed and worth re-checking then: what empty-stdout-with-exit-0 means (treated asno_changes) and what empty-stdout-with-nonzero-exit means (treated as a failed--check).Test plan
pnpm typecheckcleanpnpm test:run— 1082 passing; only the 9e2e/init-build.test.tsfailures remain, and those are pre-existing onmain(verified viagit stash), unrelated to this changetbbinary once published