Repository navigation
feat(api): update v3 spec - #4640
Conversation
📝 WalkthroughWalkthroughThis PR replaces ChangesReference type migration
Estimated code review effort: 2 (Simple) | ~15 minutes TypeSpec extension decorators
Estimated code review effort: 1 (Trivial) | ~10 minutes Spec build pipeline and schema cleanup
Estimated code review effort: 1 (Trivial) | ~8 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Hey, this one's basically a tidy-up sweep — swapping wrapper types for cleaner references, flipping some extension flags, and trimming a bit of schema fat. Nothing scary here, just consistent housekeeping across the board! 🧹✨ 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Greptile SummaryThis PR promotes a set of previously internal-only v3 API endpoints (customer charges, credits, tax codes, and organization defaults) to externally visible by removing
Confidence Score: 4/5Safe to merge — changes are consistently applied across spec, generated Go bindings, handlers, and e2e tests; the renamed schemas and de-internalized endpoints all remain gated behind x-unstable. The rename of *ReferenceItem → *Reference schemas is reflected in every usage site (handlers, tests, e2e, generated code), and the filter-schema cleanup is correct. The single stale comment referencing the old type name is the only rough edge. The api/spec/patches/@[email protected] file is large (850 lines of compiled JS dist) and cannot be easily audited line-by-line; the functional delta (adding the x-inline skip) is small and readable, but reviewers may want to re-verify the patch hash in pnpm-lock.yaml matches what was actually generated locally. Important Files Changed
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
api/spec/pnpm-workspace.yaml (1)
21-28: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winComment is now out of sync with the config.
The comment right above still says "core-js/esbuild/protobufjs were never allowed and stay denied so an install does not silently start running their postinstall scripts." but
esbuildwas just flipped totrueon the line below. Anyone reading the comment would assume esbuild is still blocked — worth updating the wording so it doesn't mislead the next reader (and reviewer) about the actual security posture here.✏️ Suggested comment fix
# pnpm 11 replaces onlyBuiltDependencies with an explicit allow/deny map. -# Preserve the prior allowlist: only `@typespec/http-client-python` may run its -# build script; core-js/esbuild/protobufjs were never allowed and stay denied -# so an install does not silently start running their postinstall scripts. +# Preserve the prior allowlist plus esbuild (needed for its postinstall +# binary download); core-js/protobufjs remain denied so an install does not +# silently start running their postinstall scripts. allowBuilds: '`@typespec/http-client-python`': true esbuild: true core-js: false protobufjs: false🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@api/spec/pnpm-workspace.yaml` around lines 21 - 28, Update the explanatory comment above allowBuilds so it matches the actual pnpm-workspace.yaml policy: esbuild is explicitly allowed, while core-js remains denied. Keep the note aligned with the allowBuilds entries in pnpm-workspace.yaml and refer to the existing package names (`@typespec/http-client-python`, esbuild, core-js) so the next reader is not misled about which build scripts may run.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@api/spec/Makefile`:
- Around line 22-27: The legacy OpenAPI outputs are being copied without
removing Go vendor extensions, so the published specs can still contain
x-go-type and x-go-type-import. Update the Makefile workflow around the legacy
OpenAPI generation/copy steps to strip those extensions from both
openapi.OpenMeter.yaml and openapi.OpenMeterCloud.yaml before copying, using the
same yq-based cleanup already applied for the MeteringAndBilling output.
---
Outside diff comments:
In `@api/spec/pnpm-workspace.yaml`:
- Around line 21-28: Update the explanatory comment above allowBuilds so it
matches the actual pnpm-workspace.yaml policy: esbuild is explicitly allowed,
while core-js remains denied. Keep the note aligned with the allowBuilds entries
in pnpm-workspace.yaml and refer to the existing package names
(`@typespec/http-client-python`, esbuild, core-js) so the next reader is not
misled about which build scripts may run.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5a95ca11-8f36-4e13-ad50-85fe9507d207
⛔ Files ignored due to path filters (3)
api/spec/patches/@[email protected]is excluded by!api/spec/patches/**api/spec/pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlapi/v3/openapi.yamlis excluded by!**/openapi.yaml
📒 Files selected for processing (17)
api/spec/Makefileapi/spec/packages/aip/src/customers/charges/operations.tspapi/spec/packages/aip/src/customers/credits/operations.tspapi/spec/packages/aip/src/defaults/operations.tspapi/spec/packages/aip/src/tax/operations.tspapi/spec/packages/legacy/package.jsonapi/spec/pnpm-workspace.yamlapi/v3/api.gen.goapi/v3/handlers/addons/convert.goapi/v3/handlers/plans/convert.goapi/v3/handlers/plans/convert_test.goapi/v3/handlers/plans/planaddons/convert.goapi/v3/test/openapi.test.yamle2e/addons_v3_test.goe2e/billinginvoice_override_test.goe2e/plan_entitlement_template_v3_test.goe2e/v3helpers_test.go
💤 Files with no reviewable changes (5)
- api/spec/packages/aip/src/customers/charges/operations.tsp
- api/spec/packages/aip/src/tax/operations.tsp
- api/spec/packages/aip/src/defaults/operations.tsp
- api/spec/packages/aip/src/customers/credits/operations.tsp
- api/v3/test/openapi.test.yaml
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Tests