Repository navigation
fix(site): drop --deployment from site:open and never treat the preview screenshot as a URL - #297
Conversation
…ew screenshot as a URL A deployment's previewUrl is the screenshot the platform takes after it goes live (a .png on images.contentstack.io), not a site URL. site:open --deployment opened that image, and deploymentUrlOf fell back to it whenever deploymentUrl was empty, so the default site:open, the deploy follower's "Deployment URL:" line and the deployments:view URL row could show it too. - site:open opens the environment's live site only: --deployment is removed (agreed with Dhruv on CL-8789) and is now refused as an unknown flag, exit 2. - deploymentUrlOf reads deploymentUrl alone. When it is empty, site:open and every announcing command (projects:create, environments:create and now deployments:create, which reads the environment only in that case) fall back to the environment's domains; deployments:view shows "-". - One URL normalizer, core/url withScheme, shared by the deployment url, the domain fallback and the domain prompt: it trims, recognises a real scheme (a bare host like "http-api-ab12.contentstackapps.com" now gets https://) and skips whitespace-only values. - previewUrlOf is deleted, Deployment.previewUrl is documented as the screenshot, and the README is regenerated. - .talismanrc: refreshed the checksums of create.test.ts, deployment.create.test.ts, deployment.presenter.test.ts and README.md (false positives on "key", "secrets" and "Password" in test code and the regenerated command docs). #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
✅ 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 |
Brings in CL-8827 (#295). README.md merged cleanly. - .talismanrc: refreshed the checksums of README.md (merged file) and of the files CL-8827 changed whose v2-dev checksums were stale: environment.update.test.ts, env/get.test.ts, env/update.test.ts, env/update.ts, core/failure.test.ts, environment.inputs.ts, environment.presenter(.test).ts, environment.update.prompt(.test).ts, environment.update.ts and environments/types.ts. Every finding is a false positive on "password", "key", "secret" or "pass" in flag names, field names, prompts and test titles; no credential values. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
tejas-contentstack
left a comment
There was a problem hiding this comment.
A high-effort review found 4 issues (1 important, 3 nits), each posted as an inline comment. Not approving because of these findings.
- Important:
deployment.create.ts:137. The newenvironments.getlookup that fetches fallback domains runs after LIVE without error handling. If that one request fails, a deployment that is already live gets reported as a faileddeployments:create. - Nit:
deployment.create.ts:129.projects:createandenvironments:createstill use the domain snapshot taken before the build, so the three commands fall back to domains in different ways. - Nit:
deployment.presenter.ts:26.withSchemelets any scheme through, such asfile://orftp://, to the browser opener. - Nit:
core/url.ts:9. Stripping trailing slashes changes some URLs, and a value of/becomes a barehttps://.
— 🤖 Claude review (Opus 5.5, high effort), requested by tejas
Generated by Claude Code
🔒 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 |
… web URLs Review follow-ups on #297: - deployments:create reads the environment's domains only when the LIVE deployment carries no url; a failure of that read no longer fails the command, it just announces no url. A live deployment is never reported as a failed create. - core/url webUrlOf replaces withScheme. It keeps http(s) URLs as given and gives a bare host https://, keeps a path or query exactly (no trailing slash stripped from "https://host/app/" or "?next=/"), drops trailing slashes only from a bare host, and returns nothing for an empty, slash-only, scheme-only or non-web (file://, ftp://) value. The deployment url, the domain fallback and the domain prompt all use it. - .talismanrc: refreshed the checksum of deployment.create.test.ts (false positive on "key" in existing test code). #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🔒 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 |
|
/ship 2b summary — Fixed in 2467b7b: (1) the post-LIVE |
Jira: CL-8789
What
A deployment's
previewUrlis the screenshot the platform takes after it goes live (a.pngon images.contentstack.io), not a URL for the site. The CLI was treating it as one.launch:site:openopens the environment's live site only.--deploymentis removed (agreed with Dhruv on CL-8789). It used to open the screenshot, and the API has no per-deployment site URL to open instead. Passing it now fails as an unknown flag with exit 2, before any request.The screenshot never shows up as a URL.
deploymentUrlOfused to fall back topreviewUrlwhendeploymentUrlwas empty, so the image could reach:site:openDeployment URL:linedeployments:viewIt now reads
deploymentUrlalone. When that is empty,site:openand every command that announces the site fall back to the environment's domains:projects:create,environments:create, and nowdeployments:create, which reads the environment only in that case, so its normal path sends no extra request.deployments:viewshows-.One URL normalizer.
core/urlwithSchemeis now shared by the deployment URL, the domain fallback and the domain prompt. It trims, checks for a real scheme, and skips whitespace-only values. A bare host such ashttp-api-ab12.contentstackapps.comnow getshttps://; before, thestartsWith('http')check left it without a scheme.previewUrlOfis deleted,Deployment.previewUrlgets a doc comment saying it is the screenshot, and the README is regenerated (only thesite:opensection changes).Tests
siteUrlOf, deploy follower) now expect the domain, or no URL.--deploymentcases, 10 unit and 4 integration.--domainas an unknown flag now also covers--deployment(exit 2, nothing sent, no browser).deployments:createreads the environment and announces its domains only when the LIVE deployment carries no URL.httpgets a scheme.npm testpasses (196 suites, 3853 tests), and lint andtscare clean. Branch coverage is 100% onopen.ts,core/url.ts,site.url.tsandsite.prompt.ts.Follow-ups (separate PRs)
88-site-open.shstill has its--deploymentcases.launch-cli-v2-commands-reference.mdstill lists--deploymentforsite:open.#claude_code#
🤖 Generated with Claude Code