@rightkit/ci 0.2.45 → 0.2.49

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.
@@ -19,12 +19,14 @@
19
19
  "items": {
20
20
  "enum": [
21
21
  "ci",
22
+ "swift-check",
22
23
  "qualification",
23
24
  "package-smoke",
24
25
  "release-candidate",
25
26
  "publish-npm",
26
27
  "publish-package-managers",
27
- "regenerate"
28
+ "regenerate",
29
+ "sign-existing"
28
30
  ]
29
31
  }
30
32
  },
@@ -122,9 +124,55 @@
122
124
  ,"swift": {
123
125
  "type": "object",
124
126
  "additionalProperties": false,
125
- "required": ["privatePackages"],
126
- "description": "Opt-in read access to private Swift package mirrors. Renders a configure step before the first build or test step and an always-run cleanup step after the last one, in the ci job, the qualification job, the release-candidate candidate job, the regenerate job and the parallel dev-artifact-mac job. Needs at least one of the lanes ci, qualification, release-candidate or regenerate. Unset renders nothing.",
127
+ "anyOf": [{ "required": ["privatePackages"] }, { "required": ["check"] }],
128
+ "description": "Opt-in read access to private Swift package mirrors. Renders a configure step before the first build or test step and an always-run cleanup step after the last one, in the ci job, the qualification job, the release-candidate candidate job, the regenerate job and the parallel dev-artifact-mac job. Needs at least one of the lanes ci, qualification, release-candidate, regenerate or swift-check. swift.check configures native iOS XCTest in the swift-check lane. Unset renders nothing.",
127
129
  "properties": {
130
+ "check": {
131
+ "type": "object",
132
+ "additionalProperties": false,
133
+ "required": [
134
+ "runner",
135
+ "xcodeVersion",
136
+ "projectDirectory",
137
+ "spec",
138
+ "project",
139
+ "scheme",
140
+ "xcodegenVersion"
141
+ ],
142
+ "properties": {
143
+ "runner": {
144
+ "enum": [
145
+ "macos-15",
146
+ "macos-15-intel",
147
+ "macos-26"
148
+ ]
149
+ },
150
+ "xcodeVersion": {
151
+ "type": "string",
152
+ "pattern": "^\\d+\\.\\d+(?:\\.\\d+)?$"
153
+ },
154
+ "xcodegenVersion": {
155
+ "type": "string",
156
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
157
+ },
158
+ "projectDirectory": {
159
+ "type": "string",
160
+ "pattern": "^(?:\\.|(?!.*\\.\\.)(?!.*\\s)[A-Za-z0-9][A-Za-z0-9._/-]*)$"
161
+ },
162
+ "spec": {
163
+ "type": "string",
164
+ "pattern": "^(?!.*\\.\\.)(?!.*\\s)[A-Za-z0-9][A-Za-z0-9._/-]*\\.ya?ml$"
165
+ },
166
+ "project": {
167
+ "type": "string",
168
+ "pattern": "^(?!.*\\.\\.)(?!.*\\s)[A-Za-z0-9][A-Za-z0-9._/-]*\\.xcodeproj$"
169
+ },
170
+ "scheme": {
171
+ "type": "string",
172
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
173
+ }
174
+ }
175
+ },
128
176
  "privatePackages": {
129
177
  "type": "array",
130
178
  "minItems": 1,
@@ -196,17 +244,52 @@
196
244
  "script": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9:_-]*$" }
197
245
  }
198
246
  },
