Skip to content

fix(environments): skip env:update when flags match the current settings - #296

Open
SakshiKoli-CS wants to merge 1 commit into
v2-devfrom
CL-8833
Open

SakshiKoli-CS wants to merge 1 commit into
v2-devfrom
CL-8833

Conversation

@SakshiKoli-CS

Copy link
Copy Markdown
Contributor

Jira: CL-8833

What

launch:env:update sent a PUT whenever any flag was passed, even when every value equalled the environment's current setting. It reported "✔ Environment updated successfully." and moved updatedAt. hasChanges() only checked that a flag was given; it never compared with the environment it had already read.

  • After reading the environment, the updater drops every flag whose value matches the current setting. Toggles and response mode are compared in their flag form (enable/disable, streaming/buffered).
  • If nothing is left, it prints "Environment not updated. No changes were entered.", exits 0 and sends nothing. No disable confirmation is asked for a setting that is already off.
  • --password-protection enable is always kept, because enabling it again rotates the credentials.
  • The interactive Response mode prompt defaults to the current mode when the API reports it.
  • toggleOf / responseModeOf now live in environment.inputs.ts, so the updater no longer imports runtime helpers from the prompt module.

Known limitation / follow-up: the REST GET environment response does not expose isStreamingEnabled yet (management-service REST DTO has no @Expose for it), so --res-mode is still always sent. The CLI compares it automatically once the API returns it.

Overlap: #295 (CL-8827) drops --description from the same files. Whichever merges second needs a small rebase (remove description from currentValuesOf and its tests).

Tests

  • Unit: unchanged flags for every setting send nothing; mixed changed/unchanged flags send only the changes; already-on password protection is still re-enabled; an unchanged --framework dropped while --server-cmd is checked against the current framework; response-mode prompt default.
  • Integration: all flags matching the fixture exit 0 with the no-changes line and no PUT.
  • npm test: 3883/3883 passed; tsc and eslint clean.

#claude_code#
🤖 Generated with Claude Code

…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>
@SakshiKoli-CS
SakshiKoli-CS requested review from a team as code owners November 19, 2026 07:13
@snyk-io

snyk-io Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 2 25 ✅ Passed
🟡 Medium Severity 0 1 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ 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:

  • Critical without fixes: 0
  • High without fixes: 2
  • Medium without fixes: 1
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

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.

1 participant