Repository navigation
feat(deployments): add the deployments resource (list, get, create, rollback, cancel) - #256
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
Adds the DEPLOYMENT UID label, git fields hidden for FileUpload, an environment variable count, generic not-found wording and --deployment. Also bumps express and overrides body-parser and csv-parse so the pre-commit Snyk gate passes. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
…d commit picker Covers the GitHub and FileUpload redeploy matrix, --commit [hash] with a picker over the environment commits, --last-upload and --data-dir, and waits on the deployment with a Ctrl-C stop that leaves it running. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
Fetches the deployment first, then goes through the shared confirm gate before sending the rollback. --reason is sent only when it is not blank. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
Cancel is a bodyless POST behind the shared confirm gate. Its not-allowed refusal, by code or by the raw 400 message, gets readable wording. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
dbe480f to
af4ad7b
Compare
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
…get output and add deployment pickers Create and rollback bodies no longer carry environment (the server DTOs reject it), --deployment is validated as 24 hex, get shows one-line commit messages without BUILD LOGS, a null deployment reads as not found, and rollback and cancel offer a picker. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
#claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
#claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
The merged flag refuses a malformed uid at parse time so no request is sent; blank values still read as absent and surrounding spaces are trimmed. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
…ormal tone Reword every user-facing message of the deployments commands and the shared upload and deployment-failure wording, drop the log-read notice, and report a malformed --deployment without oclif's parse prefix. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
#claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
#claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
Add the colon to the Deployment URL line, word a refused cancel with the deployment uid, and use the approved create and rollback failure sentences. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
siddharth-kulkarni-cs
left a comment
There was a problem hiding this comment.
Review summary
Overall this is a careful, well-layered addition. The five commands follow the resource pattern in AGENTS.md, the confirm gate is applied correctly, the request-body guard is a good class test, and table-cell sanitising in renderTable is a welcome hardening. On 6cd6ff0, tsc --noEmit and npm run lint are clean.
Inline comments, highest priority first:
- Should fix: the no-directory error lost its
--last-uploadhint. It was dropped by 0354f13.NoUploadDirectoryErroris now never caught, and the T27 title still claims the hint is there. This goes against TRD §4.8.2 rule 2. - Should fix: every failure message for a failed deployment points only at
launch:logs:get. That command is still planned (CL-7171) and not registered. This affectsprojects:createandenv:createtoo, and the retry hint and the "do not start another deployment yet" guidance were removed. - Question:
rollbackprints success right after an async API call. Per the API reference, the call only creates aPENDINGrollback event. - Commit messages go into the
--commitpicker unsanitised. This allows terminal escape injection from the repository's commit history. - Ctrl-C can be missed during the wait. An abort that lands during a poll goes unnoticed until the next sleep ends, and a second Ctrl-C is swallowed.
- Log-read failures are now silent in all three create flows.
- The
csv-parseoverride (4 → 7) leavescsv@5.5.3unable to load. It is latent today. - Optional checks before confirming a cancel, plus two nits.
Not inline:
- CI on this PR runs only the security scans. No unit or integration test job ran on this head. I couldn't run the jest suite in my environment either, so the green suite in this PR rests on local runs only. Please paste a
npm run test:coverageresult from the current head, or wire a test job. - The PR description is stale in one place. It says "
getprints alaunch:logs:gethint", butsrc/commands/launch/deployments/get.test.ts:112asserts that it doesn't. - Existing commands change output. The
Deployment URLlabel (nowDeployment URL:) inprojects:create, and the upload size and readability messages, are reworded. These are fine, but worth listing under Decisions, since they change existing commands. - Rollback UX differs from V1. TRD §4.7.5 says rollback is a "transport-only swap … same prompts, flags, confirm UX, output". V1 asked for
reasoninteractively, showed a review step of current live vs. target, and labelled deployments by#deploymentNumber. V2 drops all three, and its picker shows uid/status/short sha. That may be a deliberate simplification. If so, please record it, because users identify deployments by number in the Launch UI. - Not yet run live on dev11. The PR body says so, and I'd hold the merge until it has been, especially for rollback and cancel against the real error shapes. The cancel-not-allowed detection depends on an exact English server message, and the TRD marks those cancel codes as
[NEEDS RESEARCH].
Generated by Claude Code
…cancel Stop the wait loop at once when Ctrl-C lands during a poll, strip control characters from picker labels, and refuse cancelling a finished deployment before any question. Also name the scope in the variables hint and the topic. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
…its, number pickers deployments:rollback now reports the started rollback and waits until the target deployment is LIVE before printing success, or says how to check it. deployments:create words an empty upload directory with --data-dir and --last-upload, and the rollback and cancel pickers show the deployment number. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
#claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Harshi Shah <harshi.shah@contentstack.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
Brings CL-7170 (merged in #256) into this branch. The deployment watcher keeps one stop mechanism (v2-dev's, plus the abortable sleep and the terminal drain). The logs tests follow v2-dev's silent failed log read, and logs.presenter owns its scope hint now that the deployments presenter dropped it. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7Va7GuYHHbwwLbN1JUzkG
Jira: https://contentstack.atlassian.net/browse/CL-7170
What
Adds the V2 Deployments resource to
launch-cli:launch:deployments:list/:get—DEPLOYMENT UIDlabel, all 8 statuses, env vars as a count, no git fields for FileUpload, generic not-found wording (exit 2).launch:deployments:create— full TRD §4.8.2 redeploy matrix (exact body or exact error per cell),--last-uploadmakes no signed-URL call, wait/stream to LIVE/FAILED, Ctrl-C leaves the deployment running (exit 3). With no files to upload, the error names both--data-dirand--last-upload.--commitpicker overGET .../environments/:e/commits; no TTY → exit 2 naming--commit <sha>.launch:deployments:rollback/:cancel— confirm-gated (--yes, decline exit 3, no TTY exit 2); the mutation is never sent on a refusal. Rollback prints "started", then waits until the target deployment is LIVE before reporting success (the API is asynchronous). Pickers show#deploymentNumber.Decisions
CANCEL_NOT_ALLOWED; the CLI words both the code and that message.projects:createandenv:create);launch:logs:getships with CL-7171.launch:logs:get(CL-7171 follows this story; not in production yet).Deployment URL:label inprojects:create/env:create, and the reworded upload size/readability messages.csv-parseoverride (4 → 7) is outside the range declared bycsv@5.5.3; that module is not loaded by the CLI at runtime (only thetty-tablebin requires it).#deploymentNumberas V1 did.v2-dev(list/get, create + picker, rollback, cancel), followed by review-fix commits.Known gaps
docs/launch-cli-manual-tests).QA: the Launch QA agent tests CL-7170 in the repos once it is in QA; GoCD sanity covers dev11.
🤖 Generated with Claude Code
https://claude.ai/code/session_01V7Va7MQaPSfh5ua9RABfHr