Skip to content

Cloud deploy: say why a deploy failed, keep credentials out of output; draft deploy skill - #553

Open
fabriciojs wants to merge 9 commits into
mainfrom
feat/deploy-visibility-day-one
Open

fabriciojs wants to merge 9 commits into
mainfrom
feat/deploy-visibility-day-one

Conversation

@fabriciojs

Copy link
Copy Markdown
Member

Summary

kool cloud deploy now says why a deploy failed and keeps credentials out of its output. This PR also fixes rough edges a coding agent hit while deploying three typical apps with the released CLI, and adds a draft deploy skill for agents.

Deploy failures

  • Prints the deploy's error, hint and detail from the status API.
  • Prints the logs URL as soon as the deploy is created, and again on failure.
  • timedout is a final state. A failed status poll retries with backoff instead of waiting out the 15-minute timeout.
  • Labels docker login failures.
  • Sends an x-kool-client header so the panel can tell which deploys a coding agent ran. The values are claude-code, AI_AGENT, gemini-cli, copilot-cli, cursor, ci or human, and each is detected only from markers the tool documents.

Credentials

  • --verbose used to print the registry login and password from the deploy response. Now --verbose and echoed command lines redact credential fields and token-like values (new core/redact).
  • Help and errors steer people to KOOL_API_TOKEN over --token, which shows in the process list. --token still works.
  • The build logs out of the Kool registry only, after the push; before, it logged the user out of Docker Hub. A failed logout no longer fails a deploy that already pushed.

Smaller fixes

  • An interrupt after the deploy has started used to kill the CLI silently. It now prints the deploy id and the logs URL, and the rollout continues.
  • kool cloud exec SERVICE -- CMD works.
  • kool cloud setup links to the right kool.cloud.yml reference page.
  • The stale embedded templates/kool.deploy.yml is removed: nothing referenced it, and the validator rejected it.
  • The commands reference docs are regenerated.

Draft: kool-cloud-deploy skill

  • skills/kool-cloud-deploy/ holds a short skill with references for Laravel, Next.js (Prisma + SQLite), Vite/React SPAs, Node and static sites.
  • templates/agents/AGENTS.kool.md is a 3 KB always-loaded snippet that kool create / kool cloud setup could write.
  • Every kool.cloud.yml example passes the CLI's validator, and every Dockerfile passes docker build --check.
  • It isn't wired into any command yet. It's up for review.

The real error line, hint and detail come from a panel change in https://github.com/kool-dev/web-cloud-panel/pull/127 (private). Against the current panel, the CLI prints whatever error the panel sends today.

Testing

  • gofmt -l . is clean, and go build ./... and go vet ./... pass.
  • go test ./... passes with 0 failures, including the new tests for redaction, client detection, the status shape, logout, exec -- and signal handling.
  • golangci-lint v2.15.0 reports 0 issues.
  • End to end against a local fake API, never the real one and with no Docker build:
    • docker.login, docker.password and an env DB_PASSWORD print as [REDACTED] under --verbose;
    • SIGINT or SIGTERM after the deploy starts sends no failure report.

🤖 Generated with Claude Code

fabriciojs and others added 2 commits November 27, 2026 17:27
- Print the deploy's error, hint and detail from the status API, and the
  logs URL as soon as the deploy is created (and again on failure).
- timedout is a final state; a failed status poll retries with backoff
  instead of waiting out the 15-minute timeout.
- Send x-kool-client (claude-code, AI_AGENT, gemini-cli, copilot-cli,
  cursor, ci or human) so the panel can tell which deploys an agent ran.
- --verbose and echoed command lines redact credential fields and
  token-like values (new core/redact); help and errors prefer
  KOOL_API_TOKEN over --token, which shows in the process list.
- Log out of the Kool registry only, after the push; a failed logout no
  longer fails a deploy that already pushed. Label docker login failures.
- An interrupt after the deploy started prints the deploy id and logs URL
  instead of dying silently; the rollout continues.
- kool cloud exec accepts a leading --; setup's reference link is fixed;
  the stale embedded kool.deploy.yml template (rejected by the validator)
  is removed. Commands reference docs regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A short skill for coding agents deploying to Kool Cloud, with references
for Laravel, Next.js (Prisma + SQLite), Vite/React SPAs, Node and static
sites, plus the always-loaded AGENTS.md snippet kool create and kool cloud
setup could write. Every kool.cloud.yml example passes the CLI validator;
every Dockerfile passes docker build --check. Draft for review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 20:28

Copilot AI 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.

🟡 Changes recommended

Unresolved redaction flaws can expose quoted passwords and credential-bearing deployment diagnostics in user-visible output.

5 open issues
What changed in this PR

This PR improves Kool Cloud deploy diagnostics and credential handling in the CLI, and adds draft deployment guidance for coding agents. The new skill and agent snippet are not yet wired into commands.

