@foss.global/codefeed 4.0.0 → 4.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,37 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-10-15 - 4.2.0
4
+
5
+ ### Features
6
+
7
+ - Record source releases and protection rules in the Gitea source inventory, and download release assets (giteasourceinventory, giteasourcetransfer)
8
+ - A repository carries `releaseRecords`: every release, drafts and prereleases included, sorted by numeric id, with an author snapshot and its assets (id, uuid, name, size, download count, creation time) sorted by numeric id. Null while a release count is not complete. No digest: Gitea exposes none.
9
+ - A repository carries `protections`: branch rules sorted by rule name with every restriction Gitea reads back, and tag rules sorted by numeric id with their pattern and allowlist. Null while either protection count is not complete.
10
+ - `GiteaSourceTransfer.downloadReleaseAsset(repository, releaseId, { id, uuid, name, size }, { signal })` reads the repository by id and the release by id before the download and again after its last byte, then streams `GET /attachments/{uuid}` with the `token` authorization: no redirect, no range, exact size, the last chunk held back until size and both identity reads pass. Codes: `release-asset-invalid`, `release-asset-identity-changed`, `release-asset-size-mismatch`, `release-asset-size-overrun`, `release-asset-short-body`, `release-asset-transfer-timed-out`, `release-asset-download-failed`, `release-asset-transfer-failed` (body bytes arriving after the download ended; only after the stream is destroyed, so a reader does not see it), `http-<status>`. New option `releaseAssetTimeoutMs` (default 30 minutes, at most six hours).
11
+ - The LFS client's transfer bounds and last-chunk hold-back moved to a shared internal module; LFS codes are unchanged.
12
+ - require @foss.global/interfaces ^2.7.0 for `IForgeSourceRelease`, `IForgeSourceRepositoryProtections` and the optional `releaseRecords` and `protections`
13
+ - Upgrade: additive. A repository unit now also fails when a release or protection rule lacks a field Gitea 1.27 always sends. Rollback: reports from older readers carry no `releaseRecords` or `protections`, and older readers have no `downloadReleaseAsset`.
14
+
15
+ ### Fixes
16
+
17
+ - Destroying an LFS download stream while a read is pending now ends the download and closes its connection at once (lfsbatchclient)
18
+ - The stream came from `Readable.from`, whose destroy waits for the pending read, so a stalled download kept its connection until `requestTimeoutMs`. LFS and release asset downloads now share a stream whose destroy aborts the request immediately; error codes are unchanged.
19
+ ### Maintenance
20
+
21
+ - Upgrade @git.zone/tsbundle to ^3.4.0 (release tooling currency)
22
+
23
+ ## 2026-10-14 - 4.1.0
24
+
25
+ ### Features
26
+
27
+ - Record each source repository's id in Gitea source discovery, check it when measuring, and look a repository up by id (giteasourceinventory)
28
+ - `discover()` records each repository's `id` (canonical decimal string) and `units()` passes it into the repository unit.
29
+ - A repository unit with an `id` fails with `repository-identity-changed` when its name answers with another id; a unit without one is checked by name only, as before.
30
+ - `composeGiteaSourceInventory` counts a repository result whose id differs from discovery's as a failed unit (`repository: unit failed: repository-identity-changed`) and adds `repository: duplicate-id` when two measured repositories share one id.
31
+ - `lookupRepository(id)` reads `GET /api/v1/repositories/{id}`: `present` with the current owner and name, or `absent` only on 404; other failures reject, and a non-canonical id rejects with `invalid-repository-id`.
32
+ - require @foss.global/interfaces ^2.6.0 for the optional discovery and unit `id`
33
+ - Upgrade: additive; discoveries and units without ids keep working. Rollback: an older reader ignores stored ids and checks repository units by name only.
34
+
3
35
  ## 2026-10-14 - 4.0.0
4
36
 
5
37
  ### Breaking Changes
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@foss.global/codefeed',
6
- version: '4.0.0',
6
+ version: '4.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=
@@ -39,6 +39,16 @@ export interface IGiteaSourceMeasureOptions {
39
39
  /** Called once per unit as soon as its result exists, for example to persist it. */
40
40
  onResult?: (resultArg: TUnitResult) => void | Promise<void>;
41
41
  }
42
+ /** A repository read by its id: the name Gitea gives it now, or `absent` once it is deleted. */
43
+ export type TGiteaSourceRepositoryLookup = {
44
+ status: 'present';
45
+ id: string;
46
+ owner: string;
47
+ name: string;
48
+ } | {
49
+ status: 'absent';
50
+ id: string;
51
+ };
42
52
  /** The only limitation: data Gitea exposes to no administrator read and that the migration reissues. */
43
53
  export declare const giteaSourceInventoryLimitations: readonly string[];
44
54
  /**
@@ -57,15 +67,28 @@ export declare class GiteaSourceInventory {
57
67
  /** REST and LFS batch requests together. */
58
68
  get metrics(): IForgeRequestMetrics;
59
69
  /**
60
- * Identifies the source and its reader and lists every owner and repository.
61
- * Rejects unless the token belongs to a site administrator; a listing that
70
+ * 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
62
72
  * does not finish, or that lists a repository id twice, is reported in
63
73
  * `incompleteReasons`.
64
74
  */
65
75
  discover(signalArg?: AbortSignal): Promise<IDiscovery>;
66
76
  /** Every unit a run over this discovery measures: the instance, then owners, then repositories. */
67
77
  units(discoveryArg: IDiscovery): TUnit[];
68
- /** Measures one unit. Never rejects: a unit whose primary record cannot be read is `failed`. */
78
+ /**
79
+ * Reads a repository by its id through `GET /repositories/{id}`, which
80
+ * keeps answering after a rename or transfer: `present` with the name Gitea
81
+ * gives it now, or `absent` when Gitea answers 404, which a site
82
+ * administrator only gets for a deleted repository. Any other failed read
83
+ * rejects with its error, so it never counts as a deletion; an id that is not
84
+ * a canonical decimal rejects with `invalid-repository-id`.
85
+ */
86
+ lookupRepository(idArg: string, signalArg?: AbortSignal): Promise<TGiteaSourceRepositoryLookup>;
87
+ /**
88
+ * Measures one unit. Never rejects: a unit whose primary record cannot be
89
+ * read is `failed`, and so is a repository unit carrying an id that its name
90
+ * no longer answers with (`repository-identity-changed`).
91
+ */
69
92
  measureUnit(unitArg: TUnit, signalArg?: AbortSignal): Promise<TUnitResult>;
70
93
  /**
71
94
  * Measures units with bounded concurrency; results keep the order of `unitsArg`.
@@ -77,9 +100,10 @@ export declare class GiteaSourceInventory {
77
100
  /**
78
101
  * Composes the deterministic inventory from a discovery and its unit results.
79
102
  * Repeated results for one unit keep the last. Units without a successful
80
- * result, owner repository counts that disagree with discovery, and every
81
- * partial or unmeasured value make the inventory incomplete, with reasons
82
- * aggregated per subject kind, path and reason.
103
+ * result, a repository result for another id than discovery recorded, two
104
+ * repositories measured with one id, owner repository counts that disagree
105
+ * with discovery, and every partial or unmeasured value make the inventory
106
+ * incomplete, with reasons aggregated per subject kind, path and reason.
83
107
  */
84
108
  export declare const composeGiteaSourceInventory: (discoveryArg: IDiscovery, resultsArg: TUnitResult[], generatorsArg: plugins.fossInterfaces.data.IForgeSourceInventoryGenerator[]) => IInventory;
85
109
  export {};