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
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Run `pnpm format`, `pnpm lint`, `pnpm typecheck`, `pnpm schema:check`, `pnpm tes

## GitHub Packages access

`@commercekit-tools/notification-contract` is pinned to `0.0.3`. The committed `.npmrc` contains only the scoped registry. Configure a classic GitHub PAT with `read:packages` in your user-level npm configuration, or supply `NODE_AUTH_TOKEN` through an external npm auth configuration. Never commit credentials or add a long-lived PAT repository secret.
`@commercekit-tools/notification-contract` is pinned to `0.0.4`. The committed `.npmrc` contains only the scoped registry. Configure a classic GitHub PAT with `read:packages` in your user-level npm configuration, or supply `NODE_AUTH_TOKEN` through an external npm auth configuration. Never commit credentials or add a long-lived PAT repository secret.

```sh
npm login --scope=@commercekit-tools --registry=https://npm.pkg.github.com --auth-type=legacy
pnpm view @commercekit-tools/notification-contract@0.0.3 version --registry=https://npm.pkg.github.com
pnpm view @commercekit-tools/notification-contract@0.0.4 version --registry=https://npm.pkg.github.com
pnpm install --frozen-lockfile
```

Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The Action performs no CCv2 API calls, build/deployment work, CLI checks, projec

## Shared event contract

NotificationEvent v1 is supplied by `@commercekit-tools/notification-contract`, pinned to **0.0.3** from GitHub Packages and bundled into `dist/index.js`. Workflow users do not install the package or authenticate to GitHub Packages. Maintainers need package read access to install development dependencies; see [Contributing](CONTRIBUTING.md).
NotificationEvent v1 is supplied by `@commercekit-tools/notification-contract`, pinned to **0.0.4** from GitHub Packages and bundled into `dist/index.js`. Workflow users do not install the package or authenticate to GitHub Packages. Maintainers need package read access to install development dependencies; see [Contributing](CONTRIBUTING.md).

Notify owns presentation templates, Slack/Teams rendering and escaping, webhook policies, delivery, retries, and Action inputs/outputs. Package SemVer, event `schemaVersion`, and Action releases evolve independently. Notify remains unreleased. See the [migration compatibility notes](docs/shared-contract-migration.md).

Expand Down Expand Up @@ -134,3 +134,17 @@ pnpm payload:preview --provider teams-workflow --event deployment-action-require
The command accepts only committed fixture names, validates the event through production code, and prints formatted payload JSON. It does not send the payload. The public [older notification screenshots](https://sap-cx-actions.github.io/docs/commerce-cloud/notifications/) informed the heading, outcome, details, and action hierarchy. This Action uses provider-native Block Kit and Adaptive Cards with the smaller NotificationEvent v1 contract; it does not reproduce the old payloads or extra SAP fields.

For a visual preview, paste the complete Slack payload into [Block Kit Builder](https://app.slack.com/block-kit-builder/) in message preview mode. The top-level context block and colored attachment should appear together. If its attachment editor requests only an attachment object, extract it with `pnpm --silent payload:preview --provider slack --event build-success | jq '.attachments[0]'`; that narrower view omits the top-level context. Paste only the Adaptive Card into the [Microsoft Adaptive Card Designer](https://adaptivecards.microsoft.com/designer): `pnpm --silent payload:preview --provider teams-workflow --event build-success | jq '.attachments[0].content'`. The designers show the layout, while live provider acceptance after merge uses the manual smoke workflow in [RELEASING.md](RELEASING.md).

### Cleanup compatibility

This unreleased Action accepts `ccv2.build-cleanup.completed` through the published
`@commercekit-tools/notification-contract@0.0.4` package. The exact registry
dependency and integrity are recorded in `package.json` and `pnpm-lock.yaml`;
all runtime dependencies are bundled into `dist/index.js`.

Slack and Teams reuse the existing rendering and delivery implementation. Accepted
deletion requests indicate initiation, not physical removal. Earlier Notify
builds using notification-contract 0.0.3 reject cleanup events; consumers must
pin an immutable Notify commit containing this compatible bundle. Package
publication does not create an Action release or tag and does not authorize
real cleanup or provider delivery.
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Action release version (`v1.0.0`) and NotificationEvent schema version (`1`)

**Release hold:** Do not tag, create a GitHub Release, or publish this Action to Marketplace until the separate `commercekit-tools/ccv2-build` and `commercekit-tools/ccv2-deploy` Actions are built and their NotificationEvent v1 outputs have been validated with this notifier. This is a product release gate; the two producer Actions remain separate repositories and releases.

The Action bundles `@commercekit-tools/notification-contract@0.0.3` and its runtime dependencies. Package SemVer is independent of NotificationEvent `schemaVersion`. Maintainers and preflight CI need GitHub Packages read access as described in [Contributing](CONTRIBUTING.md); workflow users and manual provider smoke use the committed bundle without registry access. Package publication does not release this Action.
The Action bundles `@commercekit-tools/notification-contract@0.0.4` and its runtime dependencies. Package SemVer is independent of NotificationEvent `schemaVersion`. Maintainers and preflight CI need GitHub Packages read access as described in [Contributing](CONTRIBUTING.md); workflow users and manual provider smoke use the committed bundle without registry access. Package publication does not release this Action.

## Release order

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Redaction is defense in depth and does not replace safe producer behavior. See [

Report vulnerabilities through GitHub private vulnerability reporting for this repository when available. Otherwise use GitHub's private security advisory reporting flow. Do not disclose exploit details in public issues.

NotificationEvent v1 parsing and validation are supplied by the bundled `@commercekit-tools/notification-contract@0.0.3`. Notify retains filesystem safety, provider escaping and redaction, webhook URL masking, destination restrictions, timeouts, redirects and delivery policy. Runtime workflow consumers need no registry credentials. Package credentials belong only in maintainer user configuration or the CI install step; never in repository files or the bundle.
NotificationEvent v1 parsing and validation are supplied by the bundled `@commercekit-tools/notification-contract@0.0.4`. Notify retains filesystem safety, provider escaping and redaction, webhook URL masking, destination restrictions, timeouts, redirects and delivery policy. Runtime workflow consumers need no registry credentials. Package credentials belong only in maintainer user configuration or the CI install step; never in repository files or the bundle.
2 changes: 1 addition & 1 deletion THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Third-party notices

The Action's bundled runtime includes `@actions/core` and `@commercekit-tools/notification-contract@0.0.3`, including the contract package's Ajv and `ajv-formats` dependencies. The committed `dist/licenses.txt` contains the license text and notices emitted by `@vercel/ncc` for code incorporated into `dist/index.js`; distribute it with the bundle. `package.json` and `pnpm-lock.yaml` record exact direct and resolved dependencies. Development tools are used to build and validate the Action and are not required by Action consumers.
The Action's bundled runtime includes `@actions/core` and `@commercekit-tools/notification-contract@0.0.4`, including the contract package's Ajv and `ajv-formats` dependencies. The committed `dist/licenses.txt` contains the license text and notices emitted by `@vercel/ncc` for code incorporated into `dist/index.js`; distribute it with the bundle. `package.json` and `pnpm-lock.yaml` record exact direct and resolved dependencies. Development tools are used to build and validate the Action and are not required by Action consumers.

Before each release, regenerate the bundle and review `dist/licenses.txt` for changes alongside dependency updates.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/notification-event-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Check data may contain mode, changedFrom, filesChecked, errors, warnings, durati

All input is limited to 64 KiB. Strings and arrays have schema bounds. Additive unknown fields are ignored and never rendered; unknown event types and schema versions fail. Additive optional fields preserve v1; changed meaning or removed required fields require a new schema version. Event schema, Action, and producer versions evolve independently.

The machine-readable schema is available through the public `@commercekit-tools/notification-contract/schema` export (JSON import attribute required). Notify pins package version `0.0.3`; package SemVer and event schemaVersion are independent.
The machine-readable schema is available through the public `@commercekit-tools/notification-contract/schema` export (JSON import attribute required). Notify pins package version `0.0.4`; package SemVer and event schemaVersion are independent.

For `check.completed` with `success`, `warning`, or `failure`, `data.filesChecked`, `data.errors`, and `data.warnings` are required non-negative integers. They may be omitted for `cancelled` and `internal-error`. `context.runUrl`, like every event link, must be a bounded HTTPS URL without credentials or fragment. The Action may fill missing context fields from the documented GitHub Actions environment variables; it does not read the full GitHub event payload or copy arbitrary environment values.

Expand Down
18 changes: 17 additions & 1 deletion docs/shared-contract-migration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Shared contract migration

The original migration moved the pre-extraction baseline `015479e4340f61598d2125532acf6474381ca976` to `@commercekit-tools/notification-contract@0.0.2`. Notify now pins `0.0.3`; this additive package upgrade preserves the schema, rendering and delivery policies described below. Notify remains unreleased.
The original migration moved the pre-extraction baseline `015479e4340f61598d2125532acf6474381ca976` to `@commercekit-tools/notification-contract@0.0.2`. Notify now pins `0.0.4`; this additive package upgrade preserves the schema, rendering and delivery policies described below. Notify remains unreleased.

## Ownership inventory

Expand Down Expand Up @@ -31,3 +31,19 @@ The context adapter preserves producer values, fills safe missing metadata, requ
## Action Kit 0.0.3 adoption

Version 0.0.3 adds opt-in text primitives used by Build and Deploy. Notify retains its provider-specific sanitizer, redaction labels and webhook retry policy; the new primitives do not replace those policies. Upgrade the exact package dependency, installed-version assertions and reviewed release-age exception together, then regenerate the registry lockfile and committed bundle after publication. Preserve the existing golden snapshots and original migration provenance. Run the complete quality gate before pushing.

## Action Kit 0.0.4 cleanup adoption

Version 0.0.4 adds `ccv2.build-cleanup.completed` with the shared cleanup
factory, type and schema validation. Notify consumes the exact published registry
package, checks all supported event fixtures against its public schema export,
and builds the standalone bundle from that frozen installation. No candidate
source mount, local dependency link or vendored schema is used. The cleanup
presentation reuses both existing provider renderers and delivery paths.

Publication provenance: contract 0.0.4 was published by
[action-kit workflow run 43622416072](https://github.com/commercekit-tools/action-kit/actions/runs/43622416072)
from source commit
[`a03da9366e6483040d504a742c1a95413c1202cb`](https://github.com/commercekit-tools/action-kit/commit/a03da9366e6483040d504a742c1a95413c1202cb).
The actual registry integrity is recorded in the committed lockfile. This package
publication did not create an Action release or Git release tag.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"dependencies": {
"@actions/core": "3.0.1",
"@commercekit-tools/notification-contract": "0.0.3"
"@commercekit-tools/notification-contract": "0.0.4"
},
"devDependencies": {
"@eslint/js": "10.0.1",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
minimumReleaseAgeExclude:
- '@commercekit-tools/notification-contract@0.0.3'
- '@commercekit-tools/notification-contract@0.0.4'
overrides:
minimatch: 11.0.1
7 changes: 4 additions & 3 deletions scripts/schema-check.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { parseNotificationEventJson } from '@commercekit-tools/notification-cont

const root = new URL('../', import.meta.url);
const manifest = JSON.parse(await readFile(new URL('package.json', root), 'utf8'));
assert.equal(metadata.version, '0.0.3');
assert.equal(manifest.dependencies['@commercekit-tools/notification-contract'], '0.0.3');
assert.equal(metadata.version, '0.0.4');
assert.equal(manifest.dependencies['@commercekit-tools/notification-contract'], '0.0.4');
assert.equal(schema.$schema, 'https://json-schema.org/draft/2020-12/schema');
assert.equal(schema.properties.schemaVersion.const, 1);
assert(!existsSync(new URL('schema/notification-event-v1.schema.json', root)), 'Local schema must not be vendored.');
Expand All @@ -21,6 +21,7 @@ for (const name of (await readdir(fixtures)).filter((name) => name.endsWith('.js
assert.deepEqual(
[...types].sort(),
[
'ccv2.build-cleanup.completed',
'check.completed',
'ccv2.build.started',
'ccv2.build.completed',
Expand All @@ -30,4 +31,4 @@ assert.deepEqual(
].sort(),
);
assert.deepEqual([...schema.properties.eventType.enum].sort(), [...types].sort());
console.log('Notification contract 0.0.3: public schema export, all fixtures and supported event types verified.');
console.log('Published notification contract: public schema export, all fixtures and supported event types verified.');
20 changes: 20 additions & 0 deletions src/presentation/create-presentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,26 @@ export function createPresentation(event: NotificationEvent): Presentation {
add('Errors', d.errors);
add('Warnings', d.warnings);
add('Duration', duration(d.durationMs));
} else if (event.eventType === 'ccv2.build-cleanup.completed') {
category = 'CommerceKit · CCv2 build cleanup';
title =
event.status === 'success'
? 'CCv2 build cleanup completed'
: event.status === 'cancelled'
? 'CCv2 build cleanup cancelled'
: 'CCv2 build cleanup requires attention';
const mode = d.mode === 'dry-run' ? 'DRY RUN' : 'APPLY';
summary = `${mode}: ${str(d.plannedCount)} planned targets; ${str(d.deletionRequestedCount)} deletion requests accepted. Outcome: ${str(d.cleanupStatus)}.`;
highlight('Mode', mode);
add('Subscription', d.subscriptionCode);
add('Application', d.applicationCode);
add('Retention days', d.retentionDays);
add('Keep latest', d.keepLatest);
add('Planned', d.plannedCount);
add('Requests accepted', d.deletionRequestedCount);
add('Failed / unknown', `${str(d.failedCount)} / ${str(d.unknownCount)}`);
add('Deferred', d.deferredCount);
add('Duration', duration(d.durationMs));
} else if (event.eventType.startsWith('ccv2.build.')) {
category = 'CommerceKit · CCv2 build';
title =
Expand Down
Loading