From 5823c40c70a7daa83112a52a4de29569fe3d9bb0 Mon Sep 17 00:00:00 2001 From: Anilkumar Reddy Date: Fri, 13 Nov 2026 23:31:15 -0600 Subject: [PATCH] chore: use notification contract 0.0.3 --- CONTRIBUTING.md | 4 ++-- README.md | 2 +- RELEASING.md | 2 +- SECURITY.md | 2 +- THIRD_PARTY_NOTICES.md | 2 +- docs/notification-event-v1.md | 2 +- docs/shared-contract-migration.md | 6 +++++- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- pnpm-workspace.yaml | 2 +- scripts/schema-check.mjs | 6 +++--- tests/package-integration.test.ts | 2 +- 12 files changed, 23 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8b283a6..e9b32af 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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.2`. 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.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. ```sh npm login --scope=@commercekit-tools --registry=https://npm.pkg.github.com --auth-type=legacy -pnpm view @commercekit-tools/notification-contract@0.0.2 version --registry=https://npm.pkg.github.com +pnpm view @commercekit-tools/notification-contract@0.0.3 version --registry=https://npm.pkg.github.com pnpm install --frozen-lockfile ``` diff --git a/README.md b/README.md index f3208d3..63768d4 100644 --- a/README.md +++ b/README.md @@ -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.2** 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.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). 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). diff --git a/RELEASING.md b/RELEASING.md index 8dfe4e5..3cd351a 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -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.2` 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.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. ## Release order diff --git a/SECURITY.md b/SECURITY.md index fc48de1..2d605cf 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -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.2`. 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.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. diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 6eb2619..ebb945d 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -1,5 +1,5 @@ # Third-party notices -The Action's bundled runtime includes `@actions/core` and `@commercekit-tools/notification-contract@0.0.2`, 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.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. Before each release, regenerate the bundle and review `dist/licenses.txt` for changes alongside dependency updates. diff --git a/docs/notification-event-v1.md b/docs/notification-event-v1.md index 37a4b03..7025f23 100644 --- a/docs/notification-event-v1.md +++ b/docs/notification-event-v1.md @@ -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.2`; 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.3`; 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. diff --git a/docs/shared-contract-migration.md b/docs/shared-contract-migration.md index bf0e5d9..557e0a8 100644 --- a/docs/shared-contract-migration.md +++ b/docs/shared-contract-migration.md @@ -1,6 +1,6 @@ # Shared contract migration -This migration moves the pre-extraction baseline `015479e4340f61598d2125532acf6474381ca976` to `@commercekit-tools/notification-contract@0.0.2`. 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.3`; this additive package upgrade preserves the schema, rendering and delivery policies described below. Notify remains unreleased. ## Ownership inventory @@ -27,3 +27,7 @@ This migration adopts package 0.0.2's stricter validation: HTTPS links ending in Package errors do not expose Ajv diagnostic paths. The local adapter retains the invalid-JSON and byte-limit messages and uses bounded, input-free messages for schema/type/status/data and link errors. No invalid JSON is echoed. Validation failures remain fatal and occur before delivery. The context adapter preserves producer values, fills safe missing metadata, requires an explicit runner server URL, and supports producer repository/run metadata when runner values are missing. The package also rejects C1 control characters in extracted metadata and requires an origin-only server URL; the baseline extractor accepted those metadata characters and HTTPS server path prefixes. This migration adopts those stricter context policies. Invalid runner metadata is omitted without overriding valid producer context. + +## 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. diff --git a/package.json b/package.json index d1ca812..2bf7dbe 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "dependencies": { "@actions/core": "3.0.1", - "@commercekit-tools/notification-contract": "0.0.2" + "@commercekit-tools/notification-contract": "0.0.3" }, "devDependencies": { "@eslint/js": "10.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f95b30a..b338b98 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -173,8 +173,8 @@ importers: specifier: 3.0.1 version: 3.0.1 '@commercekit-tools/notification-contract': - specifier: 0.0.2 - version: 0.0.2 + specifier: 0.0.3 + version: 0.0.3 devDependencies: '@eslint/js': specifier: 10.0.1 @@ -248,8 +248,8 @@ packages: '@cacheable/utils@2.5.0': resolution: {integrity: sha512-buipgOVDkkPXNR5+xBpDw7Zk2n1EvU7qBJCNUcL7rhQ//kfpOXPAvQ511Os0vpLYJ1pZnvudNytkQt2hst3wqA==} - '@commercekit-tools/notification-contract@0.0.2': - resolution: {integrity: sha512-HEUVmkqvPdFO5TxZS6urpPx4GLzlSCDwtyz+F2NaRZBzhJ/MN0z99NGqOnJbQYmRmdor79ZaDgjigqcrga8AMQ==, tarball: https://npm.pkg.github.com/download/@commercekit-tools/notification-contract/0.0.2/2db751f8ea2f55220b4a0030e3f845632e93645c} + '@commercekit-tools/notification-contract@0.0.3': + resolution: {integrity: sha512-+TPMHceFbOTxFetmIfBa7s4y+JrBW+0ZpgnOHce7n6vldeRF2sVeNuDa/9jTYmh1q2R1oNSFiOLAIC6ODUIAQg==, tarball: https://npm.pkg.github.com/download/@commercekit-tools/notification-contract/0.0.3/10e37c57e0325438702d5c93df5563696f056210} engines: {node: '>=24.21.0'} '@eslint-community/eslint-utils@4.10.1': @@ -1147,7 +1147,7 @@ snapshots: hashery: 1.5.1 keyv: 5.6.0 - '@commercekit-tools/notification-contract@0.0.2': + '@commercekit-tools/notification-contract@0.0.3': dependencies: ajv: 8.20.0 ajv-formats: 3.0.1(ajv@8.20.0) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 651c384..a186f0f 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,4 +1,4 @@ minimumReleaseAgeExclude: - - '@commercekit-tools/notification-contract@0.0.2' + - '@commercekit-tools/notification-contract@0.0.3' overrides: minimatch: 11.0.1 diff --git a/scripts/schema-check.mjs b/scripts/schema-check.mjs index a41f418..59ef088 100644 --- a/scripts/schema-check.mjs +++ b/scripts/schema-check.mjs @@ -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.2'); -assert.equal(manifest.dependencies['@commercekit-tools/notification-contract'], '0.0.2'); +assert.equal(metadata.version, '0.0.3'); +assert.equal(manifest.dependencies['@commercekit-tools/notification-contract'], '0.0.3'); 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.'); @@ -30,4 +30,4 @@ assert.deepEqual( ].sort(), ); assert.deepEqual([...schema.properties.eventType.enum].sort(), [...types].sort()); -console.log('Notification contract 0.0.2: public schema export, all fixtures and supported event types verified.'); +console.log('Notification contract 0.0.3: public schema export, all fixtures and supported event types verified.'); diff --git a/tests/package-integration.test.ts b/tests/package-integration.test.ts index ef60a65..b12257e 100644 --- a/tests/package-integration.test.ts +++ b/tests/package-integration.test.ts @@ -19,7 +19,7 @@ import { renderTeams } from '../src/providers/teams-workflow/render.js'; const text = await readFile(new URL('./fixtures/events/build-success.json', import.meta.url), 'utf8'); it('uses the pinned package and its public schema export', () => { - expect(metadata.version).toBe('0.0.2'); + expect(metadata.version).toBe('0.0.3'); expect(schema.properties.schemaVersion.const).toBe(1); });