Skip to content

feat: app catalog v3 list, get by type and install app#4658

Merged
borosr merged 3 commits into
mainfrom
feat/v3-app-catalog-list
Jul 16, 2026
Merged

feat: app catalog v3 list, get by type and install app#4658
borosr merged 3 commits into
mainfrom
feat/v3-app-catalog-list

Conversation

@borosr

@borosr borosr commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

App Catalog List/GetByType/Install Endpoints — What / Why / How

What

Added v3 API endpoints for app catalog discovery and installation:

  • GET /api/v3/openmeter/apps/catalog — List available apps with pagination
  • GET /api/v3/openmeter/apps/catalog/{type} — Get app catalog details by type
  • POST /api/v3/openmeter/apps/install — Install an app with optional automatic billing profile creation

Unified app installation logic at the service layer, consolidating InstallMarketplaceListingWithAPIKey and InstallMarketplaceListing into a single transactional InstallApp() method.

Generated TypeScript and Go client SDKs with corresponding models and operation types.

Why

Discoverability: Users need a stable way to discover available app types (Sandbox, Stripe, External Invoicing) and their capabilities (tax calculation, invoicing, payments) without coupling to internal service details.

Installation UX: Combining app installation with optional billing profile auto-provisioning reduces multi-step workflows. Transactional execution prevents partial installations on errors (e.g., app created but billing profile fails).

Service clarity: Unifying two separate install methods eliminates duplicated validation logic and error handling, simplifying future maintenance.

How

  1. TypeSpec API definitions — Added catalog.tsp and capability.tsp defining app catalog models, install request/response discriminated unions, and install method enums
  2. Service layer refactoringInstallApp() wraps installation in transaction.Run(), calls either API-key or OAuth path based on input, then invokes billing profile callback if requested
  3. Validation aggregationInstallAppV3Input.Validate() collects all errors (errors.Join()) instead of returning on first failure
  4. Handler delegation — v3 handlers parse requests, resolve namespace, delegate to service, map responses to API types
  5. E2E test coverage — Tests catalog listing with pagination, getting specific app type, and installing external invoicing app

Generated artifacts: TypeSpec emits OpenAPI spec and SDKs; make gen-api updates api/v3/api.gen.go and TypeScript client.

Summary by CodeRabbit

  • New Features
    • Added App Catalog support: browse catalog items with pagination (including capabilities and supported install methods) and install apps from the catalog (sandbox, Stripe API key, external invoicing) in the v3 API and SDK clients.
    • Added invoice operations and governance access querying to the JavaScript client, plus corresponding internal client facades.
  • Documentation
    • Updated SDK/client documentation for the new catalog, install, invoice, and governance endpoints and refined SDK visibility guidance.
  • Tests
    • Added end-to-end coverage for App Catalog listing and installing an external invoicing app.

Greptile Summary

This PR adds v3 app catalog discovery and installation APIs. The main changes are:

  • New catalog list, get-by-type, and install endpoints.
  • Unified app installation through a shared service method.
  • Catalog capability and install-method models in the API spec and SDKs.
  • Generated Go, TypeScript, and OpenAPI artifacts for the new app APIs.
  • End-to-end coverage for catalog listing and external invoicing installation.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
api/v3/handlers/apps/convert.go Adds app type, capability, and install-method conversions for the v3 app API.
api/v3/handlers/apps/list_app_catalog.go Adds paginated catalog listing and catalog item mapping.
api/v3/handlers/apps/get_app_catalog.go Adds get-by-type catalog lookup with API-to-domain type conversion.
api/v3/handlers/apps/install_app.go Adds v3 app installation request parsing, service delegation, and response mapping.
openmeter/app/service/marketplace.go Adds a shared transactional app installation method.

Reviews (15): Last reviewed commit: "fix: generator issue" | Re-trigger Greptile

Context used (3)

  • Context used - CLAUDE.md (source)
  • Context used - AGENTS.md (source)
  • Context used - api/spec/AGENTS.md (source)

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds app catalog capability metadata, catalog listing and lookup endpoints, installation request variants, Go v3 handlers, JavaScript and Go client methods, generated API models, internal invoice/governance SDK operations, generator visibility changes, and end-to-end tests.

