Skip to content

feat(app): expose operator actions on installed apps - #5234

Merged
borosr merged 2 commits into
mainfrom
feat/app-stripe-actions
Oct 2, 2026
Merged

borosr merged 2 commits into
mainfrom
feat/app-stripe-actions

Conversation

@borosr

@borosr borosr commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Ticket: OM-516

Overview

Adds an optional actions array to installed app responses on the v3 BillingAppBase. Actions are derived at read time from the app's current state via a new Actions() method on the app.App interface; they are never persisted or emitted in events.

Stripe apps whose webhook endpoint was registered with an older event set than appstripe.LatestWebhookSchemaVersion report a reconcile_webhook_events action so operators can see which apps need their endpoint re-registered. Sandbox and external invoicing apps return no actions and omit the field.

Notes

  • LatestWebhookSchemaVersion moved from appstripe/service to appstripe so the domain type can reference it without an import cycle.
  • app.AppBase provides the nil default; appstripe.Meta overrides it.
  • The legacy v1 API is untouched.

Testing

  • openmeter/app/stripe: Meta.Actions() for outdated vs latest schema version
  • api/v3/handlers/apps: converter output for stripe (both versions) and sandbox
  • make lint-go-fast, go vet -C e2e green

Summary by CodeRabbit

  • New Features
    • App API responses can include recommended actions when an app needs attention.
    • Stripe apps with outdated webhook event registrations report an action to reconcile events; current apps and apps without required actions omit this information.
    • JavaScript and Go clients support reading app actions.

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no new actionable issue or outstanding previous finding remains.

Summary

The PR adds read-time operator actions to v3 installed-app responses. Stripe apps with outdated webhook event registrations expose a reconciliation action; apps without actions omit the field. Since the previous review, the PR excludes deleted Stripe apps from that action, tests the exclusion, and corrects the webhook constant reference.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Read installed app] --> B{Stripe app?}
  B -- No --> E[Omit actions]
  B -- Yes --> C{Deleted or webhook schema current?}
  C -- Yes --> E
  C -- No --> D[Return reconcile_webhook_events]
Loading

Reviews (3) · Last reviewed commit: "fix(app): skip actions on deleted stripe..."

@borosr
borosr requested a review from a team as a code owner October 2, 2026 11:50
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: openmeterio/openmeter/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 519353a7-1661-44e2-b6b3-1535f7e8bd11

📥 Commits

Reviewing files that changed from the base of the PR and between cdca225 and 759bb7d.

📒 Files selected for processing (3)
  • openmeter/app/stripe/README.md
  • openmeter/app/stripe/app.go
  • openmeter/app/stripe/app_test.go
 _________________________________________________________
< Fun fact: 'idempotent' doesn't mean 'it usually works'. >
 ---------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openmeterio/openmeter/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: fb75cc4c-306d-4981-b40f-570e01d59afa

📥 Commits

Reviewing files that changed from the base of the PR and between 4e29b08 and cdca225.

⛔ Files ignored due to path filters (1)
  • api/v3/openapi.yaml is excluded by !**/openapi.yaml
📒 Files selected for processing (4)
  • api/spec/packages/aip-client-javascript/src/models/types.ts
  • api/v3/api.gen.go
  • api/v3/client/models_apps.go
  • openmeter/app/app.go

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The app model now supports optional operator actions. Stripe apps report a webhook reconciliation action when their stored webhook schema version is behind the latest version. The v3 API and generated Go and JavaScript clients expose the action fields.

Changes

App action reporting

Layer / File(s) Summary
Define app action contracts
api/spec/packages/aip/src/apps/app.tsp, openmeter/app/app.go, openmeter/app/appbase.go
The app specification and runtime types define actions with a type and description. The base implementation returns no actions.
Derive Stripe webhook actions
openmeter/app/stripe/*, test/app/stripe/appstripe.go
Stripe reports a reconciliation action when the stored webhook schema version is older than the latest version. The version constant moves to the Stripe package, and tests cover action reporting.
Expose actions in API models
api/v3/api.gen.go, api/v3/client/models_apps.go, api/spec/packages/aip-client-javascript/src/*
Generated Go and JavaScript models and schemas add the action type and optional actions fields for app and installed-app models.
Map actions into API responses
api/v3/handlers/apps/convert.go, api/v3/handlers/apps/convert_test.go
The handler maps app actions to API action values and populates app responses. Tests cover outdated Stripe schemas and apps without actions.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant StripeMeta
  participant toAPIBillingAppActions
  participant BillingAppResponse
  participant APIClient
  StripeMeta->>toAPIBillingAppActions: Return derived actions
  toAPIBillingAppActions->>BillingAppResponse: Map action type and description
  BillingAppResponse-->>APIClient: Return app response with optional actions
Loading

Suggested reviewers: turip, tothandras

Merge Risk: ⚪ Minimal · up to cdca2

Installed-app responses in the v3 API now include an optional list of operator actions. Stripe apps with outdated webhook registrations report that their webhook events need reconciliation. Other apps omit the field, so existing clients are unaffected. No concrete merge-blocking risk was found.

Security Architecture Review

Security architecture risk: 🔵 Low · up to cdca2

The inspected response path reports maintenance needs rather than executing them. No introduced security issue was identified, but authorization and compatibility outside that path were not fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated new exposure is maintenance status attached to the app already being converted into a response. The inspected path does not expand execution authority or select additional tenants, accounts, or assets.

Trust Boundaries and Controls

  • observed — The API schema restricts actions to read visibility, and the traced converter maps domain-produced values outward. The reconciliation label is response data, not an instruction dispatched to a privileged operation in this path.
🚥 Pre-merge checks | ✅ 4
✅ 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 and concisely describes the main change: exposing operator actions on installed apps.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@borosr borosr self-assigned this Oct 2, 2026
@borosr borosr added kind/feature New feature or request release-note/feature Release note: Exciting New Features labels Oct 2, 2026
Comment thread openmeter/app/stripe/app.go Resolved
Comment thread api/v3/handlers/apps/convert.go Resolved
Comment thread openmeter/app/stripe/README.md Resolved
@borosr
borosr force-pushed the feat/app-stripe-actions branch from 4e29b08 to d6f5bf4 Compare October 2, 2026 11:58
Add an optional `actions` array to the app API response, derived at read time
from the app's current state and never persisted. Stripe apps whose webhook
endpoint was registered with an older event set than the latest schema
version report a `reconcile_webhook_events` action.
@borosr
borosr force-pushed the feat/app-stripe-actions branch from d6f5bf4 to cdca225 Compare October 2, 2026 12:00
@borosr
borosr enabled auto-merge (squash) October 2, 2026 12:37
@borosr
borosr merged commit 4ff5980 into main Oct 2, 2026
@borosr
borosr deleted the feat/app-stripe-actions branch October 2, 2026 12:38
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.

2 participants