@git.zone/cli 3.2.0 → 4.0.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/dist_ts/00_commitinfo_data.js +2 -2
- package/dist_ts/classes.gitzoneconfig.js +1 -1
- package/dist_ts/classes.project.js +1 -1
- package/dist_ts/gitzone.cli.js +1 -1
- package/dist_ts/gitzone.logging.js +1 -1
- package/dist_ts/helpers.changelog.js +1 -1
- package/dist_ts/helpers.climode.js +1 -1
- package/dist_ts/helpers.smartconfig.js +61 -11
- package/dist_ts/helpers.smartconfigmigrations.js +1 -1
- package/dist_ts/helpers.tsdocker.js +1 -1
- package/dist_ts/helpers.workflow.js +1 -1
- package/dist_ts/index.js +1 -1
- package/dist_ts/mod_audit/index.js +1 -1
- package/dist_ts/mod_commit/index.js +1 -1
- package/dist_ts/mod_commit/mod.helpers.js +1 -1
- package/dist_ts/mod_commit/mod.plugins.js +1 -1
- package/dist_ts/mod_commit/mod.ui.js +1 -1
- package/dist_ts/mod_config/classes.commitconfig.js +1 -1
- package/dist_ts/mod_config/classes.releaseconfig.js +1 -1
- package/dist_ts/mod_config/index.js +2 -2
- package/dist_ts/mod_config/mod.plugins.js +1 -1
- package/dist_ts/mod_deprecate/index.js +1 -1
- package/dist_ts/mod_deprecate/mod.plugins.js +1 -1
- package/dist_ts/mod_docker/classes.dockerpruner.js +7 -1
- package/dist_ts/mod_docker/index.js +1 -1
- package/dist_ts/mod_docker/mod.plugins.js +1 -1
- package/dist_ts/mod_format/classes.baseformatter.js +1 -1
- package/dist_ts/mod_format/classes.diffreporter.js +1 -1
- package/dist_ts/mod_format/classes.formatcontext.js +1 -1
- package/dist_ts/mod_format/classes.formatplanner.js +1 -1
- package/dist_ts/mod_format/classes.formatstats.js +1 -1
- package/dist_ts/mod_format/formatters/assets.formatter.js +1 -1
- package/dist_ts/mod_format/formatters/cleanup.formatter.js +1 -1
- package/dist_ts/mod_format/formatters/copy.formatter.js +1 -1
- package/dist_ts/mod_format/formatters/gitignore.formatter.js +1 -1
- package/dist_ts/mod_format/formatters/license.formatter.js +1 -1
- package/dist_ts/mod_format/formatters/packagejson.formatter.js +1 -1
- package/dist_ts/mod_format/formatters/prettier.formatter.js +1 -1
- package/dist_ts/mod_format/formatters/readme.formatter.js +1 -1
- package/dist_ts/mod_format/formatters/smartconfig.formatter.js +1 -1
- package/dist_ts/mod_format/formatters/templates.formatter.js +1 -1
- package/dist_ts/mod_format/formatters/tsconfig.formatter.js +1 -1
- package/dist_ts/mod_format/index.js +1 -1
- package/dist_ts/mod_format/interfaces.format.js +1 -1
- package/dist_ts/mod_format/mod.plugins.js +1 -1
- package/dist_ts/mod_helpers/index.js +1 -1
- package/dist_ts/mod_helpers/mod.plugins.js +1 -1
- package/dist_ts/mod_meta/index.js +1 -1
- package/dist_ts/mod_meta/meta.classes.meta.js +1 -1
- package/dist_ts/mod_meta/meta.interfaces.js +1 -1
- package/dist_ts/mod_meta/meta.plugins.js +1 -1
- package/dist_ts/mod_open/index.js +1 -1
- package/dist_ts/mod_open/mod.plugins.js +1 -1
- package/dist_ts/mod_release/index.js +4 -4
- package/dist_ts/mod_release/mod.plugins.js +1 -1
- package/dist_ts/mod_services/classes.dockercontainer.d.ts +50 -3
- package/dist_ts/mod_services/classes.dockercontainer.js +646 -84
- package/dist_ts/mod_services/classes.globalregistry.d.ts +10 -24
- package/dist_ts/mod_services/classes.globalregistry.js +210 -62
- package/dist_ts/mod_services/classes.globalregistrystore.d.ts +48 -0
- package/dist_ts/mod_services/classes.globalregistrystore.js +156 -0
- package/dist_ts/mod_services/classes.interprocesslock.d.ts +21 -0
- package/dist_ts/mod_services/classes.interprocesslock.js +141 -0
- package/dist_ts/mod_services/classes.serviceconfiguration.d.ts +15 -12
- package/dist_ts/mod_services/classes.serviceconfiguration.js +188 -91
- package/dist_ts/mod_services/classes.servicedatamarker.d.ts +32 -7
- package/dist_ts/mod_services/classes.servicedatamarker.js +145 -49
- package/dist_ts/mod_services/classes.servicemanager.d.ts +70 -28
- package/dist_ts/mod_services/classes.servicemanager.js +995 -421
- package/dist_ts/mod_services/classes.servicenames.d.ts +8 -0
- package/dist_ts/mod_services/classes.servicenames.js +54 -0
- package/dist_ts/mod_services/classes.serviceoptions.js +1 -1
- package/dist_ts/mod_services/classes.servicepruner.d.ts +3 -0
- package/dist_ts/mod_services/classes.servicepruner.js +208 -46
- package/dist_ts/mod_services/helpers.js +1 -1
- package/dist_ts/mod_services/index.d.ts +2 -0
- package/dist_ts/mod_services/index.js +81 -58
- package/dist_ts/mod_services/mod.plugins.js +1 -1
- package/dist_ts/mod_standard/index.js +2 -2
- package/dist_ts/mod_standard/mod.plugins.js +1 -1
- package/dist_ts/mod_start/index.js +1 -1
- package/dist_ts/mod_start/mod.plugins.js +1 -1
- package/dist_ts/mod_template/index.js +1 -1
- package/dist_ts/mod_template/mod.plugins.js +1 -1
- package/dist_ts/mod_tools/classes.packagemanager.js +1 -1
- package/dist_ts/mod_tools/index.js +1 -1
- package/dist_ts/mod_tools/mod.plugins.js +1 -1
- package/dist_ts/paths.js +1 -1
- package/dist_ts/plugins.d.ts +3 -1
- package/dist_ts/plugins.js +4 -2
- package/dist_ts_migration/001.service-selection.d.ts +9 -0
- package/dist_ts_migration/001.service-selection.js +51 -0
- package/dist_ts_migration/002.runtime-config.d.ts +19 -0
- package/dist_ts_migration/002.runtime-config.js +170 -0
- package/dist_ts_migration/003.service-data-marker.d.ts +9 -0
- package/dist_ts_migration/003.service-data-marker.js +156 -0
- package/dist_ts_migration/004.global-registry.d.ts +13 -0
- package/dist_ts_migration/004.global-registry.js +165 -0
- package/dist_ts_migration/index.d.ts +11 -0
- package/dist_ts_migration/index.js +59 -0
- package/package.json +6 -3
- package/readme.hints.md +102 -25
- package/readme.md +123 -28
- package/readme.plan.md +29 -16
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/helpers.smartconfig.ts +63 -10
- package/ts/mod_config/index.ts +1 -1
- package/ts/mod_docker/classes.dockerpruner.ts +6 -0
- package/ts/mod_release/index.ts +3 -3
- package/ts/mod_services/classes.dockercontainer.ts +912 -96
- package/ts/mod_services/classes.globalregistry.ts +290 -89
- package/ts/mod_services/classes.globalregistrystore.ts +279 -0
- package/ts/mod_services/classes.interprocesslock.ts +189 -0
- package/ts/mod_services/classes.serviceconfiguration.ts +215 -108
- package/ts/mod_services/classes.servicedatamarker.ts +210 -52
- package/ts/mod_services/classes.servicemanager.ts +1332 -512
- package/ts/mod_services/classes.servicenames.ts +76 -0
- package/ts/mod_services/classes.servicepruner.ts +310 -52
- package/ts/mod_services/index.ts +89 -62
- package/ts/mod_standard/index.ts +1 -1
- package/ts/plugins.ts +4 -0
- package/ts_migration/001.service-selection.ts +77 -0
- package/ts_migration/002.runtime-config.ts +218 -0
- package/ts_migration/003.service-data-marker.ts +216 -0
- package/ts_migration/004.global-registry.ts +272 -0
- package/ts_migration/index.ts +83 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type TServiceName } from './classes.servicedatamarker.js';
|
|
1
2
|
export type ContainerStatus = 'running' | 'stopped' | 'not_exists';
|
|
2
3
|
export interface IDockerUlimit {
|
|
3
4
|
soft: number;
|
|
@@ -27,6 +28,8 @@ export interface IDockerRunOptions {
|
|
|
27
28
|
export interface IDockerCreateArgvOptions extends Omit<IDockerRunOptions, 'command'> {
|
|
28
29
|
/** Container command passed as exact argv entries. */
|
|
29
30
|
command?: readonly string[];
|
|
31
|
+
user?: string;
|
|
32
|
+
entrypoint?: string;
|
|
30
33
|
}
|
|
31
34
|
export interface IDockerExecArgvOptions {
|
|
32
35
|
/** Hard per-process wall-clock bound. */
|
|
@@ -42,6 +45,27 @@ export interface IDockerArgvExecutionErrorOptions {
|
|
|
42
45
|
exitCode?: number;
|
|
43
46
|
signal?: NodeJS.Signals;
|
|
44
47
|
}
|
|
48
|
+
export interface IFencedBindOperationOptions {
|
|
49
|
+
image: string;
|
|
50
|
+
hostPath: string;
|
|
51
|
+
containerPath: string;
|
|
52
|
+
entrypoint: string;
|
|
53
|
+
command: readonly string[];
|
|
54
|
+
labels: Record<string, string>;
|
|
55
|
+
executionOptions: () => IDockerExecArgvOptions;
|
|
56
|
+
rollbackTimeoutMs?: number;
|
|
57
|
+
}
|
|
58
|
+
export declare const fencedBindOperationSpecLabel = "git.zone.operation-spec";
|
|
59
|
+
export declare const fencedBindOperationInvocationLabel = "git.zone.operation-invocation";
|
|
60
|
+
export declare const fencedBindOperationSpec = "1";
|
|
61
|
+
export declare const fencedBindOperationStaleAfterMs = 60000;
|
|
62
|
+
/** One Docker-reserved lock name for every canonical host bind target. */
|
|
63
|
+
export declare const getFencedBindOperationName: (hostPathArg: string) => string;
|
|
64
|
+
export interface IRemoveDataDirectoryOptions {
|
|
65
|
+
projectPath: string;
|
|
66
|
+
service: TServiceName;
|
|
67
|
+
preDeleteCheck?: () => Promise<void>;
|
|
68
|
+
}
|
|
45
69
|
/** Sanitised failure from the shell-free Docker execution path. */
|
|
46
70
|
export declare class DockerArgvExecutionError extends Error {
|
|
47
71
|
readonly exitCode?: number;
|
|
@@ -75,8 +99,9 @@ export declare class DockerContainer {
|
|
|
75
99
|
* @git.zone/tsdocker.
|
|
76
100
|
*/
|
|
77
101
|
private queryTimeoutSeconds;
|
|
78
|
-
/** Longer bound for
|
|
102
|
+
/** Longer bound for root-helper cleanup, which may delete a large tree. */
|
|
79
103
|
private cleanupTimeoutSeconds;
|
|
104
|
+
private bindOperationDelay;
|
|
80
105
|
constructor();
|
|
81
106
|
/** `docker` prefixed with a hard wall-clock bound. */
|
|
82
107
|
private bounded;
|
|
@@ -93,6 +118,17 @@ export declare class DockerContainer {
|
|
|
93
118
|
* command errors. The returned stdout contains Docker's immutable id.
|
|
94
119
|
*/
|
|
95
120
|
createArgv(optionsArg: IDockerCreateArgvOptions, executionOptionsArg: IDockerExecArgvOptions): Promise<IDockerExecArgvResult>;
|
|
121
|
+
private assertFencedBindInspection;
|
|
122
|
+
private assertRecoverableFencedBindInspection;
|
|
123
|
+
private readFencedBindInspection;
|
|
124
|
+
private inspectFencedBindOperation;
|
|
125
|
+
private discoverFencedBindOperationId;
|
|
126
|
+
private reclaimStaleFencedBindOperation;
|
|
127
|
+
/**
|
|
128
|
+
* Run one root bind-mount operation with a stopped-create and immutable-ID fence.
|
|
129
|
+
* Every ambiguous or failed path proves ownership again before forced removal.
|
|
130
|
+
*/
|
|
131
|
+
runFencedBindOperation(optionsArg: IFencedBindOperationOptions): Promise<void>;
|
|
96
132
|
/**
|
|
97
133
|
* Check if Docker is installed and available
|
|
98
134
|
*/
|
|
@@ -134,11 +170,18 @@ export declare class DockerContainer {
|
|
|
134
170
|
* True when an image is already present locally.
|
|
135
171
|
*/
|
|
136
172
|
imageExists(imageArg: string): Promise<boolean>;
|
|
173
|
+
/** Exact persisted quarantine path for an interrupted deletion, if present. */
|
|
174
|
+
getPendingDataDeletionPath(projectPathArg: string, serviceArg: TServiceName): Promise<string | undefined>;
|
|
175
|
+
private getDataCleanupOperation;
|
|
176
|
+
private writeServiceDataDeletionIntent;
|
|
177
|
+
private assertRegularDeletionDirectory;
|
|
178
|
+
private renameDataDirectory;
|
|
179
|
+
private deleteDataDirectory;
|
|
137
180
|
/**
|
|
138
181
|
* Remove a service data directory, escalating to a root one-off container
|
|
139
182
|
* when the invoking user cannot delete the contents.
|
|
140
183
|
*
|
|
141
|
-
* Service containers write as their own uid
|
|
184
|
+
* Service containers write as their own uid
|
|
142
185
|
* with restrictive modes, so a plain recursive delete only removes part of the
|
|
143
186
|
* tree. For MongoDB that left a half-deleted, corrupt WiredTiger dataset that
|
|
144
187
|
* crash-looped on the next start — so a partial delete is worse than none.
|
|
@@ -147,7 +190,8 @@ export declare class DockerContainer {
|
|
|
147
190
|
* The one-off container mounts only the target directory, so `rm -rf` inside
|
|
148
191
|
* it cannot reach anything else on the host.
|
|
149
192
|
*/
|
|
150
|
-
removeDataDirectory(hostPathArg: string, imageArg: string): Promise<
|
|
193
|
+
removeDataDirectory(hostPathArg: string, imageArg: string, optionsArg: IRemoveDataDirectoryOptions): Promise<boolean>;
|
|
194
|
+
private removeDataDirectoryLocked;
|
|
151
195
|
/**
|
|
152
196
|
* Execute a command in a running container
|
|
153
197
|
*/
|
|
@@ -209,4 +253,7 @@ export declare class DockerContainer {
|
|
|
209
253
|
* mounted by anything running is never a deletion candidate.
|
|
210
254
|
*/
|
|
211
255
|
listRunningMountSources(): Promise<string[]>;
|
|
256
|
+
/** Resolved host bind paths configured on running and stopped containers. */
|
|
257
|
+
listAllMountSources(): Promise<string[]>;
|
|
258
|
+
private listMountSources;
|
|
212
259
|
}
|