@foss.global/interfaces 1.0.0 → 2.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/changelog.md +30 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/forgesourceinventory.d.ts +352 -0
- package/dist_ts/data/forgesourceinventory.js +2 -0
- package/dist_ts/data/gitmanager.d.ts +57 -1
- package/dist_ts/data/index.d.ts +1 -0
- package/dist_ts/data/index.js +2 -1
- package/dist_ts/data/runner.d.ts +1 -1
- package/package.json +6 -6
- package/readme.md +66 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/forgesourceinventory.ts +351 -0
- package/ts/data/gitmanager.ts +61 -1
- package/ts/data/index.ts +1 -0
package/changelog.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-10-13 - 2.0.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- add GitManager remote transfer options and the repository size contract (gitmanager)
|
|
8
|
+
- `IGitManagerRemoteTransferOptions` on `IGitManagerImportMirrorRequest` and the new `IGitManagerRefreshMirrorRequest`: an HTTP Basic `credential` carried outside the URL, command line and Git config, `caCertificates` for a private CA, and a `timeoutMs` up to six hours.
|
|
9
|
+
- `IGitManagerRepositorySize`: object count, uncompressed object bytes and object database storage bytes.
|
|
10
|
+
|
|
11
|
+
### Breaking Changes
|
|
12
|
+
|
|
13
|
+
- measure Git objects and LFS presence in the forge source inventory (data)
|
|
14
|
+
- `IForgeSourceGitCounts` gains the required measures `objects` and `objectBytes`, and `IForgeSourceLfsCounts` gains `missingObjects`; producers must fill them. LFS `objects` and `bytes` now count only the referenced objects the forge holds.
|
|
15
|
+
|
|
16
|
+
### Maintenance
|
|
17
|
+
|
|
18
|
+
- update release tooling: pnpm 12.10.1 (deps)
|
|
19
|
+
|
|
20
|
+
## 2026-10-13 - 1.1.0
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
- add forge source inventory contracts (data)
|
|
25
|
+
- `IForgeSourceInventoryReport`: an authenticated, read-only, deterministic measurement of a source forge before its migration, with `complete`, `partial` and `notMeasured` measures as decimal strings, organization and user owner inventories with owner totals, and per-repository Git, LFS, collaboration, release (drafts, asset counts and bytes), access and Actions counts.
|
|
26
|
+
- Run units (`TForgeSourceInventoryUnit`, `TForgeSourceInventoryUnitResult`, `IForgeSourceInventoryDiscovery`) for resumable measurement, and `TForgeSourceCollisionCheck` for the native name collision check.
|
|
27
|
+
- A report never carries secret values; secrets and variables are counted, never named.
|
|
28
|
+
|
|
29
|
+
### Maintenance
|
|
30
|
+
|
|
31
|
+
- release tooling: `@git.zone/tsbuild` ^6.0.2 (TypeScript 7; the tsconfig needs no change), `@git.zone/tstest` ^7.2.1, `@git.zone/tsrun` ^3.0.3, `@git.zone/tsdoc` ^3.0.2 (its CLI moved to smartconsole; `buildDocs` is unchanged), `@types/node` ^26.6.4 and pnpm 12.10.0 (26.6.5 and pnpm 12.11.x are younger than seven days)
|
|
32
|
+
|
|
3
33
|
## 2026-09-25 - 1.0.0
|
|
4
34
|
|
|
5
35
|
### Breaking Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@foss.global/interfaces',
|
|
6
|
-
version: '
|
|
6
|
+
version: '2.0.0',
|
|
7
7
|
description: 'Shared TypeScript interfaces and TypedRequest contracts for the foss.global Git platform ecosystem.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx5QkFBeUI7SUFDL0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHFHQUFxRztDQUNuSCxDQUFBIn0=
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import type { TForgeInventoryVisibility } from './forgeinventory.js';
|
|
2
|
+
/**
|
|
3
|
+
* Authenticated, read-only measurement of a source forge before its one-time
|
|
4
|
+
* migration. Unlike the caller-visible inventory in `forgeinventory.ts`, it is
|
|
5
|
+
* read with a site administrator's token and counts per owner and repository.
|
|
6
|
+
*
|
|
7
|
+
* A report never contains secret values: no credentials, tokens, private keys,
|
|
8
|
+
* Actions secret or variable values, webhook secrets, or mirror remote URLs.
|
|
9
|
+
* Secrets and variables are counted, never named in the report. Reasons are
|
|
10
|
+
* sanitized diagnostics, never raw response bodies or URLs.
|
|
11
|
+
*/
|
|
12
|
+
/** Source forges the inventory can read. */
|
|
13
|
+
export type TForgeSourceKind = 'gitea';
|
|
14
|
+
/**
|
|
15
|
+
* Values are canonical nonnegative decimal integers, retaining JSON precision.
|
|
16
|
+
* `partial` was attempted and did not finish (a resumed run retries it);
|
|
17
|
+
* `notMeasured` was not attempted, for example because no read exists yet.
|
|
18
|
+
*/
|
|
19
|
+
export type TForgeSourceMeasure = {
|
|
20
|
+
status: 'complete';
|
|
21
|
+
value: string;
|
|
22
|
+
} | {
|
|
23
|
+
status: 'partial';
|
|
24
|
+
observedValue: string;
|
|
25
|
+
reason: string;
|
|
26
|
+
} | {
|
|
27
|
+
status: 'notMeasured';
|
|
28
|
+
reason: string;
|
|
29
|
+
};
|
|
30
|
+
export interface IForgeSourceIdentity {
|
|
31
|
+
/** Operator-assigned identity retained when the instance URL changes. */
|
|
32
|
+
instanceId: string;
|
|
33
|
+
kind: TForgeSourceKind;
|
|
34
|
+
/** Origin and path prefix only; never carries credentials. */
|
|
35
|
+
baseUrl: string;
|
|
36
|
+
version: string;
|
|
37
|
+
}
|
|
38
|
+
/** The account whose token read the source; an inventory requires a site administrator. */
|
|
39
|
+
export interface IForgeSourceReader {
|
|
40
|
+
login: string;
|
|
41
|
+
siteAdmin: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface IForgeSourceUserCounts {
|
|
44
|
+
total: TForgeSourceMeasure;
|
|
45
|
+
active: TForgeSourceMeasure;
|
|
46
|
+
admins: TForgeSourceMeasure;
|
|
47
|
+
restricted: TForgeSourceMeasure;
|
|
48
|
+
prohibitLogin: TForgeSourceMeasure;
|
|
49
|
+
/** Users authenticated through an external source such as LDAP or OAuth2. */
|
|
50
|
+
externalAuth: TForgeSourceMeasure;
|
|
51
|
+
twoFactor: TForgeSourceMeasure;
|
|
52
|
+
}
|
|
53
|
+
export interface IForgeSourceInstanceInventory {
|
|
54
|
+
users: IForgeSourceUserCounts;
|
|
55
|
+
organizations: TForgeSourceMeasure;
|
|
56
|
+
/** System and default webhooks. */
|
|
57
|
+
systemWebhooks: TForgeSourceMeasure;
|
|
58
|
+
/** Instance-scoped Actions runners; their registrations are reissued. */
|
|
59
|
+
runners: TForgeSourceMeasure;
|
|
60
|
+
/** Repositories on disk that the forge database does not know. */
|
|
61
|
+
unadoptedRepositories: TForgeSourceMeasure;
|
|
62
|
+
}
|
|
63
|
+
export interface IForgeSourcePackageTypeCounts {
|
|
64
|
+
/** Provider package type, such as `npm`, `generic` or `container`. */
|
|
65
|
+
type: string;
|
|
66
|
+
packages: TForgeSourceMeasure;
|
|
67
|
+
versions: TForgeSourceMeasure;
|
|
68
|
+
files: TForgeSourceMeasure;
|
|
69
|
+
bytes: TForgeSourceMeasure;
|
|
70
|
+
}
|
|
71
|
+
export interface IForgeSourceUserAccount {
|
|
72
|
+
admin: boolean;
|
|
73
|
+
active: boolean;
|
|
74
|
+
restricted: boolean;
|
|
75
|
+
prohibitLogin: boolean;
|
|
76
|
+
externalAuth: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface IForgeSourceOwnerInventoryBase {
|
|
79
|
+
name: string;
|
|
80
|
+
/** Provider row id as a decimal string. */
|
|
81
|
+
id: string;
|
|
82
|
+
visibility: TForgeInventoryVisibility;
|
|
83
|
+
repositories: TForgeSourceMeasure;
|
|
84
|
+
webhooks: TForgeSourceMeasure;
|
|
85
|
+
actionsVariables: TForgeSourceMeasure;
|
|
86
|
+
runners: TForgeSourceMeasure;
|
|
87
|
+
/** Sorted by type. */
|
|
88
|
+
packages: IForgeSourcePackageTypeCounts[];
|
|
89
|
+
}
|
|
90
|
+
export interface IForgeSourceOrganizationInventory extends IForgeSourceOwnerInventoryBase {
|
|
91
|
+
kind: 'organization';
|
|
92
|
+
members: TForgeSourceMeasure;
|
|
93
|
+
teams: TForgeSourceMeasure;
|
|
94
|
+
teamMemberships: TForgeSourceMeasure;
|
|
95
|
+
teamRepositoryGrants: TForgeSourceMeasure;
|
|
96
|
+
labels: TForgeSourceMeasure;
|
|
97
|
+
actionsSecrets: TForgeSourceMeasure;
|
|
98
|
+
}
|
|
99
|
+
/** User-scoped Actions secrets have no list read; see `IForgeSourceInventory.limitations`. */
|
|
100
|
+
export interface IForgeSourceUserInventory extends IForgeSourceOwnerInventoryBase {
|
|
101
|
+
kind: 'user';
|
|
102
|
+
account: IForgeSourceUserAccount;
|
|
103
|
+
sshKeys: TForgeSourceMeasure;
|
|
104
|
+
gpgKeys: TForgeSourceMeasure;
|
|
105
|
+
}
|
|
106
|
+
export type TForgeSourceOwnerInventory = IForgeSourceOrganizationInventory | IForgeSourceUserInventory;
|
|
107
|
+
/** Owner-level settings summed over every owner; repository settings are summed separately. */
|
|
108
|
+
export interface IForgeSourceOwnerTotals {
|
|
109
|
+
webhooks: TForgeSourceMeasure;
|
|
110
|
+
actionsSecrets: TForgeSourceMeasure;
|
|
111
|
+
actionsVariables: TForgeSourceMeasure;
|
|
112
|
+
runners: TForgeSourceMeasure;
|
|
113
|
+
members: TForgeSourceMeasure;
|
|
114
|
+
teams: TForgeSourceMeasure;
|
|
115
|
+
teamMemberships: TForgeSourceMeasure;
|
|
116
|
+
teamRepositoryGrants: TForgeSourceMeasure;
|
|
117
|
+
labels: TForgeSourceMeasure;
|
|
118
|
+
sshKeys: TForgeSourceMeasure;
|
|
119
|
+
gpgKeys: TForgeSourceMeasure;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Ref and object counts read at the Git level, from a mirror clone of every
|
|
123
|
+
* ref the forge advertises, except `reportedSizeKiB`.
|
|
124
|
+
*/
|
|
125
|
+
export interface IForgeSourceGitCounts {
|
|
126
|
+
/** As reported by the forge, in KiB; not a transfer size. */
|
|
127
|
+
reportedSizeKiB: TForgeSourceMeasure;
|
|
128
|
+
branches: TForgeSourceMeasure;
|
|
129
|
+
tags: TForgeSourceMeasure;
|
|
130
|
+
/** Hidden refs that preserve pull request heads. */
|
|
131
|
+
pullRequestRefs: TForgeSourceMeasure;
|
|
132
|
+
otherRefs: TForgeSourceMeasure;
|
|
133
|
+
/** Distinct Git objects reachable from those refs. */
|
|
134
|
+
objects: TForgeSourceMeasure;
|
|
135
|
+
/** Sum of the uncompressed sizes of those objects; independent of how the forge packs them. */
|
|
136
|
+
objectBytes: TForgeSourceMeasure;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* LFS objects that pointers in any reachable revision reference, by distinct
|
|
140
|
+
* object ID, checked for presence through the forge's LFS batch API.
|
|
141
|
+
*/
|
|
142
|
+
export interface IForgeSourceLfsCounts {
|
|
143
|
+
/** Referenced objects the forge holds. */
|
|
144
|
+
objects: TForgeSourceMeasure;
|
|
145
|
+
/** Sizes of the objects the forge holds. */
|
|
146
|
+
bytes: TForgeSourceMeasure;
|
|
147
|
+
/** Referenced objects the forge does not hold; they cannot be migrated. */
|
|
148
|
+
missingObjects: TForgeSourceMeasure;
|
|
149
|
+
}
|
|
150
|
+
export interface IForgeSourceCollaborationCounts {
|
|
151
|
+
issues: TForgeSourceMeasure;
|
|
152
|
+
pullRequests: TForgeSourceMeasure;
|
|
153
|
+
/** Conversation comments on issues and pull requests. */
|
|
154
|
+
comments: TForgeSourceMeasure;
|
|
155
|
+
reviews: TForgeSourceMeasure;
|
|
156
|
+
reviewComments: TForgeSourceMeasure;
|
|
157
|
+
labels: TForgeSourceMeasure;
|
|
158
|
+
milestones: TForgeSourceMeasure;
|
|
159
|
+
/** Reactions on issues, pull requests and their comments. */
|
|
160
|
+
reactions: TForgeSourceMeasure;
|
|
161
|
+
/** Files attached to issues, pull requests and their comments. */
|
|
162
|
+
attachments: TForgeSourceMeasure;
|
|
163
|
+
attachmentBytes: TForgeSourceMeasure;
|
|
164
|
+
}
|
|
165
|
+
export interface IForgeSourceReleaseCounts {
|
|
166
|
+
/** Includes drafts and prereleases. */
|
|
167
|
+
releases: TForgeSourceMeasure;
|
|
168
|
+
drafts: TForgeSourceMeasure;
|
|
169
|
+
assets: TForgeSourceMeasure;
|
|
170
|
+
assetBytes: TForgeSourceMeasure;
|
|
171
|
+
}
|
|
172
|
+
export interface IForgeSourceAccessCounts {
|
|
173
|
+
collaborators: TForgeSourceMeasure;
|
|
174
|
+
teams: TForgeSourceMeasure;
|
|
175
|
+
deployKeys: TForgeSourceMeasure;
|
|
176
|
+
webhooks: TForgeSourceMeasure;
|
|
177
|
+
branchProtections: TForgeSourceMeasure;
|
|
178
|
+
tagProtections: TForgeSourceMeasure;
|
|
179
|
+
/** Push mirror configurations; their remote credentials are reissued. */
|
|
180
|
+
pushMirrors: TForgeSourceMeasure;
|
|
181
|
+
}
|
|
182
|
+
export interface IForgeSourceActionsCounts {
|
|
183
|
+
/** Workflow files on the default branch. */
|
|
184
|
+
workflows: TForgeSourceMeasure;
|
|
185
|
+
secrets: TForgeSourceMeasure;
|
|
186
|
+
variables: TForgeSourceMeasure;
|
|
187
|
+
runners: TForgeSourceMeasure;
|
|
188
|
+
/** Run history and artifacts are archived, not migrated; counted to size the archive. */
|
|
189
|
+
runs: TForgeSourceMeasure;
|
|
190
|
+
artifacts: TForgeSourceMeasure;
|
|
191
|
+
artifactBytes: TForgeSourceMeasure;
|
|
192
|
+
}
|
|
193
|
+
/** Repository units the forge enables. */
|
|
194
|
+
export interface IForgeSourceRepositoryFeatures {
|
|
195
|
+
issues: boolean;
|
|
196
|
+
pullRequests: boolean;
|
|
197
|
+
wiki: boolean;
|
|
198
|
+
releases: boolean;
|
|
199
|
+
packages: boolean;
|
|
200
|
+
actions: boolean;
|
|
201
|
+
projects: boolean;
|
|
202
|
+
}
|
|
203
|
+
export interface IForgeSourceRepositoryInventory {
|
|
204
|
+
owner: string;
|
|
205
|
+
name: string;
|
|
206
|
+
id: string;
|
|
207
|
+
visibility: TForgeInventoryVisibility;
|
|
208
|
+
fork: boolean;
|
|
209
|
+
/** `owner/name` of the fork parent, or null. */
|
|
210
|
+
parent: string | null;
|
|
211
|
+
mirror: boolean;
|
|
212
|
+
template: boolean;
|
|
213
|
+
archived: boolean;
|
|
214
|
+
empty: boolean;
|
|
215
|
+
/** Git object format such as `sha1` or `sha256`. */
|
|
216
|
+
objectFormat: string;
|
|
217
|
+
defaultBranch: string;
|
|
218
|
+
features: IForgeSourceRepositoryFeatures;
|
|
219
|
+
git: IForgeSourceGitCounts;
|
|
220
|
+
lfs: IForgeSourceLfsCounts;
|
|
221
|
+
collaboration: IForgeSourceCollaborationCounts;
|
|
222
|
+
releases: IForgeSourceReleaseCounts;
|
|
223
|
+
wikiPages: TForgeSourceMeasure;
|
|
224
|
+
access: IForgeSourceAccessCounts;
|
|
225
|
+
actions: IForgeSourceActionsCounts;
|
|
226
|
+
}
|
|
227
|
+
export interface IForgeSourceRepositoryTotals {
|
|
228
|
+
total: TForgeSourceMeasure;
|
|
229
|
+
private: TForgeSourceMeasure;
|
|
230
|
+
internal: TForgeSourceMeasure;
|
|
231
|
+
forks: TForgeSourceMeasure;
|
|
232
|
+
mirrors: TForgeSourceMeasure;
|
|
233
|
+
templates: TForgeSourceMeasure;
|
|
234
|
+
archived: TForgeSourceMeasure;
|
|
235
|
+
empty: TForgeSourceMeasure;
|
|
236
|
+
withWiki: TForgeSourceMeasure;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Sums over every owner and repository; a sum is complete only when every
|
|
240
|
+
* addend is. Repository-shaped groups sum repositories only.
|
|
241
|
+
*/
|
|
242
|
+
export interface IForgeSourceInventoryTotals {
|
|
243
|
+
organizations: TForgeSourceMeasure;
|
|
244
|
+
users: TForgeSourceMeasure;
|
|
245
|
+
repositories: IForgeSourceRepositoryTotals;
|
|
246
|
+
git: IForgeSourceGitCounts;
|
|
247
|
+
lfs: IForgeSourceLfsCounts;
|
|
248
|
+
collaboration: IForgeSourceCollaborationCounts;
|
|
249
|
+
releases: IForgeSourceReleaseCounts;
|
|
250
|
+
wikiPages: TForgeSourceMeasure;
|
|
251
|
+
access: IForgeSourceAccessCounts;
|
|
252
|
+
actions: IForgeSourceActionsCounts;
|
|
253
|
+
owners: IForgeSourceOwnerTotals;
|
|
254
|
+
/** Sorted by type. */
|
|
255
|
+
packages: IForgeSourcePackageTypeCounts[];
|
|
256
|
+
}
|
|
257
|
+
export interface IForgeSourceInventoryGenerator {
|
|
258
|
+
package: string;
|
|
259
|
+
version: string;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* The deterministic measurement of one source: the same source state yields
|
|
263
|
+
* the same document. It carries no timestamps; run times belong to the run.
|
|
264
|
+
* Owners sort by kind then name, repositories by owner then name, and reason
|
|
265
|
+
* lists by code-unit order.
|
|
266
|
+
*/
|
|
267
|
+
export interface IForgeSourceInventory {
|
|
268
|
+
generators: IForgeSourceInventoryGenerator[];
|
|
269
|
+
source: IForgeSourceIdentity;
|
|
270
|
+
reader: IForgeSourceReader;
|
|
271
|
+
/** True only when discovery finished and no measure is partial or not measured. */
|
|
272
|
+
inventoryComplete: boolean;
|
|
273
|
+
incompleteReasons: string[];
|
|
274
|
+
/**
|
|
275
|
+
* Source data that the migration reissues rather than copies and that the
|
|
276
|
+
* provider exposes to no administrator read, such as user-scoped Actions
|
|
277
|
+
* secrets on Gitea. Nothing that is migrated may be listed here instead of
|
|
278
|
+
* being measured.
|
|
279
|
+
*/
|
|
280
|
+
limitations: string[];
|
|
281
|
+
instance: IForgeSourceInstanceInventory;
|
|
282
|
+
owners: TForgeSourceOwnerInventory[];
|
|
283
|
+
repositories: IForgeSourceRepositoryInventory[];
|
|
284
|
+
totals: IForgeSourceInventoryTotals;
|
|
285
|
+
}
|
|
286
|
+
/** A source name that already exists natively and would block an import under that name. */
|
|
287
|
+
export interface IForgeSourceCollision {
|
|
288
|
+
subject: 'owner' | 'repository';
|
|
289
|
+
/** `owner` or `owner/name` at the source. */
|
|
290
|
+
source: string;
|
|
291
|
+
/** The existing native name. */
|
|
292
|
+
native: string;
|
|
293
|
+
nativeKind: 'namespace' | 'repository' | 'user';
|
|
294
|
+
match: 'exact' | 'caseInsensitive';
|
|
295
|
+
}
|
|
296
|
+
export type TForgeSourceCollisionCheck = {
|
|
297
|
+
status: 'checked';
|
|
298
|
+
collisions: IForgeSourceCollision[];
|
|
299
|
+
} | {
|
|
300
|
+
status: 'notChecked';
|
|
301
|
+
reason: string;
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* A report is a complete basis for migration planning only when
|
|
305
|
+
* `inventoryComplete` is true and the collision check ran. Collisions sort by
|
|
306
|
+
* subject, then source, then native name.
|
|
307
|
+
*/
|
|
308
|
+
export interface IForgeSourceInventoryReport extends IForgeSourceInventory {
|
|
309
|
+
collisionCheck: TForgeSourceCollisionCheck;
|
|
310
|
+
}
|
|
311
|
+
/** The complete list of what a run measures, read before any unit. */
|
|
312
|
+
export interface IForgeSourceInventoryDiscovery {
|
|
313
|
+
source: IForgeSourceIdentity;
|
|
314
|
+
reader: IForgeSourceReader;
|
|
315
|
+
owners: Array<{
|
|
316
|
+
kind: 'organization' | 'user';
|
|
317
|
+
name: string;
|
|
318
|
+
}>;
|
|
319
|
+
repositories: Array<{
|
|
320
|
+
owner: string;
|
|
321
|
+
name: string;
|
|
322
|
+
}>;
|
|
323
|
+
/** Non-empty when discovery could not finish; such a run can never be complete. */
|
|
324
|
+
incompleteReasons: string[];
|
|
325
|
+
}
|
|
326
|
+
/** One independently measured and resumable part of a run. */
|
|
327
|
+
export type TForgeSourceInventoryUnit = {
|
|
328
|
+
kind: 'instance';
|
|
329
|
+
} | {
|
|
330
|
+
kind: 'owner';
|
|
331
|
+
ownerKind: 'organization' | 'user';
|
|
332
|
+
name: string;
|
|
333
|
+
} | {
|
|
334
|
+
kind: 'repository';
|
|
335
|
+
owner: string;
|
|
336
|
+
name: string;
|
|
337
|
+
};
|
|
338
|
+
/** A failed unit, or one holding a partial measure, is measured again when a run resumes. */
|
|
339
|
+
export type TForgeSourceInventoryUnitResult = {
|
|
340
|
+
kind: 'instance';
|
|
341
|
+
instance: IForgeSourceInstanceInventory;
|
|
342
|
+
} | {
|
|
343
|
+
kind: 'owner';
|
|
344
|
+
owner: TForgeSourceOwnerInventory;
|
|
345
|
+
} | {
|
|
346
|
+
kind: 'repository';
|
|
347
|
+
repository: IForgeSourceRepositoryInventory;
|
|
348
|
+
} | {
|
|
349
|
+
kind: 'failed';
|
|
350
|
+
unit: TForgeSourceInventoryUnit;
|
|
351
|
+
reason: string;
|
|
352
|
+
};
|
|
@@ -14,9 +14,65 @@ export interface IGitManagerRepositoryInfo extends IGitManagerRepositorySelector
|
|
|
14
14
|
export interface IGitManagerInitBareRepositoryRequest extends IGitManagerRepositorySelector {
|
|
15
15
|
defaultBranch?: string;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* HTTP Basic credentials for a remote Git transfer, such as a forge user name
|
|
19
|
+
* with an access token as the password. Neither part may contain control
|
|
20
|
+
* characters, and the user name may not contain `:`.
|
|
21
|
+
*/
|
|
22
|
+
export interface IGitManagerRemoteBasicCredential {
|
|
23
|
+
kind: 'basic';
|
|
24
|
+
username: string;
|
|
25
|
+
password: string;
|
|
26
|
+
}
|
|
27
|
+
export type TGitManagerRemoteCredential = IGitManagerRemoteBasicCredential;
|
|
28
|
+
/**
|
|
29
|
+
* Options for one transfer from a remote repository.
|
|
30
|
+
*
|
|
31
|
+
* A credential reaches Git only through the Git process environment, as an
|
|
32
|
+
* `Authorization` header. It never appears in the remote URL, on a command
|
|
33
|
+
* line, in the repository's Git config, or in an error. A credential requires
|
|
34
|
+
* an `https` remote URL without user information, and Git does not follow
|
|
35
|
+
* HTTP redirects while it carries one.
|
|
36
|
+
*/
|
|
37
|
+
export interface IGitManagerRemoteTransferOptions {
|
|
38
|
+
credential?: TGitManagerRemoteCredential;
|
|
39
|
+
/**
|
|
40
|
+
* PEM certificates that Git uses as its CA bundle for this transfer, in
|
|
41
|
+
* place of the default bundle file, for a remote behind a private CA.
|
|
42
|
+
*/
|
|
43
|
+
caCertificates?: string[];
|
|
44
|
+
/** Wall-clock limit for the transfer in milliseconds; defaults to 120000, at most 21600000 (six hours). */
|
|
45
|
+
timeoutMs?: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Clones every ref of a remote into a new mirror repository. The stored
|
|
49
|
+
* `remote.origin.url` is `remoteUrl`, so it must never carry credentials;
|
|
50
|
+
* pass them as `credential`.
|
|
51
|
+
*/
|
|
52
|
+
export interface IGitManagerImportMirrorRequest extends IGitManagerRepositorySelector, IGitManagerRemoteTransferOptions {
|
|
18
53
|
remoteUrl: string;
|
|
19
54
|
}
|
|
55
|
+
/** Fetches every ref of an imported mirror's remote again, pruning refs the remote no longer has. */
|
|
56
|
+
export interface IGitManagerRefreshMirrorRequest extends IGitManagerRepositorySelector, IGitManagerRemoteTransferOptions {
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The object database of one repository when it was measured. Objects of
|
|
60
|
+
* alternate object stores are not counted.
|
|
61
|
+
*/
|
|
62
|
+
export interface IGitManagerRepositorySize extends IGitManagerRepositorySelector {
|
|
63
|
+
/** Distinct commits, trees, blobs and annotated tags, reachable or not. */
|
|
64
|
+
objectCount: number;
|
|
65
|
+
/**
|
|
66
|
+
* Sum of the uncompressed sizes of those objects. It does not depend on
|
|
67
|
+
* how the objects are packed, so equal object sets give equal values.
|
|
68
|
+
*/
|
|
69
|
+
objectBytes: number;
|
|
70
|
+
/**
|
|
71
|
+
* Bytes of every file in the object database: loose objects, packs, their
|
|
72
|
+
* indexes and other pack metadata. It depends on packing.
|
|
73
|
+
*/
|
|
74
|
+
storageBytes: number;
|
|
75
|
+
}
|
|
20
76
|
/**
|
|
21
77
|
* One page request of a repository's complete ref inventory.
|
|
22
78
|
*
|
package/dist_ts/data/index.d.ts
CHANGED
package/dist_ts/data/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './codefeed.js';
|
|
2
2
|
export * from './forgeinventory.js';
|
|
3
|
+
export * from './forgesourceinventory.js';
|
|
3
4
|
export * from './gitmanager.js';
|
|
4
5
|
export * from './public.js';
|
|
5
6
|
export * from './runner.js';
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9kYXRhL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsYUFBYSxDQUFDIn0=
|
package/dist_ts/data/runner.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foss.global/interfaces",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared TypeScript interfaces and TypedRequest contracts for the foss.global Git platform ecosystem.",
|
|
6
6
|
"exports": {
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"@api.global/typedrequest-interfaces": "^7.1.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@git.zone/tsbuild": "^
|
|
17
|
-
"@git.zone/tsdoc": "^
|
|
18
|
-
"@git.zone/tsrun": "^3.0.
|
|
19
|
-
"@git.zone/tstest": "^
|
|
20
|
-
"@types/node": "^26.6.
|
|
16
|
+
"@git.zone/tsbuild": "^6.0.2",
|
|
17
|
+
"@git.zone/tsdoc": "^3.0.2",
|
|
18
|
+
"@git.zone/tsrun": "^3.0.3",
|
|
19
|
+
"@git.zone/tstest": "^7.2.1",
|
|
20
|
+
"@types/node": "^26.6.4"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"ts/**/*",
|
package/readme.md
CHANGED
|
@@ -153,6 +153,24 @@ instead of a page that would mix two states; the caller restarts without a
|
|
|
153
153
|
cursor. A cursor is a transport continuation, not a durable replication
|
|
154
154
|
checkpoint.
|
|
155
155
|
|
|
156
|
+
### GitManager remote transfer and size contracts
|
|
157
|
+
|
|
158
|
+
`IGitManagerImportMirrorRequest` and `IGitManagerRefreshMirrorRequest` take
|
|
159
|
+
`IGitManagerRemoteTransferOptions`: an optional `credential`
|
|
160
|
+
(`TGitManagerRemoteCredential`, HTTP Basic), optional `caCertificates` (PEM,
|
|
161
|
+
used as Git's CA bundle for that transfer) and an optional `timeoutMs`
|
|
162
|
+
(default 120000, at most 21600000). A credential reaches Git only through the
|
|
163
|
+
Git process environment as an `Authorization` header, so it never appears in
|
|
164
|
+
the remote URL, on a command line, in the repository's Git config, or in an
|
|
165
|
+
error. It requires an `https` remote without user information, and Git does
|
|
166
|
+
not follow redirects while it carries one. A refresh reuses the mirror's stored
|
|
167
|
+
remote URL.
|
|
168
|
+
|
|
169
|
+
`IGitManagerRepositorySize` measures a repository's object database:
|
|
170
|
+
`objectCount` distinct objects, `objectBytes` (their uncompressed sizes, which
|
|
171
|
+
do not depend on packing) and `storageBytes` (every file of the object
|
|
172
|
+
database, which does).
|
|
173
|
+
|
|
156
174
|
### Forge inventory contracts
|
|
157
175
|
|
|
158
176
|
`IForgeInventoryReport`, `IForgeInventoryPage<TItem>`, `IForgeInventoryNamespace`,
|
|
@@ -189,9 +207,56 @@ scope consistency, capability/result agreement, cursor binding, diagnostics, and
|
|
|
189
207
|
authorization. These DTOs do not establish replication authority, historical
|
|
190
208
|
import fidelity, checksummed manifests, or durable recovery checkpoints.
|
|
191
209
|
|
|
210
|
+
### Forge source inventory contracts
|
|
211
|
+
|
|
212
|
+
`IForgeSourceInventoryReport` is the authenticated, read-only measurement of a
|
|
213
|
+
source forge before its one-time migration, read with a site administrator's
|
|
214
|
+
token. It counts users, organizations, teams, memberships, keys, packages by
|
|
215
|
+
type, and per repository the Git refs and objects, LFS objects, issues, pull requests,
|
|
216
|
+
comments, reviews, reactions, attachments, releases (drafts included) with
|
|
217
|
+
asset bytes, wiki pages, access settings, webhooks, push mirrors, Actions
|
|
218
|
+
settings, and the Actions runs and artifacts that are archived rather than
|
|
219
|
+
migrated.
|
|
220
|
+
|
|
221
|
+
Every count is a `TForgeSourceMeasure`: `complete` with a decimal-string value,
|
|
222
|
+
`partial` with the value observed before a retryable failure, or `notMeasured`
|
|
223
|
+
when no read was attempted. `inventoryComplete` is true only when discovery
|
|
224
|
+
finished and no measure is partial or not measured; `incompleteReasons` lists
|
|
225
|
+
why not. `limitations` names source data the provider exposes to no
|
|
226
|
+
administrator read and that is reissued rather than migrated, such as Gitea's
|
|
227
|
+
user-scoped Actions secrets; everything readable is a measure instead.
|
|
228
|
+
Reasons are sanitized text, never raw response bodies or URLs.
|
|
229
|
+
|
|
230
|
+
Git counts other than the forge-reported size, and LFS counts, are read at the
|
|
231
|
+
Git level from a mirror clone of every advertised ref: refs by namespace,
|
|
232
|
+
distinct objects and their uncompressed bytes, and the LFS objects that
|
|
233
|
+
pointers in any reachable revision reference. LFS objects are checked through
|
|
234
|
+
the forge's LFS batch API and split into held objects with their bytes and
|
|
235
|
+
`missingObjects`, which cannot be migrated.
|
|
236
|
+
|
|
237
|
+
Owners are a `TForgeSourceOwnerInventory` union: an organization carries its
|
|
238
|
+
members, teams, team memberships and repository grants, labels and Actions
|
|
239
|
+
secret count; a user carries its account flags and SSH and GPG key counts.
|
|
240
|
+
Both carry repositories, webhooks, Actions variables, runners and packages by
|
|
241
|
+
type. `totals.owners` sums the owner-level counts; the repository-shaped totals
|
|
242
|
+
sum repositories only.
|
|
243
|
+
|
|
244
|
+
A run first reads `IForgeSourceInventoryDiscovery`, then measures independent
|
|
245
|
+
`TForgeSourceInventoryUnit`s (the instance, each owner and each repository). A
|
|
246
|
+
failed unit, or one holding a partial measure, is measured again on resume.
|
|
247
|
+
`IForgeSourceInventory` is deterministic: it carries no timestamps, owners sort
|
|
248
|
+
by kind and name, repositories by owner and name. The report adds
|
|
249
|
+
`collisionCheck`, the source owner and repository names that already exist
|
|
250
|
+
natively, exactly or case-insensitively, sorted by subject, source and native
|
|
251
|
+
name. A report is a complete planning basis only when `inventoryComplete` is
|
|
252
|
+
true and the collision check ran.
|
|
253
|
+
|
|
254
|
+
A report never contains secret values, credentials, tokens, private keys,
|
|
255
|
+
Actions secret or variable values, webhook secrets, or mirror remote URLs.
|
|
256
|
+
|
|
192
257
|
## Exports
|
|
193
258
|
|
|
194
|
-
- `data`: public DTOs for users, organizations, repositories, contents, commits, diffs, releases, issues, activity, news, stats, codefeed commit results, GitManager repository/read API results, and runner/CI contracts.
|
|
259
|
+
- `data`: public DTOs for users, organizations, repositories, contents, commits, diffs, releases, issues, activity, news, stats, codefeed commit results, GitManager repository/read API results, forge and forge source inventories, and runner/CI contracts.
|
|
195
260
|
- `requests`: TypedRequest contracts for `codefeed`, `publicOverview`, `publicOrg`, `publicRepo`, `publicFile`, and `publicCommits`.
|
|
196
261
|
- Barrel exports: all public data and request interfaces are also exported from the package root.
|
|
197
262
|
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import type { TForgeInventoryVisibility } from './forgeinventory.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Authenticated, read-only measurement of a source forge before its one-time
|
|
5
|
+
* migration. Unlike the caller-visible inventory in `forgeinventory.ts`, it is
|
|
6
|
+
* read with a site administrator's token and counts per owner and repository.
|
|
7
|
+
*
|
|
8
|
+
* A report never contains secret values: no credentials, tokens, private keys,
|
|
9
|
+
* Actions secret or variable values, webhook secrets, or mirror remote URLs.
|
|
10
|
+
* Secrets and variables are counted, never named in the report. Reasons are
|
|
11
|
+
* sanitized diagnostics, never raw response bodies or URLs.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** Source forges the inventory can read. */
|
|
15
|
+
export type TForgeSourceKind = 'gitea';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Values are canonical nonnegative decimal integers, retaining JSON precision.
|
|
19
|
+
* `partial` was attempted and did not finish (a resumed run retries it);
|
|
20
|
+
* `notMeasured` was not attempted, for example because no read exists yet.
|
|
21
|
+
*/
|
|
22
|
+
export type TForgeSourceMeasure =
|
|
23
|
+
| { status: 'complete'; value: string }
|
|
24
|
+
| { status: 'partial'; observedValue: string; reason: string }
|
|
25
|
+
| { status: 'notMeasured'; reason: string };
|
|
26
|
+
|
|
27
|
+
export interface IForgeSourceIdentity {
|
|
28
|
+
/** Operator-assigned identity retained when the instance URL changes. */
|
|
29
|
+
instanceId: string;
|
|
30
|
+
kind: TForgeSourceKind;
|
|
31
|
+
/** Origin and path prefix only; never carries credentials. */
|
|
32
|
+
baseUrl: string;
|
|
33
|
+
version: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The account whose token read the source; an inventory requires a site administrator. */
|
|
37
|
+
export interface IForgeSourceReader {
|
|
38
|
+
login: string;
|
|
39
|
+
siteAdmin: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface IForgeSourceUserCounts {
|
|
43
|
+
total: TForgeSourceMeasure;
|
|
44
|
+
active: TForgeSourceMeasure;
|
|
45
|
+
admins: TForgeSourceMeasure;
|
|
46
|
+
restricted: TForgeSourceMeasure;
|
|
47
|
+
prohibitLogin: TForgeSourceMeasure;
|
|
48
|
+
/** Users authenticated through an external source such as LDAP or OAuth2. */
|
|
49
|
+
externalAuth: TForgeSourceMeasure;
|
|
50
|
+
twoFactor: TForgeSourceMeasure;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface IForgeSourceInstanceInventory {
|
|
54
|
+
users: IForgeSourceUserCounts;
|
|
55
|
+
organizations: TForgeSourceMeasure;
|
|
56
|
+
/** System and default webhooks. */
|
|
57
|
+
systemWebhooks: TForgeSourceMeasure;
|
|
58
|
+
/** Instance-scoped Actions runners; their registrations are reissued. */
|
|
59
|
+
runners: TForgeSourceMeasure;
|
|
60
|
+
/** Repositories on disk that the forge database does not know. */
|
|
61
|
+
unadoptedRepositories: TForgeSourceMeasure;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface IForgeSourcePackageTypeCounts {
|
|
65
|
+
/** Provider package type, such as `npm`, `generic` or `container`. */
|
|
66
|
+
type: string;
|
|
67
|
+
packages: TForgeSourceMeasure;
|
|
68
|
+
versions: TForgeSourceMeasure;
|
|
69
|
+
files: TForgeSourceMeasure;
|
|
70
|
+
bytes: TForgeSourceMeasure;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface IForgeSourceUserAccount {
|
|
74
|
+
admin: boolean;
|
|
75
|
+
active: boolean;
|
|
76
|
+
restricted: boolean;
|
|
77
|
+
prohibitLogin: boolean;
|
|
78
|
+
externalAuth: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface IForgeSourceOwnerInventoryBase {
|
|
82
|
+
name: string;
|
|
83
|
+
/** Provider row id as a decimal string. */
|
|
84
|
+
id: string;
|
|
85
|
+
visibility: TForgeInventoryVisibility;
|
|
86
|
+
repositories: TForgeSourceMeasure;
|
|
87
|
+
webhooks: TForgeSourceMeasure;
|
|
88
|
+
actionsVariables: TForgeSourceMeasure;
|
|
89
|
+
runners: TForgeSourceMeasure;
|
|
90
|
+
/** Sorted by type. */
|
|
91
|
+
packages: IForgeSourcePackageTypeCounts[];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface IForgeSourceOrganizationInventory extends IForgeSourceOwnerInventoryBase {
|
|
95
|
+
kind: 'organization';
|
|
96
|
+
members: TForgeSourceMeasure;
|
|
97
|
+
teams: TForgeSourceMeasure;
|
|
98
|
+
teamMemberships: TForgeSourceMeasure;
|
|
99
|
+
teamRepositoryGrants: TForgeSourceMeasure;
|
|
100
|
+
labels: TForgeSourceMeasure;
|
|
101
|
+
actionsSecrets: TForgeSourceMeasure;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** User-scoped Actions secrets have no list read; see `IForgeSourceInventory.limitations`. */
|
|
105
|
+
export interface IForgeSourceUserInventory extends IForgeSourceOwnerInventoryBase {
|
|
106
|
+
kind: 'user';
|
|
107
|
+
account: IForgeSourceUserAccount;
|
|
108
|
+
sshKeys: TForgeSourceMeasure;
|
|
109
|
+
gpgKeys: TForgeSourceMeasure;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type TForgeSourceOwnerInventory = IForgeSourceOrganizationInventory | IForgeSourceUserInventory;
|
|
113
|
+
|
|
114
|
+
/** Owner-level settings summed over every owner; repository settings are summed separately. */
|
|
115
|
+
export interface IForgeSourceOwnerTotals {
|
|
116
|
+
webhooks: TForgeSourceMeasure;
|
|
117
|
+
actionsSecrets: TForgeSourceMeasure;
|
|
118
|
+
actionsVariables: TForgeSourceMeasure;
|
|
119
|
+
runners: TForgeSourceMeasure;
|
|
120
|
+
members: TForgeSourceMeasure;
|
|
121
|
+
teams: TForgeSourceMeasure;
|
|
122
|
+
teamMemberships: TForgeSourceMeasure;
|
|
123
|
+
teamRepositoryGrants: TForgeSourceMeasure;
|
|
124
|
+
labels: TForgeSourceMeasure;
|
|
125
|
+
sshKeys: TForgeSourceMeasure;
|
|
126
|
+
gpgKeys: TForgeSourceMeasure;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Ref and object counts read at the Git level, from a mirror clone of every
|
|
131
|
+
* ref the forge advertises, except `reportedSizeKiB`.
|
|
132
|
+
*/
|
|
133
|
+
export interface IForgeSourceGitCounts {
|
|
134
|
+
/** As reported by the forge, in KiB; not a transfer size. */
|
|
135
|
+
reportedSizeKiB: TForgeSourceMeasure;
|
|
136
|
+
branches: TForgeSourceMeasure;
|
|
137
|
+
tags: TForgeSourceMeasure;
|
|
138
|
+
/** Hidden refs that preserve pull request heads. */
|
|
139
|
+
pullRequestRefs: TForgeSourceMeasure;
|
|
140
|
+
otherRefs: TForgeSourceMeasure;
|
|
141
|
+
/** Distinct Git objects reachable from those refs. */
|
|
142
|
+
objects: TForgeSourceMeasure;
|
|
143
|
+
/** Sum of the uncompressed sizes of those objects; independent of how the forge packs them. */
|
|
144
|
+
objectBytes: TForgeSourceMeasure;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* LFS objects that pointers in any reachable revision reference, by distinct
|
|
149
|
+
* object ID, checked for presence through the forge's LFS batch API.
|
|
150
|
+
*/
|
|
151
|
+
export interface IForgeSourceLfsCounts {
|
|
152
|
+
/** Referenced objects the forge holds. */
|
|
153
|
+
objects: TForgeSourceMeasure;
|
|
154
|
+
/** Sizes of the objects the forge holds. */
|
|
155
|
+
bytes: TForgeSourceMeasure;
|
|
156
|
+
/** Referenced objects the forge does not hold; they cannot be migrated. */
|
|
157
|
+
missingObjects: TForgeSourceMeasure;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface IForgeSourceCollaborationCounts {
|
|
161
|
+
issues: TForgeSourceMeasure;
|
|
162
|
+
pullRequests: TForgeSourceMeasure;
|
|
163
|
+
/** Conversation comments on issues and pull requests. */
|
|
164
|
+
comments: TForgeSourceMeasure;
|
|
165
|
+
reviews: TForgeSourceMeasure;
|
|
166
|
+
reviewComments: TForgeSourceMeasure;
|
|
167
|
+
labels: TForgeSourceMeasure;
|
|
168
|
+
milestones: TForgeSourceMeasure;
|
|
169
|
+
/** Reactions on issues, pull requests and their comments. */
|
|
170
|
+
reactions: TForgeSourceMeasure;
|
|
171
|
+
/** Files attached to issues, pull requests and their comments. */
|
|
172
|
+
attachments: TForgeSourceMeasure;
|
|
173
|
+
attachmentBytes: TForgeSourceMeasure;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface IForgeSourceReleaseCounts {
|
|
177
|
+
/** Includes drafts and prereleases. */
|
|
178
|
+
releases: TForgeSourceMeasure;
|
|
179
|
+
drafts: TForgeSourceMeasure;
|
|
180
|
+
assets: TForgeSourceMeasure;
|
|
181
|
+
assetBytes: TForgeSourceMeasure;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface IForgeSourceAccessCounts {
|
|
185
|
+
collaborators: TForgeSourceMeasure;
|
|
186
|
+
teams: TForgeSourceMeasure;
|
|
187
|
+
deployKeys: TForgeSourceMeasure;
|
|
188
|
+
webhooks: TForgeSourceMeasure;
|
|
189
|
+
branchProtections: TForgeSourceMeasure;
|
|
190
|
+
tagProtections: TForgeSourceMeasure;
|
|
191
|
+
/** Push mirror configurations; their remote credentials are reissued. */
|
|
192
|
+
pushMirrors: TForgeSourceMeasure;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface IForgeSourceActionsCounts {
|
|
196
|
+
/** Workflow files on the default branch. */
|
|
197
|
+
workflows: TForgeSourceMeasure;
|
|
198
|
+
secrets: TForgeSourceMeasure;
|
|
199
|
+
variables: TForgeSourceMeasure;
|
|
200
|
+
runners: TForgeSourceMeasure;
|
|
201
|
+
/** Run history and artifacts are archived, not migrated; counted to size the archive. */
|
|
202
|
+
runs: TForgeSourceMeasure;
|
|
203
|
+
artifacts: TForgeSourceMeasure;
|
|
204
|
+
artifactBytes: TForgeSourceMeasure;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** Repository units the forge enables. */
|
|
208
|
+
export interface IForgeSourceRepositoryFeatures {
|
|
209
|
+
issues: boolean;
|
|
210
|
+
pullRequests: boolean;
|
|
211
|
+
wiki: boolean;
|
|
212
|
+
releases: boolean;
|
|
213
|
+
packages: boolean;
|
|
214
|
+
actions: boolean;
|
|
215
|
+
projects: boolean;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface IForgeSourceRepositoryInventory {
|
|
219
|
+
owner: string;
|
|
220
|
+
name: string;
|
|
221
|
+
id: string;
|
|
222
|
+
visibility: TForgeInventoryVisibility;
|
|
223
|
+
fork: boolean;
|
|
224
|
+
/** `owner/name` of the fork parent, or null. */
|
|
225
|
+
parent: string | null;
|
|
226
|
+
mirror: boolean;
|
|
227
|
+
template: boolean;
|
|
228
|
+
archived: boolean;
|
|
229
|
+
empty: boolean;
|
|
230
|
+
/** Git object format such as `sha1` or `sha256`. */
|
|
231
|
+
objectFormat: string;
|
|
232
|
+
defaultBranch: string;
|
|
233
|
+
features: IForgeSourceRepositoryFeatures;
|
|
234
|
+
git: IForgeSourceGitCounts;
|
|
235
|
+
lfs: IForgeSourceLfsCounts;
|
|
236
|
+
collaboration: IForgeSourceCollaborationCounts;
|
|
237
|
+
releases: IForgeSourceReleaseCounts;
|
|
238
|
+
wikiPages: TForgeSourceMeasure;
|
|
239
|
+
access: IForgeSourceAccessCounts;
|
|
240
|
+
actions: IForgeSourceActionsCounts;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface IForgeSourceRepositoryTotals {
|
|
244
|
+
total: TForgeSourceMeasure;
|
|
245
|
+
private: TForgeSourceMeasure;
|
|
246
|
+
internal: TForgeSourceMeasure;
|
|
247
|
+
forks: TForgeSourceMeasure;
|
|
248
|
+
mirrors: TForgeSourceMeasure;
|
|
249
|
+
templates: TForgeSourceMeasure;
|
|
250
|
+
archived: TForgeSourceMeasure;
|
|
251
|
+
empty: TForgeSourceMeasure;
|
|
252
|
+
withWiki: TForgeSourceMeasure;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Sums over every owner and repository; a sum is complete only when every
|
|
257
|
+
* addend is. Repository-shaped groups sum repositories only.
|
|
258
|
+
*/
|
|
259
|
+
export interface IForgeSourceInventoryTotals {
|
|
260
|
+
organizations: TForgeSourceMeasure;
|
|
261
|
+
users: TForgeSourceMeasure;
|
|
262
|
+
repositories: IForgeSourceRepositoryTotals;
|
|
263
|
+
git: IForgeSourceGitCounts;
|
|
264
|
+
lfs: IForgeSourceLfsCounts;
|
|
265
|
+
collaboration: IForgeSourceCollaborationCounts;
|
|
266
|
+
releases: IForgeSourceReleaseCounts;
|
|
267
|
+
wikiPages: TForgeSourceMeasure;
|
|
268
|
+
access: IForgeSourceAccessCounts;
|
|
269
|
+
actions: IForgeSourceActionsCounts;
|
|
270
|
+
owners: IForgeSourceOwnerTotals;
|
|
271
|
+
/** Sorted by type. */
|
|
272
|
+
packages: IForgeSourcePackageTypeCounts[];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface IForgeSourceInventoryGenerator {
|
|
276
|
+
package: string;
|
|
277
|
+
version: string;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* The deterministic measurement of one source: the same source state yields
|
|
282
|
+
* the same document. It carries no timestamps; run times belong to the run.
|
|
283
|
+
* Owners sort by kind then name, repositories by owner then name, and reason
|
|
284
|
+
* lists by code-unit order.
|
|
285
|
+
*/
|
|
286
|
+
export interface IForgeSourceInventory {
|
|
287
|
+
generators: IForgeSourceInventoryGenerator[];
|
|
288
|
+
source: IForgeSourceIdentity;
|
|
289
|
+
reader: IForgeSourceReader;
|
|
290
|
+
/** True only when discovery finished and no measure is partial or not measured. */
|
|
291
|
+
inventoryComplete: boolean;
|
|
292
|
+
incompleteReasons: string[];
|
|
293
|
+
/**
|
|
294
|
+
* Source data that the migration reissues rather than copies and that the
|
|
295
|
+
* provider exposes to no administrator read, such as user-scoped Actions
|
|
296
|
+
* secrets on Gitea. Nothing that is migrated may be listed here instead of
|
|
297
|
+
* being measured.
|
|
298
|
+
*/
|
|
299
|
+
limitations: string[];
|
|
300
|
+
instance: IForgeSourceInstanceInventory;
|
|
301
|
+
owners: TForgeSourceOwnerInventory[];
|
|
302
|
+
repositories: IForgeSourceRepositoryInventory[];
|
|
303
|
+
totals: IForgeSourceInventoryTotals;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/** A source name that already exists natively and would block an import under that name. */
|
|
307
|
+
export interface IForgeSourceCollision {
|
|
308
|
+
subject: 'owner' | 'repository';
|
|
309
|
+
/** `owner` or `owner/name` at the source. */
|
|
310
|
+
source: string;
|
|
311
|
+
/** The existing native name. */
|
|
312
|
+
native: string;
|
|
313
|
+
nativeKind: 'namespace' | 'repository' | 'user';
|
|
314
|
+
match: 'exact' | 'caseInsensitive';
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export type TForgeSourceCollisionCheck =
|
|
318
|
+
| { status: 'checked'; collisions: IForgeSourceCollision[] }
|
|
319
|
+
| { status: 'notChecked'; reason: string };
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* A report is a complete basis for migration planning only when
|
|
323
|
+
* `inventoryComplete` is true and the collision check ran. Collisions sort by
|
|
324
|
+
* subject, then source, then native name.
|
|
325
|
+
*/
|
|
326
|
+
export interface IForgeSourceInventoryReport extends IForgeSourceInventory {
|
|
327
|
+
collisionCheck: TForgeSourceCollisionCheck;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/** The complete list of what a run measures, read before any unit. */
|
|
331
|
+
export interface IForgeSourceInventoryDiscovery {
|
|
332
|
+
source: IForgeSourceIdentity;
|
|
333
|
+
reader: IForgeSourceReader;
|
|
334
|
+
owners: Array<{ kind: 'organization' | 'user'; name: string }>;
|
|
335
|
+
repositories: Array<{ owner: string; name: string }>;
|
|
336
|
+
/** Non-empty when discovery could not finish; such a run can never be complete. */
|
|
337
|
+
incompleteReasons: string[];
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/** One independently measured and resumable part of a run. */
|
|
341
|
+
export type TForgeSourceInventoryUnit =
|
|
342
|
+
| { kind: 'instance' }
|
|
343
|
+
| { kind: 'owner'; ownerKind: 'organization' | 'user'; name: string }
|
|
344
|
+
| { kind: 'repository'; owner: string; name: string };
|
|
345
|
+
|
|
346
|
+
/** A failed unit, or one holding a partial measure, is measured again when a run resumes. */
|
|
347
|
+
export type TForgeSourceInventoryUnitResult =
|
|
348
|
+
| { kind: 'instance'; instance: IForgeSourceInstanceInventory }
|
|
349
|
+
| { kind: 'owner'; owner: TForgeSourceOwnerInventory }
|
|
350
|
+
| { kind: 'repository'; repository: IForgeSourceRepositoryInventory }
|
|
351
|
+
| { kind: 'failed'; unit: TForgeSourceInventoryUnit; reason: string };
|
package/ts/data/gitmanager.ts
CHANGED
|
@@ -29,10 +29,70 @@ export interface IGitManagerInitBareRepositoryRequest extends IGitManagerReposit
|
|
|
29
29
|
defaultBranch?: string;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* HTTP Basic credentials for a remote Git transfer, such as a forge user name
|
|
34
|
+
* with an access token as the password. Neither part may contain control
|
|
35
|
+
* characters, and the user name may not contain `:`.
|
|
36
|
+
*/
|
|
37
|
+
export interface IGitManagerRemoteBasicCredential {
|
|
38
|
+
kind: 'basic';
|
|
39
|
+
username: string;
|
|
40
|
+
password: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type TGitManagerRemoteCredential = IGitManagerRemoteBasicCredential;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Options for one transfer from a remote repository.
|
|
47
|
+
*
|
|
48
|
+
* A credential reaches Git only through the Git process environment, as an
|
|
49
|
+
* `Authorization` header. It never appears in the remote URL, on a command
|
|
50
|
+
* line, in the repository's Git config, or in an error. A credential requires
|
|
51
|
+
* an `https` remote URL without user information, and Git does not follow
|
|
52
|
+
* HTTP redirects while it carries one.
|
|
53
|
+
*/
|
|
54
|
+
export interface IGitManagerRemoteTransferOptions {
|
|
55
|
+
credential?: TGitManagerRemoteCredential;
|
|
56
|
+
/**
|
|
57
|
+
* PEM certificates that Git uses as its CA bundle for this transfer, in
|
|
58
|
+
* place of the default bundle file, for a remote behind a private CA.
|
|
59
|
+
*/
|
|
60
|
+
caCertificates?: string[];
|
|
61
|
+
/** Wall-clock limit for the transfer in milliseconds; defaults to 120000, at most 21600000 (six hours). */
|
|
62
|
+
timeoutMs?: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Clones every ref of a remote into a new mirror repository. The stored
|
|
67
|
+
* `remote.origin.url` is `remoteUrl`, so it must never carry credentials;
|
|
68
|
+
* pass them as `credential`.
|
|
69
|
+
*/
|
|
70
|
+
export interface IGitManagerImportMirrorRequest extends IGitManagerRepositorySelector, IGitManagerRemoteTransferOptions {
|
|
33
71
|
remoteUrl: string;
|
|
34
72
|
}
|
|
35
73
|
|
|
74
|
+
/** Fetches every ref of an imported mirror's remote again, pruning refs the remote no longer has. */
|
|
75
|
+
export interface IGitManagerRefreshMirrorRequest extends IGitManagerRepositorySelector, IGitManagerRemoteTransferOptions {}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The object database of one repository when it was measured. Objects of
|
|
79
|
+
* alternate object stores are not counted.
|
|
80
|
+
*/
|
|
81
|
+
export interface IGitManagerRepositorySize extends IGitManagerRepositorySelector {
|
|
82
|
+
/** Distinct commits, trees, blobs and annotated tags, reachable or not. */
|
|
83
|
+
objectCount: number;
|
|
84
|
+
/**
|
|
85
|
+
* Sum of the uncompressed sizes of those objects. It does not depend on
|
|
86
|
+
* how the objects are packed, so equal object sets give equal values.
|
|
87
|
+
*/
|
|
88
|
+
objectBytes: number;
|
|
89
|
+
/**
|
|
90
|
+
* Bytes of every file in the object database: loose objects, packs, their
|
|
91
|
+
* indexes and other pack metadata. It depends on packing.
|
|
92
|
+
*/
|
|
93
|
+
storageBytes: number;
|
|
94
|
+
}
|
|
95
|
+
|
|
36
96
|
/**
|
|
37
97
|
* One page request of a repository's complete ref inventory.
|
|
38
98
|
*
|