Repository navigation
fix(environments): skip env:update when flags match the current settings - #296
Conversation
…ings launch:env:update sent a PUT whenever any flag was passed, even when every value equalled what the environment already had: it reported success and moved updatedAt. hasChanges() only checked that a flag was given and never compared with the environment it had just read. The updater now drops each flag whose value matches the current setting (toggles and response mode compared in their flag form) before deciding; with nothing left it prints "No changes were entered", exits 0 and sends nothing, and asks no disable confirmation for a setting already off. --password-protection enable is always kept, since re-enabling rotates the credentials. The interactive response-mode prompt defaults to the current mode when the API reports it. The REST GET environment does not return isStreamingEnabled yet, so --res-mode is still always sent until management-service exposes it. .talismanrc checksums refreshed for the three edited files. #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 |
dhruv-parekh-cs
left a comment
There was a problem hiding this comment.
Reviewed the whole PR: 0 high, 0 medium, 2 low (inline). Neither blocks approval.
— 🤖 launch-pr-review-agent (Claude)
Generated by Claude Code
Brings in #295, which removed the environment description from env:create, env:update and env:get. The unchanged-value filter no longer compares a description, and its test case drops the description flag. Refreshes the talisman checksum of environment.update.test.ts and the generated README. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The v2-dev merge changed files that already have reviewed .talismanrc entries (CL-8827's env:create/update/get and failure files, plus this fix's environment files). Only their checksums are refreshed; no new entries or detectors are added. #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 |
- toggleOf and responseModeOf treat null like undefined, so a setting the API reports as null no longer drops the user's flag; null cases added for cache priming, auto deploy, cs-auth and response mode. - Remove the code comment on currentValuesOf (AGENTS.md: no code comments); the rotation test already pins that behaviour. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
dhruv-parekh-cs
left a comment
There was a problem hiding this comment.
Re-review since 8dc67c6 (merge of v2-dev after CL-8827, talisman refresh): 0 high, 0 medium, 0 low new.
Still open from the earlier review (both low, neither blocks approval):
- Low
src/environments/environment.update.ts:91:toggleOf/responseModeOfcheck only=== undefined, so anullfrom the API still counts as a known current value. - Low
src/environments/environment.update.ts:82: the code comment AGENTS.md forbids is still there.
— 🤖 launch-pr-review-agent (Claude)
Generated by Claude Code
|
/ship 2b summary — Fixed: null treated as an unknown current value (+ null test cases); removed the code comment on currentValuesOf (both in 81ed2c2). Resolved: both launch-pr-review-agent threads. Left for human: none. General comments: Snyk and GitHub Actions scan-status posts only (no action requested). Also merged v2-dev after #295 (CL-8827) dropped --description and refreshed the affected talisman checksums. Next: needs a human approval to merge. |
🔒 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 |
dhruv-parekh-cs
left a comment
There was a problem hiding this comment.
Re-review since a907f11 (null is not a known current value): 0 high, 0 medium, 1 low (inline).
Both lows from the earlier review are fixed at this head: toggleOf/responseModeOf now treat null as unknown, and the code comment is gone. 1 low open in total, so this doesn't block approval.
— 🤖 launch-pr-review-agent (Claude)
Generated by Claude Code
tejas-contentstack
left a comment
There was a problem hiding this comment.
High-effort review found 6 findings, so this isn't an approval. 1 is a bug that was already there before this PR: the interactive Response mode prompt defaults to buffered while isStreamingEnabled is unknown. The other 5 are nits: re-applying --cs-auth/--cache-priming is now skipped, passwordProtection can be absent from the response, the Environment type doesn't allow the null values the code now handles, the no-changes message doesn't say which flags were skipped, and an unchanged --server-cmd now skips the framework check. None of them blocks the PR. Details are in the inline comments. All checks pass, and the PR is not a draft.
— 🤖 Claude review (Opus 5.5, high effort), requested by tejas
Generated by Claude Code
…n Environment - When flags were passed and every one matches the current settings, env:update now prints "Environment not updated: --cs-auth, --cache-priming already match the current settings." instead of "No changes were entered"; the interactive checklist keeps the old line. - Environment declares the toggles and isStreamingEnabled as boolean | null and serverCommand as string | null, matching the wire. The compiler then surfaced env:get showing "disabled" for a null toggle; it now shows "-". #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
04691ce
dhruv-parekh-cs
left a comment
There was a problem hiding this comment.
Re-review since 81ed2c2 (name matching flags, allow null in Environment): 0 high, 0 medium, 0 low new.
Still open from an earlier review (low, doesn't block approval; left as is by decision with the author):
- Low
src/environments/environment.inputs.ts:36/environment.update.prompt.ts:180: the interactive toggle prompt has no default when the API reportsnull, and the prompt test has nonullcase.
1 low open in total, so this is approved.
— 🤖 launch-pr-review-agent (Claude)
Generated by Claude Code
…first response mode, server-cmd check - --cs-auth is always sent, even when it matches the current setting, so the server re-applies Contentstack Authentication (it re-syncs the edge config on every write). The interactive answer is sent as given too. - The interactive Response mode prompt lists streaming first and starts on it while the API does not report the current mode. - --server-cmd is checked against the framework before unchanged flags are dropped, so an unchanged --server-cmd on a framework that takes none is refused instead of reported as matching. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…emoval) Only .talismanrc conflicted: the checksums of this branch's environment files are kept, the new v2-dev entries are taken as is. #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 |
dhruv-parekh-cs
left a comment
There was a problem hiding this comment.
Re-review since 04691ce (always send --cs-auth, streaming-first response mode, server-cmd check before dropping unchanged flags; merge of v2-dev after #297): 0 high, 0 medium, 0 low new.
Still open from an earlier review (low, doesn't block approval; left as is by decision with the author):
- Low
src/environments/environment.inputs.ts:36/environment.update.prompt.ts:187: the interactive toggle prompt has no default when the API reportsnull, and the prompt test has nonullcase.
1 low open in total, so this is approved.
— 🤖 launch-pr-review-agent (Claude)
Generated by Claude Code
|
/ship 2b summary (final) — Fixed: null treated as unknown; code comment removed; matching flags named in the no-changes message; Environment type allows null (and env:get shows '-' for a null toggle); --cs-auth always sent; Response mode lists streaming first and starts on it when the mode is unknown; --server-cmd checked against the framework before unchanged flags are dropped. Left as is by decision: --password-protection with an absent passwordProtection (unknown → sent); toggle prompt with an unknown value starts on the first option. All review threads resolved, all checks green; merging (squash). |
🔒 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 |
🔒 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 |
Merges #296 (env:update skips unchanged settings) and #300 (functions:serve names the user's file in its errors). The only conflict was .talismanrc: v2-dev's version is kept and the checksums of every file changed on either side are recomputed from the merged content. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Jira: CL-8833
What
launch:env:updatesent aPUTwhenever any flag was passed, even when every value equalled the environment's current setting. It reported "✔ Environment updated successfully." and movedupdatedAt.hasChanges()only checked that a flag was given; it never compared with the environment it had already read.enable/disable,streaming/buffered).--password-protection enableis always kept, because enabling it again rotates the credentials.toggleOf/responseModeOfnow live inenvironment.inputs.ts, so the updater no longer imports runtime helpers from the prompt module.Known limitation / follow-up: the REST
GETenvironment response does not exposeisStreamingEnabledyet (management-service REST DTO has no@Exposefor it), so--res-modeis still always sent. The CLI compares it automatically once the API returns it.Overlap: #295 (CL-8827) drops
--descriptionfrom the same files. Whichever merges second needs a small rebase (removedescriptionfromcurrentValuesOfand its tests).Tests
--frameworkdropped while--server-cmdis checked against the current framework; response-mode prompt default.PUT.npm test: 3883/3883 passed;tscand eslint clean.#claude_code#
🤖 Generated with Claude Code