Skip to content

673 climcp deploy#674

Merged
alexanderkirtzel merged 3 commits into
mainfrom
673-climcp-deploy
Jun 11, 2026
Merged

673 climcp deploy#674
alexanderkirtzel merged 3 commits into
mainfrom
673-climcp-deploy

Conversation

@alexanderkirtzel

@alexanderkirtzel alexanderkirtzel commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Deploy operations now wait up to 12 minutes by default to avoid premature cancellation
    • Retries generate a fresh idempotency key so each attempt starts a new deploy
    • Failures emit stable, machine-readable error codes and include retry hints for rate limits
  • Bug Fixes

    • deploy create no longer prints an empty token placeholder or embeds a token in sample output
  • Documentation

    • Updated CLI and MCP docs to reflect wait semantics, timeout flag, and pagination options

@alexanderkirtzel alexanderkirtzel linked an issue Jun 10, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 71e716b4-2e7f-44f7-81ad-860a0ae69688

📥 Commits

Reviewing files that changed from the base of the PR and between 5931e17 and 1b11101.

📒 Files selected for processing (3)
  • packages/mcps/mcp/src/__tests__/tools/deploy-manage.test.ts
  • packages/mcps/mcp/src/tools/deploy-manage.ts
  • packages/web/destinations/snowplow/src/types/index.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/mcps/mcp/src/tools/deploy-manage.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/mcps/mcp/src/tests/tools/deploy-manage.test.ts

📝 Walkthrough

Walkthrough

Deploy command timing, idempotency, and retryability infrastructure: the CLI now increases the default deploy wait from 120 to 720 seconds, sends unique idempotency keys per invocation to prevent accidental replay, classifies HTTP errors as retryable with Retry-After parsing, implements bounded automatic retry on rate limits for per-settings deploys, emits stable machine-readable error codes, and removes empty token placeholders from deployment creation output. Tests, docs, and MCP tool descriptions align to these semantics.

Changes

Deploy command timeout, idempotency, and error handling

