feat(bulk-assets): retry publishing assets whose scan was pending - #363
feat(bulk-assets): retry publishing assets whose scan was pending#363naman-contentstack wants to merge 2 commits into
Conversation
Assets still being scanned for malware were skipped on every publish run with only a console warning, leaving no way to publish them once the scan finished. Record those skips to pending-scan.json in the bulk operation folder, and add --retry-pending to re-check their status and publish the ones that came back clean. The log is self-pruning: a retry drops the entries it published along with any that turned quarantined, keeping only those still scanning. It is also excluded from clearLogs(), since a scan can outlast the gap between two unrelated runs. Quarantined assets are never retried, and the flag is rejected for unpublish, delete and move — scan status only gates publish. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ 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:
✅ BUILD PASSED - All security checks passed |
✅ 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
ℹ️ 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:
✅ BUILD PASSED - All security checks passed |
Problem
When
cm:stacks:bulk-assetspublishes, every asset carries a malware scan statusof
clean,pendingorquarantined.pendingonly means the scan has notfinished yet, but it was treated the same as
quarantined— skipped with aconsole warning and then forgotten. Nothing recorded which assets were skipped,
so once a scan finished there was no way to publish them short of re-running the
whole publish and hoping the timing worked out. For a large publish that is a
handful of assets silently left unpublished with no path forward.
Fix
--data-dirflow) now recordpending-skipped assets to
pending-scan.jsonin the bulk operation folder,alongside the existing success/failed logs. Each entry carries uid, locale,
version, environments, apiKey and branch — enough to rebuild the publish call
without re-fetching the asset.
--retry-pending <folder>flag re-checks scan status via the existingAssetService.fetchScanStatusByUIDs, then publishes only the assets that cameback clean, through the same
executeBulkOperationpath every other flow uses.Config is read back from the log, so no
--operation/--environments/--localesneeded (CLI flags still override).
dropping what it published and anything that turned quarantined. Quarantined
assets are never retried — that skip is intentional and permanent.
pending-scan.jsonis deliberately excluded fromclearLogs(). A scan canoutlast the gap between two unrelated runs, and wiping it would lose the only
record of what needs retrying.
--data-dirpathcollects entries through its streaming loop and writes once at the end, so the
one-chunk-at-a-time memory behaviour is preserved.
--retry-pendingis rejected forunpublish,deleteandmove, since scanstatus only gates publish.