@rightkit/git 0.2.13 → 0.2.15

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/cli/right-git.mjs CHANGED
File without changes
package/manifest.mjs CHANGED
@@ -442,7 +442,7 @@ function windowsSigningJob(manifest, pm, artifactPrefix) {
442
442
  return `
443
443
  windows-sign:
444
444
  needs: [candidate]
445
- if: \${{ startsWith(github.ref, 'refs/tags/v') }}
445
+ if: \${{ startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.signed_qualification == true) }}
446
446
  environment: release
447
447
  strategy:
448
448
  fail-fast: false
@@ -532,7 +532,7 @@ function macosSigningJob(manifest, pm, artifactPrefix) {
532
532
  return `
533
533
  macos-sign:
534
534
  needs: [candidate]
535
- if: \${{ startsWith(github.ref, 'refs/tags/v') }}
535
+ if: \${{ startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.signed_qualification == true) }}
536
536
  environment: release
537
537
  strategy:
538
538
  fail-fast: false
@@ -630,7 +630,7 @@ function releaseChainJobs(manifest, pm, artifactPrefix) {
630
630
  return `
631
631
  installed-qualification:
632
632
  needs: [candidate, windows-sign]
633
- if: \${{ always() && startsWith(github.ref, 'refs/tags/v') && needs.candidate.result == 'success' }}
633
+ if: \${{ always() && (startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.signed_qualification == true)) && needs.candidate.result == 'success' }}
634
634
  environment: release
635
635
  runs-on: \${{ vars.${chain.qualificationRunnerVariable} || '${windowsRunner}' }}
636
636
  steps:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/git",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "description": "Public-repo-only GitHub Actions workflow layer: templates, visibility gate, sync/drift/adopt/uninstall for right-git.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
@@ -15,9 +15,6 @@
15
15
  "*.json"
16
16
  ],
17
17
  "sideEffects": false,
18
- "scripts": {
19
- "test": "node --test *.test.mjs"
20
- },
21
18
  "publishConfig": {
22
19
  "registry": "https://registry.npmjs.org/",
23
20
  "access": "public"
@@ -27,5 +24,7 @@
27
24
  "url": "git+https://github.com/bogusyogi/claude.git",
28
25
  "directory": "tools/rightkit/packages/git"
29
26
  },
30
- "packageManager": "pnpm@11.24.0"
31
- }
27
+ "scripts": {
28
+ "test": "node --test *.test.mjs"
29
+ }
30
+ }
package/render.test.mjs CHANGED
@@ -93,7 +93,7 @@ test("rust-hybrid release candidate can opt into OIDC Windows signing without lo
93
93
  buildRenderContext(manifest, "/repos/widgets"),
94
94
  );
95
95
  assert.match(content, /environment: release/);
96
- assert.match(content, /windows-sign:\n needs: \[candidate\]\n if: \$\{\{ startsWith\(github\.ref, 'refs\/tags\/v'\) \}\}/);
96
+ assert.match(content, /windows-sign:\n needs: \[candidate\]\n if: \$\{\{ startsWith\(github\.ref, 'refs\/tags\/v'\) \|\| \(github\.event_name == 'workflow_dispatch' && inputs\.signed_qualification == true\) \}\}/);
97
97
  assert.match(content, /id-token: write/);
98
98
  assert.match(content, /azure\/login@[a-f0-9]{40}/);
99
99
  assert.match(content, /vars\.AZURE_CLIENT_ID/);
@@ -120,7 +120,7 @@ test("rust-hybrid release candidate can opt into protected macOS signing & notar
120
120
  buildRenderContext(manifest, "/repos/widgets"),
121
121
  );
122
122
  assert.match(content, /macos-sign:/);
123
- assert.match(content, /macos-sign:\n needs: \[candidate\]\n if: \$\{\{ startsWith\(github\.ref, 'refs\/tags\/v'\) \}\}/);
123
+ assert.match(content, /macos-sign:\n needs: \[candidate\]\n if: \$\{\{ startsWith\(github\.ref, 'refs\/tags\/v'\) \|\| \(github\.event_name == 'workflow_dispatch' && inputs\.signed_qualification == true\) \}\}/);
124
124
  assert.match(content, /environment: release/);
125
125
  assert.match(content, /secrets\.APPLE_CERTIFICATE_BASE64/);
126
126
  assert.match(content, /temporary keychain/i);
@@ -205,12 +205,18 @@ test("rust-hybrid release chain preserves signed candidate, installed qualificat
205
205
  );
206
206
  assert.match(content, /windows-sign:[\s\S]*pnpm run release:finalize:win/);
207
207
  assert.match(content, /macos-sign:[\s\S]*pnpm run release:finalize:mac/);
208
+ assert.match(content, /signed_qualification:\n description: Run protected signing & installed qualification without publishing/);
209
+ assert.match(content, /windows-sign:[\s\S]*inputs\.signed_qualification == true/);
210
+ assert.match(content, /macos-sign:[\s\S]*inputs\.signed_qualification == true/);
208
211
  assert.match(content, /installed-qualification:\n needs: \[candidate, windows-sign\]/);
212
+ assert.match(content, /installed-qualification:[\s\S]*inputs\.signed_qualification == true/);
209
213
  assert.match(content, /installed_qualification_failed/);
210
214
  assert.match(content, /shell: pwsh\n run: \|\n throw 'installed_qualification_failed \{ reason: prerequisites_absent, detail: "same-run Windows signing\/finalization did not succeed" \}'/);
211
215
  assert.doesNotMatch(content, /^ run: throw 'installed_qualification_failed .*detail: /m);
212
216
  assert.match(content, /pnpm run release:qualify:installed/);
213
217
  assert.match(content, /publish:\n needs: \[installed-qualification, macos-sign\]/);
218
+ assert.match(content, /publish:[\s\S]*startsWith\(github\.ref, 'refs\/tags\/v'\)/);
219
+ assert.doesNotMatch(content.slice(content.indexOf(" publish:")), /inputs\.signed_qualification/);
214
220
  assert.match(content, /needs\.macos-sign\.result == 'success'/);
215
221
  assert.match(content, /contents: write/);
216
222
  assert.match(content, /pnpm run release:publish:qualified/);
package/sync.mjs CHANGED
@@ -12,6 +12,22 @@ import { renderTemplate, MANAGED_MARKER } from "./render.mjs";
12
12
  const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)));
13
13
  const TEMPLATES_DIR = path.join(packageRoot, "templates");
14
14
  const WORKFLOWS_SUBDIR = path.join(".github", "workflows");
15
+ const PUBLISHED_NPM_VERSION = /^\d+\.\d+\.\d+$/;
16
+
17
+ function releaseChainDependencyError(repoPath, manifest) {
18
+ if (!manifest.candidate?.releaseChain) return null;
19
+ let pkg;
20
+ try {
21
+ pkg = JSON.parse(fs.readFileSync(path.join(repoPath, "package.json"), "utf8"));
22
+ } catch {
23
+ return "release-candidate releaseChain requires a readable package.json with direct devDependency @rightkit/release";
24
+ }
25
+ const version = pkg.devDependencies?.["@rightkit/release"];
26
+ if (typeof version !== "string" || !PUBLISHED_NPM_VERSION.test(version)) {
27
+ return "release-candidate releaseChain requires direct devDependency @rightkit/release pinned to a published npm version";
28
+ }
29
+ return null;
30
+ }
15
31
 
16
32
  /** Render every lane declared in the manifest. Returns { lane, filename, content }[]. */
17
33
  export function renderLanes(manifest, repoPath) {
@@ -82,6 +98,10 @@ export async function planSync(repoPath, deps = {}, manifestOverride = null) {
82
98
  if (!loaded.ok) {
83
99
  return { ok: false, stage: "manifest", errors: loaded.errors, changes: [] };
84
100
  }
101
+ const dependencyError = releaseChainDependencyError(repoPath, loaded.manifest);
102
+ if (dependencyError) {
103
+ return { ok: false, stage: "dependency", errors: [dependencyError], changes: [] };
104
+ }
85
105
 
86
106
  const rendered = renderLanes(loaded.manifest, repoPath);
87
107
  const wantedFilenames = new Set(rendered.map((r) => r.filename));
package/sync.test.mjs CHANGED
@@ -54,6 +54,44 @@ test("sync reports manifest errors instead of writing files", async () => {
54
54
  assert.equal(result.stage, "manifest");
55
55
  });
56
56
 
57
+ test("sync rejects a Membrane-like release chain without root @rightkit/release", async () => {
58
+ const manifest = {
59
+ schemaVersion: 1,
60
+ lanes: ["ci", "release-candidate"],
61
+ matrix: { os: ["windows-2025", "macos-15"], node: ["22.23.2"] },
62
+ packageManager: "pnpm@11.24.0",
63
+ templateVersion: "1.5.0",
64
+ profile: "rust-hybrid",
65
+ gate: { path: "scripts/ci/run-ci.sh" },
66
+ candidate: {
67
+ buildScript: "release:candidate:build",
68
+ checkScript: "release:candidate:check",
69
+ artifactRoot: "membrane-release-candidate",
70
+ os: ["windows-2025", "macos-15"],
71
+ signWindows: true,
72
+ signMacos: true,
73
+ releaseChain: {
74
+ windowsFinalizeScript: "release:finalize:windows",
75
+ macosFinalizeScript: "release:finalize:macos",
76
+ installedQualificationScript: "release:qualify:installed",
77
+ publishScript: "release:publish:qualified",
78
+ qualificationRunnerVariable: "MEMBRANE_QUALIFICATION_RUNNER_LABEL",
79
+ },
80
+ },
81
+ };
82
+ const dir = makeTempRepo(manifest, { packageJson: { name: "membrane", devDependencies: { "@rightkit/git": "0.2.13" } } });
83
+ const missing = await syncCommand(dir, { deps: PUBLIC_DEPS });
84
+ assert.equal(missing.ok, false);
85
+ assert.equal(missing.stage, "dependency");
86
+ assert.match(missing.errors[0], /direct devDependency @rightkit\/release/);
87
+ assert.equal(fs.existsSync(path.join(dir, ".github", "workflows")), false);
88
+
89
+ fs.writeFileSync(path.join(dir, "package.json"), JSON.stringify({ name: "membrane", devDependencies: { "@rightkit/git": "0.2.13", "@rightkit/release": "0.2.84" } }), "utf8");
90
+ const present = await syncCommand(dir, { deps: PUBLIC_DEPS });
91
+ assert.equal(present.ok, true);
92
+ assert.ok(fs.existsSync(path.join(dir, ".github", "workflows", "release-candidate.yml")));
93
+ });
94
+
57
95
  test("sync refuses an unmanaged same-name workflow", async () => {
58
96
  const dir = makeTempRepo(SAMPLE_MANIFEST);
59
97
  const target = path.join(dir, ".github", "workflows", "ci.yml");
@@ -5,6 +5,12 @@
5
5
  name: release-candidate
6
6
  on:
7
7
  workflow_dispatch:
8
+ inputs:
9
+ signed_qualification:
10
+ description: Run protected signing & installed qualification without publishing
11
+ required: false
12
+ type: boolean
13
+ default: false
8
14
  push:
9
15
  tags: ['v*']
10
16
  permissions: