Skip to content

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

Open
chhavi-mandowara-cstk wants to merge 10 commits into
mainfrom
staging
Open

Stop deployment log polling after cancellation, Update configuration in rollback command and Update snyk vulnerabilities#222
chhavi-mandowara-cstk wants to merge 10 commits into
mainfrom
staging

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 10 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
…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>
chore:upgrade launch-cli package version
Stop deployment log polling after cancellation, Update configuration in rollback command and Update snyk vulnerabilities
@chhavi-mandowara-cstk
chhavi-mandowara-cstk requested review from a team as code owners August 14, 2026 17:13
Copilot AI lite review requested due to automatic review settings August 14, 2026 17:13
@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 deployment lifecycle handling so polling and command flows react correctly to cancelled deployments, refreshes API clients after rollback config changes, and applies npm overrides intended to address reported Snyk vulnerabilities.

Changes:

  • Treat CANCELLED as a terminal deployment status and ensure log polling stops accordingly.
  • Exit with failure for cancelled deployments in adapters, with added Jest coverage.
  • Update rollback command to rebuild Apollo clients after config updates; bump package version and add security-related npm overrides.

Reviewed changes

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

Show a summary per file
File Description
src/util/logs-polling-utilities.test.ts Adds regression tests ensuring polling stops when deployment status becomes CANCELLED.
src/config/index.ts Adds CANCELLED to the default list of terminal deployment statuses.
src/commands/launch/rollback.ts Rebuilds API clients after getConfig() in rollback flow.
src/adapters/github.ts Treats CANCELLED like FAILED (exit code 1 after log viewing).
src/adapters/github.test.ts Adds test coverage for CANCELLED deployment handling (new-project path).
src/adapters/file-upload.ts Treats CANCELLED like FAILED (exit code 1 after log viewing).
src/adapters/file-upload.test.ts Adds test coverage for CANCELLED deployment handling (new-project path).
package.json Bumps version and adds npm overrides to address vulnerabilities.
.talismanrc Updates checksum for package-lock.json ignore entry.

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

Comment on lines 54 to +58
if (!this.flags.environment) {
await this.getConfig();
}

await this.prepareApiClients();
Comment thread package.json
Comment on lines +120 to +121
"fast-uri": "^3.1.5",
"js-yaml": "^4.3.1",
Comment on lines +726 to +748
it('should exit with code 1 when deployment status is CANCELLED for new project', async () => {
const githubInstance = new GitHub({
config: {
isExistingProject: false,
currentDeploymentStatus: DeploymentStatus.CANCELLED,
},
log: logMock,
exit: exitMock,
} as any);

try {
await githubInstance.run();
} catch (error: any) {
expect(error.message).toBe('1');
}

expect(handleNewProjectMock).toHaveBeenCalled();
expect(prepareLaunchConfigMock).toHaveBeenCalled();
expect(showLogsMock).toHaveBeenCalled();
expect(exitMock).toHaveBeenCalledWith(1);
expect(showDeploymentUrlMock).not.toHaveBeenCalled();
expect(showSuggestionMock).not.toHaveBeenCalled();
});
Comment on lines +108 to +130
it('should exit with code 1 when deployment status is CANCELLED for new project', async () => {
const fileUploadInstance = new FileUpload({
config: {
isExistingProject: false,
currentDeploymentStatus: DeploymentStatus.CANCELLED,
},
log: logMock,
exit: exitMock,
} as any);

try {
await fileUploadInstance.run();
} catch (error: any) {
expect(error.message).toBe('1');
}

expect(handleNewProjectMock).toHaveBeenCalled();
expect(prepareLaunchConfigMock).toHaveBeenCalled();
expect(showLogsMock).toHaveBeenCalled();
expect(exitMock).toHaveBeenCalledWith(1);
expect(showDeploymentUrlMock).not.toHaveBeenCalled();
expect(showSuggestionMock).not.toHaveBeenCalled();
});
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.

7 participants