Skip to content

Stop deployment log polling after cancellation, Update configuration in rollback command and Update snyk vulnerabilities - #220

Merged
chhavi-mandowara-cstk merged 10 commits into
stagingfrom
development
Aug 14, 2026
Merged

Stop deployment log polling after cancellation, Update configuration in rollback command and Update snyk vulnerabilities#220
chhavi-mandowara-cstk merged 10 commits into
stagingfrom
development

Conversation

@chhavi-mandowara-cstk

Copy link
Copy Markdown
Contributor

fix: stop deployment log polling after cancellation
fix: ensure Apollo client is rebuilt after configuration update in rollback command (csdx launch:rollback)
chore: pin brace-expansion and fast-uri via npm overrides to resolve Snyk vulnerabilities
chore: pin js-yaml via npm override to resolve Snyk high-severity finding

AryanBansal-launch and others added 7 commits July 24, 2026 16:19
deploymentStatus terminal-state list was missing CANCELLED, so
csdx launch:logs kept polling the deployment-status and
deployment-logs queries indefinitely after a deployment was
cancelled.

Co-Authored-By: Rohan Agrawal <rohan.agrawal@contentstack.com>
…llback command (csdx launch:rollback)

- Added a call to prepareApiClients() after getConfig() to ensure the Apollo client has the correct project and organization headers based on the latest configuration.
…og-polling

fix: stop deployment log polling after cancellation
Add Contentstack Authentication toggle to project creation, Add support for choosing namespace in case of multiple github connections and Update package versions and server logs query
…Snyk vulnerabilities

Adds scoped npm overrides to patch two High-severity Snyk findings without
bumping @oclif/core or @contentstack/cli-utilities to a new major version:

- brace-expansion: patched in place per minimatch parent (5.0.7 -> 5.0.9 under
  minimatch@10.2.5, 2.1.2 -> 2.1.4 under minimatch@9.0.9/5.1.9) since the tree
  carries three brace-expansion major lines at once and a flat override would
  force one version onto all of them.
- fast-uri: 3.1.3 -> 3.1.5 (single instance, via cli-utilities > conf > ajv).

Verified with npm install, npm run build, npm test, and a clean re-scan
(snyk test: 0 vulnerable paths, was 4 issues / 23 paths).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ding

js-yaml@4.3.0 (pulled in transitively via @contentstack/cli-utilities,
eslint-config-oclif, and mocha) is affected by SNYK-JS-JSYAML-18593780
(Inefficient Algorithmic Complexity, High severity), fixed in 4.3.1.
All declared ranges (^4.1.0 etc.) already permit the patch bump, so a
flat override is enough — no code changes required.

Updates the .talismanrc checksum for package-lock.json to match the
new lockfile hash (Talisman's secret scanner flags dependency hash
changes for review).

Verified with npm ci, npm run build, npm test, and a clean re-scan
(snyk test: 0 vulnerable paths, was 1 issue / 2 vulnerable paths).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@chhavi-mandowara-cstk
chhavi-mandowara-cstk requested review from a team as code owners August 14, 2026 07:46
Copilot AI lite review requested due to automatic review settings August 14, 2026 07:46
@snyk-io

snyk-io Bot commented Aug 14, 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 0 25 ✅ Passed
🟡 Medium Severity 0 0 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

✅ BUILD PASSED - All security checks passed

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.

Pull request overview

This PR updates log polling behavior and deployment status handling (including CANCELLED), rebuilds API clients after rollback configuration changes, and applies npm overrides to address Snyk-reported vulnerabilities.

Changes:

  • Update serverless log polling to use getServerlessLogsV2 and treat CANCELLED as a terminal deployment status (including adapter exit behavior).
  • Ensure rollback rebuilds API clients after configuration is loaded/updated.
  • Add npm overrides (and lockfile updates) to pin vulnerable transitive dependencies.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/unit/util/logs-polling-utilities.test.ts Update unit test fixture data to match getServerlessLogsV2 response shape.
src/util/logs-polling-utilities.ts Switch server log extraction to data.getServerlessLogsV2.logs.
src/util/logs-polling-utilities.test.ts Add Jest coverage for cancellation stopping polling and validate config includes CANCELLED.
src/graphql/queries.ts Update serverless logs GraphQL query to GetServerlessLogsV2 / getServerlessLogsV2.
src/config/index.ts Add CANCELLED to terminal deploymentStatus list.
src/commands/launch/rollback.ts Rebuild API clients after config load (rollback flow).
src/commands/launch/logs.ts Fix environment selection to set deployments for the selected environment (not the first).
src/adapters/github.ts Exit non-zero when deployment is FAILED or CANCELLED.
src/adapters/github.test.ts Add test coverage for CANCELLED exit behavior.
src/adapters/file-upload.ts Exit non-zero when deployment is FAILED or CANCELLED.
src/adapters/file-upload.test.ts Add test coverage for CANCELLED exit behavior.
package.json Add overrides pins for fast-uri, js-yaml, and brace-expansion via minimatch selectors.
package-lock.json Lockfile updates reflecting override/pin changes.
.talismanrc Update checksum for modified package-lock.json.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/util/logs-polling-utilities.test.ts
Comment thread src/commands/launch/rollback.ts
naeem-shakh-cs
naeem-shakh-cs previously approved these changes Aug 14, 2026
Copilot AI review requested due to automatic review settings August 14, 2026 11:39
@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 0 25 ✅ Passed
🟡 Medium Severity 0 0 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

✅ BUILD PASSED - All security checks passed

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.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/commands/launch/rollback.ts:58

  • prepareApiClients() is now called in init() and again unconditionally in run(), which causes redundant client recreation (and the added blank line includes trailing whitespace that can fail linting). Since the intent is to rebuild clients only after getConfig() updates the shared config, call prepareApiClients() inside that conditional instead of unconditionally.
    if (!this.flags.environment) {
      await this.getConfig();
    }
    
    await this.prepareApiClients();

@chhavi-mandowara-cstk
chhavi-mandowara-cstk merged commit a2df5fd into staging Aug 14, 2026
8 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.

8 participants