Stop deployment log polling after cancellation, Update configuration in rollback command and Update snyk vulnerabilities - #220
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
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>
✅ 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 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
getServerlessLogsV2and treatCANCELLEDas 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.
chore:upgrade launch-cli package version
a555987
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
There was a problem hiding this comment.
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 ininit()and again unconditionally inrun(), 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 aftergetConfig()updates the shared config, callprepareApiClients()inside that conditional instead of unconditionally.
if (!this.flags.environment) {
await this.getConfig();
}
await this.prepareApiClients();
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