Changes:

  • Adds failure details, earlier logs links, polling retries, timeout recognition, interrupt reporting, and registry-specific cleanup.
  • Adds credential redaction and client identification, improves token guidance, and supports cloud exec SERVICE -- CMD.
  • Adds stack-specific deployment guides, refreshes command documentation, and removes the unused legacy template.
File Description
templates/​kool.deploy.yml Removes the unused legacy template.
templates/​agents/​AGENTS.kool.md Adds a draft agent guidance snippet.
skills/​kool-cloud-deploy/​SKILL.md Adds the draft deployment workflow and troubleshooting guide.
skills/​kool-cloud-deploy/​references/​static.md Adds static-site deployment examples.
skills/​kool-cloud-deploy/​references/​spa.md Adds Vite/React build and routing guidance.
skills/​kool-cloud-deploy/​references/​node.md Adds Node API deployment guidance.
skills/​kool-cloud-deploy/​references/​nextjs.md Adds Next.js, Prisma, and SQLite guidance.
skills/​kool-cloud-deploy/​references/​laravel.md Adds Laravel deployment guidance.
services/​cloud/​build.go Labels login errors and scopes registry logout.
services/​cloud/​build_test.go Tests login errors and logout behavior.
services/​cloud/​api/​endpoint.go Redacts verbose output and adds client headers.
services/​cloud/​api/​endpoint_test.go Tests headers and verbose credential redaction.
services/​cloud/​api/​deploy_status.go Expands the deploy status response fields.
services/​cloud/​api/​deploy_status_test.go Tests status decoding and nullable fields.
services/​cloud/​api/​client.go Detects agent, CI, and human clients.
services/​cloud/​api/​client_test.go Tests client detection and sanitization.
docs/​05-Commands-Reference/​kool-cloud.md Documents environment-based authentication.
docs/​05-Commands-Reference/​kool-cloud-setup.md Refreshes inherited token guidance.
docs/​05-Commands-Reference/​kool-cloud-logs.md Refreshes inherited token guidance.
docs/​05-Commands-Reference/​kool-cloud-help.md Refreshes inherited token guidance.
docs/​05-Commands-Reference/​kool-cloud-exec.md Updates separator syntax and token guidance.
docs/​05-Commands-Reference/​kool-cloud-destroy.md Refreshes inherited token guidance.
docs/​05-Commands-Reference/​kool-cloud-deploy.md Refreshes inherited token guidance.
core/​shell/​shell.go Redacts echoed command arguments.
core/​shell/​shell_test.go Tests credential redaction in command echoes.
core/​redact/​redact.go Adds JSON, text, and argument redaction helpers.
core/​redact/​redact_test.go Tests redaction and preservation of non-secret values.
commands/​cloud.go Recommends environment tokens in help and errors.
commands/​cloud_test.go Tests token guidance and precedence.
commands/​cloud_setup.go Corrects the configuration reference URL.
commands/​cloud_deploy.go Improves polling, diagnostics, and interrupt reporting.
commands/​cloud_deploy_test.go Tests deploy outcomes, retries, and signals.
commands/​cloud_deploy_exec.go Handles the separator after the service name.
commands/​cloud_deploy_exec_test.go Tests separator handling and command forwarding.

Review effort: Balanced

Comment thread commands/cloud_deploy.go Resolved
Comment thread core/redact/redact.go Resolved
Comment thread commands/cloud_deploy.go Resolved
Comment thread commands/cloud_deploy.go Resolved
fabriciojs and others added 7 commits November 27, 2026 17:45
password='...' was left as it was, and a double-quoted value with a
space showed everything after it. A quoted value now runs through its
closing quote, skipping escaped characters, before falling back to the
unquoted pattern; blank values are still kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They are printed on the ordinary error path, not only with --verbose,
and may quote the app's own output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The loading indicator printed its completion message for failed and
timed-out deploys too, right before the failure. Only a successful
deploy keeps it now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a timeout or an interrupt the status poller kept running and
printing, which shows when kool cloud deploy runs inside another kool
command. Polling now stops, with its sleep and its request, as soon as
waiting ends, and a single status check gives up after 30 seconds so a
hung request is retried like any other failed check.

Endpoint gains SetContext, which cancels the request once done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The example's .dockerignore left out nginx.conf, which the Dockerfile
copies, so the build failed. It stays in the context now and is removed
from the web root after COPY . so it isn't published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers running, success (with a service size left null and with
WordPress credentials), failed and timed out deploys with and without an
error, a response without a services list, and responses carrying the
optional hint and detail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`kool cloud destroy` sent DELETE /deploy/destroy, a path the API does not
serve, so it failed with a 404 instead of scheduling the environment for
deletion. The endpoint is DELETE /deploy, as the CLI called it before
3.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants