fix(client): remove stray duplicate generation so the SDK module compiles (EN-1229) - #192
fix(client): remove stray duplicate generation so the SDK module compiles (EN-1229)#192flemzord wants to merge 1 commit into
Conversation
…iles pkg/client is a separate (nested) Go module, so neither the root build nor CI ever compiled it. It was left inconsistent between two Speakeasy generations: formance.go declared 'package client' with github.com/formancehq/flows/pkg/client/... import paths, while sdk.go and the rest declare 'package openapi' (matching .speakeasy/gen.yaml's packageName: openapi and the README's openapi.New entrypoint). formance.go was a leftover duplicate of sdk.go (same ServerList, sdkConfiguration, helpers; SDK renamed to Formance) and nothing referenced it. Remove it and run 'go mod tidy' to restore the missing go.sum entries (cenkalti/backoff/v4, ericlagergren/decimal). The module now builds and vets cleanly. Note: this module is not covered by CI (nested module); verified locally with 'go build ./...' and 'go vet ./...' inside pkg/client.
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (3)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| @@ -1,10 +1,8 @@ | |||
|
|
|||
| module openapi | |||
There was a problem hiding this comment.
This makes go build work inside pkg/client, but the SDK is still not consumable as github.com/formancehq/flows/pkg/client because the nested module declares itself as openapi. I verified go get github.com/formancehq/flows/pkg/client@3484f58de0b77519f366ce45f58e571319723bf2 fails with module declares its path as: openapi but was required as: github.com/formancehq/flows/pkg/client. Please set the module path (and generated imports/docs) to the published package path, or do not treat this directory as a published Go module.
|
Superseded by #199, which consolidates this change with the related reliability and safety fixes on top of the current main branch. |
Problem (H10 — HIGH)
pkg/clientis a separate nested Go module (module openapi), so neither the rootgo build ./...nor CI ever compiles it — which is why this went unnoticed.It was left inconsistent between two Speakeasy generations:
formance.go—package client, importsgithub.com/formancehq/flows/pkg/client/..., typeFormance.sdk.go,v1.go,v2.go,orchestration.go—package openapi, importsopenapi/..., typeSDK.go buildinsidepkg/clientfailed with "found packages client (formance.go) and openapi (orchestration.go)" plus missing go.sum entries.formance.gois a duplicate ofsdk.go(identicalServerList,sdkConfiguration, helpers;SDKrenamed toFormance), nothing references it, and.speakeasy/gen.yaml(packageName: openapi) + the README (openapi.New(...)) confirmopenapiis the intended generation.Fix
formance.go.go mod tidyinpkg/clientto restore the missing go.sum entries (cenkalti/backoff/v4,ericlagergren/decimal).Verified locally:
go build ./...andgo vet ./...insidepkg/clientboth pass.Severity: HIGH.