Skip to content

feat(billing): move plan writes to AdminService and add ListAllPlans - #1828

Closed
rohilsurana wants to merge 0 commit into
feat/reconcile-billing-productfrom
feat/billing-plan-api
Closed

feat(billing): move plan writes to AdminService and add ListAllPlans#1828
rohilsurana wants to merge 0 commit into
feat/reconcile-billing-productfrom
feat/billing-plan-api

Conversation

@rohilsurana

@rohilsurana rohilsurana commented Jul 31, 2026

Copy link
Copy Markdown
Member

What

Wire the frontier side of the plan admin APIs from raystack/proton#496.

  • Move CreatePlan and UpdatePlan to AdminService (super user only). They were on FrontierService before.
  • Add ListAllPlans on AdminService. It lists every plan, including disabled ones. An empty state returns all plans; a set state filters to it.
  • CreatePlan now carries the plan state. UpdatePlan is implemented (it returned Unimplemented before) and does a full write of a plan's own fields (title, description, credits, trial days, state, metadata). A plan's products are still managed through CreatePlan's upsert.
  • ListPlans and GetPlan stay on FrontierService and are unchanged.

How

  • Pin proton to the branch commit that carries these proto changes and regenerate.
  • The same ConnectHandler serves both services, so the existing CreatePlan method now satisfies AdminService. UpdatePlan and ListAllPlans are added to it.
  • The authz interceptor gates the three AdminService plan RPCs behind IsSuperUser, and the old FrontierService plan entries are removed. Any endpoint not listed is denied by default, so these entries are required.
  • ListAllPlans passes a plan.StateAll sentinel to the repository so an empty state lists plans in every state. The repository still defaults an empty state to active for ListPlans, which lists active plans only.

Depends on

Testing

  • New handler tests for UpdatePlan and ListAllPlans. Existing plan handler and service tests pass.
  • The e2e billing tests now call CreatePlan on the admin client.
  • build, vet, gofmt, and golangci-lint are green.

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview Jul 31, 2026 9:10am

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b45b34d2-5406-4245-a3df-c093835d4839

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

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.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 30618820279

Coverage increased (+0.1%) to 47.805%

Details

  • Coverage increased (+0.1%) from the base build.
  • Patch coverage: 17 uncovered changes across 2 files (22 of 39 lines covered, 56.41%).
  • 276 coverage regressions across 3 files.

Uncovered Changes

File Changed Covered %
billing/plan/service.go 15 0 0.0%
internal/api/v1beta1connect/billing_plan.go 24 22 91.67%

Coverage Regressions

276 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
core/membership/service.go 236 83.06%
core/project/service.go 33 84.51%
cmd/serve.go 7 0.0%

Coverage Stats

Coverage Status
Relevant Lines: 39569
Covered Lines: 18916
Line Coverage: 47.81%
Coverage Strength: 15.31 hits per line

💛 - Coveralls

@rohilsurana
rohilsurana force-pushed the feat/billing-plan-api branch from 0c9d968 to 35df3f1 Compare July 31, 2026 09:44
@rohilsurana rohilsurana changed the title feat(billing): plan state and UpdatePlan in the plan API feat(billing): move plan writes to AdminService and add ListAllPlans Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants