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: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
workflow_dispatch:
permissions:
contents: read
packages: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -18,8 +19,12 @@ jobs:
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
registry-url: https://npm.pkg.github.com
scope: "@commercekit-tools"
- run: corepack enable
- run: pnpm install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm quality
cross-platform:
strategy:
Expand All @@ -33,6 +38,10 @@ jobs:
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
registry-url: https://npm.pkg.github.com
scope: "@commercekit-tools"
- run: corepack enable
- run: pnpm install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm exec vitest run tests/action.test.ts tests/bundle.test.ts
5 changes: 5 additions & 0 deletions .github/workflows/sandbox-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
description: Type RUN-COMMERCEKIT-SANDBOX-BUILD
permissions:
contents: read
packages: read
concurrency:
group: ccv2-build-sandbox-smoke
cancel-in-progress: false
Expand All @@ -24,8 +25,12 @@ jobs:
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
registry-url: https://npm.pkg.github.com
scope: "@commercekit-tools"
- run: corepack enable
- run: pnpm install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: prepare
run: node scripts/sandbox/prepare.mjs
env:
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@commercekit-tools:registry=https://npm.pkg.github.com
10 changes: 8 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ Commit TypeScript source, focused tests, lockfile changes, and rebuilt `dist/` t

Use visibly synthetic fixtures only. No real SAP credentials, tenant endpoints, customer identifiers, production subscription requests, private source, local machine paths, or live API recordings belong here. IntelliJ files, node_modules, coverage, and local environment files are ignored. Never read the complete GitHub event payload into notification data.

The local vendored notify schema is checked offline. `pnpm contracts:notify:update <full-notify-commit-SHA>` is an explicit maintainer operation; review the schema/provenance diff, license, and compatibility tests. Normal build and quality commands do not fetch schemas.
Both shared packages are pinned to `0.0.2`. `.npmrc` commits only the `@commercekit-tools` registry mapping. Before installation, configure a **user-level**, untracked npm configuration containing `//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}` and supply `NODE_AUTH_TOKEN` through your secure credential tooling. Use a GitHub token with `read:packages` and access to both packages. Never put the token in repository configuration or command-line arguments. pnpm 12 verifies lockfile supply-chain metadata during installation; after a lockfile change, repeat the authenticated frozen installation before running other pnpm commands.

Read [Sandbox policy](docs/sandbox.md) before requesting live smoke approval. Routine PR CI must never create Sandbox runs. No deployment implementation, provider delivery, shared CCv2 package, tags, or release belongs in this change. Review [RELEASING.md](RELEASING.md).
CI and the manual Sandbox workflow grant only `contents: read` and `packages: read`, use the existing SHA-pinned setup-node Action with the scoped registry, and expose `secrets.GITHUB_TOKEN` only to installation steps. Package owners must grant this repository Actions read access to both packages. The bundled Action needs no registry credentials.

`pnpm contracts:check` verifies installed and declared package versions, imports the package's public schema export, validates the captured baseline events, rejects the old duplicate schema, and runs Action-level compatibility scenarios offline. It never fetches Notify main or a live schema. Baseline fixtures were captured from `ebdc830161cf9122121ddeb137d005f375063997`; do not regenerate them merely to accept a changed result.

Review package upgrades for authentication/refresh behavior, explicit retry policies, disclosure, event compatibility, licenses, and bundle changes. Use exact published versions, run all quality gates, and rebuild committed dist. The release-age exceptions in pnpm-workspace.yaml apply only to the two explicitly reviewed `0.0.2` versions; they do not exempt future versions.

Read [Sandbox policy](docs/sandbox.md) before requesting live smoke approval. Routine PR CI must never create Sandbox runs. No deployment implementation, provider delivery, new shared package publication, tags, or release belongs in this change. Review [RELEASING.md](RELEASING.md).
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ All seven outputs are strings and are written before handled failure is reported

`result-json` contains `schemaVersion`, `outcome`, `pollCount`, `retryCount`, `durationMs`, and `timedOut`. Known optional fields are `subscriptionCode`, `applicationCode`, `buildCode`, `buildName`, `branch`, `buildStatus`, `percentage`, `numberOfTasks`, `startedTaskCount`, and `error` (`code`, `message`, optional `httpStatus`). Each JSON output is capped at 16 KiB. There are no raw task payloads, headers, logs, or raw API responses.

The notification carries only supported build fields, safe error information, and approved GitHub context. `retryCount` counts actual extra HTTP attempts, including an authorization refresh replay; it is not the poll count. The workflow run link is included when safely constructible. No Cloud Portal UI link is guessed. The [vendored contract](contracts/README.md) is validated at runtime and in tests.
The notification carries only supported build fields, safe error information, and approved GitHub context. `retryCount` counts actual extra HTTP attempts, including an authorization refresh replay; it is not the poll count. The workflow run link is included when safely constructible. No Cloud Portal UI link is guessed. The [shared contract](contracts/README.md) is validated at runtime and in tests.

## Lifecycle and failure behavior

Expand All @@ -104,6 +104,12 @@ Each request has a 30-second timeout and a 256 KiB response limit. Tokens remain

Create-build POST is **not** automatically retried after timeout, network ambiguity, 5xx, or 429. An explicit 401 permits one token refresh and replay. `CREATE_BUILD_AMBIGUOUS` means check Cloud Portal before starting another build to avoid duplicates. API errors retain HTTP status and only sanitized, bounded problem title/detail. See [security](SECURITY.md).

## Shared dependencies

`@commercekit-tools/notification-contract@0.0.2` and `@commercekit-tools/ccv2-client@0.0.2` are pinned exactly and bundled into `dist/index.js`. Workflow consumers do not install these packages, authenticate to GitHub Packages, or grant `packages: read` to run the bundled Action. Build endpoint validation, polling, deadlines, status mapping, result JSON, outputs, and summaries remain owned by this Action. See the [migration inventory and compatibility checks](docs/shared-packages.md).

Maintainers and CI need GitHub Packages read access for dependency installation; see [CONTRIBUTING.md](CONTRIBUTING.md). Package upgrades require compatibility review and a rebuilt bundle. Publishing a shared package does not release this Action.

## Development and Sandbox verification

