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
3 changes: 3 additions & 0 deletions .github/workflows/provider-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
type: choice
options:
- check-success
- check-warning
- setup-success
- cleanup-warning
- check-failure
- build-success
- build-failure
Expand Down
15 changes: 12 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
# Contributing

The reporting implementation consumes exact published notification-contract
0.0.6 through normal registry installation. No candidate flag, source checkout or
file:tarball dependency is required. Historical candidate provenance is archived
in [ecosystem-reporting-validation.md](docs/ecosystem-reporting-validation.md).

Use Node.js `24.21.0` and pnpm `12.6.0`. Configure GitHub Packages authentication as described below, enable Corepack, then run `pnpm install --frozen-lockfile`.

Run `pnpm format`, `pnpm lint`, `pnpm typecheck`, `pnpm schema:check`, `pnpm test`, `pnpm test:coverage`, `pnpm audit`, and `pnpm bundle`. Review contract changes and provider payload fixtures carefully. Update `dist/index.js` with source changes. Use only synthetic fixtures; normal CI must never call real webhooks. PRs should explain contract/security effects and include focused tests.

## GitHub Packages access

`@commercekit-tools/notification-contract` is pinned to `0.0.5`. 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.6`. 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.5 version --registry=https://npm.pkg.github.com
pnpm view @commercekit-tools/notification-contract@0.0.6 version --registry=https://npm.pkg.github.com
pnpm install --frozen-lockfile
```

If an IDE overrides your npm configuration, inspect `npm config get userconfig` and point `NPM_CONFIG_USERCONFIG` to your authenticated user-level file. Do not print its credentials.

CI and release preflight use the existing pinned setup-node action, job-level `contents: read` and `packages: read`, and `NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}` only on the install step. The Notify repository must have Actions read access to the package. CodeQL uses build-mode none and needs no package installation. Smoke workflows execute the bundled Action without package credentials.

`pnpm schema:check` verifies the exact installed package version, public schema export, all committed fixtures, supported event types and absence of a vendored schema. It uses installed files and makes no registry request. Keep golden snapshots unchanged during source deduplication. The local presentation sanitizer retains Notify's redaction wording and URL filtering because the generic package sanitizers are not equivalent.
`pnpm schema:check` verifies the exact installed package version, public schema export, all committed fixtures, supported event types and absence of a vendored schema. It uses installed files and makes no registry request. Reporting-consistency intentionally updates all 40 provider snapshots to the
common Result/Inputs/Issues layout; review semantic counts, links and outcomes
independently of those golden changes. Provider escaping remains local; the shared action-text sanitizer adds common
JWT, known-secret and URL disclosure rules. Do not duplicate the shared visual
status vocabulary or event schema.
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CommerceKit Notifications

> **Registry-backed ecosystem reporting:** shared notifications and run summaries
> consume published notification-contract 0.0.6. Maintainers install the exact
> registry dependency; consumers execute the committed standalone bundle. See
> [reporting validation](docs/ecosystem-reporting-validation.md).

**Status: Initial implementation under development.** This Action is not yet released. The future `commercekit-tools/notify@v1` reference is unavailable until the separate CCv2 build and deploy Actions are built, their NotificationEvent v1 integration is validated, and an approved release is published.

Send a normalized CommerceKit workflow event to Slack Incoming Webhooks or Microsoft Teams Workflows. One root Action accepts `provider: slack` or `provider: teams-workflow`.
Expand All @@ -12,10 +17,53 @@ 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.5** 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.6** 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).

## Consistent notification and summary format

The Action shares status icons, labels and accents with every CommerceKit
Action through the existing notification-contract package. Slack and Teams use
the same header, **Result**, **Inputs** and **Issues** groups for CLI check, CLI
setup, CCv2 build, deployment and build cleanup events. All provided input names
are retained, authentication values are `[REDACTED]`, and input validation and
truncation are explicit. Older events identify unavailable input context rather
than inventing settings. Cleanup retains every aggregate and describes accepted
deletion requests; acceptance does not establish physical removal.

| Outcome | Icon | Shared language |
| ------------------- | ---- | ----------------------- |
| Success | ✅ | Succeeded |
| Failure | ❌ | Failed |
| Warning | ⚠️ | Completed with warnings |
| Started | ℹ️ | Started |
| Cancellation | ⏹️ | Cancelled |
| Internal error | ❌ | CommerceKit error |
| Deployment decision | ⚠️ | Action required |

The Action also writes a GitHub run summary for Notify itself after every
handled invocation. It contains delivery outcome, provider, source event type and
status, attempts, duration, safe errors and all five Notify input names.
`webhook-url` is always redacted; `event-json` and `event-file` display presence
only, without payloads or filesystem paths. The current workflow link uses the
shared allowlisted GitHub context.

A successfully delivered failure event produces a successful **delivery**
summary while its source outcome remains failure in the card and `status` output.
Failed delivery defaults to a warning; `fail-on-notification-error: true` makes it
fatal. Invalid configuration/events remain fatal. Summary-writing errors preserve
delivery outputs and Action outcome. Output-file failures are reported separately
as an Action contract failure, retaining the known delivery state and attempts;
they never change an accepted delivery into a failed delivery or trigger a resend.

Both providers retain every input name under their payload limits. Long values
use explicit bounded previews; Teams reduces preview length when necessary to
stay below 27 KiB. Slack enforces its 50-block bound. Known secrets, JWT-like
values, credentials/query-bearing URLs and reflected webhook values are redacted
before provider escaping and truncation. Delivery/retry policies remain owned by
Notify and unchanged by this presentation work.

## Supported providers

- Slack Incoming Webhooks (`slack`)
Expand Down Expand Up @@ -138,7 +186,7 @@ For a visual preview, paste the complete Slack payload into [Block Kit Builder](
### Cleanup compatibility

This unreleased Action accepts `ccv2.build-cleanup.completed` through the published
`@commercekit-tools/notification-contract@0.0.5` package. The exact registry
`@commercekit-tools/notification-contract@0.0.6` 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`.

Expand Down
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.5` 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.6` 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.5`. 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.6`. 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.5`, 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.6`, 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.
14 changes: 7 additions & 7 deletions dist/index.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions docs/cleanup-notification-validation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Cleanup notification validation

> This report records the earlier published 0.0.5 baseline. Current ecosystem UI
> and summary candidate evidence is in
> [ecosystem-reporting-validation.md](ecosystem-reporting-validation.md). Historical
> claims about unchanged non-cleanup snapshots do not describe the intentional
> common-layout updates in the new candidate.

## Published registry integration

The notification-contract publication gate is resolved. Notify pins the exact
Expand Down
89 changes: 89 additions & 0 deletions docs/ecosystem-reporting-validation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Ecosystem reporting consistency validation

## Published dependency and provenance

The owner-authorized [package-only run 43678067818](https://github.com/commercekit-tools/action-kit/actions/runs/43678067818)
published exact `@commercekit-tools/notification-contract@0.0.6` from action-kit
main `3fecce40414d709884fa48e48eca278f470b20b0` after main CI/CodeQL passed.
Notify now uses that actual registry dependency, lockfile and standalone bundle.
No candidate switch, local file dependency or shared-source checkout is required.

- Inspected Notify main: `6331ff4a60956a3a2b546e84d737c9338ca46bda`.
- Feature source before registry adoption: `41e699d13bd183bd51551e45c386cf9e8f77d6dd`.
- Registry integrity:
`sha512-n6F84900sDPBeYm5dnf8HLCM9B2DUVATEeF717dqKsSXTJtq1FIj/3hZ2UcNTtXe7v8R90HYF6HIom4auM8Kyw==`.
- Registry shasum: `8030f643d1dd6d741caa2c3c0ba321ad82b30cca`.
- Published artifact SHA256:
`e4b79576328c2992a96fed087e9ba6e63970e8b54d6fca976a6652702a7a73a9`.
- Normal standalone bundle SHA256:
`e9142b35852702017cd44d067c3681ad1bb6e5c2b13ec6f4d666919539d4ac92`,
byte-identical to the reviewed private candidate.

Required public APIs and installed version were verified. The schema check now
requires the exact published version and manifest pin; candidate escape paths
were removed. No new package, replacement schema, OAuth/transport subsystem or
duplicated delivery implementation was introduced.

## Behavior verified

All five event families use the shared status map and Result/Inputs/Issues
sections. Every supplied input name survives provider bounds; legacy inputs are
explicitly unavailable. Source outcomes, integer counters, cancellation,
action-required and deletion-initiation semantics remain accurate. Confidential
names are forced redacted even for direct malformed presentation callers.
Known secrets, including encoded variants and the current webhook, redact across
inputs, context, error/issue text and links before escaping/truncation.

Notify captures its five inputs with webhook masking first. Event JSON and file
paths are represented only by presence. Its own GitHub summary separates delivery
from source outcome: successful delivery of a failure event remains delivery
success; default delivery failure is a warning; fatal delivery/configuration
failures remain failure. Independent output-write faults retain accepted delivery
and attempts as a separate Action contract issue. Summary failures preserve the
original outcome. No resend was introduced.

## Executed normal registry checks

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

| Check | Status | Evidence |
| ------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| Frozen registry install and public exports | PASS | Exact 0.0.6 and all reporting APIs verified |
| Full normal quality | PASS | 188 tests/13 files; no candidate environment flag |
| Coverage | PASS | 98.12% statements, 93.22% branches, 97.29% functions, 98.95% lines; existing configuration unchanged, no exclusions or threshold changes |
| Actual standalone bundle | PASS | 58 process cases without node_modules/registry credentials; all provider fetches mocked |
| Public schema and provider snapshots | PASS | 20 fixtures and 40 intentionally updated common-layout snapshots with independent semantic assertions |
| Bounds and reporting faults | PASS | 21 Unicode-valued inputs plus maximum errors/issues/links; Teams 27 KiB/Slack 50 blocks; first-one/first-two output faults preserve accepted delivery |
| Bundle consistency, scan, audit and workflow lint | PASS | Byte-consistent bundle; scan passed; no known vulnerabilities; actionlint/diff checks passed |
| Final hosted checks | NOT RUN | Current-head normal CI and CodeQL must pass before merge |
| Live Slack/Teams smoke | NOT RUN | Explicit test-send workflow was not dispatched |

Commands actually executed: normal `pnpm install --frozen-lockfile`, public-export
assertions, `pnpm bundle`, complete `pnpm quality`, actionlint and diff checks.
The quality gate covers formatting, lint, strict types, schema/fixture checks,
coverage, bundle consistency, public scan and production audit. Registry
publication/bundle compatibility is resolved; hosted final-head checks remain
required and are not bypassed.

The standalone matrix covers every fixture for both providers, setup outcomes,
fatal/nonfatal delivery errors, invalid payloads, file privacy, reflected/encoded
webhook masking and output-file fault preservation. No real provider request or
SAP call was made.

## Historical candidate phase

Exact-source private tarballs were tested before publication, including the
privacy-fixed source `475cc4db42f79310240496201f90d7047aa54330`. Their integrity
matches the published package. The old preparation procedure is archived at
immutable Notify commit
[`41e699d13bd183bd51551e45c386cf9e8f77d6dd`](https://github.com/commercekit-tools/notify/tree/41e699d13bd183bd51551e45c386cf9e8f77d6dd).
Normal development no longer needs candidate flags or private file dependencies.

## Remaining release gates

Final-head normal CI and CodeQL must pass before merge. Producers must emit safe
input context to supply every setting; legacy events cannot supply omitted data.
Action release/Marketplace review and live provider smoke remain separate owner
steps. Passing mocked tests is not evidence of live delivery or production SAP
guarantees. This update creates no Git tag, Action release, deployment, live
provider send, real SAP operation or deletion enablement.
Loading