Stop deployment log polling after cancellation, Update configuration in rollback command and Update snyk vulnerabilities - #222
Conversation
… updated windowed server logs query
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
✅ 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
✅ BUILD PASSED - All security checks passed |
There was a problem hiding this comment.
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
CANCELLEDas 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.
| if (!this.flags.environment) { | ||
| await this.getConfig(); | ||
| } | ||
|
|
||
| await this.prepareApiClients(); |
| "fast-uri": "^3.1.5", | ||
| "js-yaml": "^4.3.1", |
| 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(); | ||
| }); |
| 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(); | ||
| }); |
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