Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Contributing

Normal development uses exact published notification-contract 0.0.6 and
ccv2-client 0.0.3. A normal frozen installation and the existing quality command
validate notifications, input masking and shared summaries. No source-tarball
preparation, candidate environment flag or action-kit checkout is needed.
[Reporting evidence](docs/consistent-reporting.md) retains the prior source-stage
provenance separately.

Use Node 24.21.0 and pnpm 12.6.0 (`corepack enable`). Install with `pnpm install --frozen-lockfile`. The package is private and must not be published to npm.

Run `pnpm format`, `pnpm lint`, `pnpm typecheck`, `pnpm contracts:check`, `pnpm test`, `pnpm test:coverage`, `pnpm audit`, `pnpm bundle`, `pnpm bundle:check`, `pnpm scan:public`, and `pnpm quality`. Coverage gates require 95% statements, branches, lines, and functions. Commit reproducible dist and its license inventory.

Tests use synthetic fixtures and mocked native fetch. Never use customer credentials, real SAP subscriptions, captured production responses, or private source. Review all staged files and scan public content before each commit.

Shared packages are pinned exactly to `@commercekit-tools/notification-contract@0.0.3` and `@commercekit-tools/ccv2-client@0.0.3`. The repository `.npmrc` selects GitHub Packages for this scope. Configure your personal read credential in your user-level `.npmrc`; never put a token in the repository. Use `npm config get userconfig` to check which configuration your shell selects if an IDE overrides it. Do not print authentication settings in diagnostics.
Shared packages are pinned exactly to `@commercekit-tools/notification-contract@0.0.6` and `@commercekit-tools/ccv2-client@0.0.3`. The repository `.npmrc` selects GitHub Packages for this scope. Configure your personal read credential in your user-level `.npmrc`; never put a token in the repository. Use `npm config get userconfig` to check which configuration your shell selects if an IDE overrides it. Do not print authentication settings in diagnostics.

Repository Actions need read access to both packages. CI uses `contents: read`, `packages: read`, setup-node registry configuration, and `NODE_AUTH_TOKEN` from `secrets.GITHUB_TOKEN` for install steps only. The repository must be granted access in each package's Actions access settings. A successful local install does not prove that the repository token has access.

Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CommerceKit CCv2 Deploy

> **Published reporting dependency:** this unreleased Action now consumes exact
> notification-contract 0.0.6 from GitHub Packages, with a regenerated registry
> lockfile and bundled runtime. All input names, safe status details and GitHub
> run summaries use the shared formatting and masking contract. Normal validation
> is being recorded in [the reporting report](docs/consistent-reporting.md).
> Existing input and remote-operation behavior is unchanged.

**UNRELEASED. No v1 tag exists.** Deploy existing SAP Commerce Cloud builds using Cloud Portal technical-user OAuth and provider-neutral NotificationEvent v1 outputs. Build creation is not a public feature.

## Authentication
Expand Down Expand Up @@ -138,14 +145,14 @@ Safe reads and token requests retry selected transient errors at most three atte

## Result and events

`result-json` is a compact allowlisted schemaVersion 1 object containing operation, outcome, known deployment/build/environment identifiers, modes, last vendor status/percentage, poll count, duration, actionRequired, decision, newDeploymentCode, timedOut, cancellation requested/rollback flags, trafficSplit updated flag, and safe error code/message. Unknown optional fields are omitted. Each JSON output is bounded to 16 KiB. No raw responses, stage/history data, reasons, credentials, or traffic entities are output.
`result-json` is a compact allowlisted schemaVersion 1 object containing operation, outcome, known deployment/build/environment identifiers, modes, last vendor status/percentage, poll count, duration, actionRequired, decision, newDeploymentCode, timedOut, cancellation requested/rollback flags, trafficSplit updated flag, and safe error code/message. Unknown optional fields are omitted. Each structured JSON output is bounded to 64 KiB, aligned with the shared parser and cleanup. No raw responses, stage/history data, reasons, credentials, or traffic entities are output.

DEPLOYED → success; FAIL → failure; UNDEPLOYED → cancelled; manual/canary handoff → action-required; timeout, auth/API/client errors or undocumented status → internal-error. Handoffs emit `ccv2.deployment.action-required`; all other final events emit `ccv2.deployment.completed`. Events validate offline through the pinned [shared notification contract](contracts/README.md). Only approved GitHub context variables are read. Links include a validated workflow URL; no Cloud Portal URL is guessed.

See [API contract](docs/api-contract.md), [Sandbox](docs/sandbox.md), [security](SECURITY.md), [contributing](CONTRIBUTING.md), and [release gates](RELEASING.md).

## Shared packages

Exact runtime pins are `@commercekit-tools/notification-contract@0.0.3` and `@commercekit-tools/ccv2-client@0.0.3`. The former owns NotificationEvent v1 types, deployment event creation, validation, context, links, and event text sanitization. The latter provides framework-independent technical-user OAuth and CCv2 HTTP transport, including token refresh, URL validation, timeouts, redaction, and safe-read/unsafe-mutation policies.
Exact runtime pins are `@commercekit-tools/notification-contract@0.0.6` and `@commercekit-tools/ccv2-client@0.0.3`. The former owns NotificationEvent v1 types, deployment event creation, validation, context, links, and event text sanitization. The latter provides framework-independent technical-user OAuth and CCv2 HTTP transport, including token refresh, URL validation, timeouts, redaction, and safe-read/unsafe-mutation policies.

Deploy retains inputs, endpoint DTO validation, mode preflight, the deployment lifecycle, green decisions, traffic split, cancellation, results, outputs, and summaries. Both packages are bundled into `dist`; workflow users need no registry configuration or package credentials. Maintainers and CI need GitHub Packages read access. Package upgrades require the full deployment regression suite and guarded Sandbox verification before release. See the [ownership inventory](docs/shared-packages.md). The Action remains **UNRELEASED**.
13 changes: 12 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Release policy — UNRELEASED

## Consistent reporting dependency

