@git.zone/cli 7.2.7 → 7.4.0
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/assets/templates/npm/.package.json +1 -1
- package/assets/templates/service/.package.json +1 -1
- package/assets/templates/wcc/.package.json +1 -1
- package/assets/templates/website/.package.json +1 -1
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/helpers.climode.js +2 -1
- package/dist_ts/mod_release/classes.detachedrelease.d.ts +85 -0
- package/dist_ts/mod_release/classes.detachedrelease.js +506 -0
- package/dist_ts/mod_release/classes.releasejournal.d.ts +8 -2
- package/dist_ts/mod_release/classes.releasejournal.js +2 -2
- package/dist_ts/mod_release/helpers.npmartifact.d.ts +57 -4
- package/dist_ts/mod_release/helpers.npmartifact.js +228 -9
- package/dist_ts/mod_release/helpers.releasepreparation.d.ts +7 -2
- package/dist_ts/mod_release/helpers.releasepreparation.js +20 -6
- package/dist_ts/mod_release/helpers.releasepublication.js +38 -8
- package/dist_ts/mod_release/index.js +118 -13
- package/dist_ts/mod_services/classes.interprocesslock.d.ts +12 -0
- package/dist_ts/mod_services/classes.interprocesslock.js +35 -12
- package/dist_ts/paths.d.ts +6 -0
- package/dist_ts/paths.js +7 -1
- package/package.json +4 -4
- package/readme.md +126 -5
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/helpers.climode.ts +1 -0
- package/ts/mod_release/classes.detachedrelease.ts +655 -0
- package/ts/mod_release/classes.releasejournal.ts +10 -3
- package/ts/mod_release/helpers.npmartifact.ts +379 -16
- package/ts/mod_release/helpers.releasepreparation.ts +25 -3
- package/ts/mod_release/helpers.releasepublication.ts +60 -0
- package/ts/mod_release/index.ts +168 -10
- package/ts/mod_services/classes.interprocesslock.ts +44 -15
- package/ts/paths.ts +10 -0
|
@@ -82,17 +82,10 @@ export class InterProcessLock {
|
|
|
82
82
|
}
|
|
83
83
|
const remaining = deadlineAt - Date.now();
|
|
84
84
|
if (remaining <= 0) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
typeof existingOwner.createdAt === 'string') {
|
|
90
|
-
ownerDescription = `pid ${existingOwner.pid}, created ${existingOwner.createdAt}`;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
catch {
|
|
94
|
-
// Incomplete stale locks remain fail-closed and require operator review.
|
|
95
|
-
}
|
|
85
|
+
const holder = await this.readOwnerMetadata();
|
|
86
|
+
const ownerDescription = holder.pid !== null && holder.createdAt !== null
|
|
87
|
+
? `pid ${holder.pid}, created ${holder.createdAt}`
|
|
88
|
+
: 'owner metadata unavailable';
|
|
96
89
|
throw new Error(`${this.description} is locked (${ownerDescription}). ` +
|
|
97
90
|
`If that process no longer exists, inspect and remove ${this.lockPath}.`);
|
|
98
91
|
}
|
|
@@ -100,6 +93,36 @@ export class InterProcessLock {
|
|
|
100
93
|
}
|
|
101
94
|
}
|
|
102
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* The holder of the lock, or null while it is free. A lock whose owner
|
|
98
|
+
* metadata is missing or incomplete is still held; its holder is then
|
|
99
|
+
* unknown, and stale-lock recovery stays manual.
|
|
100
|
+
*/
|
|
101
|
+
async readHolder() {
|
|
102
|
+
try {
|
|
103
|
+
await plugins.fs.lstat(this.lockPath);
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
if (error.code === 'ENOENT')
|
|
107
|
+
return null;
|
|
108
|
+
throw new Error(`${this.description} lock could not be inspected.`, { cause: error });
|
|
109
|
+
}
|
|
110
|
+
return this.readOwnerMetadata();
|
|
111
|
+
}
|
|
112
|
+
async readOwnerMetadata() {
|
|
113
|
+
try {
|
|
114
|
+
const owner = JSON.parse(await plugins.fs.readFile(plugins.path.join(this.lockPath, 'owner.json'), 'utf8'));
|
|
115
|
+
if (isPlainObject(owner) &&
|
|
116
|
+
typeof owner.pid === 'number' &&
|
|
117
|
+
typeof owner.createdAt === 'string') {
|
|
118
|
+
return { pid: owner.pid, createdAt: owner.createdAt };
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
// Incomplete stale locks remain fail-closed and require operator review.
|
|
123
|
+
}
|
|
124
|
+
return { pid: null, createdAt: null };
|
|
125
|
+
}
|
|
103
126
|
async release(tokenArg, requireOwnerArg) {
|
|
104
127
|
const ownerPath = plugins.path.join(this.lockPath, 'owner.json');
|
|
105
128
|
if (requireOwnerArg) {
|
|
@@ -138,4 +161,4 @@ export const withServiceDataOperationLock = async (projectPathArg, serviceArg, o
|
|
|
138
161
|
description: `${serviceArg} service data operation`,
|
|
139
162
|
}, operationArg);
|
|
140
163
|
};
|
|
141
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
164
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy5pbnRlcnByb2Nlc3Nsb2NrLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vdHMvbW9kX3NlcnZpY2VzL2NsYXNzZXMuaW50ZXJwcm9jZXNzbG9jay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQztBQXNCekMsTUFBTSxhQUFhLEdBQUcsQ0FBQyxRQUFpQixFQUF1QyxFQUFFO0lBQy9FLE9BQU8sT0FBTyxRQUFRLEtBQUssUUFBUSxJQUFJLFFBQVEsS0FBSyxJQUFJLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FBQ3ZGLENBQUMsQ0FBQztBQUVGLGtGQUFrRjtBQUNsRixNQUFNLE9BQU8sZ0JBQWdCO0lBQ1gsUUFBUSxDQUFTO0lBQ2hCLFdBQVcsQ0FBUztJQUNwQixTQUFTLENBQVM7SUFDbEIsTUFBTSxDQUFTO0lBRWhDLFlBQVksVUFBb0M7UUFDOUMsSUFBSSxD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FDdEIsVUFBd0IsRUFDeEIsWUFBOEIsRUFDbEIsRUFBRTtJQUNkLE9BQU8sb0JBQW9CLENBQ3pCO1FBQ0UsUUFBUSxFQUFFLCtCQUErQixDQUFDLGNBQWMsRUFBRSxVQUFVLENBQUM7UUFDckUsV0FBVyxFQUFFLEdBQUcsVUFBVSx5QkFBeUI7S0FDcEQsRUFDRCxZQUFZLENBQ2IsQ0FBQztBQUNKLENBQUMsQ0FBQyJ9
|
package/dist_ts/paths.d.ts
CHANGED
|
@@ -2,3 +2,9 @@ export declare let packageDir: string;
|
|
|
2
2
|
export declare let assetsDir: string;
|
|
3
3
|
export declare let templatesDir: string;
|
|
4
4
|
export declare let cwd: string;
|
|
5
|
+
/**
|
|
6
|
+
* The executable that runs this build of gitzone: `cli.js` loads `dist_ts`, and
|
|
7
|
+
* `cli.ts.js` runs the TypeScript sources through tsrun. A process that starts
|
|
8
|
+
* another gitzone process uses it, so both run the same code.
|
|
9
|
+
*/
|
|
10
|
+
export declare let cliEntryPath: string;
|
package/dist_ts/paths.js
CHANGED
|
@@ -3,4 +3,10 @@ export let packageDir = plugins.path.join(plugins.smartpath.get.dirnameFromImpor
|
|
|
3
3
|
export let assetsDir = plugins.path.join(packageDir, './assets');
|
|
4
4
|
export let templatesDir = plugins.path.join(assetsDir, 'templates');
|
|
5
5
|
export let cwd = process.cwd();
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The executable that runs this build of gitzone: `cli.js` loads `dist_ts`, and
|
|
8
|
+
* `cli.ts.js` runs the TypeScript sources through tsrun. A process that starts
|
|
9
|
+
* another gitzone process uses it, so both run the same code.
|
|
10
|
+
*/
|
|
11
|
+
export let cliEntryPath = plugins.path.join(packageDir, import.meta.url.endsWith('.ts') ? 'cli.ts.js' : 'cli.js');
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF0aHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9wYXRocy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGNBQWMsQ0FBQztBQUV4QyxNQUFNLENBQUMsSUFBSSxVQUFVLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQ3ZDLE9BQU8sQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLHdCQUF3QixDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQy9ELEtBQUssQ0FDTixDQUFDO0FBQ0YsTUFBTSxDQUFDLElBQUksU0FBUyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxVQUFVLENBQUMsQ0FBQztBQUNqRSxNQUFNLENBQUMsSUFBSSxZQUFZLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLFdBQVcsQ0FBQyxDQUFDO0FBQ3BFLE1BQU0sQ0FBQyxJQUFJLEdBQUcsR0FBRyxPQUFPLENBQUMsR0FBRyxFQUFFLENBQUM7QUFFL0I7Ozs7R0FJRztBQUNILE1BQU0sQ0FBQyxJQUFJLFlBQVksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FDekMsVUFBVSxFQUNWLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQ3pELENBQUMifQ==
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@git.zone/cli",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.4.0",
|
|
5
5
|
"description": "A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
|
7
7
|
"typings": "dist_ts/index.d.ts",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"@api.global/typedrequest": "^8.2.0",
|
|
43
43
|
"@git.zone/tsbuild": "^5.0.0",
|
|
44
44
|
"@git.zone/tspack": "^1.4.1",
|
|
45
|
-
"@git.zone/tsrun": "^3.0.
|
|
46
|
-
"@git.zone/tstest": "^6.3.
|
|
45
|
+
"@git.zone/tsrun": "^3.0.2",
|
|
46
|
+
"@git.zone/tstest": "^6.3.2",
|
|
47
47
|
"@types/node": "^26.6.2"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@aws-sdk/client-s3": "3.1095.0",
|
|
51
|
-
"@git.zone/tsdoc": "^2.2.
|
|
51
|
+
"@git.zone/tsdoc": "^2.2.2",
|
|
52
52
|
"@git.zone/tsdocker": "3.8.1",
|
|
53
53
|
"@git.zone/tspublish": "^2.0.1",
|
|
54
54
|
"@lossless.org/client": "1.5.1",
|
package/readme.md
CHANGED
|
@@ -279,7 +279,7 @@ Targets decide what happens after that:
|
|
|
279
279
|
| Target | What it does |
|
|
280
280
|
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
281
281
|
| `git` | Atomically pushes the exact `main` release commit and new tag, often triggering remote CI release builds |
|
|
282
|
-
| `npm` | Publishes the same journaled tarball to every configured registry
|
|
282
|
+
| `npm` | Publishes the same journaled tarball to every configured registry; verifies its bytes anonymously, or its integrity record with the registry's configured authentication for private packages |
|
|
283
283
|
| `docker` | Qualifies immutable OCI digest graphs with project-local tSDocker, promotes each journaled destination under single-writer alias fencing, verifies exact digests, then cleans the candidate; a terminal qualification conflict permits cleanup only |
|
|
284
284
|
|
|
285
285
|
```bash
|
|
@@ -300,6 +300,9 @@ gitzone release --no-publish
|
|
|
300
300
|
|
|
301
301
|
# Override inferred semver level
|
|
302
302
|
gitzone release --minor
|
|
303
|
+
|
|
304
|
+
# Run the release in its own session and return once it has started
|
|
305
|
+
gitzone release -y --detach
|
|
303
306
|
```
|
|
304
307
|
|
|
305
308
|
Release flags:
|
|
@@ -321,6 +324,7 @@ Release flags:
|
|
|
321
324
|
| `inspect [version]` | Read one or all durable release journals; add `--json` for machine-readable output |
|
|
322
325
|
| `resume <version>` | Resume journaled Git, npm, qualification, promotion, or cleanup work; fresh-release overrides are rejected, and `--json` remains inspect-only |
|
|
323
326
|
| `--recover-attempt <id>` | Recover the exact 32-character lowercase hexadecimal `attempt.id` shown by `inspect --json`, after independently proving its publisher stopped |
|
|
327
|
+
| `--detach` | With `-y`, run a release or `resume` in its own session after the foreground checks; see [Running a release detached](#running-a-release-detached) |
|
|
324
328
|
|
|
325
329
|
### Version floor
|
|
326
330
|
|
|
@@ -376,7 +380,7 @@ The floor must be a canonical `x.y.z` string whose components do not exceed `900
|
|
|
376
380
|
|
|
377
381
|
### Exact artifacts and release journals
|
|
378
382
|
|
|
379
|
-
Journal schema 1 supports Git and public npm publication. Schema 2 adds Docker qualification, promotion, and cleanup evidence without changing the storage path or schema-1 parsing and resume behavior. Fresh and resumed npm publication dynamically qualifies the active stable `pnpm` version; there is no version allowlist. GitZone reads `minimum-release-age` and `minimum-release-age-exclude` through that exact pnpm invocation in the release directory, so project configuration and global policy retain pnpm's normal precedence. It verifies the selected version's publication time through the configured registry unless the effective policy disables the age delay or excludes that version. Missing timestamps follow `minimum-release-age-ignore-missing-time`, including pnpm's default of `true`; malformed policy, metadata failures, immature versions, and prerelease versions stop qualification. GitZone also verifies the required pack/publish command contract and keeps every subsequent command bound to the qualified exact version. A new pnpm version with the same capabilities needs no GitZone update once it satisfies the policy. Registries must be unique canonical credential-free HTTP(S) URLs
|
|
383
|
+
Journal schema 1 supports Git and public or private npm publication. Schema 2 adds Docker qualification, promotion, and cleanup evidence without changing the storage path or schema-1 parsing and resume behavior. Fresh and resumed npm publication dynamically qualifies the active stable `pnpm` version; there is no version allowlist. GitZone reads `minimum-release-age` and `minimum-release-age-exclude` through that exact pnpm invocation in the release directory, so project configuration and global policy retain pnpm's normal precedence. It verifies the selected version's publication time through the configured registry unless the effective policy disables the age delay or excludes that version. Missing timestamps follow `minimum-release-age-ignore-missing-time`, including pnpm's default of `true`; malformed policy, metadata failures, immature versions, and prerelease versions stop qualification. GitZone also verifies the required pack/publish command contract and keeps every subsequent command bound to the qualified exact version. A new pnpm version with the same capabilities needs no GitZone update once it satisfies the policy. Registries must be unique canonical credential-free HTTP(S) URLs. `release.targets.npm.accessLevel` is `public` (the default) or `private`; see [Private npm packages](#private-npm-packages).
|
|
380
384
|
|
|
381
385
|
GitZone keeps the selected pnpm version for help checks, packing, and publication
|
|
382
386
|
through `pnpm with <version>`, including release recovery and resume. This avoids
|
|
@@ -411,14 +415,56 @@ Every release that reaches final publication stores `journal.json` under the rep
|
|
|
411
415
|
|
|
412
416
|
The canonical journal binds the release commit, annotated tag object, hashed Git destination, npm registries, per-target attempt states, and, when npm is selected, the package identity, tarball size, SHA-1, SHA-256, and SHA-512 integrity. Schema 2 also binds the exact tSDocker request, candidate identity, qualification result, ordered destination promotions, probe or promotion evidence, and terminal cleanup result. Journal updates use revision compare-and-swap under an interprocess lock. Release identity and destinations cannot change after journal creation. Qualification and promotion evidence is append-only, destination conflicts are terminal, and completed Docker state cannot regress. Inspect and resume reject malformed, future, noncanonical, duplicate-key, or merely reformatted journal JSON rather than repairing or normalizing it.
|
|
413
417
|
|
|
414
|
-
Packing must leave the release tree clean. Each registry receives that exact stored tarball through `pnpm publish <tarball> --ignore-scripts`, so publish lifecycle scripts do not run.
|
|
418
|
+
Packing must leave the release tree clean. Each registry receives that exact stored tarball through `pnpm publish <tarball> --ignore-scripts`, so publish lifecycle scripts do not run. For a public package, success is recorded only after anonymous no-redirect probes verify version metadata, SHA-1 and integrity fields, the downloaded tarball bytes, and the `latest` dist-tag. The dist-tag is satisfied by the released version itself and by any later release that has since carried the tag on, so superseded releases stay verifiable; an older version, a prerelease, a non-semver value or an absent tag does not. A matching pre-existing version follows `release.targets.npm.alreadyPublished`; conflicting bytes always stop the release, while transient responses and dist-tag propagation remain retryable.
|
|
419
|
+
|
|
420
|
+
#### Private npm packages
|
|
421
|
+
|
|
422
|
+
With `release.targets.npm.accessLevel: "private"` the journal records
|
|
423
|
+
`npm.access: "private"`, each registry receives the stored tarball through
|
|
424
|
+
`pnpm publish <tarball> --access=restricted --ignore-scripts`, and verification
|
|
425
|
+
runs through the same qualified pnpm with the registry's configured
|
|
426
|
+
authentication instead of anonymously. GitZone never reads, parses, logs or
|
|
427
|
+
journals a credential: pnpm reads its own `.npmrc` for the destination, exactly
|
|
428
|
+
as it does when it publishes, so authenticate at user level with `pnpm login
|
|
429
|
+
--registry=<registry>`.
|
|
430
|
+
|
|
431
|
+
- Before anything is committed, tagged or published — and again on `resume`
|
|
432
|
+
and `recover` — `pnpm whoami --registry=<registry>` must succeed for every
|
|
433
|
+
private destination. Otherwise the release stops with
|
|
434
|
+
`NpmRegistryAuthenticationError`, which names the registry, the login step and
|
|
435
|
+
the command to run next, and quotes the redacted `pnpm whoami` failure.
|
|
436
|
+
- A destination is `verified` when `pnpm view <name>@<version> --json` reports
|
|
437
|
+
the packed artifact's `dist.integrity` and `dist.shasum`, a `dist.tarball` on
|
|
438
|
+
the registry's own origin without credentials, query or fragment, and the
|
|
439
|
+
same `latest` dist-tag rules as public releases. pnpm has no command that
|
|
440
|
+
downloads a tarball with the registry's authentication, so the bytes are
|
|
441
|
+
proven by the registry's integrity record rather than downloaded.
|
|
442
|
+
- A not-found answer counts as absence only when `pnpm whoami` confirms
|
|
443
|
+
the authentication, because a registry answers an unauthenticated read of a
|
|
444
|
+
private package with 401, 403 or 404 alike. `whoami` proves you are logged
|
|
445
|
+
in, not that your account may read that package: a registry that answers 404
|
|
446
|
+
to a logged-in account without read access still looks like absence, so the
|
|
447
|
+
release credential must be able to read the packages it publishes. Recovery
|
|
448
|
+
checks a private version unpublished the same way.
|
|
449
|
+
- An authentication failure found by the checks before and after publishing
|
|
450
|
+
changes nothing in the journal: a pending target stays pending, and an
|
|
451
|
+
accepted upload stays accepted and is never sent again. A credential revoked
|
|
452
|
+
between that check and `pnpm publish` makes the publish command fail, and the
|
|
453
|
+
target is recorded as failed like any rejected publish. Fix the credential and
|
|
454
|
+
run `gitzone release resume <version> -y`.
|
|
455
|
+
- A scope registry in an `.npmrc` (`@scope:registry=…`) overrides `--registry`
|
|
456
|
+
for that scope's packages, so private publish and view commands also pass
|
|
457
|
+
`--config.@scope:registry=<registry>` and always address the journaled
|
|
458
|
+
destination.
|
|
459
|
+
|
|
460
|
+
Public releases are unchanged.
|
|
415
461
|
|
|
416
462
|
#### Accepted npm uploads
|
|
417
463
|
|
|
418
464
|
A registry accepts an upload before it serves it, and npmjs can need minutes
|
|
419
465
|
or more than an hour to make the version readable. GitZone records that state
|
|
420
466
|
as `accepted`: the upload was taken, its bytes are proven locally, and only an
|
|
421
|
-
exact anonymous
|
|
467
|
+
exact probe (anonymous, or authenticated for a private package) promotes it to `verified`. `accepted` is not `failed`.
|
|
422
468
|
`failed` means the registry rejected the submission or the publish command
|
|
423
469
|
itself failed.
|
|
424
470
|
|
|
@@ -737,7 +783,8 @@ commit, matching package and completed changelog versions, and no pending
|
|
|
737
783
|
changes. The metadata commit must not change release configuration. It also
|
|
738
784
|
checks remote ancestry, requires the release tag to be absent remotely, and
|
|
739
785
|
requires an anonymous HTTP 404 for the version of every package it publishes at
|
|
740
|
-
every npm registry when npm is selected
|
|
786
|
+
every npm registry when npm is selected (for a private package, an
|
|
787
|
+
authenticated not-found answer; see [Private npm packages](#private-npm-packages)). Published or uncertain Git/npm state
|
|
741
788
|
cannot be adopted without its original journal. Gitea asset preparation recovery
|
|
742
789
|
is not supported.
|
|
743
790
|
|
|
@@ -785,6 +832,80 @@ deferred ancestry; execution fetches and verifies that history before writing th
|
|
|
785
832
|
preparation binding. Earlier version, changelog, commit or tag failures still
|
|
786
833
|
require explicit operator reconciliation.
|
|
787
834
|
|
|
835
|
+
### Running a release detached
|
|
836
|
+
|
|
837
|
+
A release runs its tests, build, push and every publication in one process,
|
|
838
|
+
which can take longer than the tool call or terminal that started it. With
|
|
839
|
+
`--detach`, `gitzone release -y` and `gitzone release resume <version> -y`
|
|
840
|
+
return once the release is running in a session of its own:
|
|
841
|
+
|
|
842
|
+
```bash
|
|
843
|
+
gitzone release -y --detach
|
|
844
|
+
gitzone release resume 6.0.0 -y --detach
|
|
845
|
+
```
|
|
846
|
+
|
|
847
|
+
In the foreground, `--detach` checks what `--plan` checks — arguments,
|
|
848
|
+
configuration, the release branch, a clean tree, the Git destination and the
|
|
849
|
+
version — plus pending changelog entries, or for `resume` the journal or
|
|
850
|
+
recorded intent of that version. It needs `-y` (or `release.confirmation:
|
|
851
|
+
"auto"` for a fresh release), because nothing can answer a prompt later, and it
|
|
852
|
+
cannot be combined with `--plan`. Any failure there exits non-zero and starts
|
|
853
|
+
nothing. Everything else — the pnpm and tSDocker capability checks, tests,
|
|
854
|
+
build, commit, tag and publication — runs in the detached release and appears
|
|
855
|
+
in its log and recorded outcome.
|
|
856
|
+
|
|
857
|
+
A fresh release prints its release plan there, as `--plan` does. The launcher
|
|
858
|
+
then starts a supervisor with `detached: true` — a new session and process
|
|
859
|
+
group without a controlling terminal, stdin `/dev/null` — and the supervisor
|
|
860
|
+
starts the release as its child with the same arguments minus `--detach`. Once
|
|
861
|
+
the supervisor reports the release running, the launcher prints one line and
|
|
862
|
+
exits 0:
|
|
863
|
+
|
|
864
|
+
```text
|
|
865
|
+
Release running detached: run <id>, process group <pid>, log <path>. Follow it with `tail -f <path>`; `gitzone release inspect` shows its outcome.
|
|
866
|
+
```
|
|
867
|
+
|
|
868
|
+
When the supervisor refuses to start the release, the launcher prints why and
|
|
869
|
+
exits 1. When the supervisor does not report within 60 seconds, the launcher
|
|
870
|
+
terminates its whole process group (`SIGTERM`, and `SIGKILL` after another 10
|
|
871
|
+
seconds), then exits 1 and says whether a release had started before it was
|
|
872
|
+
stopped; `gitzone release inspect` shows the outcome of such a run.
|
|
873
|
+
|
|
874
|
+
Everything lives beside the release journals:
|
|
875
|
+
|
|
876
|
+
```text
|
|
877
|
+
<git-common-dir>/gitzone/releases/v1/detached.lock held by the supervisor while the release runs
|
|
878
|
+
<git-common-dir>/gitzone/releases/v1/detached/<id>.json run record: command, version, pids, state, exit code or signal
|
|
879
|
+
<git-common-dir>/gitzone/releases/v1/detached/<id>.log stdout and stderr of the release
|
|
880
|
+
```
|
|
881
|
+
|
|
882
|
+
The supervisor records the run as `running`, and when the release ends, as
|
|
883
|
+
`succeeded` (exit code 0) or `failed` with its non-zero exit code or the signal
|
|
884
|
+
that killed it, and appends `Detached release finished: …` to the log. A crash
|
|
885
|
+
or kill of the release is recorded the same way. From the moment it holds the
|
|
886
|
+
lock, a `SIGHUP`, `SIGINT` or `SIGTERM` does not end the supervisor: before the
|
|
887
|
+
release has started, the signal cancels the launch, the lock is released and no
|
|
888
|
+
run is recorded; after that, the supervisor passes each signal on to the
|
|
889
|
+
release once and stays to record the outcome. `kill -- -<process group>` stops
|
|
890
|
+
the whole run: the release receives the signal directly as well, and the
|
|
891
|
+
supervisor passes nothing on to a release that has already ended.
|
|
892
|
+
`gitzone release inspect` lists the runs, latest first, before the journals,
|
|
893
|
+
and `inspect --json` adds them as `runs`. The run's state says how the process
|
|
894
|
+
ended; the journal of its version still says what was published, and a failed
|
|
895
|
+
run continues with `gitzone release resume <version> -y`, detached or not.
|
|
896
|
+
|
|
897
|
+
While the lock is held, every other release, `resume` or `recover` of the
|
|
898
|
+
project, detached or not, is refused; only the run's own release passes.
|
|
899
|
+
`--plan` runs and `inspect` stay allowed, since they change nothing. The
|
|
900
|
+
lock sits in the Git common directory, so all worktrees of a repository share
|
|
901
|
+
it. A release started without `--detach` does not take the lock, so a detached
|
|
902
|
+
launch cannot see it. When the supervisor itself is killed with `SIGKILL`, or
|
|
903
|
+
the machine stops, the run stays `running` and the lock stays held: prove the
|
|
904
|
+
recorded supervisor process no longer exists, then remove
|
|
905
|
+
`<git-common-dir>/gitzone/releases/v1/detached.lock`, as with every other
|
|
906
|
+
GitZone lock. Run records and logs are kept; remove old ones from
|
|
907
|
+
`detached/` when they are no longer needed.
|
|
908
|
+
|
|
788
909
|
## Standard Changelog
|
|
789
910
|
|
|
790
911
|
The changelog is convention-based and intentionally not configured.
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@git.zone/cli',
|
|
6
|
-
version: '7.
|
|
6
|
+
version: '7.4.0',
|
|
7
7
|
description: 'A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.'
|
|
8
8
|
}
|