Skip to content

fix(client): remove stray duplicate generation so the SDK module compiles (EN-1229) - #192

Closed
flemzord wants to merge 1 commit into
mainfrom
fix/pkg-client-compile
Closed

fix(client): remove stray duplicate generation so the SDK module compiles (EN-1229)#192
flemzord wants to merge 1 commit into
mainfrom
fix/pkg-client-compile

Conversation

@flemzord

Copy link
Copy Markdown
Member

Problem (H10 — HIGH)

pkg/client is a separate nested Go module (module openapi), so neither the root go build ./... nor CI ever compiles it — which is why this went unnoticed.

It was left inconsistent between two Speakeasy generations:

  • formance.gopackage client, imports github.com/formancehq/flows/pkg/client/..., type Formance.
  • sdk.go, v1.go, v2.go, orchestration.gopackage openapi, imports openapi/..., type SDK.

go build inside pkg/client failed with "found packages client (formance.go) and openapi (orchestration.go)" plus missing go.sum entries.

formance.go is a duplicate of sdk.go (identical ServerList, sdkConfiguration, helpers; SDK renamed to Formance), nothing references it, and .speakeasy/gen.yaml (packageName: openapi) + the README (openapi.New(...)) confirm openapi is the intended generation.

Fix

  • Delete the orphaned formance.go.
  • go mod tidy in pkg/client to restore the missing go.sum entries (cenkalti/backoff/v4, ericlagergren/decimal).

Verified locally: go build ./... and go vet ./... inside pkg/client both pass.

Note: this module is not built by CI (nested module — root go test ./... skips it), so the pipeline here won't exercise it. A future improvement is to add pkg/client to CI, or regenerate it via just generate-client (needs SPEAKEASY_API_KEY).

Severity: HIGH.

…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.
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (3)
  • pkg/client/formance.go is excluded by !pkg/client/**
  • pkg/client/go.mod is excluded by !**/*.mod, !pkg/client/**
  • pkg/client/go.sum is excluded by !**/*.sum, !**/*.sum, !pkg/client/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fb863303-c55a-467e-a60c-1aefe1cce490

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pkg-client-compile

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@flemzord

flemzord commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

Tracked in Jira: EN-1229 (Epic EN-1217).

@flemzord flemzord changed the title fix(client): remove stray duplicate generation so the SDK module compiles fix(client): remove stray duplicate generation so the SDK module compiles (EN-1229) Jun 11, 2026
Comment thread pkg/client/go.mod
@@ -1,10 +1,8 @@

module openapi

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@flemzord

flemzord commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

Superseded by #199, which consolidates this change with the related reliability and safety fixes on top of the current main branch.

@flemzord flemzord closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant