Skip to content

feat: onboarding wizard #5#2750

Merged
comatory merged 15 commits intoondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-topicfrom
ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-05
Apr 29, 2026
Merged

feat: onboarding wizard #5#2750
comatory merged 15 commits intoondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-topicfrom
ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-05

Conversation

@comatory
Copy link
Copy Markdown
Contributor

@comatory comatory commented Apr 8, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added wgc demo command for automated local federated graph setup, including plugin publishing, router token generation, and router initialization.
    • Interactive onboarding experience with support for managing existing graphs.
  • Documentation

    • Added documentation for the demo command with prerequisites and usage guidelines.

Checklist

Open Source AI Manifesto

This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.

PR (5): for onboarding wizard - CLI integration

Parent: #2736

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 8, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 970064ec-be75-4f38-91de-3a7c6027e8e4

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

Walkthrough

Adds a new interactive demo command to the CLI that guides users through setting up a local federated graph with demonstration plugins, router token, and running Docker container. Introduces shared abstractions for plugin publishing and router token management, refactors existing token and plugin commands to use these helpers, and expands CLI utilities with terminal UI and interactive key press handling.

Changes

Cohort / File(s) Summary
Demo Command Infrastructure
cli/.env.example, cli/src/commands/demo/index.ts, cli/src/commands/demo/command.ts, cli/src/commands/demo/api.ts, cli/src/commands/demo/types.ts, cli/src/commands/demo/util.ts
New demo command module with API wrappers for platform operations, terminal UI helpers, Docker/plugin orchestration, auth verification via preAction hook, and interactive guided flows including onboarding, graph creation/deletion, plugin publishing, and router startup.
Core Shared Helpers
cli/src/core/router-token.ts, cli/src/core/plugin-publish.ts, cli/src/core/config.ts
New router token creation/deletion helpers with error handling; new plugin publishing pipeline with platform validation, Docker build/push, and federated subgraph publication; config extended with demo identifiers, telemetry endpoints, Docker builder settings, and onboarding repository details.
Existing Command Refactoring
cli/src/commands/router/commands/token/commands/create.ts, cli/src/commands/router/commands/token/commands/delete.ts, cli/src/commands/router/commands/plugin/commands/publish.ts
Token and plugin publish commands refactored to delegate to new centralized helpers (createRouterToken, deleteRouterToken, publishPluginPipeline), removing inline platform calls and error handling logic; platform argument validation now uses shared SUPPORTED_PLATFORMS constant.
CLI Utilities
cli/src/utils.ts
Added waitForKeyPress for interactive key listening with persistent callbacks, rainbow for ANSI gradient text coloring, stripAnsi and visibleLength for ANSI escape handling; composeSubgraphs reformatted for consistency.
Command Registry
cli/src/commands/index.ts
Demo command group wired into CLI program with shared client instance.
Test Suites
cli/test/demo/command.test.ts, cli/test/demo/util.test.ts
End-to-end test suite for demo command covering fresh setup, existing graph, and retry/failure paths; utility test suite covering file download, Docker readiness, router container startup, plugin publishing, and log management with mocked execa, fetch, and filesystem.
Documentation
docs-website/cli/demo.mdx, docs-website/docs.json
New documentation page for wgc demo command with prerequisites, features, and constraints; navigation configuration updated to include demo command link.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • feat: onboarding wizard #1 #2719: Server-side implementation of onboarding RPCs (getOnboarding, createFederatedGraph, deleteFederatedGraph) that directly correspond to platform API calls invoked by the new demo command.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.62% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: onboarding wizard #5' clearly summarizes the main change: implementing an onboarding wizard feature as the fifth iteration, with explicit reference to the iteration number.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the cli label Apr 8, 2026
@comatory comatory mentioned this pull request Apr 8, 2026
5 tasks
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-04 branch from 31d2073 to b2f5c39 Compare April 8, 2026 07:44
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-05 branch from 5855726 to 4e88f5b Compare April 8, 2026 07:44
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 24.82547% with 2692 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.59%. Comparing base (fdd035b) to head (5f316d4).
⚠️ Report is 4 commits behind head on ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-topic.

Files with missing lines Patch % Lines
...src/components/onboarding/federation-animation.tsx 0.00% 605 Missing and 1 partial ⚠️
studio/src/components/onboarding/step-3.tsx 0.00% 289 Missing and 1 partial ⚠️
...udio/src/components/onboarding/metrics-monitor.tsx 0.00% 264 Missing and 1 partial ⚠️
studio/src/components/onboarding/step-finished.tsx 0.00% 228 Missing and 1 partial ⚠️
...io/src/components/onboarding/traffic-animation.tsx 0.00% 188 Missing and 1 partial ⚠️
studio/src/components/onboarding/step-2.tsx 0.00% 176 Missing and 1 partial ⚠️
cli/src/core/plugin-publish.ts 12.35% 149 Missing ⚠️
studio/src/components/onboarding/step-1.tsx 0.00% 132 Missing and 1 partial ⚠️
cli/src/commands/demo/command.ts 80.28% 69 Missing ⚠️
...rc/components/onboarding/onboarding-navigation.tsx 0.00% 54 Missing and 1 partial ⚠️
... and 29 more

❌ Your patch check has failed because the patch coverage (24.82%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@                                           Coverage Diff                                           @@
##           ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-topic    #2750      +/-   ##
=======================================================================================================
- Coverage                                                                46.28%   37.59%   -8.70%     
=======================================================================================================
  Files                                                                     1045      780     -265     
  Lines                                                                   139773   103288   -36485     
  Branches                                                                  8768     5186    -3582     
=======================================================================================================
- Hits                                                                     64695    38827   -25868     
+ Misses                                                                   73326    62717   -10609     
+ Partials                                                                  1752     1744       -8     
Files with missing lines Coverage Δ
cli/src/commands/demo/index.ts 100.00% <100.00%> (ø)
cli/src/commands/demo/types.ts 100.00% <100.00%> (ø)
cli/src/commands/index.ts 85.15% <100.00%> (+0.73%) ⬆️
cli/src/core/config.ts 100.00% <100.00%> (ø)
router/core/websocket.go 76.51% <100.00%> (+0.57%) ⬆️
studio/src/hooks/use-session-storage.ts 0.00% <ø> (ø)
router/core/batch.go 53.54% <0.00%> (-26.78%) ⬇️
router/core/errors.go 74.19% <50.00%> (-6.46%) ⬇️
router/core/graphql_prehandler.go 67.03% <0.00%> (-17.60%) ⬇️
...io/src/components/dashboard/workspace-provider.tsx 0.00% <0.00%> (ø)
... and 35 more

... and 387 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-04 branch from b2f5c39 to 02e794c Compare April 8, 2026 07:55
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-05 branch 2 times, most recently from 1a5c570 to 8bfd103 Compare April 8, 2026 12:54
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-05 branch 4 times, most recently from addc513 to bfdd07f Compare April 9, 2026 09:03
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

Router-nonroot image scan passed

✅ No security vulnerabilities found in image:

ghcr.io/wundergraph/cosmo/router:sha-389b3a62afca01f1eba7ed5cbe018e0a2e470141-nonroot

@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-04 branch from 02e794c to 9648dc5 Compare April 9, 2026 09:08
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-05 branch 2 times, most recently from 9629758 to cefd0e0 Compare April 9, 2026 09:24
@github-actions github-actions Bot removed the monorepo label Apr 9, 2026
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-04 branch from 9648dc5 to 578d732 Compare April 9, 2026 09:57
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-05 branch 2 times, most recently from 7867a28 to 5eb613b Compare April 9, 2026 11:35
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-04 branch from 578d732 to 6b106ed Compare April 9, 2026 11:58
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-05 branch from 5eb613b to e629243 Compare April 9, 2026 11:59
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-04 branch 3 times, most recently from 6b106ed to 2a88e40 Compare April 9, 2026 12:12
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-05 branch from e629243 to 0a365b8 Compare April 9, 2026 12:12
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-04 branch from 2a88e40 to 81d369b Compare April 9, 2026 12:19
@comatory comatory force-pushed the ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-05 branch from f4018ed to 09f1524 Compare April 20, 2026 09:40
@comatory
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🧹 Nitpick comments (5)
cli/src/core/plugin-publish.ts (1)

52-93: Duplicate platform list definitions.

supportedPlatforms inside getDefaultPlatforms() duplicates the exported SUPPORTED_PLATFORMS constant. Consider reusing the constant to avoid maintenance burden.

♻️ Proposed refactor to reuse constant
+export const SUPPORTED_PLATFORMS = ['linux/amd64', 'linux/arm64', 'darwin/amd64', 'darwin/arm64', 'windows/amd64'];
+
 export function getDefaultPlatforms(): string[] {
-  const supportedPlatforms = ['linux/amd64', 'linux/arm64', 'darwin/amd64', 'darwin/arm64', 'windows/amd64'];
   const defaultPlatforms = ['linux/amd64'];
 
   // ... rest of function ...
 
-  if (dockerPlatform && supportedPlatforms.includes(dockerPlatform) && !defaultPlatforms.includes(dockerPlatform)) {
+  if (dockerPlatform && SUPPORTED_PLATFORMS.includes(dockerPlatform) && !defaultPlatforms.includes(dockerPlatform)) {
     defaultPlatforms.push(dockerPlatform);
   }
 
   return defaultPlatforms;
 }
-
-export const SUPPORTED_PLATFORMS = ['linux/amd64', 'linux/arm64', 'darwin/amd64', 'darwin/arm64', 'windows/amd64'];
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/src/core/plugin-publish.ts` around lines 52 - 93, getDefaultPlatforms
currently declares a local supportedPlatforms array that duplicates the exported
SUPPORTED_PLATFORMS; remove the local supportedPlatforms declaration and
references and reuse the exported SUPPORTED_PLATFORMS constant instead (keep the
local defaultPlatforms logic and dockerPlatform calculation as-is), i.e.,
replace checks like supportedPlatforms.includes(dockerPlatform) with
SUPPORTED_PLATFORMS.includes(dockerPlatform) and delete the duplicated array
inside getDefaultPlatforms so SUPPORTED_PLATFORMS is the single source of truth.
docs-website/cli/demo.mdx (1)

29-31: Break this behavior summary into a short list.

This paragraph bundles several distinct actions and outcomes into one long sentence, which makes the page harder to scan as reference docs. A short bullet list for graph creation/reuse, plugin publishing, router startup, and log-path output would fit the docs style better.

As per coding guidelines: "Prefer short, declarative sentences. If a sentence has more than one comma-separated clause, consider splitting it. Use structured lists when presenting multiple distinct items. Do not pack them into a single paragraph."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs-website/cli/demo.mdx` around lines 29 - 31, Split the long paragraph
under the "What The Command Does" heading into a short bullet list of distinct
actions: (1) create or reuse a demo federated graph in the `default` namespace,
(2) configure and publish required demo plugins/components, (3) start a local
router at http://localhost:3002, (4) print the path to the local log file for
router/publishing output, and also add a brief separate sentence noting that an
existing demo can be reused or deleted to start over; update the "What The
Command Does" section accordingly so each action is its own short, declarative
list item.
cli/src/commands/demo/util.ts (3)

483-510: Missing error handling around readPluginFiles.

If readPluginFiles throws an exception (e.g., plugin directory doesn't exist, file read error), the spinner will continue running and the error will propagate unhandled. Consider wrapping the inner loop body in try/catch to stop the spinner and return a structured error.

Proposed fix
     for (let i = 0; i < pluginNames.length; i++) {
       const pluginName = pluginNames[i];
       const pluginDir = path.join(supportDir, 'plugins', pluginName);

       const spinner = demoSpinner(`Publishing plugin ${pc.bold(pluginName)} (${i + 1}/${pluginNames.length})…`).start();

+      let files;
+      try {
+        files = await readPluginFiles(pluginDir);
+      } catch (err) {
+        spinner.fail(`Failed to read plugin ${pc.bold(pluginName)}: ${err instanceof Error ? err.message : String(err)}`);
+        return { error: err instanceof Error ? err : new Error(String(err)) };
+      }
-      const files = await readPluginFiles(pluginDir);
       const result = await publishPluginPipeline({
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/src/commands/demo/util.ts` around lines 483 - 510, The loop calling
readPluginFiles lacks try/catch so thrown errors leave demoSpinner running and
propagate; wrap the inner per-plugin logic (where readPluginFiles,
publishPluginPipeline, pipeToLog are called and spinner is created) in a
try/catch that calls spinner.fail with a descriptive message, ends logStream,
and returns a structured error object (same shape as publishPluginPipeline
result) so the caller receives { error: <Error> }; ensure you still call
logStream.end() in the finally path and preserve existing behavior when
publishPluginPipeline returns result.error.

129-181: Consider handling GitHub API rate limits.

The prepareSupportingData function fetches from the GitHub API without authentication. Unauthenticated requests are limited to 60 requests/hour, which could be exhausted quickly during development or repeated runs. Consider documenting this limitation or optionally supporting a GITHUB_TOKEN environment variable for authenticated requests.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/src/commands/demo/util.ts` around lines 129 - 181, prepareSupportingData
currently uses unauthenticated fetches to GitHub (treeResponse and individual
rawUrl fetches) which can hit the 60 requests/hour rate limit; update the
function to read a GITHUB_TOKEN env var (or config) and, when present, add an
Authorization: Bearer <token> header to the GitHub API request for the tree (and
to any API requests if you switch to api.github.com for file contents), falling
back to unauthenticated requests if absent; ensure the header is applied to the
fetch calls that use
config.demoOnboardingRepositoryName/config.demoOnboardingRepositoryBranch (i.e.,
where treeResponse is fetched) and include a brief error message noting
rate-limit status when treeResponse.ok is false so the user can be guided to set
GITHUB_TOKEN.

456-456: Unreachable code after try/catch/finally.

Line 456 (return { error: null }) appears to be unreachable. All execution paths within the try block either return explicitly (lines 434, 440) or fall through to await proc (line 443) which will either complete normally (caught by finally and then exit), throw (caught by catch), or be canceled (caught by catch). The catch block returns on all paths (lines 447, 450).

Consider removing this line or restructuring to make control flow clearer.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/src/commands/demo/util.ts` at line 456, The final "return { error: null
}" is unreachable because all paths in the try/catch already return or rethrow
after awaiting "proc" and the catch block returns on all branches; remove the
unreachable return or refactor the function so all branches set a single result
variable and perform one return at the end (e.g., replace direct returns in the
try/catch with assignments to a local "result" and return "result" after the
try/catch/finally). Update references to "proc" and the existing catch branches
to use the chosen pattern so control flow is explicit and no dead return
remains.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cli/src/commands/demo/api.ts`:
- Line 30: Fix the misspelling "occured" → "occurred" in the three error message
constructions that create new Error objects (e.g., the expression error: new
Error(response.response?.details ?? 'An unknown error occured') and the
analogous messages at the other two occurrences). Update the string literal in
each place so the fallback message reads 'An unknown error occurred' (preserving
the existing conditional/response usage and surrounding code such as the
response.response?.details checks).
- Around line 9-34: The RPC calls in fetchUserInfo (and similarly in
checkExistingOnboarding, fetchFederatedGraphByName, cleanUpFederatedGraph,
createFederatedGraph) can throw transport-level ConnectError and must be wrapped
in try/catch; update each function to wrap the await client.platform.* call in a
try block, catch exceptions (specifically handle ConnectError) and return the
same structured response shape (userInfo/other payload as null and error set to
a new Error with the caught error's message or details) so transport failures
become handled errors rather than unhandled rejections.

In `@cli/src/commands/demo/command.ts`:
- Around line 106-120: The current flow sets deleted = true and prints success
messages unconditionally even when cleanupFederatedGraph()/cleanupFn() fails;
change the logic so that spinner.succeed and setting deleted = true only happen
after a confirmed successful deletion (i.e., when deleteResponse has no error
and cleanupFederatedGraph()/cleanupFn() returned success). Move
spinner.succeed(graph removed) and deleted = true into the success branch, keep
spinner.fail and the waitForKeyPress retry flow inside the error branch, and
ensure cleanupFederatedGraph()/cleanupFn() returns or throws a clear status so
the calling code can reliably decide success versus failure.
- Around line 297-299: Remove the unconditional token echo: stop printing
createResult.token to stdout by deleting or guarding the console.log(` 
${pc.bold(createResult.token)}`) call; the token is already passed to
runRouterContainer(), so either remove that line entirely or only print the
token when an explicit, opt-in flag (e.g. --show-token) is provided and
documented, ensuring spinner.succeed('Router token generated.') remains but the
secret token is not echoed by default.
- Around line 64-73: The error branches that call waitForKeyPress (e.g., the
getFederatedGraphResponse.error branch referencing retryFn and waitForKeyPress)
currently await a retry keypress but then fall through returning undefined;
change these to propagate the retry outcome back to the caller by returning the
retry result (i.e., call and return the result of retryFn or repeat the
operation in a loop until success/cancel) instead of just returning undefined.
Apply the same fix to the other similar blocks mentioned (around lines handling
graph creation/plugin publish and onboarding-status retry) so each branch either
returns the retryFn result or uses a loop that only exits on success or cancel,
ensuring the outer flow receives the retried value.

In `@cli/src/core/plugin-publish.ts`:
- Around line 141-158: The call to client.platform.validateAndFetchPluginData
inside publishPluginPipeline can throw transport-level ConnectError but is not
wrapped; add a try-catch around that RPC invocation (the block that constructs
the request with name/namespace/labels and calls
client.platform.validateAndFetchPluginData) and on catch return a
PluginPublishResult with the caught error (preserving error details) so callers
always receive a structured result; ensure you only change the error-handling
around validateAndFetchPluginData and keep the subsequent response.code check
as-is.
- Around line 209-228: Wrap the call to client.platform.publishFederatedSubgraph
in a try-catch that specifically handles transport errors (ConnectError) and
general errors: catch errors around the publishFederatedSubgraph(...) invocation
and on ConnectError log a clear message (including error details) using the same
logger, perform any necessary rollback/cleanup (e.g., mark or remove the pushed
Docker image or set a failure flag), and rethrow or return a controlled failure
so the pipeline does not continue as if publish succeeded; ensure the catch
surrounds the exact call to client.platform.publishFederatedSubgraph and
preserves existing headers from getBaseHeaders() and fields like
name/pluginName, namespace, proto, SubgraphType.GRPC_PLUGIN, and newVersion.

In `@cli/src/core/router-token.ts`:
- Around line 35-50: The await calls to
client.platform.createFederatedGraphToken (in createRouterToken) and the
corresponding delete call (in deleteRouterToken) must be wrapped in try/catch so
transport-level rejections are converted to the promised { error: Error | null }
shape; surround the await of client.platform.createFederatedGraphToken(...) and
the deleteFederatedGraphToken(...) call with try/catch and on catch return {
error: new ConnectError(caughtError.message ?? 'RPC error', /* preserve or map
status if available */) } (or wrap the original error) instead of letting the
rejection escape, keeping the existing success path that returns { error: null,
token } or { error: null } intact.

In `@cli/src/utils.ts`:
- Around line 320-342: The waitForKeyPress function calls
process.stdin.setRawMode(true) unguarded which throws when stdin is not a TTY;
update waitForKeyPress to check process.stdin.isTTY before calling setRawMode
and process.stdin.resume (or wrap setRawMode in try/catch), and ensure cleanup
logic (resetting raw mode and pausing) only runs if raw mode was enabled;
reference the waitForKeyPress function and the onData handler so you add the
isTTY guard around the setRawMode/resume calls and conditionally call
process.stdin.setRawMode(false)/pause in the Ctrl+C and resolve paths.

---

Nitpick comments:
In `@cli/src/commands/demo/util.ts`:
- Around line 483-510: The loop calling readPluginFiles lacks try/catch so
thrown errors leave demoSpinner running and propagate; wrap the inner per-plugin
logic (where readPluginFiles, publishPluginPipeline, pipeToLog are called and
spinner is created) in a try/catch that calls spinner.fail with a descriptive
message, ends logStream, and returns a structured error object (same shape as
publishPluginPipeline result) so the caller receives { error: <Error> }; ensure
you still call logStream.end() in the finally path and preserve existing
behavior when publishPluginPipeline returns result.error.
- Around line 129-181: prepareSupportingData currently uses unauthenticated
fetches to GitHub (treeResponse and individual rawUrl fetches) which can hit the
60 requests/hour rate limit; update the function to read a GITHUB_TOKEN env var
(or config) and, when present, add an Authorization: Bearer <token> header to
the GitHub API request for the tree (and to any API requests if you switch to
api.github.com for file contents), falling back to unauthenticated requests if
absent; ensure the header is applied to the fetch calls that use
config.demoOnboardingRepositoryName/config.demoOnboardingRepositoryBranch (i.e.,
where treeResponse is fetched) and include a brief error message noting
rate-limit status when treeResponse.ok is false so the user can be guided to set
GITHUB_TOKEN.
- Line 456: The final "return { error: null }" is unreachable because all paths
in the try/catch already return or rethrow after awaiting "proc" and the catch
block returns on all branches; remove the unreachable return or refactor the
function so all branches set a single result variable and perform one return at
the end (e.g., replace direct returns in the try/catch with assignments to a
local "result" and return "result" after the try/catch/finally). Update
references to "proc" and the existing catch branches to use the chosen pattern
so control flow is explicit and no dead return remains.

In `@cli/src/core/plugin-publish.ts`:
- Around line 52-93: getDefaultPlatforms currently declares a local
supportedPlatforms array that duplicates the exported SUPPORTED_PLATFORMS;
remove the local supportedPlatforms declaration and references and reuse the
exported SUPPORTED_PLATFORMS constant instead (keep the local defaultPlatforms
logic and dockerPlatform calculation as-is), i.e., replace checks like
supportedPlatforms.includes(dockerPlatform) with
SUPPORTED_PLATFORMS.includes(dockerPlatform) and delete the duplicated array
inside getDefaultPlatforms so SUPPORTED_PLATFORMS is the single source of truth.

In `@docs-website/cli/demo.mdx`:
- Around line 29-31: Split the long paragraph under the "What The Command Does"
heading into a short bullet list of distinct actions: (1) create or reuse a demo
federated graph in the `default` namespace, (2) configure and publish required
demo plugins/components, (3) start a local router at http://localhost:3002, (4)
print the path to the local log file for router/publishing output, and also add
a brief separate sentence noting that an existing demo can be reused or deleted
to start over; update the "What The Command Does" section accordingly so each
action is its own short, declarative list item.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d3a5ee44-9b1d-4903-b9dc-b413c4a5305c

📥 Commits

Reviewing files that changed from the base of the PR and between 9236b46 and 9342eea.

📒 Files selected for processing (18)
  • cli/.env.example
  • cli/src/commands/demo/api.ts
  • cli/src/commands/demo/command.ts
  • cli/src/commands/demo/index.ts
  • cli/src/commands/demo/types.ts
  • cli/src/commands/demo/util.ts
  • cli/src/commands/index.ts
  • cli/src/commands/router/commands/plugin/commands/publish.ts
  • cli/src/commands/router/commands/token/commands/create.ts
  • cli/src/commands/router/commands/token/commands/delete.ts
  • cli/src/core/config.ts
  • cli/src/core/plugin-publish.ts
  • cli/src/core/router-token.ts
  • cli/src/utils.ts
  • cli/test/demo/command.test.ts
  • cli/test/demo/util.test.ts
  • docs-website/cli/demo.mdx
  • docs-website/docs.json

Comment thread cli/src/commands/demo/api.ts
Comment thread cli/src/commands/demo/api.ts Outdated
Comment thread cli/src/commands/demo/command.ts Outdated
Comment thread cli/src/commands/demo/command.ts Outdated
Comment thread cli/src/commands/demo/command.ts
Comment thread cli/src/core/plugin-publish.ts
Comment thread cli/src/core/plugin-publish.ts
Comment thread cli/src/core/router-token.ts
Comment thread cli/src/utils.ts
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

❌ Patch coverage is 69.45774% with 383 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.27%. Comparing base (723e9e8) to head (f775983).
⚠️ Report is 1 commits behind head on ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-topic.

Files with missing lines Patch % Lines
cli/src/core/plugin-publish.ts 12.35% 149 Missing ⚠️
cli/src/commands/demo/command.ts 79.60% 72 Missing ⚠️
cli/src/utils.ts 44.31% 49 Missing ⚠️
...ommands/router/commands/plugin/commands/publish.ts 2.77% 35 Missing ⚠️
cli/src/commands/demo/api.ts 84.90% 24 Missing ⚠️
cli/src/commands/demo/util.ts 93.62% 22 Missing ⚠️
.../commands/router/commands/token/commands/create.ts 4.76% 20 Missing ⚠️
.../commands/router/commands/token/commands/delete.ts 9.09% 10 Missing ⚠️
cli/src/core/router-token.ts 94.73% 2 Missing ⚠️
Additional details and impacted files
@@                                           Coverage Diff                                            @@
##           ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-topic    #2750       +/-   ##
========================================================================================================
- Coverage                                                                40.33%   39.27%    -1.07%     
========================================================================================================
  Files                                                                     1014      136      -878     
  Lines                                                                   126712    12802   -113910     
  Branches                                                                  5725      631     -5094     
========================================================================================================
- Hits                                                                     51112     5028    -46084     
+ Misses                                                                   73882     7772    -66110     
+ Partials                                                                  1718        2     -1716     
Files with missing lines Coverage Δ
cli/src/commands/demo/index.ts 100.00% <100.00%> (ø)
cli/src/commands/demo/types.ts 100.00% <100.00%> (ø)
cli/src/commands/index.ts 85.15% <100.00%> (+0.73%) ⬆️
cli/src/core/config.ts 100.00% <100.00%> (ø)
cli/src/core/router-token.ts 94.73% <94.73%> (ø)
.../commands/router/commands/token/commands/delete.ts 40.90% <9.09%> (+2.90%) ⬆️
.../commands/router/commands/token/commands/create.ts 46.80% <4.76%> (+3.41%) ⬆️
cli/src/commands/demo/util.ts 93.62% <93.62%> (ø)
cli/src/commands/demo/api.ts 84.90% <84.90%> (ø)
...ommands/router/commands/plugin/commands/publish.ts 19.33% <2.77%> (+1.86%) ⬆️
... and 3 more

... and 885 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread cli/src/commands/demo/types.ts Outdated
Comment thread cli/src/commands/demo/util.ts Outdated
Comment thread cli/src/core/config.ts Outdated
Comment thread docs-website/cli/demo.mdx
Comment thread cli/test/demo/util.test.ts Outdated
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Copy link
Copy Markdown
Contributor

@wilsonrivera wilsonrivera left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants