@wtf/release-oci 2.0.0 → 3.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/README.md CHANGED
@@ -1,18 +1,18 @@
1
1
  # @wtf/release-oci
2
2
 
3
- Releases the OCI images of a repo in trains, with no release tool and no rebuild. A pipeline builds
4
- and tests an image; a release copies that tested image, by its digest, to the tags of its version
5
- in the registry, so the bytes released are the bytes tested. This library reads the images of a
6
- repo for the trains, finds the tested image of each, and copies it to the tags of a release by
3
+ Releases the OCI images of a repo, with no release tool and no rebuild. A pipeline builds and tests
4
+ an image; a release copies that tested image, by its digest, to the tag of its version in the
5
+ registry, and points the tags that move at it, so the bytes released are the bytes tested. This
6
+ library reads the images of a repo, finds the tested image of each, and copies it by
7
7
  [crane](https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md). It is the
8
8
  library of [`@wtf/semantic-release-oci`](../semantic-release-oci/README.md), with no dependency on
9
- semantic-release; each function runs `git` and `crane` by the `System` of
10
- [`@wtf/release-system/system`](../release-system/README.md) its caller gives it.
9
+ semantic-release nor on the trains; each function runs `git` and `crane` by the platform its caller
10
+ gives it, in the folder of the repo, as [`@wtf/release`](../release/README.md) has them.
11
11
 
12
12
  ## The ecosystem
13
13
 
14
- Its default export is the ecosystem of OCI images, `ociEcosystem` of `./ecosystem`, an `Ecosystem`
15
- of [`@wtf/release-trains/ecosystem`](../release-trains/README.md), which a config names in
14
+ Its default export is the ecosystem of OCI images, `ociEcosystem` of `./ecosystem`, a
15
+ `ReleasingEcosystem` of [`@wtf/release/contract`](../release/README.md), which a config names in
16
16
  `ecosystems` as `'@wtf/release-oci'`. The trains then read the images of the repo as they read npm
17
17
  packages and crates: which train holds each, the order of the trains, and the checks of a release
18
18
  ([Ecosystems](../docs/guides/ecosystems.md)).
@@ -29,79 +29,99 @@ packages and crates: which train holds each, the order of the trains, and the ch
29
29
  - `satisfies` takes a tag of the one version it names.
30
30
 
31
31
  ```ts
32
+ import type { ReleasePlatform, RepoContext } from '@wtf/release'
32
33
  import oci from '@wtf/release-oci'
33
- import type { System } from '@wtf/release-system/system'
34
34
 
35
35
  oci.resolve('0.0.0', '1.4.0') // '1.4.0'
36
36
  oci.satisfies('1.4.0', '1.4.0') // true
37
37
 
38
38
  /** The images of the repo at the tag of a release, as the trains read them. */
39
- export const imagesAt = (system: System, tag: string) => oci.packages({ system, ref: tag })
39
+ export const imagesAt = (repo: RepoContext<ReleasePlatform>, tag: string) =>
40
+ oci.packages({ ...repo, ref: tag })
40
41
  ```
41
42
 
42
- ## What a release of images is
43
-
44
- No version is written into git: the tags of the registry are the versions. A release of a train
45
- does this:
46
-
47
- - `readImages` (`./images`) reads the images of the files git tracks; `imagesAt` reads them at a
48
- commit.
49
- - `ownersOf` of `@wtf/release-trains/packages` gives each image its train.
50
- - `smokeImages` (`./publish`) finds the tested image of each, its source, by its digest
51
- (`crane digest`), and the platforms of its index (`crane manifest`). A source the registry has
52
- not, or of fewer platforms than the release asks, fails (`EOCISMOKE`).
53
- - `publishImages` copies the digest of each source to the tags the release gives
54
- (`crane copy <source>@<digest> <image>:<tag>`), which mounts each blob of the source's repository
55
- rather than moving it. The tag of the version is copied once: a registry that has it at the same
56
- digest is skipped, so a release that stopped part way is finished by running it again, and at
57
- another digest is refused (`EOCIRETAG`), as a released version never moves.
58
- - `registryPageOf` (`./registry`) gives the page of each image in the container registry of GitLab,
59
- which the GitLab release of the tag links it by.
43
+ ## A release of images
44
+
45
+ No version is written into git: the tags of the registry are the versions. A driver, as `runStep`
46
+ of `@wtf/release/driver`, runs the steps of the ecosystem over the images of the plan it gives,
47
+ `plan.own`, each with the same options, `OciOptions`:
48
+
49
+ | Option | What it is |
50
+ | ----------- | ------------------------------------------------------------------------------------------- |
51
+ | `moving` | The tags that move to the version, as `['1.4', '1']` or `['12.12', 'latest']`: `[]` of none |
52
+ | `source` | The tested image of each: its `repository`, `{image}` the image's own, and its `tag` |
53
+ | `platforms` | The platforms each tested image must be of, as `linux/amd64`: any by default |
54
+ | `crane` | The command of crane: `crane` by default |
55
+ | `registry` | The container registry of GitLab, its `project` and `headers`: the page of each image there |
56
+
57
+ Each step:
58
+
59
+ - `verify` checks that the version and each tag of `moving` is a tag of an image (`EOCIVERSION`),
60
+ and that each image has a repository (`EOCIIMAGE`). It asks the registry nothing.
61
+ - `smoke` finds the tested image of each by its digest (`crane digest`), and the platforms of its
62
+ index (`crane manifest`). A source the registry has not, or of fewer platforms than `platforms`
63
+ names, fails (`EOCISMOKE`).
64
+ - `publish` smokes each image, then copies the digest of its tested image to the tag of the version,
65
+ `crane copy <source>@<digest> <image>:<version>`, which mounts each blob of the source's repository
66
+ rather than moving it. It gives each image, of its page in the container registry of `registry`
67
+ where the options name one (`EOCILINK`); of none, the forge of the release is asked.
68
+ - `move` points each tag of `moving` at the digest the registry has of the version,
69
+ `crane copy <image>@<digest> <image>:<tag>`. A version the registry has not fails (`EOCIMOVE`).
70
+
71
+ The tag of the version is copied once: a registry that has it at the same digest is skipped, so a
72
+ release that stopped part way is finished by running it again, and at another digest is refused
73
+ (`EOCIRETAG`), as a released version never moves. The tags that move are copied every time. A dry
74
+ run, `release.dryRun`, asks the registry, and copies nothing and asks GitLab nothing. The ecosystem
75
+ writes nothing into git, so it has no `prepare`.
60
76
 
61
- ## The tags of a release
77
+ ```ts
78
+ import type { Plan, Release } from '@wtf/release/contract'
79
+ import { runStep } from '@wtf/release/driver'
80
+ import oci from '@wtf/release-oci'
62
81
 
63
- `tagsOfRelease` (`./tags`) gives the version, and of a release, the minor and the major, which move
64
- to each release of their line, so a consumer that pins `1` takes each fix and feature of 1.x:
82
+ /** The images of `plan` released as `12.12-wtf.1`, `12.12` and `latest`, of a tested image. */
83
+ export async function release(of: Release, plan: Plan, tag: string) {
84
+ const plans = new Map([['oci', plan]])
85
+ const options = { moving: ['12.12', 'latest'], source: { repository: '{image}/snapshot', tag } }
86
+ const ecosystems = [[oci, options]] as const
87
+ await runStep(of, plans, ecosystems, 'verify')
88
+ const { released } = await runStep(of, plans, ecosystems, 'publish')
89
+ await runStep(of, plans, ecosystems, 'move')
90
+ return released
91
+ }
92
+ ```
65
93
 
66
- | Version | Tags |
67
- | -------------- | ------------------- |
68
- | `1.4.2` | `1.4.2`, `1.4`, `1` |
69
- | `0.3.1` | `0.3.1`, `0.3` |
70
- | `8.0.0-next.1` | `8.0.0-next.1` |
94
+ ## The tags of a release
71
95
 
72
- A minor of the major `0` breaks what the one before gave, so a release of `0.x` moves its minor
73
- alone; a prerelease moves no tag.
96
+ The ecosystem takes the tags of a release as they are given: the version, the tag that is copied
97
+ once and never moved, and `moving`, each tag copied on every run, `[]` of none. It derives none: a
98
+ release of a semver version, as the plugin makes it, moves its minor and its major, and a release of
99
+ a version that is no semver, as `12.12-wtf.1` of an image of Debian 12.12, names its own. Each is a
100
+ tag an image can have, `[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}`, none given twice, as `checkReleaseTags`
101
+ of `./tags` checks.
74
102
 
75
- `publishImages` takes the tags of a release as they are given: `version`, the tag that is copied
76
- once and never moved, and `moving`, each tag copied on every run, `[]` of none. It derives none:
77
- `releaseTagsOf` gives those of a semver version, as the plugin passes them, and a release of a
78
- version that is no semver, as `12.12-wtf.1` of an image of Debian 12.12, names its own. Each is a tag
79
- an image can have, `[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}`, none given twice, as `checkReleaseTags`
80
- checks before anything is asked of the registry.
103
+ The functions the steps build on take each image of its repository and its source, of no plan:
104
+ `smokeImages`, `publishImages` and `moveImages` of `./publish`.
81
105
 
82
106
  ```ts
83
- import { publishImages } from '@wtf/release-oci/publish'
84
- import type { System } from '@wtf/release-system/system'
107
+ import type { RepoPlatform } from '@wtf/release'
108
+ import { moveImages, publishImages } from '@wtf/release-oci/publish'
85
109
 
86
110
  /** The base image of Debian 12.12, its first build of ours, as `12.12-wtf.1`, `12.12` and `latest`. */
87
- export const release = (system: System, source: string) =>
88
- publishImages({
89
- context: { system },
90
- images: [
91
- {
92
- repository: 'registry.gitlab.com/acme/images/base',
93
- source: { repository: 'registry.gitlab.com/acme/images/base', tag: source }
94
- }
95
- ],
111
+ export async function release(platform: RepoPlatform, source: string) {
112
+ const repository = 'registry.gitlab.com/acme/images/base'
113
+ await publishImages({
114
+ context: { platform },
115
+ images: [{ repository, source: { repository, tag: source } }],
116
+ version: '12.12-wtf.1'
117
+ })
118
+ await moveImages({
119
+ context: { platform },
120
+ repositories: [repository],
96
121
  version: '12.12-wtf.1',
97
122
  moving: ['12.12', 'latest']
98
123
  })
99
- ```
100
-
101
- ```ts
102
- import { tagsOfRelease } from '@wtf/release-oci/tags'
103
-
104
- export const tags = tagsOfRelease('1.4.2') // ['1.4.2', '1.4', '1']
124
+ }
105
125
  ```
106
126
 
107
127
  ## The version in an image
@@ -114,24 +134,26 @@ build as an argument of its own.
114
134
 
115
135
  ## Subpaths
116
136
 
117
- | Subpath | What it is |
118
- | ------------- | ---------------------------------------------------------------------------------- |
119
- | `.` | `OciImage`, and the ecosystem as the default export |
120
- | `./ecosystem` | `ociEcosystem`, `packagesOfImages`, `packagesOfRepo`, `resolveTag`, `satisfiesTag` |
121
- | `./images` | `readImages`, `imagesAt`, `imagesOf`, `imageDirOf`, `repositoryOf` |
122
- | `./tags` | `tagsOfRelease`, `releaseTagsOf`, `checkReleaseTags` |
123
- | `./publish` | `smokeImages`, `publishImages`, `digestOf`, `platformsOf` |
124
- | `./registry` | `registryPageOf` |
125
- | `./errors` | `OciError`, `OCI_ERRORS` |
137
+ | Subpath | What it is |
138
+ | ------------- | ------------------------------------------------------------------------------------------------------------------ |
139
+ | `.` | `OciImage`, and the ecosystem as the default export |
140
+ | `./ecosystem` | `ociEcosystem`, `OciOptions`, `repositoriesOf`, `packagesOfImages`, `packagesOfRepo`, `resolveTag`, `satisfiesTag` |
141
+ | `./images` | `readImages`, `imagesAt`, `imagesOf`, `imageDirOf`, `repositoryOf` |
142
+ | `./tags` | `checkReleaseTags`, `isImageTag` |
143
+ | `./publish` | `smokeImages`, `publishImages`, `moveImages`, `digestOf`, `platformsOf` |
144
+ | `./registry` | `registryPageOf`, `checkRegistryAccess` |
145
+ | `./errors` | `OciError`, `OCI_ERRORS` |
126
146
 
127
147
  ## Errors
128
148
 
129
- | Code | Means |
130
- | --------------- | ----------------------------------------------------------------------------- |
131
- | `EOCIECOSYSTEM` | `ecosystems` lists neither `@wtf/semantic-release-oci/ecosystem` nor this |
132
- | `EOCIIMAGE` | An image has no repository: neither `image` nor `CI_REGISTRY_IMAGE` names one |
133
- | `EOCISOURCE` | The tested image has no tag: neither `sourceTag` nor `CI_COMMIT_REF_SLUG` |
134
- | `EOCISMOKE` | The registry has not the tested image, or crane cannot ask it |
135
- | `EOCIRETAG` | The registry has the version already, at another digest |
136
- | `EOCITAG` | crane cannot copy the tested image to a tag |
137
- | `EOCILINK` | GitLab cannot give the page of an image in its container registry |
149
+ | Code | Means |
150
+ | --------------- | --------------------------------------------------------------------------------------- |
151
+ | `EOCIECOSYSTEM` | `ecosystems` lists neither `@wtf/semantic-release-oci/ecosystem` nor this |
152
+ | `EOCIIMAGE` | An image has no repository: neither `image` nor `CI_REGISTRY_IMAGE` names one |
153
+ | `EOCISOURCE` | The tested image has no tag: neither `sourceTag` nor `CI_COMMIT_REF_SLUG`, nor `source` |
154
+ | `EOCIVERSION` | The version, or a tag that moves, is no tag of an image, or a tag is given twice |
155
+ | `EOCISMOKE` | The registry has not the tested image, or crane cannot ask it |
156
+ | `EOCIRETAG` | The registry has the version already, at another digest |
157
+ | `EOCITAG` | crane cannot copy the tested image to a tag |
158
+ | `EOCIMOVE` | The registry has not the version, which the tags that move would point at |
159
+ | `EOCILINK` | GitLab cannot give the page of an image in its container registry |
@@ -1,11 +1,23 @@
1
1
  /**
2
- * The ecosystem of OCI images ({@link ociEcosystem}), as the trains read it, and the default export
3
- * of the package, which a config names in `ecosystems` as `'@wtf/release-oci'`: the images of the
4
- * repo, each folder of a file an image is built of that git tracks ({@link packagesOfRepo}), of the
5
- * working tree or of a commit; a repo of none has none. An image names no other image of the repo
6
- * as a dependency the trains could read: a `FROM` or a base pins a tag of a registry, not a package
7
- * of the repo. A range of an image is a tag: a release publishes the version itself
8
- * ({@link resolveTag}), which takes that version alone ({@link satisfiesTag}).
2
+ * The ecosystem of OCI images ({@link ociEcosystem}), a `ReleasingEcosystem` of
3
+ * `@wtf/release/contract`, and the default export of the package, which a config names in
4
+ * `ecosystems` as `'@wtf/release-oci'`. Its read side: the images of the repo, each folder of a file
5
+ * an image is built of that git tracks ({@link packagesOfRepo}), of the working tree or of a commit;
6
+ * a repo of none has none. An image names no other image of the repo as a dependency: a `FROM` or a
7
+ * base pins a tag of a registry, not a package of the repo. A range of an image is a tag: a release
8
+ * publishes the version itself ({@link resolveTag}), which takes that version alone
9
+ * ({@link satisfiesTag}).
10
+ *
11
+ * Its steps, each over the images of the plan it is given, of its options ({@link OciOptions}):
12
+ *
13
+ * | Step | What it does |
14
+ * | --------- | -------------------------------------------------------------------------- |
15
+ * | `verify` | checks the version and the tags that move, and the repository of each |
16
+ * | `smoke` | finds the tested image of each by its digest, of the platforms asked |
17
+ * | `publish` | copies the tested image of each, by its digest, to the tag of the version |
18
+ * | `move` | points the tags that move at the digest of the version |
19
+ *
20
+ * It writes nothing into git, so it has no `prepare`: the tags of the registry are the versions.
9
21
  *
10
22
  * ```js
11
23
  * // release.config.mjs
@@ -21,15 +33,17 @@
21
33
  * @packageDocumentation
22
34
  * @module @wtf/release-oci/ecosystem
23
35
  */
24
- import type { Ecosystem, EcosystemContext, Package } from '@wtf/release-trains/ecosystem';
36
+ import type { ReleasingEcosystem } from '@wtf/release/contract';
37
+ import type { EcosystemContext, Package } from '@wtf/release/ecosystem';
25
38
  import type { OciImage } from './index.ts';
26
- /** An image as the trains read it: a package of the trains, and the image it is of. */
39
+ import { type ContainerRegistry } from './registry.ts';
40
+ /** An image as a release reads it: a package of the ecosystem, and the image it is of. */
27
41
  export interface OciPackage extends Package {
28
42
  /** The image, as `readImages` of `./images` gives it. */
29
43
  readonly image: OciImage;
30
44
  }
31
45
  /**
32
- * The images of the repo as the trains read them: each a package named by its repository, or by its
46
+ * The images of the repo as a release reads them: each a package named by its repository, or by its
33
47
  * folder where the environment names no registry image; of its folder and the file it is built of;
34
48
  * published, as every image a pipeline builds is; and of no dependency.
35
49
  *
@@ -38,7 +52,7 @@ export interface OciPackage extends Package {
38
52
  */
39
53
  export declare function packagesOfImages(images: readonly OciImage[]): OciPackage[];
40
54
  /**
41
- * The tag a release publishes of an image of `version`, the release of its train: the version
55
+ * The tag a release publishes of an image of `version`, the version of the release: the version
42
56
  * itself, as `1.4.0`. No image of the repo names another as a dependency, so a range is never read
43
57
  * of a manifest.
44
58
  *
@@ -49,7 +63,7 @@ export declare function packagesOfImages(images: readonly OciImage[]): OciPackag
49
63
  export declare const resolveTag: (_range: string, version: string) => string;
50
64
  /**
51
65
  * Whether `version` is the one `tag` names: a tag of an image names one version, and a moving tag,
52
- * as `1`, is no range the trains read.
66
+ * as `1`, is no range a release reads.
53
67
  *
54
68
  * @param tag - A tag, as `1.4.0`.
55
69
  * @param version - A version, as `1.4.0`.
@@ -57,18 +71,69 @@ export declare const resolveTag: (_range: string, version: string) => string;
57
71
  */