Layer / File(s) Summary
Error handling infrastructure for retryability
packages/cli/src/core/api-error.ts, packages/cli/src/core/__tests__/api-error.test.ts
ApiErrorOptions and ApiError now carry status, retryable, and retryAfterSeconds. New parseRetryAfter, throwApiResponseError, and extractApiErrorOptions helpers classify retryability from HTTP status/headers and parse Retry-After. handleCliError emits machine-readable error: code=... output and exits with EXIT_RETRYABLE (75) for retryable failures or 2 for CLIENT_OUTDATED, else 1.
Deploy timing constants and status rendering
packages/cli/src/commands/deploy/index.ts
Exported DEFAULT_DEPLOY_WAIT_MS (720 seconds) replaces hardcoded timeouts. New exported renderStatusLabel(status, substatus) helper maps deploying:building and other status pairs to human labels with safe fallbacks for unknown combinations.
Deploy triggering with idempotency keys and bounded retry
packages/cli/src/commands/deploy/index.ts
Both legacy and per-settings deploy POST routes now include per-invocation Idempotency-Key header via randomUUID(). Per-settings route uses apiFetch with response introspection; on 429 rate limits with --wait enabled, emits a rate_limited status, sleeps for parsed Retry-After seconds, and re-triggers once. Error handling switched to throwApiResponseError for HTTP-aware classification.
Deployment creation output
packages/cli/src/commands/deployments/index.ts
Removed token display and placeholder from human-readable create output; added guidance to create a deploy token in the app and set WALKEROS_DEPLOY_TOKEN environment variable. JSON output and create flow unchanged.
Deploy and error handling test coverage
packages/cli/src/__tests__/unit/commands/deploy.test.ts, packages/cli/src/__tests__/unit/commands/deployments.test.ts, packages/cli/src/core/__tests__/api-error.test.ts
Deploy tests validate per-invocation idempotency key freshness, renderStatusLabel fallbacks, SSE stream timeout defaults, and explicit timeout overrides via AbortSignal. Deployments test asserts create output guidance and absence of token placeholders. API error tests exercise retryable/non-retryable classification across HTTP 429/503/409, Retry-After parsing, and machine-readable error output with exit codes.
User-facing documentation
.changeset/*, packages/cli/src/cli.ts, packages/mcps/mcp/src/tools/deploy-manage.ts, packages/mcps/mcp/src/__tests__/tools/deploy-manage.test.ts, skills/walkeros-using-cli/commands-reference.md, website/docs/apps/cli.mdx, website/docs/apps/mcp.mdx, packages/web/destinations/snowplow/src/types/index.ts
Changeset files document deploy timing, idempotency, error codes, and token removal. CLI help and reference docs updated to reflect 12-minute (720s) default wait and --timeout as an override. Deploy_manage tool description and tests clarified wait semantics, pagination (cursor, limit), deletion, and error reporting. Website CLI and MCP docs expanded to explain idempotency retry behavior, error.code machine-readable output, and rate-limit auto-retry under --wait.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Spans error handling infrastructure, deploy timing/retry logic, API response classification, and widespread test/doc updates. Reviewers should focus on retry metadata propagation, Retry-After parsing/approximation, bounded retry behavior, idempotency-key generation, and consistent test coverage.

Possibly related PRs

Poem

🐰 A rabbit hops through timeout woods,
With idempotent keys, as it should,
No tokens to display, just guidance to share,
Retries that wait with careful care,
Logs the code so CI knows when to prepare!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title '673 climcp deploy' is a vague reference combining issue number and abbreviations that doesn't clearly summarize the actual changes, which involve multiple deploy/deployment behavior improvements across CLI, MCP, and error handling. Use a descriptive title that captures the main intent, such as 'Improve deploy reliability with idempotency keys, rate limit handling, and better error reporting' or similar.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 673-climcp-deploy

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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/mcps/mcp/src/__tests__/tools/deploy-manage.test.ts`:
- Around line 83-106: The test's expectation for the default wait budget is
wrong: update the assertion that checks description for "120" to the correct
default (either "720" for seconds or "12" for minutes); locate the test using
registerDeployTool(...) and server.getTool('deploy_manage')!, inspect the
config.description string (variable description) and replace
expect(description).toContain('120') with expect(description).toContain('720')
or expect(description).toContain('12') to match the corrected deploy_manage
documentation.

In `@packages/mcps/mcp/src/tools/deploy-manage.ts`:
- Line 23: Update the hardcoded "120-second" timeout text to "720-second" in the
deploy tool help/description string (the string beginning "deploy waits for the
deployment to reach a terminal status...") and update the corresponding unit
test assertion in deploy-manage.test (the test that currently expects a
120-second budget) to expect 720 seconds instead; ensure both description
occurrences and the test expectation are changed so the tool docs and test align
with the new 720-second default.

In `@packages/web/destinations/snowplow/src/types/index.ts`:
- Around line 18-27: The comment and imports incorrectly claim all six Snowplow
types are used in local type positions; update types/index.ts to only import
Action in a local type position (import type { Action } from
'`@snowplow/browser-plugin-snowplow-ecommerce`') and change Product, Cart, Refund,
User, and Page to be re-exported directly (export type { Product, Cart, Refund,
User, Page } from '`@snowplow/browser-plugin-snowplow-ecommerce`'); also update
the comment to reflect that only Action is used locally and the others are
simple re-exports so the imports can be simplified.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 764b8298-e6a6-4dec-bd77-646a68ee17b9

📥 Commits

Reviewing files that changed from the base of the PR and between 7a6c24f and 5931e17.

📒 Files selected for processing (15)
  • .changeset/cli-honest-deploy-waits.md
  • .changeset/mcp-deploy-manage-contract.md
  • packages/cli/src/__tests__/unit/commands/deploy.test.ts
  • packages/cli/src/__tests__/unit/commands/deployments.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/deploy/index.ts
  • packages/cli/src/commands/deployments/index.ts
  • packages/cli/src/core/__tests__/api-error.test.ts
  • packages/cli/src/core/api-error.ts
  • packages/mcps/mcp/src/__tests__/tools/deploy-manage.test.ts
  • packages/mcps/mcp/src/tools/deploy-manage.ts
  • packages/web/destinations/snowplow/src/types/index.ts
  • skills/walkeros-using-cli/commands-reference.md
  • website/docs/apps/cli.mdx
  • website/docs/apps/mcp.mdx

Comment thread packages/mcps/mcp/src/__tests__/tools/deploy-manage.test.ts
const DESCRIPTION =
'Deploy walkerOS flows and manage deployments. ' +
'For get/delete actions pass flowId (required) plus optional slug to disambiguate when a flow has multiple active deployments. ' +
'deploy waits for the deployment to reach a terminal status by default (wait=true), with a 120-second budget; pass wait=false to return immediately with the deployment id. ' +

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Timeout budget across MCP tool and test not updated from 120 to 720 seconds.

The MCP tool description (deploy-manage.ts lines 23, 54) still claims a "120-second budget," and the test (deploy-manage.test.ts line 91) validates that incorrect value. The correct default is 12 minutes (720 seconds), as documented in cli.mdx and skills/walkeros-using-cli/commands-reference.md and confirmed by the AI summary ("increased default wait from 120 to 720 seconds"). Both the tool description and test must be updated together to reflect the new 720-second (12-minute) budget.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/mcps/mcp/src/tools/deploy-manage.ts` at line 23, Update the
hardcoded "120-second" timeout text to "720-second" in the deploy tool
help/description string (the string beginning "deploy waits for the deployment
to reach a terminal status...") and update the corresponding unit test assertion
in deploy-manage.test (the test that currently expects a 120-second budget) to
expect 720 seconds instead; ensure both description occurrences and the test
expectation are changed so the tool docs and test align with the new 720-second
default.

Comment thread packages/web/destinations/snowplow/src/types/index.ts Outdated
@alexanderkirtzel alexanderkirtzel merged commit 3e1d7a7 into main Jun 11, 2026
4 of 5 checks passed
@alexanderkirtzel alexanderkirtzel deleted the 673-climcp-deploy branch June 11, 2026 08:06
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.

cli/mcp deploy

1 participant