Conversation
677e571 to
5f22dd5
Compare
TristanSpeakEasy
left a comment
There was a problem hiding this comment.
LGTM — clean port overall. The structure is solid and the vast majority of the code is a faithful 1:1 carry-over from sdk-generation-action. Just two minor nits on new code introduced during the port.
| func setEnvBool(key string, value bool) { | ||
| if value { | ||
| _ = os.Setenv(key, "true") | ||
| } |
There was a problem hiding this comment.
Nit: setEnvBool is a no-op when value is false, which means a pre-existing truthy env var (e.g. INPUT_DEBUG=true) can't be turned off via --debug=false — downstream code reading os.Getenv will still see "true".
func setEnvBool(key string, value bool) {
if value {
_ = os.Setenv(key, "true")
} else {
_ = os.Setenv(key, "false")
}
}
internal/ci/actions/runWorkflow.go
Outdated
| if pinnedVersion == "" { | ||
| return "latest" | ||
| } | ||
| if pinnedVersion != "latest" && (len(pinnedVersion) == 0 || pinnedVersion[0] != 'v') { |
There was a problem hiding this comment.
Nit: len(pinnedVersion) == 0 is unreachable here — the empty case already returns "latest" on line 432. Can simplify to:
if pinnedVersion != "latest" && pinnedVersion[0] != 'v' {| EnableSDKChangelog string `json:"enable-sdk-changelog"` | ||
| OpenAPIDocLocation string `json:"openapi-doc-location"` | ||
| SignedCommits bool `json:"signed-commits"` | ||
| BranchName string `json:"branch-name"` |
There was a problem hiding this comment.
If we add more flags this will fail and break old CLIs. We should move all these flags into a single struct to enable forward compat
There was a problem hiding this comment.
enabled unknown args for ci + subcommands
Migrate CI/CD workflow logic from the external sdk-generation-action repository into the main speakeasy CLI. This includes CI subcommands (generate, publish, release, tag, finalize, etc.), git auth helpers, environment setup, and supporting internal packages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename archives.format to archives.formats and brews to homebrew_casks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The cmd/ci/ stubs were only scaffolding - they set env vars then returned "not yet implemented". Now they delegate to the actual logic in internal/ci/actions/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
homebrew_casks has a different schema (no test/extra_install fields). Revert to brews which is only a deprecation warning, not breaking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The old Docker-based action cloned the repo internally to {workspace}/repo/.
Now that it's a composite action, actions/checkout handles the checkout and
the CLI opens the repo from CWD via go-git DetectDotGit.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The runbridge call used context.Background() which had no speakeasy version set, causing a nil interface panic in GetSpeakeasyVersionFromContext. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
RunWithVisualization uses Bubble Tea which tries to open /dev/tty, causing failure in CI environments where no TTY is available. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a flag has DefaultValue from os.Getenv(), pflag doesn't mark it as Changed, so the interactive validator treats it as missing. These flags are always populated via INPUT_* env vars in CI. ✻ Clauded...
git.GetRepo() and getRepoMetadata() now respect INPUT_GITHUB_REPOSITORY, falling back to GITHUB_REPOSITORY. This fixes cross-repo scenarios where the workflow runs in one repo but operates on a different SDK repo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GITHUB_* env vars are immutable in GitHub Actions and cannot be overridden via GITHUB_ENV. Add GetGithubRef() that checks INPUT_GITHUB_REF first, mirroring the existing GetRepo() pattern with INPUT_GITHUB_REPOSITORY.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b96da2e to
dad68fb
Compare
setEnvBool now explicitly sets "false" so pre-existing env vars can be overridden, and remove unreachable len check in formatPinnedVersion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Moves CI orchestration logic from
sdk-generation-actioninto the CLI asspeakeasy cisubcommands. This makes the GitHub Action a thin wrapper that installs the CLI and delegates to it, rather than owning the workflow logic itself.What's new
speakeasy cicommand group (hidden, not user-facing) with subcommands:generate,release,suggest,finalize,tag,test,log-result,publish-event,setup-env,pr-descriptioninternal/ci/package tree: environment detection, git operations, release management, telemetry, version bumps, document handlingINPUT_*env vars so the GHA can pass inputs directlyWhy
✻ Clauded...