Notification-contract **0.0.6** is published through the owner-authorized
[package-only run 43678067818](https://github.com/commercekit-tools/action-kit/actions/runs/43678067818).
This consumer pins the exact registry artifact and bundles it normally with
ccv2-client 0.0.3 unchanged. Candidate-only validation switches are retired.
Normal full quality and hosted checks must pass on the current PR head before
its authorized source merge. See [reporting evidence](docs/consistent-reporting.md).
All remaining Action-release, provider/live validation and owner gates below
remain separate. Package publication does not create an Action tag or release.

NO RELEASE UNTIL BUILD, DEPLOY AND NOTIFY ARE SANDBOX-VERIFIED TOGETHER.

No tags, moving v1, GitHub Release, npm publishing, or Marketplace publication until all gates pass:
Expand Down Expand Up @@ -27,4 +38,4 @@ No tags, moving v1, GitHub Release, npm publishing, or Marketplace publication u

Merging an implementation is not release authorization.

The current shared dependencies are exactly `@commercekit-tools/notification-contract@0.0.3` and `@commercekit-tools/ccv2-client@0.0.3`. These package versions being published does not release this Action. Any package upgrade requires complete deployment regression tests, all ten guarded Sandbox scenarios (including canary traffic split), and coordinated build → deploy → notify validation again. Rebuild and verify committed dist and license notices. Workflow consumers require no package configuration because dependencies are bundled. Maintainers/CI need GitHub Packages read access for installation.
The current shared dependencies are exactly `@commercekit-tools/notification-contract@0.0.6` and `@commercekit-tools/ccv2-client@0.0.3`. These package versions being published does not release this Action. Any package upgrade requires complete deployment regression tests, all ten guarded Sandbox scenarios (including canary traffic split), and coordinated build → deploy → notify validation again. Rebuild and verify committed dist and license notices. Workflow consumers require no package configuration because dependencies are bundled. Maintainers/CI need GitHub Packages read access for installation.
8 changes: 4 additions & 4 deletions dist/index.js

Large diffs are not rendered by default.

148 changes: 148 additions & 0 deletions docs/consistent-reporting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Consistent Action reporting

## Published dependency and scope

The owner-authorized [package-only publication run 43678067818](https://github.com/commercekit-tools/action-kit/actions/runs/43678067818)
published notification-contract **0.0.6** from action-kit main
`3fecce40414d709884fa48e48eca278f470b20b0`. Main
[CI 43677942127](https://github.com/commercekit-tools/action-kit/actions/runs/43677942127)
and [CodeQL 43677942074](https://github.com/commercekit-tools/action-kit/actions/runs/43677942074)
passed; processed main analysis was `2169851728`.

Actual registry metadata was independently read back before consumer changes:

- Exact dependency: `@commercekit-tools/notification-contract@0.0.6`.
- Shasum: `8030f643d1dd6d741caa2c3c0ba321ad82b30cca`.
- Integrity: `sha512-n6F84900sDPBeYm5dnf8HLCM9B2DUVATEeF717dqKsSXTJtq1FIj/3hZ2UcNTtXe7v8R90HYF6HIom4auM8Kyw==`.
- Artifact SHA256: `e4b79576328c2992a96fed087e9ba6e63970e8b54d6fca976a6652702a7a73a9`, identical to the exact reviewed source tarball.
- ccv2-client remains exact published **0.0.3**.

The normal manifest and registry lockfile pin these actual published packages;
the committed bundle includes runtime dependencies. No local source checkout,
file dependency, candidate environment flag, package token or installation is
required to execute the bundled Action. Development installation uses authorized
read-only GitHub Packages access.

Input names/defaults, endpoint validation, remote mutations, polling/deadlines,
retry/refresh policies and domain outcomes remain unchanged. Shared input
capture/projection, schema/factories, redaction, status styling and Markdown
summaries come from the existing notification-contract package. OAuth/HTTP
remain in ccv2-client; delivery remains in Notify. No subsystem was duplicated.

## Notification and summary behavior

Every handled outcome reports all **21 input names**. Valid configuration
uses effective normalized defaults; invalid configuration shows safely captured
settings with `inputsValidated=false`. Capture reads each input once and masks
the four authentication values before any public field is read. Token endpoint,
client ID, client secret and resource are always literal `[REDACTED]` in public
context. Received tokens continue to use the existing Action masker.

Shared known-secret/JWT redaction precedes the 256-character per-value bound;
truncation is explicit. API URLs use only a validated safe HTTPS origin. Arbitrary
credential-bearing URLs are not reflected. Missing optional values are visible
as not set. Markdown/HTML control syntax is escaped by the shared renderer.

Deploy includes all operation, deployment/build/environment, database/strategy,
green-decision, rollback, waiting and polling settings. The three free-form or
structured inputs `decision-reason`, `cancel-reason` and `traffic-split-json`
show presence only; raw request/reason bodies are never copied to outputs,
notifications or summaries. This also applies before validation completes.
Manual/canary handoff keeps the existing `action-required` event/status and
uses the shared warning style with a safe instruction to review the deployment.
Cancellation/traffic-update outcomes appear as named result rows.

Each execution attempts a GitHub job summary after outputs, including handled
input/API/authentication/timeout failures. The shared layout is an icon/status
heading followed by Result and Inputs tables, safe Issues when present, and a
validated workflow link when available. Human labels replace internal property
names. Icons/labels reuse the shared status mapping:

| Outcome | Style | Operation behavior |
| ----------------------------- | -------------------- | ------------------------------------------------- |
| success | ✅ Succeeded | Existing success behavior |
| failure | ❌ Failed | Existing failure behavior |
| internal-error | ❌ CommerceKit error | Existing validation/API/deadline failure behavior |
| cancelled | ⏹️ Cancelled | Existing Action exit policy is retained |
| action-required (Deploy only) | ⚠️ Action required | Existing non-failing manual/canary handoff |

Trusted local outcome/operation enums (and allowlisted Build statuses) retain
their actual semantics when a credential coincidentally equals an enum word.
Public copies of supplied input values remain redacted. Arbitrary API strings
are never restored after sanitization. This prevents masking from manufacturing
an invalid event or a different domain outcome.

Structured result/event JSON is bounded to **64 KiB**, deliberately raised from
16 KiB for the unreleased reporting enhancement. All 21 invalid deployment settings
can expand under JSON Unicode escaping even when each projected value is bounded
to 256 characters. A worst-case malformed-Unicode test verifies a valid event over
16 KiB remains present, schema-valid and below 64 KiB with all input names.
Scalar outputs retain their existing bound and endpoint field validation.

Reporting cannot overwrite the operation result. Event creation failure emits
an empty notification output, a safe warning and an issue in the available
summary; consumers must skip notification delivery when the event is empty.
Each output is attempted independently, and the summary is still attempted if
an output write fails. An output contract failure can fail the Action separately
while keeping the original domain result/event status. An existing operation
error remains the primary Action failure. Summary errors warn without erasing
outputs or changing the operation outcome.

## Registry-backed validation

Status vocabulary: PASS, FAIL, BLOCKED, NOT RUN.

| Check | Result |
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Registry availability and integrity | PASS: actual published 0.0.6 independently verified |
| Normal frozen dependency installation | PASS: exact registry versions and reproducible lockfile |
| Normal standalone bundle generation | PASS: SHA256 `540d42a2072000d1ffa884c22a7eac933233a5a584c6831be85a1472d1e7744e`, identical to reviewed v2 candidate |
| Full normal quality, tests and coverage | PASS: 312 tests/12 files, zero skipped; 99.12% statements, 97.48% branches, 98.57% functions, 99.76% lines |
| Required hosted checks and coordinated source merge | NOT RUN: pending final pushed head |
| Real SAP, hosted Sandbox dispatch, live provider delivery | NOT RUN in this reporting task |

Normal commands use Node 24.21.0/pnpm 12.6.0 and need no candidate variables:

```sh
pnpm install --frozen-lockfile
pnpm bundle
pnpm quality
```

Quality includes format, lint, strict types, public schema/compatibility tests,
coverage, bundle byte consistency, public scan and production dependency audit.
All normal commands above passed against the actual registry package, without
candidate variables. Public scan checked 65 files; the production dependency audit
reported no known vulnerabilities. Source `git diff --check` passed as well.
Existing 95% statement/branch/function/line thresholds and production source
inclusion remain unchanged. Actual standalone bundle cases verify all 21
input names, status icons/tables, safe error explanations, masking and zero mocked
API requests for invalid configuration. The original remote-operation suites
remain in place; passing repository checks is not live SAP validation.

## Historical source-candidate validation

Before publication the exact reviewed source candidate at action-kit
`475cc4db42f79310240496201f90d7047aa54330` was validated in fresh private
consumers. Its 19140-byte tarball has the same integrity and SHA256 recorded
above. Those candidate results passed **312 tests in 12 files** with
99.12% statements, 97.48% branches, 98.57% functions, 99.76% lines. Privacy review independently proved lowercase/mixed
percent-escape redaction and canonical trailing-dot Slack/Slack Gov webhook
masking across input snapshots, summary facts and links. Producer tests exercise
mixed-case URL/form-encoded credentials in actual result/event/summary sinks.

The original source-stage procedures, candidate-only switching and complete
validation evidence are archived at immutable consumer commit
[`56e037ca68d5adbc53438733020b65a8b4f65b2f`](https://github.com/commercekit-tools/ccv2-deploy/tree/56e037ca68d5adbc53438733020b65a8b4f65b2f)
([report](https://github.com/commercekit-tools/ccv2-deploy/blob/56e037ca68d5adbc53438733020b65a8b4f65b2f/docs/consistent-reporting.md)).
They are historical evidence; current scripts assert only exact registry versions
and reject file dependencies. Candidate compatibility overrides were removed.

## Remaining release and validation gates

The dependency-publication gate is resolved. Normal validation and hosted checks
on the final source head must pass before the authorized source merge; they
cannot be replaced by candidate results or weakened checks. Action publication,
Marketplace/version tags, hosted provider smoke, coordinated live validation and
owner release approval remain separately governed by RELEASING.md. No Git tag,
Action release, deployment, live provider send or real SAP request occurred.
12 changes: 12 additions & 0 deletions docs/shared-packages.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Shared package ownership

## Current published reporting adoption

The current Action consumes exact registry notification-contract **0.0.6** and
ccv2-client **0.0.3**. Shared input capture/context, masking, status styles and
Markdown run-summary rendering are reused alongside the existing event factories,
validation and context APIs. Normal lockfile and standalone dist are regenerated
from the registry artifact; no candidate alias or local link is used. See
[validation and provenance](consistent-reporting.md). The earlier 0.0.3 extraction
inventory below remains historical evidence; current public pins are those above.

## Historical 0.0.3 extraction

Both packages are published GitHub Packages dependencies pinned exactly to **0.0.3**. No local checkout, workspace link, runtime registry request, or package publishing step is used. The Action remains **UNRELEASED**.

| Area | Classification | Ownership after migration |
Expand Down
Loading
Loading