codegen: add golden tests and production overrides (PRINFRA-121) - #15
Closed
somanshreddy wants to merge 1 commit into
Closed
somanshreddy wants to merge 1 commit into
somanshreddy wants to merge 1 commit into
Conversation
This was referenced Mar 31, 2026
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Mar 31, 2026
somanshreddy
force-pushed
the
03-31-codegen_add_renderer_templates_and_cli_entry_point
branch
from
March 31, 2026 18:29
5a6a098 to
a8b1753
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_golden_tests_and_production_overrides
branch
from
March 31, 2026 18:29
c25cc32 to
781d382
Compare
PRINFRA-121 CLI M1: OpenAPI codegen pipeline
Build the code generation pipeline that reads Scope
Mapping Rules
Acceptance Criteria
|
somanshreddy
force-pushed
the
03-31-codegen_add_golden_tests_and_production_overrides
branch
2 times, most recently
from
March 31, 2026 20:08
b165a9b to
c2675cb
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_renderer_templates_and_cli_entry_point
branch
from
March 31, 2026 20:08
0b9e0be to
2f5c57f
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_golden_tests_and_production_overrides
branch
from
March 31, 2026 20:59
c2675cb to
e68dee9
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_renderer_templates_and_cli_entry_point
branch
from
March 31, 2026 20:59
2f5c57f to
b3208f9
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_golden_tests_and_production_overrides
branch
from
March 31, 2026 21:06
e68dee9 to
869f6f8
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_renderer_templates_and_cli_entry_point
branch
2 times, most recently
from
March 31, 2026 21:25
16055f5 to
7f8ff00
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_golden_tests_and_production_overrides
branch
from
March 31, 2026 21:25
869f6f8 to
6745dc1
Compare
Golden file tests verify codegen output stability against a mini spec. Production overrides.yaml configures all 40 v3 endpoints: group names, skip patterns, positional promotions, and usage examples. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
somanshreddy
force-pushed
the
03-31-codegen_add_golden_tests_and_production_overrides
branch
from
March 31, 2026 21:31
6745dc1 to
e26cccf
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_renderer_templates_and_cli_entry_point
branch
from
March 31, 2026 21:31
7f8ff00 to
8b6e2ae
Compare
somanshreddy
changed the base branch from
03-31-codegen_add_renderer_templates_and_cli_entry_point
to
graphite-base/15
March 31, 2026 21:41
Collaborator
Author
|
Merged into PR #14 (renderer + templates) during stack restructuring. |
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.

Description
Proves the codegen pipeline works and configures it for all 40 v3 endpoints.
Golden file tests — a mini OpenAPI spec with 6 endpoints (list with pagination, get by ID, create with body including complex fields, delete, nested action, multipart upload) runs through the full pipeline. Output is compared against checked-in golden files. Run `go test ./codegen/ -update` to refresh golden files after intentional changes.
Test coverage — golden file comparison, v1 endpoint skipping, pagination detection, complex field omission, multipart detection, nested action naming, skip pattern matching, missing examples validation.
Production overrides — overrides.yaml configures all 40 v3 endpoints with:
After this PR, running `make generate SPEC=path/to/external-api.json` produces all 40 command definitions. Wiring them into the CLI is Stack 2.
Testing
8 golden file tests covering all codegen patterns. All tests are mocked — no external dependencies.
Files
codegen/generate_test.go— 8 tests: golden files, v1 filtering, pagination, complex fields, multipart, naming, x-cli-visible, missing examplescodegen/overrides.yaml— production overrides for all 40 v3 endpointscodegen/testdata/mini_spec.json— minimal 6-endpoint test speccodegen/testdata/golden/— expected codegen output (widget.go, upload.go, registry.go)