247
+ "signExisting": {
248
+ "type": "object",
249
+ "description": "rust-hybrid only. Manual-only lane 'sign-existing': verifies an already-qualified artifact of another run of this repository (run id, artifact id or name, source sha) through the GitHub API and signs it per file with right-release sign-dev-artifact in the protected signing environment. Never builds. Requires lane 'sign-existing' and a macOS runner in matrix.os.",
250
+ "required": ["macSignManifest", "macPayloadMetadata"],
251
+ "additionalProperties": false,
252
+ "properties": {
253
+ "macSignManifest": { "type": "string", "pattern": "^(?!.*\\.\\.)(?!.*\\s)[A-Za-z0-9][A-Za-z0-9._/-]*$", "description": "Repository-relative sign manifest JSON (per-file fixed codesign identifiers, paths relative to the extracted artifact)." },
254
+ "macPayloadMetadata": { "type": "string", "pattern": "^(?!.*\\.\\.)[A-Za-z0-9][A-Za-z0-9._/ -]*$", "description": "Payload metadata JSON inside the artifact, relative to the extracted artifact root." },
255
+ "macPayloadMetadataSource": { "type": "string", "pattern": "^(?!.*\\.\\.)(?!.*\\s)[A-Za-z0-9][A-Za-z0-9._/-]*$", "description": "Optional repository-relative path of a generated payload metadata file (for example dist/dev-macos/payload.json). When set, the unsigned dev packaging step zips the .app (wrapper layout kept) plus this file at the inner-zip root, named by macPayloadMetadata (a bare file name); the step fails if the file is missing. Needs devArtifact.mac 'sign', 'notarize' or 'unsigned'." },
256
+ "environment": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$", "description": "Protected GitHub environment holding the Developer ID secrets. Defaults to the candidate.releaseChain signing environment, else 'release'." }
257
+ }
258
+ },
199
259
  "concurrency": {
200
260
  "type": "object",
201
261
  "additionalProperties": false,
202
- "description": "Requires lane 'ci'. Sets the ci workflow's concurrency.",
262
+ "description": "Requires lane 'ci'. Sets the ci workflow's concurrency: one CI run in progress per repository unless mainPushes is 'queue' with a recorded reason.",
203
263
  "properties": {
204
264
  "mainPushes": {
205
265
  "enum": ["cancel", "queue"],
206
266
  "default": "cancel",
207
- "description": "'cancel' (default) cancels a superseded push to the default branch. 'queue' lets default-branch pushes run to completion; PR runs still cancel superseded runs."
267
+ "description": "'cancel' (default) renders the supersede job: a newer push to the default branch cancels an older run that only just started or is failing, and waits for one that is nearly done. 'queue' lets default-branch pushes run to completion, renders no supersede job and requires 'reason'; PR runs still cancel superseded runs."
268
+ },
269
+ "graceFraction": {
270
+ "type": "number",
271
+ "exclusiveMinimum": 0,
272
+ "maximum": 1,
273
+ "default": 0.7,
274
+ "description": "Not with mainPushes 'queue'. An older default-branch run is cancelled by a newer push while its elapsed time is under this fraction of the median duration of the last medianWindow successful runs (or when any of its jobs has failed). Past it, the run is left to finish and the new run waits."
275
+ },
276
+ "medianWindow": {
277
+ "type": "integer",
278
+ "minimum": 1,
279
+ "maximum": 100,
280
+ "default": 10,
281
+ "description": "Not with mainPushes 'queue'. How many recent successful push runs of the workflow the median duration is taken over. With fewer than 3 such runs nothing is cancelled for being young; only runs that never started and runs with a failed job are."
282
+ },
283
+ "reason": {
284
+ "type": "string",
285
+ "minLength": 1,
286
+ "pattern": "^(?=.*\\S)[^\\r\\n\\u0085\\u2028\\u2029]+$",
287
+ "description": "Required, non-empty, single line, when mainPushes is 'queue': why default-branch pushes must not cancel each other. Rendered as a YAML comment above the ci workflow's concurrency block."
208
288
  }
209
- }
289
+ },
290
+ "if": { "properties": { "mainPushes": { "const": "queue" } }, "required": ["mainPushes"] },
291
+ "then": { "required": ["reason"] },
292
+ "else": { "not": { "required": ["reason"] } }
210
293
  },
211
294
  "devArtifact": {
212
295
  "type": "object",
@@ -220,6 +303,8 @@
220
303
  "retentionDays": { "type": "integer", "minimum": 1, "maximum": 90, "default": 7 },
221
304
  "macAppPath": { "type": "string", "pattern": "^(?!.*\\.\\.)[A-Za-z0-9][A-Za-z0-9._/ -]*\\.app$", "description": "Repository-relative path of the built .app (required when mac is 'sign')." },
222
305
  "macEntitlements": { "type": "string", "pattern": "^(?!.*\\.\\.)(?!.*\\s)[A-Za-z0-9][A-Za-z0-9._/-]*$", "description": "Optional repository-relative entitlements plist for codesign." },
306
+ "macSignManifest": { "type": "string", "pattern": "^(?!.*\\.\\.)(?!.*\\s)[A-Za-z0-9][A-Za-z0-9._/-]*$", "description": "Optional repository-relative sign manifest JSON (right-release sign-dev-artifact: per-file fixed codesign identifier, paths relative to the extracted archive). With mac 'sign', replaces codesign --deep on the .app. Requires macPayloadMetadata; not combinable with macEntitlements or mac 'notarize'." },
307
+ "macPayloadMetadata": { "type": "string", "pattern": "^(?!.*\\.\\.)[A-Za-z0-9][A-Za-z0-9._/ -]*$", "description": "Path of the payload metadata JSON (recorded hashes) inside the staged archive, relative to the extracted archive root. Required with macSignManifest." },
223
308
  "windowsGlob": { "type": "string", "pattern": "^(?!.*\\.\\.)[A-Za-z0-9][A-Za-z0-9._/*?-]*$", "description": "Repository-relative glob of built files to upload (required when windows is 'unsigned')." }
224
309
  }
225
310
  },
@@ -256,6 +341,16 @@
256
341
  }
257
342
  }
258
343
  },
344
+ "devQualification": {
345
+ "type": "object",
346
+ "required": ["buildScript", "journeyScript"],
347
+ "additionalProperties": false,
348
+ "description": "Optional `dev-qualification` job (Orthic-Labs/rightkit#107): builds the dev build (QA surface on) from the admitted revision and runs the app's in-app journeys against it. Gates windows-sign and macos-sign. The sealed candidate stays QA-free. Unset renders nothing.",
349
+ "properties": {
350
+ "buildScript": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9:_-]*$", "description": "Package script that builds the dev build. Must differ from candidate.buildScript." },
351
+ "journeyScript": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9:_-]*$", "description": "Package script that runs the in-app journeys against the dev build." }
352
+ }
353
+ },
259
354
  "signWindows": { "type": "boolean" },
260
355
  "signMacos": { "type": "boolean" },
261
356
  "releaseChain": {
package/manifest.test.mjs CHANGED
@@ -485,3 +485,51 @@ test("defaultBranch is an optional safe branch name", () => {
485
485
  assert.equal(validateManifest({ ...VALID_MINIMAL, defaultBranch }).valid, false, String(defaultBranch));
486
486
  }
487
487
  });
488
+
489
+ // Orthic-Labs/rightkit#107: candidate.devQualification and the QA-surface guard.
490
+ const DEV_QUAL_BASE = {
491
+ ...VALID_MINIMAL,
492
+ profile: "rust-hybrid",
493
+ gate: { path: "scripts/gate.sh" },
494
+ lanes: ["ci", "release-candidate"],
495
+ candidate: {
496
+ buildScript: "ci:candidate",
497
+ checkScript: "ci:candidate-check",
498
+ admissionScript: "release:admit",
499
+ stageSummaryScript: "release:stage-summary",
500
+ artifactRoot: "widgets-unsigned",
501
+ os: ["ubuntu-latest"],
502
+ },
503
+ };
504
+
505
+ test("candidate.devQualification validates build and journey scripts", () => {
506
+ const withDev = (devQualification) => ({ ...DEV_QUAL_BASE, candidate: { ...DEV_QUAL_BASE.candidate, devQualification } });
507
+ const ok = validateManifest(withDev({ buildScript: "build:dev-qualification", journeyScript: "qa:journeys" }));
508
+ assert.equal(ok.valid, true, JSON.stringify(ok.errors));
509
+ for (const bad of [
510
+ null,
511
+ [],
512
+ {},
513
+ { buildScript: "build:dev" },
514
+ { journeyScript: "qa:journeys" },
515
+ { buildScript: "echo unsafe", journeyScript: "qa:journeys" },
516
+ { buildScript: "build:dev", journeyScript: "qa journeys" },
517
+ { buildScript: "build:dev", journeyScript: "qa:journeys", extra: "x" },
518
+ ]) {
519
+ assert.equal(validateManifest(withDev(bad)).valid, false, JSON.stringify(bad));
520
+ }
521
+ const same = validateManifest(withDev({ buildScript: "ci:candidate", journeyScript: "qa:journeys" }));
522
+ assert.equal(same.valid, false);
523
+ assert.ok(same.errors.some((error) => error.includes("must differ from candidate.buildScript") && error.includes("#107")));
524
+ });
525
+
526
+ test("candidate scripts named after a QA surface are refused and point at dev-qualification", () => {
527
+ for (const name of ["build:qa-native", "ci:qa-control", "build:dev-native", "build:dev-inspect", "ci:test-mode"]) {
528
+ for (const key of ["buildScript", "checkScript"]) {
529
+ const result = validateManifest({ ...DEV_QUAL_BASE, candidate: { ...DEV_QUAL_BASE.candidate, [key]: name } });
530
+ assert.equal(result.valid, false, `${key}=${name}`);
531
+ assert.ok(result.errors.some((error) => error.includes(`candidate.${key}`) && error.includes("#107") && error.includes("devQualification")), `${key}=${name}`);
532
+ }
533
+ }
534
+ assert.equal(validateManifest(DEV_QUAL_BASE).valid, true);
535
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/ci",
3
- "version": "0.2.45",
3
+ "version": "0.2.49",
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",