@git.zone/cli 7.2.6 → 7.3.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/helpers.workflow.d.ts +19 -1
- package/dist_ts/helpers.workflow.js +31 -2
- package/dist_ts/mod_config/index.js +18 -2
- 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 +34 -0
- package/dist_ts/mod_release/classes.releasejournal.js +134 -2
- package/dist_ts/mod_release/helpers.giteaassets.d.ts +19 -0
- package/dist_ts/mod_release/helpers.giteaassets.js +53 -4
- package/dist_ts/mod_release/helpers.gitremote.d.ts +52 -0
- package/dist_ts/mod_release/helpers.gitremote.js +87 -0
- package/dist_ts/mod_release/helpers.releasebranch.d.ts +5 -0
- package/dist_ts/mod_release/helpers.releasebranch.js +39 -15
- package/dist_ts/mod_release/helpers.releasepreparation.js +18 -8
- package/dist_ts/mod_release/helpers.releasepublication.d.ts +3 -0
- package/dist_ts/mod_release/helpers.releasepublication.js +19 -15
- package/dist_ts/mod_release/index.js +303 -66
- 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 +158 -21
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/helpers.climode.ts +1 -0
- package/ts/helpers.workflow.ts +50 -0
- package/ts/mod_config/index.ts +19 -0
- package/ts/mod_release/classes.detachedrelease.ts +655 -0
- package/ts/mod_release/classes.releasejournal.ts +181 -1
- package/ts/mod_release/helpers.giteaassets.ts +67 -5
- package/ts/mod_release/helpers.gitremote.ts +147 -0
- package/ts/mod_release/helpers.releasebranch.ts +75 -30
- package/ts/mod_release/helpers.releasepreparation.ts +25 -7
- package/ts/mod_release/helpers.releasepublication.ts +27 -36
- package/ts/mod_release/index.ts +443 -87
- package/ts/mod_services/classes.interprocesslock.ts +44 -15
- package/ts/paths.ts +10 -0
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { TServiceName } from './classes.servicedatamarker.js';
|
|
2
|
+
/** The process a held lock names, as far as its owner metadata tells. */
|
|
3
|
+
export interface IInterProcessLockHolder {
|
|
4
|
+
pid: number | null;
|
|
5
|
+
createdAt: string | null;
|
|
6
|
+
}
|
|
2
7
|
export interface IInterProcessLockOptions {
|
|
3
8
|
lockPath: string;
|
|
4
9
|
description: string;
|
|
@@ -14,6 +19,13 @@ export declare class InterProcessLock {
|
|
|
14
19
|
constructor(optionsArg: IInterProcessLockOptions);
|
|
15
20
|
runExclusive<T>(operationArg: () => Promise<T>): Promise<T>;
|
|
16
21
|
private acquire;
|
|
22
|
+
/**
|
|
23
|
+
* The holder of the lock, or null while it is free. A lock whose owner
|
|
24
|
+
* metadata is missing or incomplete is still held; its holder is then
|
|
25
|
+
* unknown, and stale-lock recovery stays manual.
|
|
26
|
+
*/
|
|
27
|
+
readHolder(): Promise<IInterProcessLockHolder | null>;
|
|
28
|
+
private readOwnerMetadata;
|
|
17
29
|
private release;
|
|
18
30
|
}
|
|
19
31
|
export declare const withInterProcessLock: <T>(optionsArg: IInterProcessLockOptions, operationArg: () => Promise<T>) => Promise<T>;
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy5pbnRlcnByb2Nlc3Nsb2NrLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vdHMvbW9kX3NlcnZpY2VzL2NsYXNzZXMuaW50ZXJwcm9jZXNzbG9jay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQztBQXNCekMsTUFBTSxhQUFhLEdBQUcsQ0FBQyxRQUFpQixFQUF1QyxFQUFFO0lBQy9FLE9BQU8sT0FBTyxRQUFRLEtBQUssUUFBUSxJQUFJLFFBQVEsS0FBSyxJQUFJLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FBQ3ZGLENBQUMsQ0FBQztBQUVGLGtGQUFrRjtBQUNsRixNQUFNLE9BQU8sZ0JBQWdCO0lBQ1gsUUFBUSxDQUFTO0lBQ2hCLFdBQVcsQ0FBUztJQUNwQixTQUFTLENBQVM7SUFDbEIsTUFBTSxDQUFTO0lBRWhDLFlBQVksVUFBb0M7UUFDOUMsSUFBSSxDQUFDLFFBQVEsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsUUFBUSxDQUFDLENBQUM7UUFDMUQs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CQUErQixDQUFDLGNBQWMsRUFBRSxVQUFVLENBQUM7UUFDckUsV0FBVyxFQUFFLEdBQUcsVUFBVSx5QkFBeUI7S0FDcEQsRUFDRCxZQUFZLENBQ2IsQ0FBQztBQUNKLENBQUMsQ0FBQyJ9
|
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.3.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.1",
|
|
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
|
@@ -192,7 +192,7 @@ The release core is not configurable plumbing. It always follows the same profes
|
|
|
192
192
|
4. With `--merge`, fast-forward and lease-push `main` before release metadata is created.
|
|
193
193
|
5. Update version files and baked commit info.
|
|
194
194
|
6. Move pending changelog entries into the new version section.
|
|
195
|
-
7. Create the local release commit and tag on `main
|
|
195
|
+
7. Create the local release commit and tag on `main`, and record the release intent, so any later failure is resumable (see [Resuming a release that failed before its journal](#resuming-a-release-that-failed-before-its-journal)).
|
|
196
196
|
8. Create a disposable detached checkout of that release commit, install its locked dependencies when the commit carries a `package.json`, and run the configured release build there. An active Docker target additionally builds the release worktree its qualification reads.
|
|
197
197
|
9. When npm is selected, prepare every named tspublish module outside the repository, then pack each module and the public root package once into an exact tarball from that checkout.
|
|
198
198
|
10. Atomically install a durable journal before final publication. A release that publishes only the root package to npm uses journal schema 1, one that also or only publishes tspublish modules uses schema 3, a Docker release uses schema 2 with or without modules, and a Gitea asset release uses schema 4, all in the same storage tree.
|
|
@@ -252,16 +252,16 @@ Consequences worth knowing before upgrading:
|
|
|
252
252
|
- An install that fails in the checkout for an environmental reason — an
|
|
253
253
|
unreachable registry, a missing credential, an unusable store — stops the
|
|
254
254
|
release with the local release commit and tag created, nothing pushed, and no
|
|
255
|
-
release journal written.
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
(`git tag -d v<version>` and `git reset --hard HEAD^` on
|
|
262
|
-
again. Confirm first that `HEAD` is the release commit —
|
|
263
|
-
--format=%s` prints `v<version>` — so that a commit made on top
|
|
264
|
-
dropped.
|
|
255
|
+
release journal written. The release recorded its intent, so fix the
|
|
256
|
+
environment and run `gitzone release resume <version> -y`: it prepares and
|
|
257
|
+
publishes that exact tagged commit without moving any ref. A tag created by
|
|
258
|
+
GitZone 7.2.6 or earlier has no recorded intent; a release with a Git target
|
|
259
|
+
plus an npm and/or Docker target continues with `gitzone release recover
|
|
260
|
+
<version>`, and other configurations of that age delete the tag and drop the
|
|
261
|
+
release commit (`git tag -d v<version>` and `git reset --hard HEAD^` on
|
|
262
|
+
`main`) and release again. Confirm first that `HEAD` is the release commit —
|
|
263
|
+
`git log -1 --format=%s` prints `v<version>` — so that a commit made on top
|
|
264
|
+
of it is never dropped.
|
|
265
265
|
- The `--plan` step list names the isolated work: `preflight.lockfile` for a
|
|
266
266
|
project with a `package.json`, then `core.releaseCheckout`,
|
|
267
267
|
`core.releaseCheckout.build`, then `core.packNpmArtifact`.
|
|
@@ -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
|
|
|
@@ -629,6 +633,13 @@ the stall bound), or still progressing but below the rate floor. All of them
|
|
|
629
633
|
leave the target inconclusive for `gitzone release resume`. The settings tune transfers
|
|
630
634
|
only and may change between runs and resumes.
|
|
631
635
|
|
|
636
|
+
Any other request failure is inconclusive too, and says why without a URL,
|
|
637
|
+
header or token: the HTTP status it reached, each error of the cause chain by
|
|
638
|
+
name and code, a message only when it is plain words, and how far the transfer
|
|
639
|
+
got, for example `Gitea public asset verification is inconclusive (HTTP 200;
|
|
640
|
+
TypeError: terminated; SocketError [UND_ERR_SOCKET]: other side closed; 1048576
|
|
641
|
+
of 461373440 bytes received)`.
|
|
642
|
+
|
|
632
643
|
The complete remote attachment set must equal the manifest. Extra names,
|
|
633
644
|
duplicates, changed release identity, or conflicting bytes stop publication;
|
|
634
645
|
the CLI has no deletion or replacement path. It verifies the complete set again
|
|
@@ -675,9 +686,49 @@ Resume probes remotely observable targets before acting. A published Git release
|
|
|
675
686
|
|
|
676
687
|
Schema 1 resumes final Git release-ref and npm publication after the journal is atomically installed. Schema 2 additionally resumes Docker qualification, ordered promotion, and cleanup. Schema 3 resumes the complete npm package set. `--merge` remains available only for non-Docker releases because its pre-release Git push would violate qualification-before-publication ordering.
|
|
677
688
|
|
|
689
|
+
### Resuming a release that failed before its journal
|
|
690
|
+
|
|
691
|
+
Once the local release commit and annotated tag exist, a release records its
|
|
692
|
+
intent before it builds, packs or checks the remote again:
|
|
693
|
+
|
|
694
|
+
```text
|
|
695
|
+
<git-common-dir>/gitzone/releases/v1/v<version>.intent.json
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
The intent binds the release commit and tag object, the version floor record,
|
|
699
|
+
the targets and release-build choice the command line selected, and, for a Git
|
|
700
|
+
target, the remote name, the hashed push destination and the remote `main` the
|
|
701
|
+
push will lease. Any failure between the tag and the installed journal — the
|
|
702
|
+
release build, packing, freezing Gitea assets, Docker validation, or a remote
|
|
703
|
+
that cannot be inspected — is then resumable:
|
|
704
|
+
|
|
705
|
+
```bash
|
|
706
|
+
gitzone release resume 6.0.0 -y
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
Without a journal, resume reads the intent, resolves the release from the
|
|
710
|
+
`.smartconfig.json` the release commit carries with the recorded targets and
|
|
711
|
+
build choice, and requires clean `main` at the release commit, the recorded tag
|
|
712
|
+
object, the recorded push destination and a remote `main` that still equals the
|
|
713
|
+
leased value. It then prepares the journal exactly as the release would have —
|
|
714
|
+
the Docker worktree build, the disposable checkout with its build, packing and
|
|
715
|
+
frozen assets — and continues as a normal resume from that journal. Tests are
|
|
716
|
+
not run again: preflight ran them on the source the release commit only adds
|
|
717
|
+
version metadata to. Installing the journal removes the intent, and from then on
|
|
718
|
+
the journal alone decides what resume does. A failed resume leaves the intent in
|
|
719
|
+
place for the next one. `recover` on a version with a recorded intent runs this
|
|
720
|
+
resume.
|
|
721
|
+
|
|
722
|
+
To abandon such a release instead of resuming it (nothing reached a remote, and
|
|
723
|
+
you delete the local tag and reset `main` to the commit before the release
|
|
724
|
+
commit), delete its intent file as well; otherwise a later tag of the same version
|
|
725
|
+
is handed to a resume that refuses it.
|
|
726
|
+
|
|
727
|
+
### Recovering a tag without a recorded intent
|
|
728
|
+
|
|
678
729
|
For a Git release with npm and/or Docker targets whose local release commit
|
|
679
|
-
and annotated tag
|
|
680
|
-
installation, use:
|
|
730
|
+
and annotated tag were created by GitZone 7.2.6 or earlier, which recorded no
|
|
731
|
+
intent, and whose build or pack failed before journal installation, use:
|
|
681
732
|
|
|
682
733
|
```bash
|
|
683
734
|
gitzone release recover 6.0.0 --plan
|
|
@@ -738,6 +789,80 @@ deferred ancestry; execution fetches and verifies that history before writing th
|
|
|
738
789
|
preparation binding. Earlier version, changelog, commit or tag failures still
|
|
739
790
|
require explicit operator reconciliation.
|
|
740
791
|
|
|
792
|
+
### Running a release detached
|
|
793
|
+
|
|
794
|
+
A release runs its tests, build, push and every publication in one process,
|
|
795
|
+
which can take longer than the tool call or terminal that started it. With
|
|
796
|
+
`--detach`, `gitzone release -y` and `gitzone release resume <version> -y`
|
|
797
|
+
return once the release is running in a session of its own:
|
|
798
|
+
|
|
799
|
+
```bash
|
|
800
|
+
gitzone release -y --detach
|
|
801
|
+
gitzone release resume 6.0.0 -y --detach
|
|
802
|
+
```
|
|
803
|
+
|
|
804
|
+
In the foreground, `--detach` checks what `--plan` checks — arguments,
|
|
805
|
+
configuration, the release branch, a clean tree, the Git destination and the
|
|
806
|
+
version — plus pending changelog entries, or for `resume` the journal or
|
|
807
|
+
recorded intent of that version. It needs `-y` (or `release.confirmation:
|
|
808
|
+
"auto"` for a fresh release), because nothing can answer a prompt later, and it
|
|
809
|
+
cannot be combined with `--plan`. Any failure there exits non-zero and starts
|
|
810
|
+
nothing. Everything else — the pnpm and tSDocker capability checks, tests,
|
|
811
|
+
build, commit, tag and publication — runs in the detached release and appears
|
|
812
|
+
in its log and recorded outcome.
|
|
813
|
+
|
|
814
|
+
A fresh release prints its release plan there, as `--plan` does. The launcher
|
|
815
|
+
then starts a supervisor with `detached: true` — a new session and process
|
|
816
|
+
group without a controlling terminal, stdin `/dev/null` — and the supervisor
|
|
817
|
+
starts the release as its child with the same arguments minus `--detach`. Once
|
|
818
|
+
the supervisor reports the release running, the launcher prints one line and
|
|
819
|
+
exits 0:
|
|
820
|
+
|
|
821
|
+
```text
|
|
822
|
+
Release running detached: run <id>, process group <pid>, log <path>. Follow it with `tail -f <path>`; `gitzone release inspect` shows its outcome.
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
When the supervisor refuses to start the release, the launcher prints why and
|
|
826
|
+
exits 1. When the supervisor does not report within 60 seconds, the launcher
|
|
827
|
+
terminates its whole process group (`SIGTERM`, and `SIGKILL` after another 10
|
|
828
|
+
seconds), then exits 1 and says whether a release had started before it was
|
|
829
|
+
stopped; `gitzone release inspect` shows the outcome of such a run.
|
|
830
|
+
|
|
831
|
+
Everything lives beside the release journals:
|
|
832
|
+
|
|
833
|
+
```text
|
|
834
|
+
<git-common-dir>/gitzone/releases/v1/detached.lock held by the supervisor while the release runs
|
|
835
|
+
<git-common-dir>/gitzone/releases/v1/detached/<id>.json run record: command, version, pids, state, exit code or signal
|
|
836
|
+
<git-common-dir>/gitzone/releases/v1/detached/<id>.log stdout and stderr of the release
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
The supervisor records the run as `running`, and when the release ends, as
|
|
840
|
+
`succeeded` (exit code 0) or `failed` with its non-zero exit code or the signal
|
|
841
|
+
that killed it, and appends `Detached release finished: …` to the log. A crash
|
|
842
|
+
or kill of the release is recorded the same way. From the moment it holds the
|
|
843
|
+
lock, a `SIGHUP`, `SIGINT` or `SIGTERM` does not end the supervisor: before the
|
|
844
|
+
release has started, the signal cancels the launch, the lock is released and no
|
|
845
|
+
run is recorded; after that, the supervisor passes each signal on to the
|
|
846
|
+
release once and stays to record the outcome. `kill -- -<process group>` stops
|
|
847
|
+
the whole run: the release receives the signal directly as well, and the
|
|
848
|
+
supervisor passes nothing on to a release that has already ended.
|
|
849
|
+
`gitzone release inspect` lists the runs, latest first, before the journals,
|
|
850
|
+
and `inspect --json` adds them as `runs`. The run's state says how the process
|
|
851
|
+
ended; the journal of its version still says what was published, and a failed
|
|
852
|
+
run continues with `gitzone release resume <version> -y`, detached or not.
|
|
853
|
+
|
|
854
|
+
While the lock is held, every other release, `resume` or `recover` of the
|
|
855
|
+
project, detached or not, is refused; only the run's own release passes.
|
|
856
|
+
`--plan` runs and `inspect` stay allowed, since they change nothing. The
|
|
857
|
+
lock sits in the Git common directory, so all worktrees of a repository share
|
|
858
|
+
it. A release started without `--detach` does not take the lock, so a detached
|
|
859
|
+
launch cannot see it. When the supervisor itself is killed with `SIGKILL`, or
|
|
860
|
+
the machine stops, the run stays `running` and the lock stays held: prove the
|
|
861
|
+
recorded supervisor process no longer exists, then remove
|
|
862
|
+
`<git-common-dir>/gitzone/releases/v1/detached.lock`, as with every other
|
|
863
|
+
GitZone lock. Run records and logs are kept; remove old ones from
|
|
864
|
+
`detached/` when they are no longer needed.
|
|
865
|
+
|
|
741
866
|
## Standard Changelog
|
|
742
867
|
|
|
743
868
|
The changelog is convention-based and intentionally not configured.
|
|
@@ -780,7 +905,8 @@ CLI workflow config lives under `@git.zone/cli` in `.smartconfig.json`. Docker r
|
|
|
780
905
|
"enabled": true,
|
|
781
906
|
"remote": "origin",
|
|
782
907
|
"pushBranch": true,
|
|
783
|
-
"pushTags": true
|
|
908
|
+
"pushTags": true,
|
|
909
|
+
"remoteTimeoutSeconds": 180
|
|
784
910
|
},
|
|
785
911
|
"npm": {
|
|
786
912
|
"enabled": true,
|
|
@@ -1558,10 +1684,11 @@ package's `files` list; `.npmignore` does not prevent that traversal when
|
|
|
1558
1684
|
`files` is present. Keep service data and its permissions intact.
|
|
1559
1685
|
|
|
1560
1686
|
Inspect the release journal before retrying. An installed journal must be
|
|
1561
|
-
resumed with its original artifacts. A failure
|
|
1562
|
-
not started final publication
|
|
1563
|
-
|
|
1564
|
-
source correction can be released as a new version from the clean
|
|
1687
|
+
resumed with its original artifacts. A failure after the release tag but before
|
|
1688
|
+
journal installation has not started final publication; `gitzone release resume
|
|
1689
|
+
<version> -y` prepares the journal from the recorded intent and publishes. A
|
|
1690
|
+
later source correction can be released as a new version from the clean
|
|
1691
|
+
checkout.
|
|
1565
1692
|
|
|
1566
1693
|
A release step fails on a Git, pnpm or tSDocker command:
|
|
1567
1694
|
|
|
@@ -1569,11 +1696,21 @@ The error names the step, then the command and how it ended, then the end of
|
|
|
1569
1696
|
its error output on one line:
|
|
1570
1697
|
|
|
1571
1698
|
```text
|
|
1572
|
-
Unable to inspect main at the configured Git push destination. `git ls-remote` timed out after
|
|
1699
|
+
Unable to inspect main at the configured Git push destination. Step: publication state check. `git ls-remote` timed out after 180 s and was terminated by SIGTERM; gave up after 3 attempts over 565.2 s
|
|
1573
1700
|
```
|
|
1574
1701
|
|
|
1575
|
-
|
|
1576
|
-
|
|
1702
|
+
Every `git ls-remote` of a release — the preflight before the tests, the check
|
|
1703
|
+
after them, the check before each publication step and the Git target's own
|
|
1704
|
+
probe — runs under `release.targets.git.remoteTimeoutSeconds` (default 180, at
|
|
1705
|
+
most 3600) per attempt. A timeout, a reset or dropped connection, and a transport failure Git reports
|
|
1706
|
+
as "RPC failed" (other than HTTP 401, 403 or 404) are retried twice, after 5 and 20 seconds;
|
|
1707
|
+
authentication failures, a missing repository and Git's own answers are final
|
|
1708
|
+
at once. The error names the release step, the per-attempt bound, and the
|
|
1709
|
+
attempts and time spent. The preflight reads the remote before the configured
|
|
1710
|
+
tests run, so a remote that is down fails the release before a long test run;
|
|
1711
|
+
the check immediately before the push stays authoritative. A failure after the
|
|
1712
|
+
release tag is resumable with `gitzone release resume <version> -y`. `git
|
|
1713
|
+
fetch` and `git push` keep their five-minute bound. Check the remote with the
|
|
1577
1714
|
same command, for example `git ls-remote <push-url> refs/heads/main`, and
|
|
1578
1715
|
retry once it answers promptly. An exit code comes with Git's own message,
|
|
1579
1716
|
such as `does not appear to be a git repository` for a wrong push URL. The
|
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.3.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
|
}
|
package/ts/helpers.climode.ts
CHANGED
package/ts/helpers.workflow.ts
CHANGED
|
@@ -15,6 +15,10 @@ import {
|
|
|
15
15
|
planReleaseNpmPackages,
|
|
16
16
|
type IReleaseNpmPackageSet,
|
|
17
17
|
} from "./mod_release/helpers.npmpackages.js";
|
|
18
|
+
import {
|
|
19
|
+
defaultReleaseGitRemoteTimeoutSeconds,
|
|
20
|
+
maximumReleaseGitRemoteTimeoutSeconds,
|
|
21
|
+
} from "./mod_release/helpers.gitremote.js";
|
|
18
22
|
|
|
19
23
|
export type TConfirmationMode = "prompt" | "auto" | "plan";
|
|
20
24
|
|
|
@@ -51,6 +55,8 @@ export interface IReleaseGitTargetConfig {
|
|
|
51
55
|
remote?: string;
|
|
52
56
|
pushBranch?: boolean;
|
|
53
57
|
pushTags?: boolean;
|
|
58
|
+
/** Seconds one `git ls-remote` attempt may take; default 180. */
|
|
59
|
+
remoteTimeoutSeconds?: number;
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
export interface IReleaseNpmTargetConfig {
|
|
@@ -275,6 +281,8 @@ export interface IResolvedReleaseWorkflow {
|
|
|
275
281
|
versionFloor?: string;
|
|
276
282
|
gitEnabled: boolean;
|
|
277
283
|
gitRemote: string;
|
|
284
|
+
/** Bound of one attempt of every Git remote inspection. */
|
|
285
|
+
gitRemoteTimeoutSeconds: number;
|
|
278
286
|
pushBranch: boolean;
|
|
279
287
|
pushTags: boolean;
|
|
280
288
|
npmEnabled: boolean;
|
|
@@ -298,8 +306,19 @@ export interface IResolvedReleaseWorkflow {
|
|
|
298
306
|
dockerNoBuild: boolean;
|
|
299
307
|
}
|
|
300
308
|
|
|
309
|
+
/**
|
|
310
|
+
* The release choices a command line can override. A release records them
|
|
311
|
+
* with its local commit and tag, so a resume re-resolves exactly that release
|
|
312
|
+
* from the configuration its commit carries.
|
|
313
|
+
*/
|
|
314
|
+
export type TReleaseRecordedPlan = Pick<
|
|
315
|
+
IResolvedReleaseWorkflow,
|
|
316
|
+
"targets" | "runBuild"
|
|
317
|
+
>;
|
|
318
|
+
|
|
301
319
|
export interface IResolvedReleaseResumeConfiguration {
|
|
302
320
|
gitRemote: string;
|
|
321
|
+
gitRemoteTimeoutSeconds: number;
|
|
303
322
|
npmRegistries: string[];
|
|
304
323
|
npmAccessLevel: "public" | "private";
|
|
305
324
|
npmAlreadyPublished: "success" | "error";
|
|
@@ -850,6 +869,22 @@ export const resolveCommitWorkflow = async (
|
|
|
850
869
|
};
|
|
851
870
|
};
|
|
852
871
|
|
|
872
|
+
/** Remote inspection is tuning, not identity: it may change between resumes. */
|
|
873
|
+
export const resolveGitRemoteTimeoutSeconds = (valueArg: unknown): number => {
|
|
874
|
+
if (valueArg === undefined) return defaultReleaseGitRemoteTimeoutSeconds;
|
|
875
|
+
if (
|
|
876
|
+
typeof valueArg !== "number" ||
|
|
877
|
+
!Number.isSafeInteger(valueArg) ||
|
|
878
|
+
valueArg < 1 ||
|
|
879
|
+
valueArg > maximumReleaseGitRemoteTimeoutSeconds
|
|
880
|
+
) {
|
|
881
|
+
throw new Error(
|
|
882
|
+
`release.targets.git.remoteTimeoutSeconds must be a whole number of seconds between 1 and ${maximumReleaseGitRemoteTimeoutSeconds}`,
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
return valueArg;
|
|
886
|
+
};
|
|
887
|
+
|
|
853
888
|
/** One accepted upload may wait this long for the registry to serve it. */
|
|
854
889
|
export const resolveNpmVerificationWindowMinutes = (
|
|
855
890
|
valueArg: unknown,
|
|
@@ -884,8 +919,14 @@ const assertNoRemovedNpmTargetSettings = (
|
|
|
884
919
|
}
|
|
885
920
|
};
|
|
886
921
|
|
|
922
|
+
/**
|
|
923
|
+
* Resolves the release from its configuration and command line. A resume of
|
|
924
|
+
* a recorded release passes `recordedPlanArg`, which replaces every command
|
|
925
|
+
* line override with the choices that release was created with.
|
|
926
|
+
*/
|
|
887
927
|
export const resolveReleaseWorkflow = async (
|
|
888
928
|
argvArg: any,
|
|
929
|
+
recordedPlanArg?: TReleaseRecordedPlan,
|
|
889
930
|
): Promise<IResolvedReleaseWorkflow> => {
|
|
890
931
|
const cliConfig = await readCliWorkflowConfig();
|
|
891
932
|
const releaseConfig = cliConfig.release || {};
|
|
@@ -937,6 +978,7 @@ export const resolveReleaseWorkflow = async (
|
|
|
937
978
|
if (argvArg.b || argvArg.build) runBuild = true;
|
|
938
979
|
if (isDisabled(argvArg, "test")) runTests = false;
|
|
939
980
|
if (isDisabled(argvArg, "build")) runBuild = false;
|
|
981
|
+
if (recordedPlanArg) runBuild = recordedPlanArg.runBuild;
|
|
940
982
|
|
|
941
983
|
const configuredTargets: TReleaseTarget[] = [];
|
|
942
984
|
if (gitEnabled) configuredTargets.push("git");
|
|
@@ -951,6 +993,7 @@ export const resolveReleaseWorkflow = async (
|
|
|
951
993
|
if (isDisabled(argvArg, "publish")) {
|
|
952
994
|
targets = targets.filter((target) => target === "git");
|
|
953
995
|
}
|
|
996
|
+
if (recordedPlanArg) targets = recordedPlanArg.targets;
|
|
954
997
|
const selectedTargets = unique(targets);
|
|
955
998
|
targets = releaseTargetOrder.filter((target) =>
|
|
956
999
|
selectedTargets.includes(target),
|
|
@@ -1051,6 +1094,10 @@ export const resolveReleaseWorkflow = async (
|
|
|
1051
1094
|
...(versionFloor ? { versionFloor } : {}),
|
|
1052
1095
|
gitEnabled,
|
|
1053
1096
|
gitRemote: gitConfig.remote || "origin",
|
|
1097
|
+
// Dormant settings of an inactive target are not validated.
|
|
1098
|
+
gitRemoteTimeoutSeconds: targets.includes("git")
|
|
1099
|
+
? resolveGitRemoteTimeoutSeconds(gitConfig.remoteTimeoutSeconds)
|
|
1100
|
+
: defaultReleaseGitRemoteTimeoutSeconds,
|
|
1054
1101
|
pushBranch,
|
|
1055
1102
|
pushTags,
|
|
1056
1103
|
npmEnabled,
|
|
@@ -1146,6 +1193,9 @@ export const resolveReleaseResumeConfiguration = async (optionsArg: {
|
|
|
1146
1193
|
|
|
1147
1194
|
return {
|
|
1148
1195
|
gitRemote,
|
|
1196
|
+
gitRemoteTimeoutSeconds: optionsArg.git
|
|
1197
|
+
? resolveGitRemoteTimeoutSeconds(gitConfig.remoteTimeoutSeconds)
|
|
1198
|
+
: defaultReleaseGitRemoteTimeoutSeconds,
|
|
1149
1199
|
npmRegistries,
|
|
1150
1200
|
npmAccessLevel,
|
|
1151
1201
|
npmAlreadyPublished,
|
package/ts/mod_config/index.ts
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
getDeclaredTsdockerRange,
|
|
25
25
|
resolveGiteaAssetsConfiguration,
|
|
26
26
|
resolveGiteaAssetTransferLimits,
|
|
27
|
+
resolveGitRemoteTimeoutSeconds,
|
|
27
28
|
resolveNpmVerificationWindowMinutes,
|
|
28
29
|
} from "../helpers.workflow.js";
|
|
29
30
|
import { hasInstalledProjectTsdockerBinary } from "../helpers.tsdocker.js";
|
|
@@ -2181,6 +2182,24 @@ async function validateGitTarget(
|
|
|
2181
2182
|
fix: "Set release.targets.git.pushTags to true or disable the Git target.",
|
|
2182
2183
|
});
|
|
2183
2184
|
}
|
|
2185
|
+
try {
|
|
2186
|
+
const timeoutSeconds = resolveGitRemoteTimeoutSeconds(
|
|
2187
|
+
gitTarget.remoteTimeoutSeconds,
|
|
2188
|
+
);
|
|
2189
|
+
findings.push({
|
|
2190
|
+
level: "ok",
|
|
2191
|
+
message: `Git remote inspection waits up to ${timeoutSeconds} s per attempt`,
|
|
2192
|
+
});
|
|
2193
|
+
} catch (error) {
|
|
2194
|
+
findings.push({
|
|
2195
|
+
level: "error",
|
|
2196
|
+
message:
|
|
2197
|
+
error instanceof Error
|
|
2198
|
+
? error.message
|
|
2199
|
+
: "Invalid Git remote inspection timeout",
|
|
2200
|
+
fix: "Set release.targets.git.remoteTimeoutSeconds to a whole number of seconds between 1 and 3600 or remove it.",
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2184
2203
|
findings.push({
|
|
2185
2204
|
level: "ok",
|
|
2186
2205
|
message: `Git release target is enabled (${gitTarget.remote || "origin"})`,
|