Changes

App Catalog and API Implementation

Layer / File(s) Summary
Catalog and installation contracts
api/spec/packages/aip/src/apps/*, api/spec/packages/aip/src/{konnect,openmeter}.tsp
Defines capabilities, installation methods, catalog metadata, installation payloads, responses, and catalog operations.
Generated models and handlers
api/v3/api.gen.go, api/spec/packages/aip-client-javascript/src/models/*, api/v3/handlers/apps/*
Adds generated models, schemas, unions, endpoint bindings, converters, handlers, billing profile provisioning, and route wiring.
Client surfaces
api/spec/packages/aip-client-javascript/src/{funcs,sdk}/*, api/v3/client/*
Adds catalog listing, pagination, lookup, installation, invoice, and governance client methods and models.
Internal operation generation
api/spec/packages/typespec-typescript/*, AGENTS.md, api/spec/AGENTS.md
Routes private operations to internal SDK surfaces and updates generator guidance and tests.
End-to-end validation
e2e/apps_v3_test.go, test/app/*, test/billing/suite.go, openmeter/server/server_test.go
Updates installation test fixtures and verifies catalog results, pagination metadata, built-in entries, and external invoicing installation.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Server
  participant AppsHandler
  participant AppService
  Client->>Server: Request catalog or installation operation
  Server->>AppsHandler: Forward request
  AppsHandler->>AppService: Query marketplace or install app
  AppService-->>AppsHandler: Return listing or installed app
  AppsHandler-->>Server: Encode API response
  Server-->>Client: Return result
Loading

Possibly related PRs

Suggested reviewers: tothandras, rolosp, turip, chrisgacsal

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: new v3 app catalog listing, lookup, and install endpoints.
✨ 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 feat/v3-app-catalog-list

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.

Comment thread api/v3/handlers/apps/list_app_catalog.go Outdated
@borosr
borosr force-pushed the feat/v3-app-catalog-list branch from df6bf17 to 4430441 Compare July 9, 2026 08:27
@borosr borosr self-assigned this Jul 9, 2026
@borosr borosr changed the title feat: app catalog v3 list endpoint feat: app catalog v3 list, get by type and get oauth install url endpoint Jul 9, 2026
@borosr borosr changed the title feat: app catalog v3 list, get by type and get oauth install url endpoint feat: app catalog v3 list, get by type and get oauth install url endpoints Jul 9, 2026
@borosr
borosr marked this pull request as ready for review July 9, 2026 13:41
@borosr
borosr requested a review from a team as a code owner July 9, 2026 13:41
@borosr
borosr requested review from rolosp and tothandras July 9, 2026 13:41
@borosr
borosr marked this pull request as draft July 9, 2026 13:45

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
api/v3/handlers/apps/get_app_catalog.go (1)

15-20: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider the request type naming.

GetAppCatalogRequest = app.GetOauth2InstallURLInput reuses an OAuth2-specific input type for a general catalog item lookup. While functionally correct (the type only carries a Type field), the name is misleading at the call site. If this is the only shared input shape, consider introducing a more generic domain type like app.GetMarketplaceListingInput or aliasing it clearly.

🤖 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/v3/handlers/apps/get_app_catalog.go` around lines 15 - 20, The request
type alias in GetAppCatalogHandler is misleading because GetAppCatalogRequest
currently reuses the OAuth2-specific app.GetOauth2InstallURLInput for a general
catalog lookup. Update the request type in this handler to use a more generic
domain input name, such as a marketplace/listing input, or add a clearly named
alias in the app package so the call site reflects the actual purpose of
GetAppCatalogHandler and GetAppCatalogRequest.
e2e/apps_v3_test.go (1)

22-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add e2e coverage for the single-item app catalog endpoints
The list endpoint is covered here, but GetAppCatalog and GetAppCatalogOauth2InstallUrl still need a couple of focused e2e cases to catch routing and response-shape regressions.

🤖 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 `@e2e/apps_v3_test.go` around lines 22 - 72, The app catalog e2e coverage
currently exercises only ListAppCatalog, so add focused tests for the
single-item endpoints as requested. Extend TestV3AppCatalogList or add a nearby
test to call GetAppCatalog and GetAppCatalogOauth2InstallUrl through the
existing newV3Client helper, using known catalog items such as
BillingAppCatalogItemTypeSandbox or BillingAppCatalogItemTypeStripe. Assert the
responses are OK and the returned payloads have the expected shape and key
fields so routing and serialization regressions are caught.
🤖 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/packages/aip/src/apps/catalog.tsp`:
- Line 38: The `@example` description in the catalog app has a typo in the
Stripe text; update the string in the example metadata so it says “integration”
instead of “interation” in the `catalog.tsp` example block. Locate the affected
`description` field near the Stripe example and correct the spelling without
changing the rest of the sentence.

In `@api/spec/packages/aip/src/apps/operations.tsp`:
- Around line 65-67: The doc comment above getOAuth2InstallURL is using a plain
block comment instead of a recognized TypeSpec doc comment, so update it to the
proper doc comment syntax used by the other operations in operations.tsp. Keep
the existing description but ensure it is attached to getOAuth2InstallURL with
the correct comment form so it shows up in the generated OpenAPI spec.

In `@api/v3/handlers/apps/get_app_catalog_oauth2.go`:
- Line 52: The OAuth2 install URL endpoint is reusing the same operation name as
GetAppCatalog, which makes the two handlers indistinguishable in telemetry.
Update the httptransport.WithOperationName value in get_app_catalog_oauth2.go to
a unique name for this endpoint, and keep GetAppCatalog’s operation name
unchanged so metrics, traces, and logs can tell them apart.

In `@api/v3/handlers/apps/get_app_catalog.go`:
- Around line 48-53: The operation name used in get_app_catalog_oauth2.go is
still shared with the catalog-item handler, which causes log, metric, and trace
collisions. Update the httptransport.WithOperationName value in the
getAppCatalogOAuth2InstallURL-related setup to use the distinct name
get-app-catalog-item-oauth2-install-url, keeping the rest of the
httptransport.AppendOptions configuration unchanged.

---

Nitpick comments:
In `@api/v3/handlers/apps/get_app_catalog.go`:
- Around line 15-20: The request type alias in GetAppCatalogHandler is
misleading because GetAppCatalogRequest currently reuses the OAuth2-specific
app.GetOauth2InstallURLInput for a general catalog lookup. Update the request
type in this handler to use a more generic domain input name, such as a
marketplace/listing input, or add a clearly named alias in the app package so
the call site reflects the actual purpose of GetAppCatalogHandler and
GetAppCatalogRequest.

In `@e2e/apps_v3_test.go`:
- Around line 22-72: The app catalog e2e coverage currently exercises only
ListAppCatalog, so add focused tests for the single-item endpoints as requested.
Extend TestV3AppCatalogList or add a nearby test to call GetAppCatalog and
GetAppCatalogOauth2InstallUrl through the existing newV3Client helper, using
known catalog items such as BillingAppCatalogItemTypeSandbox or
BillingAppCatalogItemTypeStripe. Assert the responses are OK and the returned
payloads have the expected shape and key fields so routing and serialization
regressions are caught.
🪄 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: 74e37b96-7639-46c4-9d0e-0b7f7bb1aab3

📥 Commits

Reviewing files that changed from the base of the PR and between 4ccc0e8 and 646cc12.

⛔ Files ignored due to path filters (1)
  • api/v3/openapi.yaml is excluded by !**/openapi.yaml
