Skip to content

feat: add guarded CCv2 build cleanup action - #1

Merged
anilkreddy merged 4 commits into
mainfrom
feat/initial-cleanup
Nov 14, 2026
Merged

anilkreddy merged 4 commits into
mainfrom
feat/initial-cleanup

Conversation

@anilkreddy

@anilkreddy anilkreddy commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Behavior

Add the initial Node 24 CCv2 build cleanup action with strict configuration, all-page discovery, combined age/count retention, protected-build decisions, bounded immutable plans, sequential deletion orchestration, sanitized reports/outputs, and dry-run-first consumer workflows. Reuse published @commercekit-tools/ccv2-client@0.0.3 and @commercekit-tools/notification-contract@0.0.3; do not duplicate OAuth, HTTP/retry infrastructure, event schemas, or webhook delivery.

Real apply is deliberately blocked: SAP's supported build response has no last-modified timestamp, and portal UI restrictions do not establish API enforcement of the four-hour eligibility rule. Candidates remain eligibility-unverified; no bypass input exists. HTTP 204 is described as deletion initiation only.

Validation evidence

  • Local complete suite: 302 tests passed, 14 files passed, zero skips; 100% statement, branch, function and line coverage, against unchanged 98% thresholds and no production-code exclusions.
  • Actual bundled action tested against the existing local sandbox: OAuth form/resource/header behavior, 401 refresh, read 429/500 recovery, 105-build pagination, protections, exact application scope, scheduled/current versus historical deployments, repeat runs, invalid data, instability, authorization failure, reports and summaries. Zero target API mutations, including blocked apply. Runs removed in finally.
  • Separate bundle tested against the exact-source packed notification candidate; actual cleanup event parsed/validated and counts/mode checked. Normal registry bundle remains separate and emits an explicit unsupported-event warning with empty notification output.
  • Frozen package install; formatting, ESLint, strict TypeScript, action metadata, actionlint/ShellCheck, public scan, ncc standalone bundle and byte-for-byte dist consistency passed. Production dependency audit: no known vulnerabilities.
  • Dependent candidate regressions: action-kit 277 tests; Notify 88 tests; sandbox 63 tests. See companion PRs for any additional post-handoff checks.
  • Normal bundle SHA-256: 857e04451c56b3c50f24ef70265ce725bfd585d121548cecc3020c2aa2886d20.
  • Exact-source notification tarball integrity: sha512-T+wt6X75QSHDpxHJDxqH797K1jO+YFKAbMLymqJ1rs78R0mWR8RT1bn53mwXviqAu7eO51YWMxm6CH6eW8iPtw==.

Detailed commands/provenance and PASS/BLOCKED/NOT RUN results: validation report, integration audit, sandbox scenarios, and candidate provenance.

Dependencies and blockers

  • Companion action-kit PR: minimal additive ccv2.build-cleanup.completed event/schema/factory; no client/transport changes or new package.
  • Companion Notify PR: cleanup presentation using existing Slack/Teams delivery. Published contract 0.0.3/current released Notify cannot support the event. Separately authorized publication, exact dependency pin/lockfile updates, and a compatible immutable Notify commit are required before normal notification readiness.
  • Companion sandbox PR: isolated fixture/race controls and initiation semantics; no Cloudflare configuration/deployment changes. Simulation is not production SAP evidence.
  • SAP eligibility evidence, operational protection review, separately authorized non-production validation and owner approvals remain release/apply blockers.
  • GitHub hosted CI/CodeQL results must be reviewed independently; local results do not imply remote checks passed. Package/source access may restrict fork CI. No privileged pull_request_target workflow.
  • Hosted sandbox, live SAP reads/deletion and webhook delivery were not run. Slow-network sandbox timeout/cancellation and actual token-expiry scenarios are documented as NOT RUN; corresponding transport/orchestration branches are covered separately.

Review state

Draft only. All implementation remains on the feature branch above the empty main review baseline. Security fix 29d454c1d0ff02a3619d325936ae00c2bc94a3a7 updates the audited development dependency, simplifies complete parenthesis encoding and rebuilds dist. Final head 2ff0d5280fcd4bcb58f80157ec808230b9400fa8 additionally pins the examples to that immutable validated fix.

No publication, release, tag, production enablement or real SAP deletion is authorized. All four implementation PRs remain drafts.

Companion draft PRs

These are coordinated draft changes. No merge, publication, tagging, deployment, production enablement, or real SAP deletion is authorized by this review. Keep the dependency-publication and SAP eligibility gates explicit.

Audit and CodeQL remediation — validated 2026-11-14

  • FIXED: GHSA-g3hv-75wg-m249. An exact pnpm override pins the affected dev-tool minimatch range to published 11.0.1 with regenerated lockfile integrity. Full pnpm audit now reports no known vulnerabilities. No ignored advisory or reduced severity/scope was used; the audit script now matches the full CI audit.
  • FIXED: both incomplete-string-escaping CodeQL findings. The global match now maps each parenthesis directly to %28/%29, retaining shared HTTPS validation. A regression checks repeated/nested parentheses and preserves existing percent encoding.
  • PASS: local complete validation: 302 tests, zero skips, 100% statements/branches/functions/lines; frozen install, full audit, formatting, lint, strict types, normal and exact-source candidate bundled sandbox E2E, dist consistency, metadata/actionlint and public scan.
  • PASS: hosted validate on exact final head 2ff0d5280fcd4bcb58f80157ec808230b9400fa8.
  • PASS: CodeQL analysis and CodeQL check, with zero check annotations.
  • SAP eligibility evidence, operational review, separately authorized non-production validation and compatible notification publication/pinning remain blocked. Passing these checks does not authorize real deletion or release.

Separate Dependabot review

Reviewed open Dependabot PRs across the four repositories. Only sandbox had such PRs.

  • Sandbox #15 was merged as an explicit dependency-only exception after repairing its missing Hono lockfile and verifying all local checks (60 tests) plus fresh hosted validation on exact head 2ba64030863f328734bb34b73c045f0c41af5624. Merge commit: b24db34313555bea3236ebd4c79e8afce64ab5c7. The repository has no automatic deployment/publication/live SAP workflow.
  • Sandbox #14 remains OPEN / NOT MERGED: its grouped tooling update fails generated Worker-type consistency and overlaps the Hono patch. It needs a separate repair and complete validation before merge.

The four coordinated implementation PRs remain open drafts with auto-merge disabled.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread src/reporting/result.ts Fixed
Comment thread src/reporting/result.ts Fixed
@anilkreddy
anilkreddy marked this pull request as ready for review November 14, 2026 17:14
@anilkreddy
anilkreddy merged commit bad5bdd into main Nov 14, 2026
3 checks passed
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.

2 participants