Repository navigation
builds: build history, status, logs, download and cancel across providers - #33
Open
Interlap01 wants to merge 6 commits into
Open
Interlap01 wants to merge 6 commits into
Interlap01 wants to merge 6 commits into
Conversation
…cel becomes an alias
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.
What
builder buildsreads the builds Builder started on GitHub Actions, Codemagic or Bitrise and normalizes them:builder builds [--provider] [--limit N] [--status running|failed|succeeded] [--json]: build ID, kind (ipa/simulator), profile when recoverable, status (with the provider's own word), started, duration, run URL.builder builds show <id>: jobs and steps, failed step with its error annotations (same data asRunFailedError), artifacts with size and expiry.builder builds logs <id> [--failed] [--follow]: GitHub job logs (/actions/jobs/{id}/logs), Codemagic step logs, Bitrise log chunks or the archived raw log;--followpolls until the build ends.builder builds download <id> [-o dist]: the IPA, using the existing download code, so it works afterios buildwas interrupted.builder builds cancel <id>: GitHub run cancel, plus Codemagic/Bitrise throughbuild.CancelRemote.ios cancel --provider --run-idstill works as a deprecated alias that calls the same path; with a bare Codemagic/Bitrise run ID it skips the lookup, so it behaves as it did before.<id>is the 8-hex build ID, a provider run ID, or a run URL (the URL's host also picks the provider).Why
The provider dashboards were the only way to see past builds, read a failure, or get an IPA back after the CLI was interrupted. Builder already knows how to identify its own runs, so this puts that behind one command for all three providers.
How
internal/builds: aSourceper provider (GitHub,Remote) with list/find/show/logs/download/cancel and a smallLogStreaminterface for follow mode.ios-build.ymlandios-share.yml, build ID taken fromdisplay_title(iOS Build <id>, or the tag name for tag-triggered runs).internal/ci:ci.Historyfor Codemagic (GET /builds?appId&workflowId,GET /builds/{id}) and Bitrise (GET /apps/{app}/builds?workflow,/builds/{slug},/log). Build ID and profile come from the variables the provider reports back, else from the<id>.ipaartifact name.BUILDER_PROFILEwhen a profile is selected, so the profile can be shown later. The runner ignores it, and theBUILDER_prefix is already reserved.Testing
go test -race ./...passes.go run.go vetandgofmtare also clean.--failed, follow), download (ok, expired, still running, simulator), cancel. Codemagic and Bitrise (TLS fakes, because artifact URLs must be HTTPS): list, filter, find, show, step logs or chunk logs, archived log, download, cancel. Command-layer tests cover output, JSON, provider routing by URL, and theios cancelalias.Left out
--provider,buildslists only the default provider. It does not merge all configured providers.run-namein the workflow templates.