@foss.global/codefeed 5.0.0 → 5.2.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 CHANGED
@@ -1,5 +1,44 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-11-11 - 5.2.0
4
+
5
+ ### Features
6
+
7
+ - inventory packages one unit per package when the run selects the package class, with their distinct content (giteasourceinventory)
8
+ - `discover(signal, { classes: ['packages'] })` lists every package from `/admin/packages` as `discovery.packages`, and `units()` adds a `package` unit per package; without the class nothing changes and the package class is unread. An unknown class rejects with `invalid-options`.
9
+ - A package unit records an `IForgeSourcePackageInventory`: owner id, linked repository, every version and each distinct file content once with its files, from the v1 package API. Container index candidates (a file list of exactly `manifest.json`) are read by digest from the registry, checked by SHA-256 and the index or manifest-list media type (`unexpected-manifest-shape` otherwise), and record their `references`; no other manifest is read. npm packages record every served dist-tag, a derived `latest` included, and each version's deprecation; Cargo versions their yank from the sparse index.
10
+ - A unit is whole or failed, never truncated: a listing that does not finish, `npm-version-missing`, `cargo-index-incomplete`, `package-identity-changed` and `unit-over-bound` (over `forgeSourceInventoryUnitMaxBytes` of UTF-8 JSON) fail it.
11
+ - `composeGiteaSourceInventory` adds `packages` and `totals.packageContent` exactly when discovery lists packages, an empty list included; `composeGiteaPackageContent` is exported as the pure function behind the content figures. Unit kinds are dispatched exhaustively; an unknown kind fails as `unit-kind-unsupported`.
12
+ - Every read is a GET; reading an index counts a download of its version, an accepted read stamp (S10 ruling, Addenda 1 and 2).
13
+ - require @foss.global/interfaces ^3.2.1
14
+ - read package content for the migration (giteasourcetransfer)
15
+ - `readContainerManifest` returns a manifest's exact bytes and `Content-Type`, checked against its digest; `downloadContainerBlob` streams a config or layer verified by SHA-256 and size.
16
+ - `downloadPackageFile` streams a generic file, npm tarball, Swift archive or crate, and `readPackageDocument` returns an npm version document, Swift release metadata or `Package.swift`, or a crate version's sparse index line, with its SHA-256; both are bracketed by identity reads of the version (`package-version-identity-changed`, `http-404`). The new option `packageTransferTimeoutMs` bounds a download.
17
+ - `ForgeRequestClient.requestBytes` reads a body as the bytes that arrived with the declared media type (forgeinventory)
18
+
19
+ ### Tests
20
+
21
+ - Check every package record field for field against @foss.global/forgefixtures ^1.0.0 on Gitea 28.2.0, the distinct content against an independent computation, every transfer read, and, with the fixture's state snapshots, that the package inventory and transfer reads change nothing but `package_version.download_count` (once per lead-file read) and the administrator token's `access_token.updated_unix` (giteasourceinventory, giteasourcetransfer)
22
+ - Check the package class selection, index candidates, `unexpected-manifest-shape`, `unit-over-bound`, the npm, Cargo and listing failures, composition and the pure content function against a mocked Gitea, and the package transfer's digest, size, media type and identity checks against a local HTTPS server (giteasourceinventory, giteasourcetransfer)
23
+
24
+ ## 2026-11-11 - 5.1.0
25
+
26
+ ### Features
27
+
28
+ - record users, teams and repository access in the Gitea source inventory, and count deploy tokens apart from SSH deploy keys (giteasourceinventory)
29
+ - A user owner records `userRecord`: id, login, the active, admin, restricted and prohibit-login flags, visibility, and every SSH key from `/users/{user}/keys` with id, title, fingerprint, OpenSSH key type and public key. Null while `sshKeys` is not complete.
30
+ - An organization records `teamRecords`: every team with its permission, units map, includes-all and create-repository flags, visibility, members by id and login and repository ids, from `/orgs/{org}/teams`, `/teams/{id}/members` and `/teams/{id}/repos`. Null while a team listing is not complete.
31
+ - A repository records `accessRecords`: its collaborators with one `/collaborators/{user}/permission` read each (the effective permission Gitea reports, never the collaboration's own mode), its SSH deploy keys (id, shared key row id, title, fingerprint, public key, read-only) and its deploy tokens (id, title, read-only; never the token or its mask). Null while any of its counts is not complete; a failed permission read makes `access.collaborators` partial with `collaborator-permission: <code>`.
32
+ - Count meaning change: `access.deployKeys` (and its total) counts SSH deploy keys only; Gitea 28 deploy tokens, which 5.0.0 counted there, are counted by the new `access.deployTokens`. Composing a stored repository result from before 5.1.0 counts its `deployTokens` as not measured, so the inventory stays incomplete until the repository is measured again.
33
+ - A deploy key entry whose `key_type` is neither `ssh` nor `token`, or a team without Gitea 28's `visibility`, fails its unit.
34
+ - require @foss.global/interfaces ^3.1.0
35
+ - Upgrade: additive fields; re-run the inventory to record them. A consumer that summed `deployKeys` as all deploy key entries adds `deployTokens`. Rollback: 5.0.0 records none of them and counts deploy tokens as deploy keys.
36
+
37
+ ### Tests
38
+
39
+ - Check the identity records against @foss.global/forgefixtures ^0.7.0 on Gitea 28.2.0: every user with its SSH keys (Ed25519, RSA, ECDSA and `sk-*`), every team including Owners and the granular, includes-all and create-repository teams, every collaborator's effective permission, shared, read-write and read-only SSH deploy keys and deploy tokens, with no token mask in the report (giteasourceinventory)
40
+ - Check paging of collaborators, team members and SSH keys, null records on a failed page, a failed or mismatched permission read and an unknown access mode, the deploy key and token split, an unknown deploy key type, and composition of a stored result without `deployTokens` (giteasourceinventory)
41
+
3
42
  ## 2026-11-11 - 5.0.0
4
43
 
5
44
  ### Breaking Changes
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@foss.global/codefeed',
6
- version: '5.0.0',
6
+ version: '5.2.0',
7
7
  description: 'The @foss.global/codefeed module generates commit/activity feeds from forge providers including Gitea and GitManager.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx1QkFBdUI7SUFDN0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHVIQUF1SDtDQUNySSxDQUFBIn0=
@@ -32,6 +32,17 @@ export interface IGiteaSourceInventoryOptions {
32
32
  requestTimeoutMs?: number;
33
33
  maxResponseBytes?: number;
34
34
  }
35
+ /** A class of source data a run measures only when its discovery selects it. */
36
+ export type TGiteaSourceInventoryClass = 'packages';
37
+ export interface IGiteaSourceDiscoveryOptions {
38
+ /**
39
+ * Classes beside the instance, owners and repositories to list for
40
+ * measurement. `packages` lists every package, so `units` measures one unit
41
+ * per package; without it, discovery carries no `packages` and the package
42
+ * class is unread.
43
+ */
44
+ classes?: readonly TGiteaSourceInventoryClass[];
45
+ }
35
46
  export interface IGiteaSourceMeasureOptions {
36
47
  signal?: AbortSignal;
37
48
  /** Units measured at the same time. Requests within one unit are sequential. */
@@ -53,9 +64,10 @@ export type TGiteaSourceRepositoryLookup = {
53
64
  export declare const giteaSourceInventoryLimitations: readonly string[];
54
65
  /**
55
66
  * Authenticated, read-only inventory of a Gitea instance, read with a site
56
- * administrator's token: GET requests to its REST API, a mirror clone of every
57
- * repository for refs, objects and LFS pointers, and LFS batch `download`
58
- * requests that check which referenced objects Gitea holds. It counts secrets
67
+ * administrator's token: GET requests to its REST API and package registries,
68
+ * a mirror clone of every repository for refs, objects and LFS pointers, and
69
+ * LFS batch `download` requests that check which referenced objects Gitea
70
+ * holds. It counts secrets
59
71
  * and variables without retaining their values, and reports every read that
60
72
  * did not finish as a partial or unmeasured value instead of a count.
61
73
  */
@@ -68,12 +80,18 @@ export declare class GiteaSourceInventory {
68
80
  get metrics(): IForgeRequestMetrics;
69
81
  /**
70
82
  * Identifies the source and its reader and lists every owner and repository
71
- * with its id. Rejects unless the token belongs to a site administrator; a listing that
72
- * does not finish, or that lists a repository id twice, is reported in
73
- * `incompleteReasons`.
83
+ * with its id, and with `classes: ['packages']` every package from the
84
+ * administrator package listing (`packages`, absent otherwise). Rejects
85
+ * unless the token belongs to a site administrator, and rejects an unknown
86
+ * class with `invalid-options`; a listing that does not finish, or that
87
+ * lists a repository id twice, is reported in `incompleteReasons`.
88
+ */
89
+ discover(signalArg?: AbortSignal, optionsArg?: IGiteaSourceDiscoveryOptions): Promise<IDiscovery>;
90
+ /**
91
+ * Every unit a run over this discovery measures: the instance, then owners,
92
+ * then repositories, then the packages discovery lists when it selected
93
+ * them.
74
94
  */
75
- discover(signalArg?: AbortSignal): Promise<IDiscovery>;
76
- /** Every unit a run over this discovery measures: the instance, then owners, then repositories. */
77
95
  units(discoveryArg: IDiscovery): TUnit[];
78
96
  /**
79
97
  * Reads a repository by its id through `GET /repositories/{id}`, which
@@ -87,7 +105,11 @@ export declare class GiteaSourceInventory {
87
105
  /**
88
106
  * Measures one unit. Never rejects: a unit whose primary record cannot be
89
107
  * read is `failed`, and so is a repository unit carrying an id that its name
90
- * no longer answers with (`repository-identity-changed`).
108
+ * no longer answers with (`repository-identity-changed`). A package unit is
109
+ * read whole or fails, never partly: a listing that does not finish, an
110
+ * index that is not what its file list promises (`unexpected-manifest-shape`)
111
+ * and a result over `forgeSourceInventoryUnitMaxBytes` of UTF-8 JSON
112
+ * (`unit-over-bound`) fail it, and its record is never truncated.
91
113
  */
92
114
  measureUnit(unitArg: TUnit, signalArg?: AbortSignal): Promise<TUnitResult>;
93
115
  /**
@@ -104,6 +126,10 @@ export declare class GiteaSourceInventory {
104
126
  * repositories measured with one id, owner repository counts that disagree
105
127
  * with discovery, and every partial or unmeasured value make the inventory
106
128
  * incomplete, with reasons aggregated per subject kind, path and reason.
129
+ * `packages` and `totals.packageContent` (`composeGiteaPackageContent`) are
130
+ * present exactly when discovery lists packages, an empty list included; a
131
+ * package without a record is left out, never truncated, and makes its
132
+ * content measures partial.
107
133
  */
108
134
  export declare const composeGiteaSourceInventory: (discoveryArg: IDiscovery, resultsArg: TUnitResult[], generatorsArg: plugins.fossInterfaces.data.IForgeSourceInventoryGenerator[]) => IInventory;
109
135
  export {};