Skip to content

build: re-bump speakeasy-core/client-sdk-go with registry auth fixed + regression coverage - #2121

Merged
ThomasRooney merged 2 commits into
mainfrom
build/rebump-client-sdk-go-with-auth-fix
Aug 26, 2026
Merged

build: re-bump speakeasy-core/client-sdk-go with registry auth fixed + regression coverage#2121
ThomasRooney merged 2 commits into
mainfrom
build/rebump-client-sdk-go-with-auth-fix

Conversation

@ThomasRooney

@ThomasRooney ThomasRooney commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

Re-does #2117 (reverted in #2120 after it broke registry auth for customers as v1.795.2):

  • speakeasy-core v0.22.2 → v0.23.0 — captures the registry license token (the original point of build: bump speakeasy-core to capture the registry license token #2117).
  • speakeasy-client-sdk-go/v3 v3.26.7 → v3.28.0 — v3.27.0 was generated from a composed spec that marked all 13 artifacts/subscriptions operations security: [], so utils.PopulateSecurity vanished from them and every tag promote/tag apply/ci tag went out without x-api-key → 403s. Fixed at the source (speakeasy-registry#4707: fragments now all declare the same top-level security, so merge keeps the global block; #4705 typed the target_resource enum) and regenerated from the registry-published spec (speakeasy-client-sdk-go#52, tagged v3.28.0). PopulateSecurity is back on all 11 Artifacts + 2 Subscriptions operations; the only operations without auth are the three that are public by design (getAccessToken, handleCheckoutCallback, handleStripeWebhook). No SDK signature changes vs v3.26.7.

Why no test caught it last time

The regression changed no method signatures — auth just silently disappeared from the requests, so builds and CI stayed green. Registry e2e tests (TestRegistryFlow etc.) push/pull via oras/ocicommon credentials and never touch the generated SDK; the only SDK-auth callsites are registry/tagging.go (Artifacts.PostTags) and internal/remote/sources.go (Artifacts.GetRevisions, which swallows errors entirely) — neither had coverage, and there wasn't a single httptest server in the repo to assert outbound headers. release.yml runs no tests at all.

New regression guards

  1. internal/sdk/sdk_test.go — hermetic contract test: httptest server + InitSDKWithKey, asserts the x-api-key header is present on Artifacts.PostTags and Artifacts.GetRevisions requests. Verified to fail against v3.27.0 (header absent) and pass against v3.26.7 / v3.28.0. Catches any future SDK bump that drops auth, at unit-test speed with no credentials needed.
  2. integration/workflow_registry_test.goTestRegistryFlow now ends with speakeasy tag promote -s test-source -t e2e-test, exercising the platform-API (SDK) auth path end-to-end alongside the existing oras push/pull. Runs on every PR via validate.yml (SPEAKEASY_API_KEY). With v3.27.0 this step 403s.

Possible follow-up (out of scope here): a pkg/merge warning when setExplicitNoSecurity stamps security: [] onto operations, so composed-spec consumers notice before an SDK regen does.

Verification (at v3.28.0)

  • go build ./..., go test ./internal/sdk/ pass.
  • go test ./integration/ -run 'TestRegistryFlow$' passes (49s, real platform).

…and regression coverage

Re-does #2117 (reverted in #2120): speakeasy-core v0.23.0 to capture the
registry license token, and speakeasy-client-sdk-go v3.27.1 which
restores auth on the artifacts/subscriptions operations that v3.27.0
silently dropped (generated from a composed spec that marked them
'security: []'; fixed at the source in speakeasy-registry#4707 and
regenerated in speakeasy-client-sdk-go#51). Pinned to a v3.27.1
pseudo-version until the tag exists.

Why nothing caught it last time: the SDK regression left every method
signature unchanged — utils.PopulateSecurity simply vanished from those
operations, so builds stayed green and the requests went out with no
x-api-key. Registry e2e tests push/pull via oras/ocicommon credentials
and never touch the generated SDK, and the only SDK callsites
(registry/tagging.go PostTags, internal/remote/sources.go GetRevisions —
which swallows errors) had no coverage.

Two new guards:
- internal/sdk/sdk_test.go: hermetic contract test asserting the
  x-api-key header is sent on Artifacts.PostTags and
  Artifacts.GetRevisions (verified to fail against v3.27.0).
- integration/workflow_registry_test.go: TestRegistryFlow now finishes
  with 'speakeasy tag promote', exercising the platform-API auth path
  end-to-end (passes in 30s against prod).

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/sdk/sdk_test.go">

<violation number="1" location="internal/sdk/sdk_test.go:24">
P2: If `SPEAKEASY_SERVER_URL` is set in the test process, `InitSDKWithKey` will ignore `server.URL` and send these requests to the env URL instead. Clear that env before constructing the client, or this regression guard will become non-hermetic and can miss the auth path it is meant to pin down.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread internal/sdk/sdk_test.go
@ThomasRooney
ThomasRooney force-pushed the build/rebump-client-sdk-go-with-auth-fix branch from 865c9a7 to 6dea276 Compare August 25, 2026 10:40
The v3.27.1 pseudo-version pointed at speakeasy-client-sdk-go#51, which
was superseded by #52 (same auth fix, regenerated from the
registry-published spec after speakeasy-registry#4705/#4707 merged) and
tagged as v3.28.0.
@ThomasRooney
ThomasRooney merged commit 8b9ea52 into main Aug 26, 2026
6 checks passed
@ThomasRooney
ThomasRooney deleted the build/rebump-client-sdk-go-with-auth-fix branch August 26, 2026 15:26
ThomasRooney added a commit that referenced this pull request Aug 28, 2026
…2126)

Dependency bump only, split out of #2124 so the SDK/core change ships
and is verified on its own before the generator change.

- `speakeasy-client-sdk-go/v3` v3.28.0 → **v3.28.1** (regenerated from
the registry spec after speakeasy-registry#4708: `AccessDetails` gains
`license_jwt` and `status_code`; no signature changes).
- `speakeasy-core` v0.23.0 → **v0.24.0** (`access.CheckGenerationAccess`
returns the full access decision including the platform-issued license
token; `HasGenerationAccess` unchanged).

No CLI behaviour change: nothing reads the token yet. #2124 (generator
pin + commercial-on-token wiring) rebases on top once
openapi-generation#55 is released.

Guards from #2121 still apply: `internal/sdk/sdk_test.go` asserts
`x-api-key` on `Artifacts.PostTags`/`GetRevisions`; `TestRegistryFlow`
ends with `tag promote`.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Bumps `speakeasy-core` to v0.24.0 and `speakeasy-client-sdk-go/v3` to
v3.28.1. These upgrades expose a platform-issued license token and new
`AccessDetails` fields (`license_jwt`, `status_code`), but nothing reads
them yet, so CLI behavior is unchanged.

<sup>Written for commit 943cae8.
Summary will update on new commits.</sup>

<a
href="https://cubic.dev/pr/speakeasy-api/speakeasy/pull/2126?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants