Skip to content

feat(cache): add launch:cache:purge to purge an environment's CDN cache (+Claude) - #255

Merged
Harshi-Shah-CS merged 4 commits into
v2-devfrom
CL-7172
Oct 28, 2026
Merged

Harshi-Shah-CS merged 4 commits into
v2-devfrom
CL-7172

Conversation

@Harshi-Shah-CS

Copy link
Copy Markdown
Contributor

Jira: https://contentstack.atlassian.net/browse/CL-7172

Summary. csdx launch:cache:purge --org --project --env with exactly one of --path, --tags, --hosts purges an environment's CDN cache: it reads the environment, then sends one POST …/revalidate-cdn-cache.

  • --path /blog is an exact match; a trailing /* sets isPrefix: true (/* alone purges / as a prefix). A path must start with /.
  • --tags / --hosts are trimmed, de-duplicated (first-seen order); an empty list exits 2.
  • exactlyOneOf('path','tags','hosts') is the only guard (exit 2, names the flags supplied).
  • Success names what was purged, the match type and the environment's name, even when --env was a UID.
  • Quota 429 (launch.ORGANIZATION.REVALIDATE_RATE_LIMIT_EXCEEDED) gets the daily-limit message, exit 1, exactly one POST; 403 gets a permission message; foreign project/environment gets the generic not-found wording, exit 2, before any POST.
  • launch:cache topic added to csdx launch --help.

src/transport change. New RestRequest.noRetryCodes: a 429 carrying a listed code is final. Only CacheApi.purge sets it; all other requests and 429s retry as before. Recorded in AGENTS.md.

Also in this PR. fix(deps): express 4.22.3 (qs 6.17.0, body-parser 1.20.9) clears two Snyk advisories. .talismanrc checksums refreshed for 6 edited files (low-severity prose and test titles on v2-dev; no credentials).

Known gaps.

  • Snyk still lists 4 issues with no upgrade or patch: adm-zip 0.6.1, csv-parse 4.16.3 (via cli-utilities > tty-table), deepmerge 4.3.1, picomatch 4.0.5. Not from this change; --fail-on=all passes.
  • Verification items for dev11: manual purge by each criterion, including --path "/*"; docs/launch-cli-manual-tests/run.sh cases (that path is not in this repo).
  • 2 upload.archive tests fail as root in the sandbox, identically on v2-dev.

QA: the Launch QA agent tests CL-7172 in the repos once it is in QA; GoCD sanity covers dev11.

🤖 Authored by an AI agent (Claude Code).


Generated by Claude Code

claude and others added 4 commits October 28, 2026 09:05
Raise the express range to ^4.22.3 and refresh the lockfile so body-parser resolves to 1.20.9 and qs to 6.17.0, clearing the Snyk qs and body-parser advisories.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Sakshi Koli <sakshi.koli@contentstack.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RRzARBNPiGXBj5RQsYpVvQ
Add the cache resource (CacheApi, inputs, errors, presenter) and the launch:cache:purge command, which reads the environment and sends one revalidate-cdn-cache POST for exactly one of --path, --tags or --hosts. Registers the launch:cache topic and the cache layering edge.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Sakshi Koli <sakshi.koli@contentstack.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RRzARBNPiGXBj5RQsYpVvQ
Add RestRequest.noRetryCodes (a src/transport change) so a 429 carrying a listed code is final; only CacheApi.purge opts out, for the daily purge quota, which a retry cannot clear. Word the quota 429, the 403, a missing environment and the CLI-bug code, and report a 404 on the environment read as a usage error before any POST.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Sakshi Koli <sakshi.koli@contentstack.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RRzARBNPiGXBj5RQsYpVvQ
Refreshed the checksum of the existing .talismanrc entries for: AGENTS.md, README.md, src/transport/rest-client.ts, src/transport/rest-client.test.ts, test/guards/layering.test.ts, test/integration/retired-commands.test.ts.

Talisman flagged only low-severity prose, test titles and key/value identifiers already on v2-dev; no credentials.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Sakshi Koli <sakshi.koli@contentstack.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RRzARBNPiGXBj5RQsYpVvQ
@Harshi-Shah-CS
Harshi-Shah-CS requested review from a team as code owners October 28, 2026 09:28
@snyk-io

snyk-io Bot commented Oct 28, 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 9 25 ✅ Passed
🟡 Medium Severity 0 4 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: 9
  • Medium without fixes: 4
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@Harshi-Shah-CS
Harshi-Shah-CS merged commit 0e73b02 into v2-dev Oct 28, 2026
7 checks passed
@Harshi-Shah-CS
Harshi-Shah-CS deleted the CL-7172 branch October 28, 2026 09:49
@Harshi-Shah-CS Harshi-Shah-CS self-assigned this Oct 28, 2026
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.

4 participants