Skip to content

Fetch flow drafts directly from dashboard URLs - #227

Closed
facumenzella wants to merge 3 commits into
mainfrom
facu/flow-show-dashboard-url
Closed

facumenzella wants to merge 3 commits into
mainfrom
facu/flow-show-dashboard-url

Conversation

@facumenzella

@facumenzella facumenzella commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Checklist

  • Added a regression test.
  • Verified go build ./..., go test -race ./..., and gofmt.

Motivation

A dashboard link contains the project and flow IDs. Users can paste the link into rc flows show to fetch the editable draft in one command.

Description

Pass the dashboard URL as the positional argument. Quote the URL so the shell preserves its query string and fragment.

rc flows show 'https://app.revenuecat.com/projects/abc12345/flows/wf_abc/editor?returnTo=paywalls#ln=components' --json

The URL selects the project and flow for this request. Paywall builder links that contain a flow ID also work. A bare flow ID uses the selected project.


Note

Low Risk
Localized CLI argument parsing for one read-only command; no auth or data mutation paths.

Overview
rc flows show now accepts a RevenueCat dashboard link as the positional argument, not only a flow ID. Two URL shapes are recognized: /projects/…/paywalls/…/builder and /projects/…/flows/…/editor (query strings and fragments are ignored). Project and flow IDs are taken from the path and used for the API call, so a pasted builder/editor link works even when --project-id points at another project.

Command help and docs/command-surface.md document the [id-or-url] usage and add a URL example. A regression test asserts both URL forms hit the correct project/flow and return the draft.

Reviewed by Cursor Bugbot for commit 8619fee. Bugbot is set up for automated code reviews on this repo. Configure here.

AI session context

CLI 1.0.0 sent the entire URL as a flow ID and reported a missing resource. The first PR version printed a hint. After review, we changed the command to fetch the draft directly. The regression test checks both URL formats with a different project selected. A live check confirmed that the example editor link returned its draft.

@facumenzella
facumenzella marked this pull request as ready for review November 27, 2026 14:41
@facumenzella
facumenzella requested a review from a team as a code owner November 27, 2026 14:41
@facumenzella facumenzella changed the title Suggest the flow ID when a dashboard URL is passed to flows show Fetch flow drafts directly from dashboard URLs Nov 27, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8619fee. Configure here.

rt := RuntimeFrom(cmd.Context())
client, err := rt.API()
return rt, client, "proj" + match[1], match[2], err
}

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.

Wrong project ID reconstructed from URL

Medium Severity

resolveFlowShowTarget builds the API project ID as proj plus the dashboard path segment. dashboardProjectID strips proj and an optional _, so IDs like proj_abc become /projects/abc/... in dashboard links (including the View it URL from rc flows edit). Pasting that URL requests projsnap/projabc instead of proj_snap/proj_abc and the lookup 404s.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8619fee. Configure here.

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.

1 participant