📒 Files selected for processing (23)
  • api/spec/packages/aip-client-javascript/README.md
  • api/spec/packages/aip-client-javascript/src/funcs/apps.ts
  • api/spec/packages/aip-client-javascript/src/index.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/apps.ts
  • api/spec/packages/aip-client-javascript/src/models/schemas.ts
  • api/spec/packages/aip-client-javascript/src/models/types.ts
  • api/spec/packages/aip-client-javascript/src/sdk/apps.ts
  • api/spec/packages/aip/src/apps/capability.tsp
  • api/spec/packages/aip/src/apps/catalog.tsp
  • api/spec/packages/aip/src/apps/oauth.tsp
  • api/spec/packages/aip/src/apps/operations.tsp
  • api/spec/packages/aip/src/konnect.tsp
  • api/spec/packages/aip/src/openmeter.tsp
  • api/v3/api.gen.go
  • api/v3/handlers/apps/convert.gen.go
  • api/v3/handlers/apps/convert.go
  • api/v3/handlers/apps/get_app_catalog.go
  • api/v3/handlers/apps/get_app_catalog_oauth2.go
  • api/v3/handlers/apps/handler.go
  • api/v3/handlers/apps/list_app_catalog.go
  • api/v3/server/routes.go
  • e2e/apps_v3_test.go
  • e2e/v3helpers_test.go