See [CONTRIBUTING.md](CONTRIBUTING.md), [API contract review](docs/api-contract.md), and [Sandbox verification](docs/sandbox.md). Ordinary CI is entirely mocked for SAP/Sandbox. All five live Sandbox scenarios passed using the guarded workflow scripts and bundled Action locally before merge; see [validation evidence](docs/build-validation.md). GitHub dispatch was unavailable before the new workflow reached main. No real SAP credentials or subscriptions are used in development tests.
Expand Down
2 changes: 2 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ Implementation may merge after review. Do not create `v1.0.0`, create or move `v
- [ ] Coordinated v1 release owner approval recorded

The manual Sandbox workflow requires owner approval after PR review and local/CI success. The five scenarios passed locally with the same guarded scripts and bundled Action under explicit owner approval on 2026-11-09; see [validation evidence](docs/build-validation.md). GitHub-hosted dispatch was unavailable before the workflow existed on main. Do not infer live smoke authorization from permission to merge. No release workflow is provided here. Future maintainers must separately design and review coordinated version-tag and publication procedures after every gate passes.

The shared-package migration does not satisfy any additional live validation gate and does not authorize release. Both shared dependencies remain exactly pinned at `0.0.2` and included in dist. Before approving a package upgrade, review the public contract, authentication/retry behavior, licenses, offline compatibility fixtures, standalone bundle test, and reproducibility. Existing Sandbox evidence describes the earlier implementation; live Sandbox verification of a migration requires separate owner authorization.
2 changes: 2 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ Create-build mutation retries after ambiguous failures are forbidden to avoid du
Only synthetic fixtures belong in this public repository. Never add real SAP credentials to repository secrets or run tests against a real SAP subscription. The guarded manual Sandbox workflow creates synthetic credentials and deletes its disposable run in an always-run step. Run creation failures or hard runner termination can prevent cleanup; Sandbox runs expire independently.

Exact direct dependencies, pinned external Actions, CodeQL, Dependabot, bundle reproducibility, and offline contract validation are part of the quality gate. The minimatch override in pnpm-workspace.yaml mitigates GHSA-g3hv-75wg-m249 in development tooling; remove it only after upstream dependencies select a patched compatible version.

Shared authentication/transport and notification code comes from the exact published `@commercekit-tools/ccv2-client@0.0.2` and `@commercekit-tools/notification-contract@0.0.2` packages. They are included in the reviewed bundle; runtime does not access GitHub Packages. Registry authentication is for maintainer/CI installation only, with read-only package permissions and no committed credentials. Package upgrades must retain mutation retry safety, secret masking/redaction, bounded outputs, and the compatibility fixtures. Build retains its conservative markup/JWT disclosure filter and HTML summary escaping around the shared sanitizers.
8 changes: 4 additions & 4 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Third-party notices

This repository is MIT licensed. The exact NotificationEvent v1 schema is vendored from CommerceKit Notifications under MIT; see [contract provenance](contracts/README.md) and [its license](contracts/notify-LICENSE).
This repository is MIT licensed. The shared CommerceKit Action Kit packages are MIT licensed; see [contract ownership](contracts/README.md).

The generated [dist/licenses.txt](dist/licenses.txt) is produced by `@vercel/ncc --license licenses.txt` from actual bundled dependencies. It contains package identifiers and full license text for the Actions toolkit and its bundled transitive dependencies, Ajv, ajv-formats, and their dependencies. Rebuild it whenever dependencies change; bundle reproducibility compares it byte-for-byte.
The generated [dist/licenses.txt](dist/licenses.txt) is produced by `@vercel/ncc --license licenses.txt` from actual bundled dependencies. It contains package identifiers and full license text for both shared CommerceKit packages, the Actions toolkit and its bundled transitive dependencies, Ajv, ajv-formats, and their dependencies. Rebuild it whenever dependencies change; bundle reproducibility compares it byte-for-byte.

Runtime direct dependencies:

- `@actions/core`: GitHub inputs, masking, outputs, logs, summary, and failure status.
- `ajv`: local NotificationEvent JSON Schema 2020-12 validation.
- `ajv-formats`: URI and date-time validation.
- `@commercekit-tools/ccv2-client@0.0.2`: technical-user authentication, token lifecycle, validated transport, retry policies, and safe problem facts.
- `@commercekit-tools/notification-contract@0.0.2`: NotificationEvent v1 types/schema, validation, factories, context/links, and text sanitization. Its exact Ajv and ajv-formats dependencies provide JSON Schema 2020-12, URI, and date-time validation.

Development tooling: TypeScript and Node types, ESLint with typescript-eslint and globals, Prettier, Vitest and V8 coverage, and ncc. Development-only dependencies are not runtime requirements. Exact versions and transitive licenses are inspectable through package.json and pnpm-lock.yaml. SAP-authored OpenAPI is not included or relicensed.
8 changes: 5 additions & 3 deletions contracts/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# NotificationEvent contract

`notification-event-v1.schema.json` is an exact copy from the MIT-licensed public repository [commercekit-tools/notify](https://github.com/commercekit-tools/notify/blob/23451071bcdb856f5a5c4b1f59cfe45ab9641893/schema/notification-event-v1.schema.json), commit **23451071bcdb856f5a5c4b1f59cfe45ab9641893**. Schema version: **1**. Provenance and SHA-256 are recorded in `notify-provenance.json`.
The Action uses the public exports of `@commercekit-tools/notification-contract@0.0.2`, published from the MIT-licensed [CommerceKit Action Kit](https://github.com/commercekit-tools/action-kit). The package owns NotificationEvent v1 types, schema, validator, event factory, safe context/links, and generic text sanitization. No schema is vendored locally and no runtime dependency on the Notify Action exists.

The source license is MIT, copyright (c) 2026 CommerceKit. See the included [notify license](notify-LICENSE). The schema is bundled and validated locally with Ajv 2020 and ajv-formats; it creates no runtime network dependency on notify or the schema's logical `$id` URL.
`pnpm contracts:check` imports `@commercekit-tools/notification-contract/schema`, checks schemaVersion 1 and exact installed/declared versions of both shared packages, verifies the local duplicate is absent, validates every pre-migration fixture, and executes all 16 compatibility scenarios against the current Action. Checks are offline after dependency installation. Event creation validates at runtime through `createBuildEvent` and `validateNotificationEvent` inside the package. Sandbox assertions use the same public validator.

Intentional maintainer update: `pnpm contracts:notify:update <40-character-commit-SHA>`. Review byte-level changes and license, update this document's source link, run format and quality, and rebuild dist. No implicit main lookup or update occurs in ordinary CI. After notify v1 exists, maintainers may adopt its immutable release commit as provenance.
The compatibility fixtures in `tests/fixtures/build-compatibility.json` were captured from base `ebdc830161cf9122121ddeb137d005f375063997`. They preserve result/event fields, optional omissions, safe messages, status mappings, output ordering, and summaries; generated event identity/timestamps are normalized. JSON object member order is not semantically significant.

Upgrade only to an explicitly reviewed, exact published package version. Review source and license changes, preserve these fixture assertions, run the full quality gate and rebuild dist. Do not fetch a live schema or implicitly track main in routine CI. See [shared-package ownership](../docs/shared-packages.md).
Loading
Loading