58
72
  export declare const satisfiesTag: (tag: string, version: string) => boolean;
59
73
  /**
60
- * The images of the repo of `context` as the trains read them, of the commit `ref` where it names
74
+ * The images of the repo of `context` as a release reads them, of the commit `ref` where it names
61
75
  * one, else of the working tree.
62
76
  *
63
- * @param context - The folder of the repo, its environment, the system, and the commit.
77
+ * @param context - The folder of the repo, the platform git runs by, and the commit.
64
78
  * @returns The packages, one of each image.
65
79
  * @throws `EGIT` of a commit git has not.
66
80
  */
67
81
  export declare function packagesOfRepo(context: EcosystemContext): Promise<OciPackage[]>;
82
+ /** The tested image of each image of a release: where the pipeline that tested it pushed it. */
83
+ export interface OciSourceOptions {
84
+ /**
85
+ * The repository of the tested image of each image, `{image}` its repository, as
86
+ * `{image}/snapshot`.
87
+ */
88
+ readonly repository: string;
89
+ /** Its tag, as `base-v1-4-2`, the snapshot of the pipeline of the tag of the release. */
90
+ readonly tag: string;
91
+ }
92
+ /** The options of the ecosystem of OCI images, which a driver gives each step. */
93
+ export interface OciOptions {
94
+ /**
95
+ * The tags that move to the version of the release, as `['1.4', '1']` of `1.4.2`, or
96
+ * `['12.12', 'latest']` of `12.12-wtf.1`: `[]` of none. The ecosystem derives none: its caller
97
+ * names them by its own rules.
98
+ */
99
+ readonly moving: readonly string[];
100
+ /** The tested image of each image, which `smoke` finds and `publish` copies. */
101
+ readonly source?: OciSourceOptions | undefined;
102
+ /** The platforms each tested image must be of, as `linux/amd64`: any by default. */
103
+ readonly platforms?: readonly string[] | undefined;
104
+ /** The command of crane, by its name on the path or its path: `crane` by default. */
105
+ readonly crane?: string | undefined;
106
+ /**
107
+ * The container registry of GitLab that `publish` asks the page of each image of: none by
108
+ * default, of an image of no page, which the forge of the release is asked of.
109
+ */
110
+ readonly registry?: ContainerRegistry | undefined;
111
+ }
112
+ /**
113
+ * The repository of each image of `packages`. Throws `EOCIIMAGE`, together, of each image of none.
114
+ *
115
+ * @param packages - The images, as the ecosystem gives them.
116
+ * @returns The repository of each, in their order.
117
+ */
118
+ export declare function repositoriesOf(packages: readonly OciPackage[]): string[];
68
119
  /**
69
120
  * The ecosystem of OCI images: its packages, the images of the repo, of the working tree or of a
70
- * commit ({@link packagesOfRepo}); a tag published as the version ({@link resolveTag}); and a tag
71
- * of one version ({@link satisfiesTag}).
121
+ * commit ({@link packagesOfRepo}); a tag published as the version ({@link resolveTag}); a tag of
122
+ * one version ({@link satisfiesTag}); and the steps of a release of its images, each there:
123
+ *
124
+ * - `verify` checks that the version and each tag that moves is a tag of an image, none given twice
125
+ * (`EOCIVERSION`), and that each image has a repository (`EOCIIMAGE`), together; it asks the
126
+ * registry nothing;
127
+ * - `smoke` finds the tested image of each image by its digest, of the platforms of `platforms`
128
+ * (`EOCISMOKE`), as `smokeImages` of `./publish` does;
129
+ * - `publish` copies the tested image of each image, by its digest, to the tag of the version,
130
+ * skipped of a registry that has it at the same digest and refused at another (`EOCIRETAG`), as
131
+ * `publishImages` of `./publish` does; then asks the page of each of the container registry of
132
+ * `registry` (`EOCILINK`), and gives each image, by its repository; a dry run asks the registry,
133
+ * and copies and asks GitLab nothing;
134
+ * - `move` points the tags of `moving` of each image at the digest the registry has of the version,
135
+ * as `moveImages` of `./publish` does (`EOCIMOVE`), and gives each image it moved; a dry run asks
136
+ * the registry, and copies nothing.
72
137
  */
73
- export declare const ociEcosystem: Ecosystem;
138
+ export declare const ociEcosystem: ReleasingEcosystem<OciOptions, OciPackage, 'verify' | 'smoke' | 'move'>;
74
139
  //# sourceMappingURL=ecosystem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ecosystem.d.ts","sourceRoot":"","sources":["../src/ecosystem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AAEzF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAG1C,uFAAuF;AACvF,MAAM,WAAW,UAAW,SAAQ,OAAO;IACzC,yDAAyD;IACzD,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,GAAG,UAAU,EAAE,CAS1E;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,EAAE,SAAS,MAAM,KAAG,MAAiB,CAAA;AAE9E;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,EAAE,SAAS,MAAM,KAAG,OACP,CAAA;AAErD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAIrF;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,gFAAgF;IAChF,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;IAC9C,oFAAoF;IACpF,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IAClD,qFAAqF;IACrF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAA;CAClD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM,EAAE,CAexE;AA8CD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,YAAY,EAAE,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAgE9F,CAAA"}
package/dist/ecosystem.js CHANGED
@@ -1,6 +1,11 @@
1
+ import { throwAll } from '@wtf/release/errors';
2
+ import { OciError } from "./errors.js";
1
3
  import { imagesAt, readImages } from "./images.js";
4
+ import { moveImages, publishImages, smokeImages } from "./publish.js";
5
+ import { registryPageOf } from "./registry.js";
6
+ import { checkReleaseTags } from "./tags.js";
2
7
  /**
3
- * The images of the repo as the trains read them: each a package named by its repository, or by its
8
+ * The images of the repo as a release reads them: each a package named by its repository, or by its
4
9
  * folder where the environment names no registry image; of its folder and the file it is built of;
5
10
  * published, as every image a pipeline builds is; and of no dependency.
6
11
  *
@@ -18,7 +23,7 @@ export function packagesOfImages(images) {
18
23
  }));
19
24
  }
20
25
  /**
21
- * The tag a release publishes of an image of `version`, the release of its train: the version
26
+ * The tag a release publishes of an image of `version`, the version of the release: the version
22
27
  * itself, as `1.4.0`. No image of the repo names another as a dependency, so a range is never read
23
28
  * of a manifest.
24
29
  *
@@ -29,7 +34,7 @@ export function packagesOfImages(images) {
29
34
  export const resolveTag = (_range, version) => version;
30
35
  /**
31
36
  * Whether `version` is the one `tag` names: a tag of an image names one version, and a moving tag,
32
- * as `1`, is no range the trains read.
37
+ * as `1`, is no range a release reads.
33
38
  *
34
39
  * @param tag - A tag, as `1.4.0`.
35
40
  * @param version - A version, as `1.4.0`.
@@ -37,25 +42,143 @@ export const resolveTag = (_range, version) => version;
37
42
  */
38
43
  export const satisfiesTag = (tag, version) => tag.replace(/^v/, '') === version.replace(/^v/, '');
39
44
  /**
40
- * The images of the repo of `context` as the trains read them, of the commit `ref` where it names
45
+ * The images of the repo of `context` as a release reads them, of the commit `ref` where it names
41
46
  * one, else of the working tree.
42
47
  *
43
- * @param context - The folder of the repo, its environment, the system, and the commit.
48
+ * @param context - The folder of the repo, the platform git runs by, and the commit.
44
49
  * @returns The packages, one of each image.
45
50
  * @throws `EGIT` of a commit git has not.
46
51
  */
47
52
  export async function packagesOfRepo(context) {
48
53
  return packagesOfImages(context.ref === undefined ? await readImages(context) : await imagesAt(context.ref, context));
49
54
  }
55
+ /**
56
+ * The repository of each image of `packages`. Throws `EOCIIMAGE`, together, of each image of none.
57
+ *
58
+ * @param packages - The images, as the ecosystem gives them.
59
+ * @returns The repository of each, in their order.
60
+ */
61
+ export function repositoriesOf(packages) {
62
+ const errors = [];
63
+ const repositories = packages.flatMap(({ image: { dir, repository } }) => {
64
+ if (repository !== undefined)
65
+ return [repository];
66
+ errors.push(new OciError('EOCIIMAGE', `The image of ${dir} has no repository: the environment its images were read of names no registry image of the project, \`CI_REGISTRY_IMAGE\`.`, 'Read the images in a pipeline of GitLab, which gives `CI_REGISTRY_IMAGE`, or give `readImages` of `@wtf/release-oci/images` the registry image of the project, as `registry.gitlab.com/acme/images`.'));
67
+ return [];
68
+ });
69
+ throwAll(errors);
70
+ return repositories;
71
+ }
72
+ /**
73
+ * The images of `plan`, each of its tested image, of the source of `options`. Throws `EOCIIMAGE` of
74
+ * an image of no repository, and `EOCISOURCE` of options of no source.
75
+ *
76
+ * @param plan - What the release is of.
77
+ * @param options - The options of the ecosystem.
78
+ * @returns Each image, of its source.
79
+ */
80
+ function imagesToPublish(plan, options) {
81
+ const repositories = repositoriesOf(plan.own);
82
+ const { source } = options;
83
+ if (source === undefined)
84
+ throw new OciError('EOCISOURCE', 'The tested image of the release is not named: the options of the ecosystem give no `source`.', 'Give the repository and the tag the pipeline pushes the tested image of each image as: the repository `{image}/snapshot`, `{image}` its repository, and the tag `base-v1-4-2`.');
85
+ return repositories.map((repository) => ({
86
+ repository,
87
+ source: { repository: source.repository.replaceAll('{image}', repository), tag: source.tag }
88
+ }));
89
+ }
90
+ /**
91
+ * The errors `check` throws: each of an `AggregateError`, or the one; none of a check that passes.
92
+ *
93
+ * @param check - The check.
94
+ * @returns Its errors.
95
+ */
96
+ function faultsOf(check) {
97
+ try {
98
+ check();
99
+ return [];
100
+ }
101
+ catch (error) {
102
+ return error instanceof AggregateError ? error.errors : [error];
103
+ }
104
+ }
105
+ /** Where crane runs of a release and its options. */
106
+ const craneOf = (release, options) => ({
107
+ platform: release.platform,
108
+ crane: options.crane
109
+ });
50
110
  /**
51
111
  * The ecosystem of OCI images: its packages, the images of the repo, of the working tree or of a
52
- * commit ({@link packagesOfRepo}); a tag published as the version ({@link resolveTag}); and a tag
53
- * of one version ({@link satisfiesTag}).
112
+ * commit ({@link packagesOfRepo}); a tag published as the version ({@link resolveTag}); a tag of
113
+ * one version ({@link satisfiesTag}); and the steps of a release of its images, each there:
114
+ *
115
+ * - `verify` checks that the version and each tag that moves is a tag of an image, none given twice
116
+ * (`EOCIVERSION`), and that each image has a repository (`EOCIIMAGE`), together; it asks the
117
+ * registry nothing;
118
+ * - `smoke` finds the tested image of each image by its digest, of the platforms of `platforms`
119
+ * (`EOCISMOKE`), as `smokeImages` of `./publish` does;
120
+ * - `publish` copies the tested image of each image, by its digest, to the tag of the version,
121
+ * skipped of a registry that has it at the same digest and refused at another (`EOCIRETAG`), as
122
+ * `publishImages` of `./publish` does; then asks the page of each of the container registry of
123
+ * `registry` (`EOCILINK`), and gives each image, by its repository; a dry run asks the registry,
124
+ * and copies and asks GitLab nothing;
125
+ * - `move` points the tags of `moving` of each image at the digest the registry has of the version,
126
+ * as `moveImages` of `./publish` does (`EOCIMOVE`), and gives each image it moved; a dry run asks
127
+ * the registry, and copies nothing.
54
128
  */
55
129
  export const ociEcosystem = {
56
130
  name: 'oci',
57
131
  packages: packagesOfRepo,
58
132
  resolve: resolveTag,
59
- satisfies: satisfiesTag
133
+ satisfies: satisfiesTag,
134
+ async verify(release, plan, options) {
135
+ throwAll([
136
+ ...faultsOf(() => checkReleaseTags({ version: release.version, moving: options.moving })),
137
+ ...faultsOf(() => repositoriesOf(plan.own))
138
+ ]);
139
+ },
140
+ async smoke(release, plan, options) {
141
+ await smokeImages(imagesToPublish(plan, options), craneOf(release, options), options.platforms ?? []);
142
+ },
143
+ async publish(release, plan, options) {
144
+ const published = await publishImages({
145
+ context: craneOf(release, options),
146
+ images: imagesToPublish(plan, options),
147
+ version: release.version,
148
+ platforms: options.platforms,
149
+ dryRun: release.dryRun,
150
+ log: release.log
151
+ });
152
+ const { registry } = options;
153
+ const pages = registry === undefined || release.dryRun
154
+ ? []
155
+ : await Promise.all(published.map(({ repository }) => registryPageOf({
156
+ fetch: release.platform.fetch,
157
+ project: registry.project,
158
+ repository,
159
+ headers: registry.headers
160
+ })));
161
+ return published.map(({ repository, version }, index) => {
162
+ const page = pages[index];
163
+ return page === undefined
164
+ ? { ecosystem: 'oci', name: repository, version }
165
+ : { ecosystem: 'oci', name: repository, version, page };
166
+ });
167
+ },
168
+ async move(release, plan, options) {
169
+ const moved = await moveImages({
170
+ context: craneOf(release, options),
171
+ repositories: repositoriesOf(plan.own),
172
+ version: release.version,
173
+ moving: options.moving,
174
+ dryRun: release.dryRun,
175
+ log: release.log
176
+ });
177
+ return moved.map(({ repository }) => ({
178
+ ecosystem: 'oci',
179
+ name: repository,
180
+ version: release.version
181
+ }));
182
+ }
60
183
  };
61
184
  //# sourceMappingURL=ecosystem.js.map
@@ -1 +1 @@
1
-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EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC;YAClC,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC;YACtC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,GAAG,EAAE,OAAO,CAAC,GAAG;SACjB,CAAC,CAAA;QACF,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;YACpC,SAAS,EAAE,KAAK;YAChB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC,CAAC,CAAA;IACL,CAAC;CACF,CAAA"}
package/dist/errors.d.ts CHANGED
@@ -1,29 +1,30 @@
1
1
  /**
2
- * What the release of OCI images throws: {@link OciError}, a `ReleaseError` of
3
- * `@wtf/release-system/errors` of the codes of {@link OCI_ERRORS}, which semantic-release prints by
4
- * its mark, beside the codes of the options of a plugin, its `SYSTEM_ERRORS` (`EOPTIONS`). What is
5
- * the same of every ecosystem, as a package of two trains, is the trains' own, `TRAINS_ERRORS` of
6
- * `@wtf/release-trains/errors`.
2
+ * What the release of OCI images throws: {@link OciError}, a `ReleaseError` of `@wtf/release/errors`
3
+ * of the codes of {@link OCI_ERRORS}, beside the codes of the options of a plugin, its
4
+ * `RELEASE_ERRORS` (`EOPTIONS`). What is the same of every ecosystem, as the plan of a release, is
5
+ * its driver's own.
7
6
  *
8
7
  * @packageDocumentation
9
8
  * @module @wtf/release-oci/errors
10
9
  */
11
- import { ReleaseError } from '@wtf/release-system/errors';
10
+ import { ReleaseError } from '@wtf/release/errors';
12
11
  /** The codes of the errors of the OCI images, each with what it means. */
13
12
  export declare const OCI_ERRORS: {
14
13
  readonly EOCIECOSYSTEM: "The `ecosystems` of the config lists neither `@wtf/semantic-release-oci/ecosystem` nor `@wtf/release-oci`, so the trains read no image.";
15
14
  readonly EOCIIMAGE: "The repository of an image cannot be named: neither the option `image` nor `CI_REGISTRY_IMAGE` of the environment gives one.";
16
- readonly EOCISOURCE: "The tested image of a release cannot be named: neither the option `sourceTag` nor `CI_COMMIT_REF_SLUG` of the environment gives its tag.";
15
+ readonly EOCISOURCE: "The tested image of a release cannot be named: neither the option `sourceTag` nor `CI_COMMIT_REF_SLUG` of the environment gives its tag, or the options of the ecosystem give no `source`.";
16
+ readonly EOCIVERSION: "The version of a release, or a tag that moves with it, is no tag of an image, or a tag is given twice.";
17
17
  readonly EOCISMOKE: "The registry has not the tested image of a release, or crane cannot ask it: there is nothing to copy to the tags of the release.";
18
18
  readonly EOCIRETAG: "The registry has the full version of a release already, at another digest: a released version is never moved.";
19
19
  readonly EOCITAG: "crane cannot copy the tested image to a tag of the release.";
20
+ readonly EOCIMOVE: "The registry has not the version of a release, so the tags that move with it have nothing to point at.";
20
21
  readonly EOCILINK: "The container registry of GitLab cannot be asked the page of an image, or lists none.";
21
22
  };
22
23
  /** A code of {@link OCI_ERRORS}. */
23
24
  export type OciErrorCode = keyof typeof OCI_ERRORS;
24
25
  /**
25
26
  * An error of the OCI images, or of the options of the plugin over them: a stable `code`, of
26
- * {@link OCI_ERRORS} or of `SYSTEM_ERRORS` of `@wtf/release-system/errors`, its `message` what is
27
+ * {@link OCI_ERRORS} or of `RELEASE_ERRORS` of `@wtf/release/errors`, its `message` what is
27
28
  * wrong, and its `details` how to fix it.
28
29
  */
29
30
  export declare class OciError extends ReleaseError {
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,0EAA0E;AAC1E,eAAO,MAAM,UAAU;;;;;;;;CAab,CAAA;AAEV,oCAAoC;AACpC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,UAAU,CAAA;AAElD;;;;GAIG;AACH,qBAAa,QAAS,SAAQ,YAAY;CAAG"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,0EAA0E;AAC1E,eAAO,MAAM,UAAU;;;;;;;;;;CAiBb,CAAA;AAEV,oCAAoC;AACpC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,UAAU,CAAA;AAElD;;;;GAIG;AACH,qBAAa,QAAS,SAAQ,YAAY;CAAG"}