Repository navigation
feat(app): expose operator actions on installed apps - #5234
Conversation
|
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 configurationConfiguration used: Repository: openmeterio/openmeter/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openmeterio/openmeter/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe 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. ChangesApp action reporting
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
Suggested reviewers: Merge Risk: ⚪ Minimal · up to 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 ReviewSecurity architecture risk: 🔵 Low · up to 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 Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 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 |
4e29b08 to
d6f5bf4
Compare
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.
d6f5bf4 to
cdca225
Compare
Ticket: OM-516
Overview
Adds an optional
actionsarray to installed app responses on the v3BillingAppBase. Actions are derived at read time from the app's current state via a newActions()method on theapp.Appinterface; they are never persisted or emitted in events.Stripe apps whose webhook endpoint was registered with an older event set than
appstripe.LatestWebhookSchemaVersionreport areconcile_webhook_eventsaction so operators can see which apps need their endpoint re-registered. Sandbox and external invoicing apps return no actions and omit the field.Notes
LatestWebhookSchemaVersionmoved fromappstripe/servicetoappstripeso the domain type can reference it without an import cycle.app.AppBaseprovides the nil default;appstripe.Metaoverrides it.Testing
openmeter/app/stripe:Meta.Actions()for outdated vs latest schema versionapi/v3/handlers/apps: converter output for stripe (both versions) and sandboxmake lint-go-fast,go vet -C e2egreenSummary by CodeRabbit
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]Reviews (3) · Last reviewed commit: "fix(app): skip actions on deleted stripe..."