Skip to content

feat(ripple): add bit ripple CLI for Ripple CI management#10261

Merged
davidfirst merged 10 commits intomasterfrom
feat/ripple-cli
Mar 30, 2026
Merged

feat(ripple): add bit ripple CLI for Ripple CI management#10261
davidfirst merged 10 commits intomasterfrom
feat/ripple-cli

Conversation

@davidfirst
Copy link
Copy Markdown
Member

Adds a new bit ripple command with subcommands for managing Ripple CI jobs from the CLI:

  • bit ripple list — list recent jobs with filters (owner, scope, lane, status, user, limit)
  • bit ripple log [job-id] — show job details and per-component build status
  • bit ripple errors [job-id] — show build errors with actual log output from containers
  • bit ripple retry [job-id] — retry a failed job
  • bit ripple stop [job-id] — stop a running job

All commands auto-detect the current lane from .bitmap when no job-id is given. The errors command fetches container logs in parallel from the Ripple SSE endpoint with idle timeouts for fast response (~5s).

New aspect: teambit.cloud/ripple at scopes/cloud/ripple/.

Adds a new aspect (teambit.cloud/ripple) providing CLI access to Ripple CI:
- `bit ripple list` — list recent jobs with filters (owner, scope, status, limit)
- `bit ripple log [job-id]` — show job details and component build status
- `bit ripple errors [job-id]` — show build errors with actual log output
- `bit ripple retry [job-id]` — retry a failed job
- `bit ripple stop [job-id]` — stop a running job

All commands auto-detect the current lane from .bitmap when no job-id is given.
Error logs are fetched in parallel from the Ripple SSE endpoint with idle timeouts.
Copilot AI review requested due to automatic review settings March 30, 2026 16:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Introduces a new core aspect (teambit.cloud/ripple) that adds a bit ripple CLI namespace for interacting with Ripple CI jobs on bit.cloud (list/log/errors/retry/stop), and wires it into Bit’s core aspect manifests so it loads as part of the standard CLI.

Changes:

  • Added new teambit.cloud/ripple aspect with bit ripple command + subcommands for job inspection and control.
  • Registered the new aspect in core aspect manifests and core-aspects IDs list.
  • Added the Ripple aspect to the workspace .bitmap.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
scopes/harmony/testing/load-aspect/core-aspects-ids.json Adds teambit.cloud/ripple to the generated list of core aspects.
scopes/harmony/bit/manifests.ts Registers RippleAspect in the core manifests map so the aspect loads in Bit CLI.
scopes/cloud/ripple/ripple.main.runtime.ts Implements RippleMain: GraphQL calls, SSE log fetching, lane auto-detection helpers, and CLI registration.
scopes/cloud/ripple/ripple.cmd.ts Adds the top-level bit ripple command entry point.
scopes/cloud/ripple/ripple.aspect.ts Declares the teambit.cloud/ripple aspect ID.
scopes/cloud/ripple/ripple-stop.cmd.ts Implements bit ripple stop subcommand.
scopes/cloud/ripple/ripple-retry.cmd.ts Implements bit ripple retry subcommand.
scopes/cloud/ripple/ripple-log.cmd.ts Implements bit ripple log subcommand.
scopes/cloud/ripple/ripple-list.cmd.ts Implements bit ripple list subcommand.
scopes/cloud/ripple/ripple-errors.cmd.ts Implements bit ripple errors subcommand, including container log parsing.
scopes/cloud/ripple/index.ts Exports the Ripple aspect (and RippleMain type).
.bitmap Tracks the new ripple component under teambit.cloud.

- Use Workspace API directly (getCurrentLaneId, defaultScope) instead of
  manually parsing .bitmap and workspace.jsonc
- Add null guard for job in json() method of errors command
- Remove unused --component flag from errors command
- Validate --limit flag in list command
Extract colorPhase, stripComponentVersion, resolveJobId to ripple-utils.ts.
Remove unused methods, types, and GQL queries. Fix idleTimer cleanup leak.
Copilot AI review requested due to automatic review settings March 30, 2026 18:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 11 comments.

- Fix scope.replace('.', '/') to handle multiple dots in scope names
- Improve --owner and --lane option descriptions to match actual behavior
- Throw clear error for invalid --limit values instead of misleading empty results
Copilot AI review requested due to automatic review settings March 30, 2026 18:08
@davidfirst davidfirst enabled auto-merge (squash) March 30, 2026 18:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 15 comments.

Copilot AI review requested due to automatic review settings March 30, 2026 18:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Switch from teambit.harmony/node to teambit.harmony/envs/core-aspect-env
so that Babel's lazy require transform is applied, reducing bootstrap
file reads.
…strap reads

Move all subcommand classes into ripple.cmd.ts to eliminate 5 separate
file reads during bootstrap, bringing the total under the 1050 threshold.
Copilot AI review requested due to automatic review settings March 30, 2026 21:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment on lines +226 to +233
const response = await fetch(url, { headers, signal: controller.signal });
if (!response.ok || !response.body) {
clearTimeout(hardTimeout);
return [];
}
const reader = response.body.getReader();
const decoder = new TextDecoder();
let buffer = '';
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

getContainerLog() reads response.body.getReader() (WHATWG streams). With the repo’s current engines.node >=12.22.0, this will not work in older Node runtimes, and the errors command will fail when fetching logs. Consider aligning the repo’s declared Node support (>=18) or reworking log consumption to a Node stream-compatible implementation.

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +94
const table = new Table({
head: [
chalk.cyan('Job ID'),
chalk.cyan('Name'),
chalk.cyan('Scope'),
chalk.cyan('Status'),
chalk.cyan('User'),
chalk.cyan('Started'),
chalk.cyan('Duration'),
],
chars: {
top: '',
'top-mid': '',
'top-left': '',
'top-right': '',
bottom: '',
'bottom-mid': '',
'bottom-left': '',
'bottom-right': '',
left: '',
'left-mid': '',
mid: '',
'mid-mid': '',
right: '',
'right-mid': '',
middle: ' ',
},
style: { 'padding-left': 1, 'padding-right': 1 },
});
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

The cli-table rendering configuration (custom chars + padding) is duplicated in multiple places in this file. Consider extracting a small helper (e.g. createCompactTable(head)) to keep table formatting consistent and reduce future maintenance when the layout needs to change.

Copilot uses AI. Check for mistakes.
Comment on lines +254 to +274
const table = new Table({
head: [chalk.cyan('Task'), chalk.cyan('Status'), chalk.cyan('Started'), chalk.cyan('Warnings')],
chars: {
top: '',
'top-mid': '',
'top-left': '',
'top-right': '',
bottom: '',
'bottom-mid': '',
'bottom-left': '',
'bottom-right': '',
left: '',
'left-mid': '',
mid: '',
'mid-mid': '',
right: '',
'right-mid': '',
middle: ' ',
},
style: { 'padding-left': 1, 'padding-right': 1 },
});
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

This file defines another cli-table instance with the same custom chars/style config as the list output above. Extracting a shared helper for table creation would avoid format drift and reduce duplication.

Copilot uses AI. Check for mistakes.
@davidfirst davidfirst merged commit 693c624 into master Mar 30, 2026
16 checks passed
@davidfirst davidfirst deleted the feat/ripple-cli branch March 30, 2026 22:09
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.

3 participants