Comment thread api/spec/packages/aip/src/apps/catalog.tsp Outdated
Comment thread api/spec/packages/aip/src/apps/operations.tsp Outdated
Comment thread api/v3/handlers/apps/get_app_catalog_oauth2.go Outdated
Comment thread api/v3/handlers/apps/get_app_catalog.go
@borosr
borosr force-pushed the feat/v3-app-catalog-list branch 2 times, most recently from 0a24c1c to 4e4372d Compare July 14, 2026 08:49
@borosr
borosr marked this pull request as ready for review July 14, 2026 08:54
@borosr borosr added kind/feature New feature or request release-note/feature Release note: Exciting New Features labels Jul 14, 2026
@borosr borosr changed the title feat: app catalog v3 list, get by type and get oauth install url endpoints feat: app catalog v3 list, get by type and install app Jul 14, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (2)
e2e/apps_v3_test.go (2)

26-28: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add concise given/when/then intent comments to these subtests.

As per coding guidelines, non-trivial service and lifecycle subtests must begin with concise given, when, and then intent comments.

Also applies to: 60-67, 87-94

🤖 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 `@e2e/apps_v3_test.go` around lines 26 - 28, The affected catalog subtests
should begin with concise Given/When/Then intent comments. Add these comments to
the subtests around Apps.ListCatalog and the additional ranges at 60-67 and
87-94, describing the setup, service action, and expected outcome without
changing test behavior.

Source: Coding guidelines


87-98: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the billing-profile installation path.

The new orchestration’s meaningful failure and default-assignment behavior only runs with CreateBillingProfile: true; this test would still pass if that entire branch regressed. Add an install case that verifies the profile and returned default capability types.

As per path instructions, tests should meaningfully cover behavior introduced by the PR.

🤖 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 `@e2e/apps_v3_test.go` around lines 87 - 98, Add coverage to the “Should
install external invoicing app” test for the CreateBillingProfile: true path,
verifying the installed billing profile and the returned default capability
types. Keep the existing external-invoicing assertions, and ensure the test
fails if billing-profile orchestration or default capability assignment
regresses.

Source: Path instructions

🤖 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/v3/client/models_apps.go`:
- Around line 340-342: Update the TypeSpec source documentation for
CreateBillingProfile and the corresponding related fields at the other generated
locations so each comment accurately describes billing-profile creation behavior
and consequences. Regenerate api/v3/client/models_apps.go from the TypeSpec
source; do not edit the generated Go file directly.

In `@api/v3/client/README.md`:
- Line 206: Populate the missing description for om.Apps.Install in the API
operation documentation, preferably by adding the appropriate source `@doc` text
if this README is generated, then regenerate or update the table so the Install
row contains a clear description.

In `@api/v3/handlers/apps/handler.go`:
- Around line 36-47: The New constructor currently does not explicitly receive a
logger. Add a required *slog.Logger parameter, store it on the handler struct,
and update server initialization to pass the production logger through New;
ensure all constructor call sites are updated accordingly.

In `@api/v3/handlers/apps/install_app.go`:
- Around line 43-57: The InstallAppRequest conversion flow around
body.Discriminator and ToDomainAppTypeFromAPIBillingAppType must return the
repository’s structured bad-request error, including the relevant payload field
context, rather than plain fmt.Errorf values. Apply the same treatment to all
corresponding discriminator and variant-conversion failures in the covered
conversion paths, while preserving the existing error messages and successful
conversion behavior.
- Around line 114-133: The InstallApp flow must not leave an installed app
behind when createBillingProfile fails. Update the installation and
createBillingProfile operations to use a shared transaction where supported;
otherwise add compensating cleanup or idempotency keyed to the request so failed
provisioning is retriable without duplicate state. Preserve the existing error
responses while ensuring the installedApp state is rolled back or safely marked
when provisioning fails.
- Around line 194-227: Update the capability assignment after CreateProfile in
the install flow: only populate defaultForCapabilityTypes with the three Stripe
capabilities when setDefaultBillingProfile is true; otherwise return an empty
list. Also explicitly define the intended behavior for a nil
defaultBillingProfile and ensure setDefaultBillingProfile reflects that decision
consistently.

In `@e2e/apps_v3_test.go`:
- Around line 53-57: The app catalog handler must convert the domain billing
type custom_invoicing to the public API enum external_invoicing. Update
ToAPIBillingAppTypeFromDomain and its use in the catalog handler, then remove
the test waiver and assert the custom invoicing entry through the generated
external-invoicing enum.

---

Nitpick comments:
In `@e2e/apps_v3_test.go`:
- Around line 26-28: The affected catalog subtests should begin with concise
Given/When/Then intent comments. Add these comments to the subtests around
Apps.ListCatalog and the additional ranges at 60-67 and 87-94, describing the
setup, service action, and expected outcome without changing test behavior.
- Around line 87-98: Add coverage to the “Should install external invoicing app”
test for the CreateBillingProfile: true path, verifying the installed billing
profile and the returned default capability types. Keep the existing
external-invoicing assertions, and ensure the test fails if billing-profile
orchestration or default capability assignment regresses.
🪄 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: 09540580-1a5c-4b13-a549-c0ee42bf780f

📥 Commits

Reviewing files that changed from the base of the PR and between 646cc12 and 4e4372d.

⛔ Files ignored due to path filters (1)
  • api/v3/openapi.yaml is excluded by !**/openapi.yaml
📒 Files selected for processing (25)
  • api/spec/packages/aip-client-javascript/README.md
  • api/spec/packages/aip-client-javascript/src/funcs/apps.ts
  • api/spec/packages/aip-client-javascript/src/index.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/apps.ts
  • api/spec/packages/aip-client-javascript/src/models/schemas.ts
  • api/spec/packages/aip-client-javascript/src/models/types.ts
  • api/spec/packages/aip-client-javascript/src/sdk/apps.ts
  • api/spec/packages/aip/src/apps/capability.tsp
  • api/spec/packages/aip/src/apps/catalog.tsp
  • api/spec/packages/aip/src/apps/operations.tsp
  • api/spec/packages/aip/src/konnect.tsp
  • api/spec/packages/aip/src/openmeter.tsp
  • api/v3/api.gen.go
  • api/v3/client/README.md
  • api/v3/client/apps.go
  • api/v3/client/models_apps.go
  • api/v3/handlers/apps/convert.gen.go
  • api/v3/handlers/apps/convert.go
  • api/v3/handlers/apps/get_app_catalog.go
  • api/v3/handlers/apps/handler.go
  • api/v3/handlers/apps/install_app.go
  • api/v3/handlers/apps/list_app_catalog.go
  • api/v3/server/routes.go
  • api/v3/server/server.go
  • e2e/apps_v3_test.go
🚧 Files skipped from review as they are similar to previous changes (8)
  • api/spec/packages/aip/src/konnect.tsp
  • api/spec/packages/aip/src/openmeter.tsp
  • api/v3/handlers/apps/get_app_catalog.go
  • api/spec/packages/aip/src/apps/capability.tsp
  • api/v3/handlers/apps/convert.gen.go
  • api/v3/handlers/apps/convert.go
  • api/v3/handlers/apps/list_app_catalog.go
  • api/spec/packages/aip-client-javascript/src/models/schemas.ts

Comment thread api/v3/client/models_apps.go Outdated
Comment thread api/v3/client/README.md Outdated
Comment thread api/v3/handlers/apps/handler.go
Comment thread api/v3/handlers/apps/install_app.go
Comment thread api/v3/handlers/apps/install_app.go Outdated
Comment thread api/v3/handlers/apps/install_app.go
Comment thread e2e/apps_v3_test.go Outdated
Comment thread api/spec/packages/aip/src/apps/catalog.tsp Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
openmeter/app/service/service.go (1)

38-47: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Initialize new dependencies in the constructor.

Hey! It looks like we missed initializing the new billingService and stripeAppService dependencies in the New constructor. Since they're now part of the Service struct, leaving them out here means they'll be nil, which will trigger a panic when InstallApp tries to use them.

Could you also double-check that they are added to the Config struct and validated in Config.Validate() if they are strictly required?

Here's a quick fix for the constructor (assuming the Config fields follow the usual naming conventions):

🛠️ Proposed fix for the constructor
 func New(config Config) (*Service, error) {
 	if err := config.Validate(); err != nil {
 		return nil, err
 	}
 
 	return &Service{
 		adapter:          config.Adapter,
+		billingService:   config.BillingService,
+		stripeAppService: config.StripeAppService,
 		publisher:        config.Publisher,
 	}, nil
 }
🤖 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 `@openmeter/app/service/service.go` around lines 38 - 47, Update New to
initialize the Service struct’s billingService and stripeAppService fields from
the corresponding Config dependencies, alongside adapter and publisher. Ensure
those dependencies are present in Config and are checked by Config.Validate()
when required, so InstallApp never receives nil services.
openmeter/app/httpdriver/marketplace.go (1)

95-123: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Pass CreateDefaultBillingProfile directly to InstallAppV3Input.

Hey! Great job pulling the common fields into InstallAppV3Input! However, it looks like we're still assigning the fallback billing profile boolean to the wrapper's CreateBillingProfile field instead of passing it into InstallAppV3Input.CreateDefaultBillingProfile. Because of this, the underlying service will receive false (the default struct value) and will inadvertently skip creating the default billing profile during installation.

  • openmeter/app/httpdriver/marketplace.go#L95-L123: For the API key install, drop the CreateBillingProfile field from MarketplaceAppAPIKeyInstallRequest and assign CreateDefaultBillingProfile: lo.FromPtrOr(body.CreateBillingProfile, true) directly inside the inner InstallAppV3Input.
  • openmeter/app/httpdriver/marketplace.go#L164-L191: For the standard install, similarly drop the field from MarketplaceAppInstallRequest and move the assignment directly to InstallAppV3Input.
🤖 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 `@openmeter/app/httpdriver/marketplace.go` around lines 95 - 123, The install
request wrappers currently retain the billing-profile flag instead of passing it
to the underlying input. In openmeter/app/httpdriver/marketplace.go lines
95-123, remove CreateBillingProfile from MarketplaceAppAPIKeyInstallRequest and
set CreateDefaultBillingProfile directly in its InstallAppV3Input using the
existing default-true fallback; apply the same change to
MarketplaceAppInstallRequest at lines 164-191.
🤖 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 `@openmeter/app/marketplace.go`:
- Around line 150-165: Update InstallAppV3Input.Validate to accumulate
validation failures for MarketplaceListingID, Namespace, and APIKey instead of
returning on the first error. Preserve field-specific context for each failure,
then return models.NewNillableGenericValidationError(errors.Join(errs...));
return the nillable validation result even when no errors are collected.

In `@openmeter/app/service/marketplace.go`:
- Around line 77-78: Update the service constructor and configuration to require
and validate billingService and stripeAppService alongside adapter and
publisher. Initialize both corresponding Service fields, then update every
constructor call site to supply the new dependencies so createBillingProfile and
Stripe provisioning no longer access nil services.
- Around line 94-103: The Sandbox branch in the app capability provisioning flow
must only report capabilities when this app becomes the default billing profile.
Update the logic around ProvisionDefaultBillingProfile to detect its no-op
case—preferably by returning or retrieving the resulting profile and verifying
its app reference—and return no capabilities when another default already
exists; preserve the existing capability list only when the installed Sandbox
app is actually defaulted.

In `@test/app/custominvoicing/invocing_test.go`:
- Around line 49-56: Make the installation assertion fatal before the custom
invoicing configuration upsert and any dereference of customInvoicingApp.App.
Replace the non-fatal NoError handling for the install result with the test
suite’s fatal requirement mechanism, while preserving the existing error message
and subsequent provisioning flow.

---

Outside diff comments:
In `@openmeter/app/httpdriver/marketplace.go`:
- Around line 95-123: The install request wrappers currently retain the
billing-profile flag instead of passing it to the underlying input. In
openmeter/app/httpdriver/marketplace.go lines 95-123, remove
CreateBillingProfile from MarketplaceAppAPIKeyInstallRequest and set
CreateDefaultBillingProfile directly in its InstallAppV3Input using the existing
default-true fallback; apply the same change to MarketplaceAppInstallRequest at
lines 164-191.

In `@openmeter/app/service/service.go`:
- Around line 38-47: Update New to initialize the Service struct’s
billingService and stripeAppService fields from the corresponding Config
dependencies, alongside adapter and publisher. Ensure those dependencies are
present in Config and are checked by Config.Validate() when required, so
InstallApp never receives nil services.
🪄 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: 4313bf0b-efd0-4f74-b345-f18648846c44

📥 Commits

Reviewing files that changed from the base of the PR and between df78134 and 98a7a0b.

⛔ Files ignored due to path filters (1)
  • api/v3/openapi.yaml is excluded by !**/openapi.yaml
📒 Files selected for processing (22)
  • api/spec/packages/aip-client-javascript/README.md
  • api/spec/packages/aip-client-javascript/src/funcs/apps.ts
  • api/spec/packages/aip-client-javascript/src/models/schemas.ts
  • api/spec/packages/aip-client-javascript/src/models/types.ts
  • api/spec/packages/aip-client-javascript/src/sdk/apps.ts
  • api/spec/packages/aip/src/apps/catalog.tsp
  • api/spec/packages/aip/src/apps/operations.tsp
  • api/v3/api.gen.go
  • api/v3/client/README.md
  • api/v3/client/apps.go
  • api/v3/client/models_apps.go
  • api/v3/handlers/apps/install_app.go
  • openmeter/app/httpdriver/marketplace.go
  • openmeter/app/marketplace.go
  • openmeter/app/service.go
  • openmeter/app/service/marketplace.go
  • openmeter/app/service/service.go
  • openmeter/server/server_test.go
  • test/app/custominvoicing/invocing_test.go
  • test/app/stripe/appstripe.go
  • test/app/stripe/fixture.go
  • test/billing/suite.go
🚧 Files skipped from review as they are similar to previous changes (10)
  • api/v3/client/README.md
  • api/spec/packages/aip-client-javascript/README.md
  • api/spec/packages/aip/src/apps/operations.tsp
  • api/spec/packages/aip/src/apps/catalog.tsp
  • api/spec/packages/aip-client-javascript/src/funcs/apps.ts
  • api/spec/packages/aip-client-javascript/src/sdk/apps.ts
  • api/v3/client/models_apps.go
  • api/v3/client/apps.go
  • api/spec/packages/aip-client-javascript/src/models/types.ts
  • api/spec/packages/aip-client-javascript/src/models/schemas.ts

Comment thread openmeter/app/marketplace.go Outdated
Comment thread openmeter/app/service/marketplace.go Outdated
Comment thread openmeter/app/service/marketplace.go Outdated
Comment thread test/app/custominvoicing/invocing_test.go
@borosr
borosr force-pushed the feat/v3-app-catalog-list branch 2 times, most recently from 7a86c69 to 16a6c46 Compare July 15, 2026 11:35
Comment thread api/spec/packages/aip/src/apps/operations.tsp Outdated
Comment thread api/spec/packages/aip/src/apps/operations.tsp Outdated
@borosr
borosr force-pushed the feat/v3-app-catalog-list branch from 16a6c46 to ac1c672 Compare July 15, 2026 12:11
@borosr
borosr enabled auto-merge (squash) July 15, 2026 12:44
borosr added 2 commits July 16, 2026 09:26
… and get oauth install url, add install app endpoint, improve test, unify app install on service level, collect validation errors, import cycle error
@borosr
borosr force-pushed the feat/v3-app-catalog-list branch from dfe9ae7 to c5938b2 Compare July 16, 2026 07:26
Comment thread openmeter/app/marketplace.go
@borosr
borosr merged commit 106e6d4 into main Jul 16, 2026
30 checks passed
@borosr
borosr deleted the feat/v3-app-catalog-list branch July 16, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature New feature or request release-note/feature Release note: Exciting New Features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants