Skip to content

Add runtime-driven canary and unstable SDK publishing - #2544

Open
MackinnonBuck wants to merge 6 commits into
mainfrom
mackinnonbuck-sdk-unstable-publishing
Open

Add runtime-driven canary and unstable SDK publishing#2544
MackinnonBuck wants to merge 6 commits into
mainfrom
mackinnonbuck-sdk-unstable-publishing

Conversation

@MackinnonBuck

@MackinnonBuck MackinnonBuck commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • keep publish.yml as the normal stable/prerelease publisher with no runtime handoff or unstable path, and reserve the canary and unstable prerelease namespaces for runtime-driven releases
  • add runtime-sdk.yml as the unified runtime-driven Node SDK entry for canary and unstable, and as the second public npm trusted-publisher identity
  • reuse runtime-backed-node-release.yml for exact eight-platform runtime acquisition, Ubuntu/macOS/Windows tests, one nine-package build and retained manifest, and optional internal Azure publication/verification
  • publish unstable artifacts internally first, then publish the exact retained tarballs publicly with platform packages before the umbrella
  • add a durable runtime_run_id artifact ledger with serialized claiming, API provenance validation, bounded artifact-index retries, canonical-run mirroring, and collision rejection
  • retain deterministic unstable SDK versioning and strict registry integrity/tag recovery behavior

Runtime dispatch contract

runtime-sdk.yml accepts channel, runtime_version, runtime_sha, runtime_source, runtime_run_id, and mode. Canary permits only azure with tests-only|internal; unstable permits only github-packages with internal. Direct manual unstable runs additionally support an optional version.

Duplicate dispatches wait for and mirror the canonical SDK workflow run. Failed or canceled canonical runs must be rerun directly; no cross-run release recovery path exists.

Validation

  • focused release suite: 49 tests
  • Node TypeScript typecheck
  • Node lint (no errors; five existing warnings)
  • Prettier and diff checks
  • workflow topology and idempotency contract tests

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@MackinnonBuck
MackinnonBuck requested a review from a team as a code owner September 4, 2026 21:09
Copilot AI balanced review requested due to automatic review settings September 4, 2026 21:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Critical argument-validation and moderate provenance, version-comparison, and SemVer handling issues remain unresolved.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 High severity · 4 Medium severity

New issues introduced by this change (5)
Severity Finding
High severity nodejs/​scripts/​runtime-package-acquisition.ts — Missing or misspelled required flags are silently converted to empty strings. In particular,…
Medium severity .github/​workflows/​publish.ymlruntime_run_id is only checked for numeric syntax and then copied into the release manifest;…
Medium severity .github/​workflows/​publish.yml — This substring match can select and test a different runtime version whose output merely contains…
Medium severity .github/​workflows/​sdk-canary.yml — This is a substring check, so a different runtime version can pass (for example, expected 1.0.8
Medium severity .github/​workflows/​sdk-canary.yml — SemVer permits build metadata. If the public latest is 1.2.3+build, this leaves PATCH=3+build;…
What changed in this PR

Adds gated canary and unstable Node SDK publishing with deterministic versioning, runtime acquisition, integrity-aware manifests, and recovery support.

Changes:

  • Adds runtime acquisition, versioning, manifest, and publishing helpers.
  • Reworks canary and unstable workflows with cross-platform validation.
  • Adds focused release tests and operator documentation.
File Description Review
nodejs/​test/​unstable-version.test.ts Tests deterministic unstable versions. No unresolved comments.
nodejs/​test/​runtimeArtifacts.test.ts Tests local runtime selection. No unresolved comments.
nodejs/​test/​runtime-package-acquisition.test.ts Tests runtime acquisition and validation. No unresolved comments.
nodejs/​test/​release-workflows.test.ts Tests workflow contracts. No unresolved comments.
nodejs/​test/​release-manifest.test.ts Tests manifest integrity. No unresolved comments.
nodejs/​test/​npm-release.test.ts Tests integrity-aware publishing. No unresolved comments.
nodejs/​scripts/​unstable-version.ts Calculates deterministic unstable versions. No unresolved comments.
nodejs/​scripts/​set-cli-version.js Adds local-package mode. No unresolved comments.
nodejs/​scripts/​runtime-package-acquisition.ts Acquires exact runtime packages. Critical (1 vote): Reject unknown, duplicate, missing, and incomplete arguments before filesystem operations; a missing --output currently targets the working directory.
nodejs/​scripts/​releaseArtifacts.ts Supports pre-acquired runtime roots. No unresolved comments.
nodejs/​scripts/​release-manifest.ts Creates and verifies release manifests. No unresolved comments.
nodejs/​scripts/​npm-release.js Publishes package sets with integrity checks. No unresolved comments.
nodejs/​README.md Documents runtime package inputs. No unresolved comments.
nodejs/​package.json Adds release helper commands. No unresolved comments.
docs/​developer-docs/​unstable-releases.md Adds the operator runbook. No unresolved comments.
docs/​developer-docs/​secrets.md Documents token permissions. No unresolved comments.
.github/​workflows/​sdk-canary.yml Reworks gated canary packaging. Moderate (1 vote each): Strip SemVer build metadata before patch arithmetic; replace substring runtime-version checks at lines 217 and 360 with exact parsed comparisons.
.github/​workflows/​publish.yml Adds gated unstable publishing. Moderate (1 vote each): Validate runtime_run_id provenance against the source repository and runtime metadata; replace substring runtime-version checks at lines 535 and 686 with exact parsed comparisons.
Suppressed comments (2)

.github/workflows/publish.yml:686

  • This release gate checks only that the expected text occurs somewhere in the output, so a clean install with a different version such as 1.0.83 can satisfy an expected 1.0.8. Parse the runtime's reported version and require exact equality before allowing public publication.
          "$RUNTIME" --version | grep -F "$RUNTIME_VERSION"

.github/workflows/sdk-canary.yml:360

  • The clean-install gate uses a substring match, so it can accept the wrong embedded runtime when the requested version is a prefix of the actual one (for example, 1.0.8 versus 1.0.83). Parse the emitted version and require exact equality so this gate proves the package contains the selected runtime.
          "$RUNTIME" --version | grep -F "$RUNTIME_VERSION"

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +239 to +257
function parseArguments(args: string[]): AcquireRuntimePackagesOptions {
const values = new Map<string, string>();
for (let index = 0; index < args.length; index += 2) {
const key = args[index];
const value = args[index + 1];
if (!key?.startsWith("--") || !value) {
throw new Error(
"Usage: runtime-package-acquisition.ts --version <version> --sha <sha> --registry <url> --output <directory>"
);
}
values.set(key, value);
}
return {
runtimeVersion: values.get("--version") ?? "",
runtimeSha: values.get("--sha") ?? "",
registry: values.get("--registry") ?? "",
outputDirectory: values.get("--output") ?? "",
};
}
Comment thread .github/workflows/publish.yml Outdated
Comment on lines +386 to +389
[[ "$RUNTIME_SHA" =~ ^[0-9a-f]{40}$ ]] ||
{ echo "::error::runtime_sha must be a lowercase full SHA."; exit 1; }
[[ "$RUNTIME_RUN_ID" =~ ^[0-9]+$ ]] ||
{ echo "::error::runtime_run_id must be numeric."; exit 1; }
Comment thread .github/workflows/publish.yml Outdated
set -euo pipefail
node scripts/set-cli-version.js "$RUNTIME_VERSION" --local-package
runtime_path="$(npm run --silent prepare:runtime -- --print-path)"
"$runtime_path" --version | grep -F "$RUNTIME_VERSION"
Comment thread .github/workflows/sdk-canary.yml Outdated
node "$legacy_path" --version | grep -F "$RUNTIME_VERSION"
node scripts/set-cli-version.js "$RUNTIME_VERSION" --local-package
runtime_path="$(npm run --silent prepare:runtime -- --print-path)"
"$runtime_path" --version | grep -F "$RUNTIME_VERSION"
Comment thread .github/workflows/sdk-canary.yml Outdated

- name: Set package and runtime versions
PUBLIC_LATEST="$(node scripts/get-version.js current)"
BASE="${PUBLIC_LATEST%%-*}"
Mackinnon Buck and others added 2 commits September 4, 2026 14:28
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@MackinnonBuck MackinnonBuck changed the title Add gated unstable SDK publishing Add runtime-driven canary and unstable SDK publishing Sep 4, 2026
@github-actions

This comment has been minimized.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d81fc7cf-d30a-470e-b7bf-42a02f62841d
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

SDK Consistency Review

Scope of PR #2544: This PR only modifies Node.js release/publishing infrastructure — GitHub Actions workflows (publish.yml, new runtime-backed-node-release.yml, runtime-sdk.yml, removed sdk-canary.yml), release tooling scripts (nodejs/scripts/npm-release.js, release-manifest.ts, runtime-dispatch-ledger.ts, runtime-package-acquisition.ts, unstable-version.ts, set-cli-version.js, releaseArtifacts.ts), their corresponding tests, and documentation (docs/developer-docs/secrets.md, docs/developer-docs/unstable-releases.md).

No changes touch SDK client code in any language (nodejs/src/, python/copilot/, go/, dotnet/src/, java/sdk/src/main/java/, rust/src/). There are no new/modified public APIs, method signatures, or client-facing behaviors.

Conclusion: These changes concern npm-specific release/packaging mechanics (unstable version tagging, runtime binary acquisition/dispatch, publish workflow validation) that are inherently tied to the Node.js/npm ecosystem and its distribution model. This is analogous to a "language-specific optimization" — it does not need to be mirrored in other SDKs, since each language has its own independent release/packaging pipeline outside the scope of this PR.

✅ No cross-SDK consistency issues found.

Generated by SDK Consistency Review Agent for #2544 · copilot · sonnet50 · 18.6 AIC · ⌖ 11.9 AIC · ⊞ 9.7K ·

Mackinnon Buck added 2 commits September 4, 2026 16:36
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d81fc7cf-d30a-470e-b7bf-42a02f62841d
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d81fc7cf-d30a-470e-b7bf-42a02f62841d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants