Skip to content

refactor: use shared Action Kit packages - #6

Merged
anilkreddy merged 7 commits into
mainfrom
refactor/use-action-kit-0.0.2
Nov 12, 2026
Merged

anilkreddy merged 7 commits into
mainfrom
refactor/use-action-kit-0.0.2

Conversation

@anilkreddy

@anilkreddy anilkreddy commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Replace duplicated authentication/transport and NotificationEvent code with the exact published @commercekit-tools/ccv2-client@0.0.2 and @commercekit-tools/notification-contract@0.0.2 packages. Build lifecycle, inputs/outputs, status mapping, result shape, failure output ordering, summaries, and logging remain locally owned. action.yml is unchanged.

Base: ebdc830161cf9122121ddeb137d005f375063997. See docs/shared-packages.md for the responsibility inventory.

Shared packages and access

  • Shared token manager handles form-encoded technical-user OAuth, memory-only token caching, proactive expiry refresh and missing-expiry reuse.
  • Shared client handles the approuter bearer header, validated URLs, bounded response/request transport, retry/backoff, problem facts and redaction.
  • Shared notification factory/validator/types/context/links replace the vendored schema, update script, and direct Ajv imports. Local adapters preserve Build error codes and disclosure policy.
  • .npmrc contains only the scoped GitHub Packages registry. CI quality, cross-platform jobs, and the manual Sandbox workflow use read-only package permissions and expose GITHUB_TOKEN only during installation. No credential is committed.
  • Published versions installed successfully locally and in all four PR CI installation steps using this repository’s scoped GITHUB_TOKEN, confirming Actions read access to both packages.

Mutation safety and compatibility

Create-build calls explicitly use unsafe-mutation with one authorized 401 replay. Timeout, network failure, 429 and 5xx never trigger automatic mutation retry. Progress calls explicitly use safe-read with bounded transient retries and one 401 replay. Regression tests assert exact mutation attempt counts, refresh failure classification, Retry-After, request counters, and rejection of array/empty/binary endpoint responses.

Sixteen fixtures captured from the original implementation compare complete result/event JSON, output order, and summaries, normalizing only event identity/time and comparing JSON structurally. Every fixture validates through the published contract. The original seven outputs and eleven inputs remain unchanged.

Validation

Node 24.21.0 / pnpm 12.6.0. Executed and passed:

  • pnpm format:check, pnpm lint, pnpm typecheck, pnpm contracts:check
  • pnpm test, pnpm test:coverage: 127 tests in 7 suites
  • Coverage: statements 99.59%, branches 98.39%, functions 100%, lines 99.57%; all thresholds remain 95%
  • pnpm audit: no known vulnerabilities
  • pnpm bundle, pnpm bundle:check, pnpm scan:public, pnpm quality

The bundle executes from an isolated temporary directory without repository node_modules or registry credentials and only synthetic endpoint responses. Its size changes from 678,041 to 687,633 bytes (+9,592 bytes, 1.41%), reflecting the shared transport/validator helpers. Both package licenses are included; reproducibility passes.

Follow-up duplication audit delegates credential/runtime/completion/error types, approved event field selection and default source metadata, and bounded event JSON parsing to package APIs. Required Build-specific adapters are documented in docs/shared-packages.md.

All PR checks passed for 3fbb7af4e1cabb78fe9162465ee1ec96d4c3eada: quality, Linux/macOS/Windows cross-platform, CodeQL analysis and scan. CI · CodeQL.

Scope and release status

No Notify, Deploy, Sandbox, or legacy repository modifications. Guarded Sandbox scenarios and cleanup are retained; no live Sandbox or real SAP requests were executed. No provider delivery logic.

UNRELEASED. Do not merge automatically. No tags, GitHub Release, or Marketplace publication.

@anilkreddy
anilkreddy merged commit 28af0c6 into main Nov 12, 2026
6 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.

1 participant