Repository navigation
Add apx client verify generate-and-compile gate - #42
Merged
Merged
Conversation
A spec can be valid OpenAPI 3 and pass lint/breaking yet produce a client that does not compile (e.g. redundant _limit/limit query params collapsing to one Go field, or a path param named url shadowing net/url). Add 'apx client verify', which generates a client and compiles it, failing when any generated client does not build. --warn-only (or release.verify_clients.warn_only) downgrades a failure to a warning for staged rollout; a generator whose toolchain is absent is skipped, so the gate covers Go always and TypeScript where Node is present. Centralize the Builder-or-npm build dispatch in internal/client, shared by generate --build, publish, and verify. Add a regression fixture reproducing both patterns plus network-gated E2E tests. Fixes #40
daniel-garcia
added a commit
to infobloxopen/apx-action
that referenced
this pull request
Jul 18, 2026
For each converted OpenAPI v3 module, generate a client and compile it, so a spec that passes lint/breaking but produces a non-building SDK is caught before publish (e.g. a path param named url shadowing net/url, or redundant limit/offset params colliding with _limit/_offset on one Go field). Adds a 'verify-clients' input: fail (default) | warn | off. 'fail' stops the run — in check and publish — before any publish PR is opened; 'warn' reports; 'off' skips. Generators default to go; override per repo via verify_clients.generators in .apx-publish.yaml. Because the default is fail, the apx-toolchain image must provide 'apx client verify' (infobloxopen/apx#42); a stale image without it will fail publishes, by design.
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.
Closes #40.
Problem
A spec can be valid OpenAPI 3 and pass
apx lint+apx breaking, yet produce a client that does not compile. The release pipeline never generated or compiled a client, so a broken module could be tagged and published. Two constructs trigger it (both valid OAS3):_limit/limit(+_offset/offset) query params — oapi-codegen strips the leading underscore, so each pair collapses to the same Go field (Limit/Offsetredeclared);url— the emittedurlargument shadows thenet/urlimport (url.Parse undefined).Fix
Add
apx client verify: generate a client and compile it, failing when any generated client does not build. This is the missing release gate.--warn-only(andrelease.verify_clients.warn_only) downgrades a failure to a warning (exit 0) for staged rollout; the default is to fail the gate.release.verify_clients.generatorssets the matrix; default isgo+typescript-angular.internal/clientand shared bygenerate --build,publish, andverify.Tests
client.Verify(pass / build-fail / generate-fail / skip / unknown generator / default matrix), using stub generators — no network.testdata/goclient/collision.openapi.yaml) reproducing both patterns, plus network-gated E2E tests asserting the gate rejects it and accepts the good fixture.configuration.md,release-guardrails.md),CHANGELOG.md, andapx.example.yamlupdated; schema/doc parity test passes.Verified end-to-end on the fixture: