@rightkit/release 0.2.43 → 0.2.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.2.43",
3
+ "version": "0.2.44",
4
4
  "description": "Portable Right Suite release CLI/SDK: signed installers, updater artifacts, patch/update routing, hardening, R2 publish, and RightApps registration.",
5
5
  "type": "module",
6
6
  "bin": {
package/release-state.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { spawnSync } from "node:child_process";
3
- import { existsSync, readFileSync, watch } from "node:fs";
3
+ import { existsSync, readFileSync, readdirSync, watch } from "node:fs";
4
4
  import path from "node:path";
5
5
  import { DEFAULT_SCCACHE_MAX_BYTES, resolveCacheLayout } from "./cache-policy.mjs";
6
6
 
@@ -118,6 +118,24 @@ export async function runBuildStateMachine({
118
118
  const releaseId = `${app}-${version}-${commit.slice(0, 8)}`;
119
119
  const platformDir = platform === "win" ? "windows" : platform === "mac" ? "mac" : platform;
120
120
  const sealedDir = path.join(root, ".right-release", "sealed", releaseId, platformDir);
121
+ const sealedRoot = path.join(root, ".right-release", "sealed");
122
+ if (existsSync(sealedRoot)) {
123
+ for (const releaseEntry of readdirSync(sealedRoot, { withFileTypes: true })) {
124
+ if (!releaseEntry.isDirectory()) continue;
125
+ const releaseRoot = path.join(sealedRoot, releaseEntry.name);
126
+ for (const platformEntry of readdirSync(releaseRoot, { withFileTypes: true })) {
127
+ if (!platformEntry.isDirectory()) continue;
128
+ const manifestPath = path.join(releaseRoot, platformEntry.name, "release-manifest.json");
129
+ if (!existsSync(manifestPath)) continue;
130
+ const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
131
+ if (manifest.app === app && manifest.version === version && manifest.commit !== commit) {
132
+ throw new Error(
133
+ `${app} version ${version} is already sealed from commit ${manifest.commit} (${manifest.releaseId}); bump the version before rebuilding`,
134
+ );
135
+ }
136
+ }
137
+ }
138
+ }
121
139
  if (existsSync(path.join(sealedDir, "release-manifest.json"))) {
122
140
  const sealed = verifySealedRelease(sealedDir);
123
141
  if (sealed.manifest.app !== app || sealed.manifest.version !== version || sealed.manifest.commit !== commit) {
@@ -150,6 +150,31 @@ test("missing runtime input fails before build preparation and cannot touch an e
150
150
  assert.equal(readFileSync(fx.installer, "utf8"), "signed-installer");
151
151
  });
152
152
 
153
+ test("a version already sealed from another commit cannot be rebuilt", async () => {
154
+ const fx = fixture();
155
+ let prepared = false;
156
+ await assert.rejects(
157
+ runBuildStateMachine({
158
+ root: fx.root,
159
+ app: "fixture",
160
+ version: fx.manifest.version,
161
+ commit: "1234567890abcdef",
162
+ platform: "win",
163
+ requiredInputs: [],
164
+ ops: {
165
+ preflight: async () => {},
166
+ prepare: async () => { prepared = true; },
167
+ build: async () => {},
168
+ sign: async () => {},
169
+ harden: async () => {},
170
+ seal: async () => {},
171
+ },
172
+ }),
173
+ /version 1\.2\.3 is already sealed from commit abcdef1234567890/,
174
+ );
175
+ assert.equal(prepared, false);
176
+ });
177
+
153
178
  test("an interrupted build leaves every previously sealed release untouched", async () => {
154
179
  const fx = fixture();
155
180
  await assert.rejects(
@@ -432,7 +432,7 @@ test("every app platform requires effective non-empty build inputs", () => {
432
432
  test("RightKit exposes one current version manifest", () => {
433
433
  assert.equal(existsSync(versionsPath), true, "rightkit-versions.json must be the single current-version source");
434
434
  assert.match(versions.packageManager, /^pnpm@\d+\.\d+\.\d+$/);
435
- assert.equal(versions.npm["@rightkit/release"], "0.2.43");
435
+ assert.equal(versions.npm["@rightkit/release"], "0.2.44");
436
436
  assert.equal(versions.npm["@rightkit/legal"], "0.2.0");
437
437
  assert.equal(versions.npm["@rightkit/license"], "0.1.5");
438
438
  assert.equal(versions.npm["@rightkit/logs"], "0.1.3");
@@ -444,11 +444,11 @@ test("RightKit exposes one current version manifest", () => {
444
444
  "@rightkit/license": "0.1.6",
445
445
  });
446
446
  assert.deepEqual(versions.legacyNpm, {
447
- "@rightkit/release": ["0.2.22", "0.2.29", "0.2.30", "0.2.31", "0.2.41", "0.2.42"],
447
+ "@rightkit/release": ["0.2.22", "0.2.29", "0.2.30", "0.2.31", "0.2.41", "0.2.42", "0.2.43"],
448
448
  });
449
449
  assert.ok(
450
450
  new Set([versions.npm["@rightkit/release"], ...versions.legacyNpm["@rightkit/release"]]).has("0.2.42"),
451
- "the previously published @rightkit/release 0.2.42 must remain accepted during the 0.2.43 rollout",
451
+ "the previously published @rightkit/release 0.2.42 must remain accepted during the 0.2.44 rollout",
452
452
  );
453
453
  const licensePackage = JSON.parse(readFileSync(
454
454
  path.join(workspace, "tools/rightkit/packages/license/package.json"),
@@ -7,7 +7,7 @@
7
7
  "@rightkit/logs": "0.1.3",
8
8
  "@rightkit/platform-ui": "0.1.0",
9
9
  "@rightkit/qa": "0.1.0",
10
- "@rightkit/release": "0.2.43",
10
+ "@rightkit/release": "0.2.44",
11
11
  "@rightkit/tauri": "0.1.0",
12
12
  "@rightkit/updates": "0.2.3"
13
13
  },
@@ -17,7 +17,7 @@
17
17
  "@rightkit/license": "0.1.6"
18
18
  },
19
19
  "legacyNpm": {
20
- "@rightkit/release": ["0.2.22", "0.2.29", "0.2.30", "0.2.31", "0.2.41", "0.2.42"]
20
+ "@rightkit/release": ["0.2.22", "0.2.29", "0.2.30", "0.2.31", "0.2.41", "0.2.42", "0.2.43"]
21
21
  },
22
22
  "cargo": {
23
23
  "rightkit-license": "0.1.2",