Skip to content

fix(api): v3 meter query path - #4205

Merged
tothandras merged 2 commits into
mainfrom
fix/v3-query-endpoint
Apr 22, 2026
Merged

tothandras merged 2 commits into
mainfrom
fix/v3-query-endpoint

Conversation

@tothandras

@tothandras tothandras commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • API Changes
    • Meter query operations moved to a dedicated endpoint: POST /openmeter/meters/{meterId}/query (same request/response behavior).
  • Tests
    • End-to-end and unit tests updated to exercise the new /query path.
  • Chores
    • Server routing and generated API specification updated to reflect the new endpoint.

@tothandras
tothandras requested a review from a team as a code owner April 22, 2026 10:33
@tothandras tothandras added the release-note/bug-fix Release note: Bug Fixes label Apr 22, 2026
@tothandras tothandras changed the title fix(api): v3 query path fix(api): v3 meter query path Apr 22, 2026
@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2954d9f8-4f22-4587-b1e5-ad082208ecd4

📥 Commits

Reviewing files that changed from the base of the PR and between 3c22105 and 251b9f2.

📒 Files selected for processing (3)
  • e2e/helpers.go
  • openmeter/server/server_test.go
  • quickstart/quickstart_test.go

📝 Walkthrough

Walkthrough

Extracted meter query operations into a new MetersQueryOperations interface and exposed them via a new MetersQueryEndpoints route at /openmeter/meters/{meterId}/query. Generated Go server code, tests, and helpers updated to use the new route.

Changes

Cohort / File(s) Summary
TypeSpec: meters operations & endpoints
api/spec/packages/aip/src/meters/operations.tsp, api/spec/packages/aip/src/openmeter.tsp, api/spec/packages/aip/src/konnect.tsp
Moved query and queryCsv out of MetersOperations into a new MetersQueryOperations interface. Added MetersQueryEndpoints (@route("/openmeter/meters/{meterId}/query"), @tag(Shared.MetersTag)) that extends Meters.MetersQueryOperations.
Generated Go API
api/v3/api.gen.go
Updated routing: QueryMeter now mapped to POST /openmeter/meters/{meterId}/query (was POST /openmeter/meters/{meterId}). Reordered a request-body type alias, adjusted wrapper/unimplemented stubs, and regenerated embedded swagger spec.
Tests & e2e helpers
openmeter/server/server_test.go, e2e/helpers.go, quickstart/quickstart_test.go
Updated test and helper code to use the new /openmeter/meters/{meterID}/query POST path; request/response handling unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

release-note/ignore

Suggested reviewers

  • turip
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: moving the v3 meter query endpoint from POST /openmeter/meters/{meterId} to POST /openmeter/meters/{meterId}/query.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/v3-query-endpoint

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.

@tothandras
tothandras merged commit da06064 into main Apr 22, 2026
27 checks passed
@tothandras
tothandras deleted the fix/v3-query-endpoint branch April 22, 2026 10:51

This branch was previously deployed

1 inactive deployment
dev — 251b9f2e Deployed Apr 22, 2026 by tothandras via Migration Checks #13733
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/bug-fix Release note: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants