@simplysf/simply-gitlab-core 0.1.0 → 0.3.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/LICENSE.txt +206 -0
- package/README.md +76 -76
- package/lib/baseline-apply.d.ts +35 -0
- package/lib/baseline-apply.js +177 -0
- package/lib/baseline-apply.js.map +1 -0
- package/lib/baseline-config.d.ts +100 -0
- package/lib/baseline-config.js +342 -0
- package/lib/baseline-config.js.map +1 -0
- package/lib/baseline-export.d.ts +21 -0
- package/lib/baseline-export.js +245 -0
- package/lib/baseline-export.js.map +1 -0
- package/lib/baseline-plan.d.ts +96 -0
- package/lib/baseline-plan.js +412 -0
- package/lib/baseline-plan.js.map +1 -0
- package/lib/baseline-render.d.ts +13 -0
- package/lib/baseline-render.js +139 -0
- package/lib/baseline-render.js.map +1 -0
- package/lib/baseline-run.d.ts +49 -0
- package/lib/baseline-run.js +102 -0
- package/lib/baseline-run.js.map +1 -0
- package/lib/baseline-targets.d.ts +31 -0
- package/lib/baseline-targets.js +100 -0
- package/lib/baseline-targets.js.map +1 -0
- package/lib/gitlab-client.d.ts +32 -0
- package/lib/gitlab-client.js +96 -0
- package/lib/gitlab-client.js.map +1 -1
- package/lib/index.d.ts +7 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -1
- package/package.json +131 -130
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
Apache License Version 2.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, SimplySF.
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Apache License
|
|
7
|
+
Version 2.0, January 2004
|
|
8
|
+
http://www.apache.org/licenses/
|
|
9
|
+
|
|
10
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
11
|
+
|
|
12
|
+
1. Definitions.
|
|
13
|
+
|
|
14
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
15
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
16
|
+
|
|
17
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
18
|
+
the copyright owner that is granting the License.
|
|
19
|
+
|
|
20
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
21
|
+
other entities that control, are controlled by, or are under common
|
|
22
|
+
control with that entity. For the purposes of this definition,
|
|
23
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
24
|
+
direction or management of such entity, whether by contract or
|
|
25
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
26
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
27
|
+
|
|
28
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
29
|
+
exercising permissions granted by this License.
|
|
30
|
+
|
|
31
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
32
|
+
including but not limited to software source code, documentation
|
|
33
|
+
source, and configuration files.
|
|
34
|
+
|
|
35
|
+
"Object" form shall mean any form resulting from mechanical
|
|
36
|
+
transformation or translation of a Source form, including but
|
|
37
|
+
not limited to compiled object code, generated documentation,
|
|
38
|
+
and conversions to other media types.
|
|
39
|
+
|
|
40
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
41
|
+
Object form, made available under the License, as indicated by a
|
|
42
|
+
copyright notice that is included in or attached to the work
|
|
43
|
+
(an example is provided in the Appendix below).
|
|
44
|
+
|
|
45
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
46
|
+
form, that is based on (or derived from) the Work and for which the
|
|
47
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
48
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
49
|
+
of this License, Derivative Works shall not include works that remain
|
|
50
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
51
|
+
the Work and Derivative Works thereof.
|
|
52
|
+
|
|
53
|
+
"Contribution" shall mean any work of authorship, including
|
|
54
|
+
the original version of the Work and any modifications or additions
|
|
55
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
56
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
57
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
58
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
59
|
+
means any form of electronic, verbal, or written communication sent
|
|
60
|
+
to the Licensor or its representatives, including but not limited to
|
|
61
|
+
communication on electronic mailing lists, source code control systems,
|
|
62
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
63
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
64
|
+
excluding communication that is conspicuously marked or otherwise
|
|
65
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
66
|
+
|
|
67
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
68
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
69
|
+
subsequently incorporated within the Work.
|
|
70
|
+
|
|
71
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
72
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
73
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
74
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
75
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
76
|
+
Work and such Derivative Works in Source or Object form.
|
|
77
|
+
|
|
78
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
79
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
80
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
81
|
+
(except as stated in this section) patent license to make, have made,
|
|
82
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
83
|
+
where such license applies only to those patent claims licensable
|
|
84
|
+
by such Contributor that are necessarily infringed by their
|
|
85
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
86
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
87
|
+
institute patent litigation against any entity (including a
|
|
88
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
89
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
90
|
+
or contributory patent infringement, then any patent licenses
|
|
91
|
+
granted to You under this License for that Work shall terminate
|
|
92
|
+
as of the date such litigation is filed.
|
|
93
|
+
|
|
94
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
95
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
96
|
+
modifications, and in Source or Object form, provided that You
|
|
97
|
+
meet the following conditions:
|
|
98
|
+
|
|
99
|
+
(a) You must give any other recipients of the Work or
|
|
100
|
+
Derivative Works a copy of this License; and
|
|
101
|
+
|
|
102
|
+
(b) You must cause any modified files to carry prominent notices
|
|
103
|
+
stating that You changed the files; and
|
|
104
|
+
|
|
105
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
106
|
+
that You distribute, all copyright, patent, trademark, and
|
|
107
|
+
attribution notices from the Source form of the Work,
|
|
108
|
+
excluding those notices that do not pertain to any part of
|
|
109
|
+
the Derivative Works; and
|
|
110
|
+
|
|
111
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
112
|
+
distribution, then any Derivative Works that You distribute must
|
|
113
|
+
include a readable copy of the attribution notices contained
|
|
114
|
+
within such NOTICE file, excluding those notices that do not
|
|
115
|
+
pertain to any part of the Derivative Works, in at least one
|
|
116
|
+
of the following places: within a NOTICE text file distributed
|
|
117
|
+
as part of the Derivative Works; within the Source form or
|
|
118
|
+
documentation, if provided along with the Derivative Works; or,
|
|
119
|
+
within a display generated by the Derivative Works, if and
|
|
120
|
+
wherever such third-party notices normally appear. The contents
|
|
121
|
+
of the NOTICE file are for informational purposes only and
|
|
122
|
+
do not modify the License. You may add Your own attribution
|
|
123
|
+
notices within Derivative Works that You distribute, alongside
|
|
124
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
125
|
+
that such additional attribution notices cannot be construed
|
|
126
|
+
as modifying the License.
|
|
127
|
+
|
|
128
|
+
You may add Your own copyright statement to Your modifications and
|
|
129
|
+
may provide additional or different license terms and conditions
|
|
130
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
131
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
132
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
133
|
+
the conditions stated in this License.
|
|
134
|
+
|
|
135
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
136
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
137
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
138
|
+
this License, without any additional terms or conditions.
|
|
139
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
140
|
+
the terms of any separate license agreement you may have executed
|
|
141
|
+
with Licensor regarding such Contributions.
|
|
142
|
+
|
|
143
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
144
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
145
|
+
except as required for reasonable and customary use in describing the
|
|
146
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
147
|
+
|
|
148
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
149
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
150
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
151
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
152
|
+
implied, including, without limitation, any warranties or conditions
|
|
153
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
154
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
155
|
+
appropriateness of using or redistributing the Work and assume any
|
|
156
|
+
risks associated with Your exercise of permissions under this License.
|
|
157
|
+
|
|
158
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
159
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
160
|
+
unless required by applicable law (such as deliberate and grossly
|
|
161
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
162
|
+
liable to You for damages, including any direct, indirect, special,
|
|
163
|
+
incidental, or consequential damages of any character arising as a
|
|
164
|
+
result of this License or out of the use or inability to use the
|
|
165
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
166
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
167
|
+
other commercial damages or losses), even if such Contributor
|
|
168
|
+
has been advised of the possibility of such damages.
|
|
169
|
+
|
|
170
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
171
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
172
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
173
|
+
or other liability obligations and/or rights consistent with this
|
|
174
|
+
License. However, in accepting such obligations, You may act only
|
|
175
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
176
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
177
|
+
defend, and hold each Contributor harmless for any liability
|
|
178
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
179
|
+
of your accepting any such warranty or additional liability.
|
|
180
|
+
|
|
181
|
+
END OF TERMS AND CONDITIONS
|
|
182
|
+
|
|
183
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
184
|
+
|
|
185
|
+
To apply the Apache License to your work, attach the following
|
|
186
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
187
|
+
replaced with your own identifying information. (Don't include
|
|
188
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
189
|
+
comment syntax for the file format. We also recommend that a
|
|
190
|
+
file or class name and description of purpose be included on the
|
|
191
|
+
same "printed page" as the copyright notice for easier
|
|
192
|
+
identification within third-party archives.
|
|
193
|
+
|
|
194
|
+
Copyright {yyyy} {name of copyright owner}
|
|
195
|
+
|
|
196
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
197
|
+
you may not use this file except in compliance with the License.
|
|
198
|
+
You may obtain a copy of the License at
|
|
199
|
+
|
|
200
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
201
|
+
|
|
202
|
+
Unless required by applicable law or agreed to in writing, software
|
|
203
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
204
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
205
|
+
See the License for the specific language governing permissions and
|
|
206
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
# @simplysf/simply-gitlab-core
|
|
2
|
-
|
|
3
|
-
Configuration, authentication, the HTTP client, and the shared logic that
|
|
4
|
-
[`@simplysf/simply-gitlab`](../simply-gitlab) (the CLI) and
|
|
5
|
-
[`@simplysf/simply-gitlab-mcp`](../simply-gitlab-mcp) (the MCP server) are both built on.
|
|
6
|
-
|
|
7
|
-
Everything a command does between parsing its input and rendering its result lives here, so the CLI
|
|
8
|
-
and the MCP server cannot disagree about what a rule means. Nothing in this package touches a
|
|
9
|
-
terminal or a process: no oclif, no child processes, no `process.argv`, nothing written to stdout or
|
|
10
|
-
stderr. `process.env` is read only through an injectable `env` parameter.
|
|
11
|
-
|
|
12
|
-
You want this package directly if you are building something else against GitLab in TypeScript. If
|
|
13
|
-
you want a CLI or an MCP server, install one of those instead.
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
npm install @simplysf/simply-gitlab-core
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
```ts
|
|
22
|
-
import { GitLabClient, resolveGitLabConfig } from '@simplysf/simply-gitlab-core';
|
|
23
|
-
|
|
24
|
-
// Reads GITLAB_URL (default https://gitlab.com) and GITLAB_TOKEN, and throws a ConfigError
|
|
25
|
-
// naming what is missing.
|
|
26
|
-
const client = new GitLabClient(resolveGitLabConfig());
|
|
27
|
-
|
|
28
|
-
// A project is named by numeric id or by full path; the path is encoded for you.
|
|
29
|
-
const project = await client.getProject('group/subgroup/project');
|
|
30
|
-
|
|
31
|
-
// Lists follow pages up to your limit and tell you whether they got everything.
|
|
32
|
-
const { items, total, complete } = await client.listMergeRequests('group/project', { state: 'opened' }, 50);
|
|
33
|
-
if (!complete) console.warn(`showing ${items.length} of ${total ?? 'many'}`);
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## What is in here
|
|
37
|
-
|
|
38
|
-
**Configuration and auth** — `resolveGitLabConfig`, `buildAuthHeaders`, `loadEnvFile`.
|
|
39
|
-
|
|
40
|
-
**Transport** — `HttpTransport`, with retries on 429 and 5xx, a capped `Retry-After`, a 30s deadline
|
|
41
|
-
covering the response body, GitLab's bracketed array query parameters, a non-JSON mode for job
|
|
42
|
-
traces, and its offset-pagination headers.
|
|
43
|
-
|
|
44
|
-
**The client** — `GitLabClient`, which owns project-path encoding and page walking, and returns
|
|
45
|
-
`{ items, total?, pages, complete }` from every list.
|
|
46
|
-
|
|
47
|
-
**Errors** — `ConfigError` (exit 2), `AuthError` (3), `NetworkError` (1), `HttpError` (1), all
|
|
48
|
-
extending `CliError`.
|
|
49
|
-
|
|
50
|
-
**Safety** — `assertWritesAllowed`/`isReadOnly` for `GITLAB_READ_ONLY`; `redactSecrets` and
|
|
51
|
-
`sanitiseDeep` to keep a token out of any message or response body; `stripControl` and
|
|
52
|
-
`stripControlOneLine` for text the instance chose.
|
|
53
|
-
|
|
54
|
-
**Operations** — `assertIid`, `buildMergeRequestCreateBody`, `buildMergeRequestUpdateBody`,
|
|
55
|
-
`buildCommitBody`, `parseCommitActions`, `buildFileWrite`, `decodeFileContent`, `maskVariables`,
|
|
56
|
-
`tailLog`, `searchColumns`.
|
|
57
|
-
|
|
58
|
-
**Rendering** — `formatTable`, `formatKeyValue`, and the column sets each list command uses.
|
|
59
|
-
|
|
60
|
-
**Testing** — `@simplysf/simply-gitlab-core/testing` exports `startTestServer` and `respondJson`, a
|
|
61
|
-
tiny local HTTP server that records every request. Both other packages test against it.
|
|
62
|
-
|
|
63
|
-
## Stability
|
|
64
|
-
|
|
65
|
-
Every export from `src/index.ts` is semver-covered: adding one is a minor or patch change, removing
|
|
66
|
-
or renaming one is breaking. `test/index.test.ts` pins the list, so a removal fails a test rather
|
|
67
|
-
than shipping quietly in a patch.
|
|
68
|
-
|
|
69
|
-
## Documentation
|
|
70
|
-
|
|
71
|
-
- [GitLab client core design](../../docs/design/0001-gitlab-client-core.md)
|
|
72
|
-
- [Contributing](./CONTRIBUTING.md)
|
|
73
|
-
|
|
74
|
-
## License
|
|
75
|
-
|
|
76
|
-
Apache-2.0.
|
|
1
|
+
# @simplysf/simply-gitlab-core
|
|
2
|
+
|
|
3
|
+
Configuration, authentication, the HTTP client, and the shared logic that
|
|
4
|
+
[`@simplysf/simply-gitlab`](../simply-gitlab) (the CLI) and
|
|
5
|
+
[`@simplysf/simply-gitlab-mcp`](../simply-gitlab-mcp) (the MCP server) are both built on.
|
|
6
|
+
|
|
7
|
+
Everything a command does between parsing its input and rendering its result lives here, so the CLI
|
|
8
|
+
and the MCP server cannot disagree about what a rule means. Nothing in this package touches a
|
|
9
|
+
terminal or a process: no oclif, no child processes, no `process.argv`, nothing written to stdout or
|
|
10
|
+
stderr. `process.env` is read only through an injectable `env` parameter.
|
|
11
|
+
|
|
12
|
+
You want this package directly if you are building something else against GitLab in TypeScript. If
|
|
13
|
+
you want a CLI or an MCP server, install one of those instead.
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npm install @simplysf/simply-gitlab-core
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { GitLabClient, resolveGitLabConfig } from '@simplysf/simply-gitlab-core';
|
|
23
|
+
|
|
24
|
+
// Reads GITLAB_URL (default https://gitlab.com) and GITLAB_TOKEN, and throws a ConfigError
|
|
25
|
+
// naming what is missing.
|
|
26
|
+
const client = new GitLabClient(resolveGitLabConfig());
|
|
27
|
+
|
|
28
|
+
// A project is named by numeric id or by full path; the path is encoded for you.
|
|
29
|
+
const project = await client.getProject('group/subgroup/project');
|
|
30
|
+
|
|
31
|
+
// Lists follow pages up to your limit and tell you whether they got everything.
|
|
32
|
+
const { items, total, complete } = await client.listMergeRequests('group/project', { state: 'opened' }, 50);
|
|
33
|
+
if (!complete) console.warn(`showing ${items.length} of ${total ?? 'many'}`);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## What is in here
|
|
37
|
+
|
|
38
|
+
**Configuration and auth** — `resolveGitLabConfig`, `buildAuthHeaders`, `loadEnvFile`.
|
|
39
|
+
|
|
40
|
+
**Transport** — `HttpTransport`, with retries on 429 and 5xx, a capped `Retry-After`, a 30s deadline
|
|
41
|
+
covering the response body, GitLab's bracketed array query parameters, a non-JSON mode for job
|
|
42
|
+
traces, and its offset-pagination headers.
|
|
43
|
+
|
|
44
|
+
**The client** — `GitLabClient`, which owns project-path encoding and page walking, and returns
|
|
45
|
+
`{ items, total?, pages, complete }` from every list.
|
|
46
|
+
|
|
47
|
+
**Errors** — `ConfigError` (exit 2), `AuthError` (3), `NetworkError` (1), `HttpError` (1), all
|
|
48
|
+
extending `CliError`.
|
|
49
|
+
|
|
50
|
+
**Safety** — `assertWritesAllowed`/`isReadOnly` for `GITLAB_READ_ONLY`; `redactSecrets` and
|
|
51
|
+
`sanitiseDeep` to keep a token out of any message or response body; `stripControl` and
|
|
52
|
+
`stripControlOneLine` for text the instance chose.
|
|
53
|
+
|
|
54
|
+
**Operations** — `assertIid`, `buildMergeRequestCreateBody`, `buildMergeRequestUpdateBody`,
|
|
55
|
+
`buildCommitBody`, `parseCommitActions`, `buildFileWrite`, `decodeFileContent`, `maskVariables`,
|
|
56
|
+
`tailLog`, `searchColumns`.
|
|
57
|
+
|
|
58
|
+
**Rendering** — `formatTable`, `formatKeyValue`, and the column sets each list command uses.
|
|
59
|
+
|
|
60
|
+
**Testing** — `@simplysf/simply-gitlab-core/testing` exports `startTestServer` and `respondJson`, a
|
|
61
|
+
tiny local HTTP server that records every request. Both other packages test against it.
|
|
62
|
+
|
|
63
|
+
## Stability
|
|
64
|
+
|
|
65
|
+
Every export from `src/index.ts` is semver-covered: adding one is a minor or patch change, removing
|
|
66
|
+
or renaming one is breaking. `test/index.test.ts` pins the list, so a removal fails a test rather
|
|
67
|
+
than shipping quietly in a patch.
|
|
68
|
+
|
|
69
|
+
## Documentation
|
|
70
|
+
|
|
71
|
+
- [GitLab client core design](../../docs/design/0001-gitlab-client-core.md)
|
|
72
|
+
- [Contributing](./CONTRIBUTING.md)
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
Apache-2.0.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { BaselinePlan, TargetPlan } from './baseline-plan.js';
|
|
2
|
+
import { type RunOptions } from './baseline-run.js';
|
|
3
|
+
import type { GitLabClient } from './gitlab-client.js';
|
|
4
|
+
/** What executing one target's plan amounted to. */
|
|
5
|
+
export interface TargetResult {
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly kind: 'project' | 'group';
|
|
8
|
+
readonly applied: number;
|
|
9
|
+
/** Set when execution stopped part-way; the actions before it are already applied. */
|
|
10
|
+
readonly error?: string;
|
|
11
|
+
/** The section that failed, so a partial application can be described precisely. */
|
|
12
|
+
readonly failedSection?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ApplyResult {
|
|
15
|
+
readonly targets: readonly TargetResult[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Executes one target's plan, in the order the sections were planned.
|
|
19
|
+
*
|
|
20
|
+
* There is no transaction across GitLab endpoints and this does not pretend otherwise: a failure
|
|
21
|
+
* part-way leaves the earlier sections applied, and the result says which section stopped it so a
|
|
22
|
+
* following `plan` can be read against that.
|
|
23
|
+
*/
|
|
24
|
+
export declare function applyTarget(client: GitLabClient, target: TargetPlan): Promise<TargetResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Executes a whole plan.
|
|
27
|
+
*
|
|
28
|
+
* One target failing does not abandon the other forty-nine — that is the default, because a run
|
|
29
|
+
* that stopped at the twelfth project would leave the operator worse off than one that reported
|
|
30
|
+
* twelve successes and one failure. `--fail-fast` is there for the systematic problem where the
|
|
31
|
+
* rest are pointless.
|
|
32
|
+
*/
|
|
33
|
+
export declare function applyPlan(client: GitLabClient, plan: BaselinePlan, options?: RunOptions): Promise<ApplyResult>;
|
|
34
|
+
/** How many targets an apply failed on, for the exit code. */
|
|
35
|
+
export declare function applyFailures(result: ApplyResult): readonly TargetResult[];
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { mapPool, DEFAULT_CONCURRENCY } from './baseline-run.js';
|
|
17
|
+
import { ConfigError } from './errors.js';
|
|
18
|
+
function asRecord(value) {
|
|
19
|
+
return (typeof value === 'object' && value !== null ? value : {});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Resolves the name-based references an approval rule carries into the ids the API demands.
|
|
23
|
+
*
|
|
24
|
+
* This has to happen here rather than at plan time. A rule scoped to `main` needs that branch's
|
|
25
|
+
* protection id, and the protected-branches section that creates it runs moments earlier in this
|
|
26
|
+
* same apply — so at plan time the id does not exist yet.
|
|
27
|
+
*/
|
|
28
|
+
async function resolveRuleReferences(client, ref, body, branches, groups) {
|
|
29
|
+
const resolved = { ...body };
|
|
30
|
+
if (branches !== undefined && branches.length > 0) {
|
|
31
|
+
const protectedBranches = (await client.listProtectedBranches(ref)).items.map(asRecord);
|
|
32
|
+
const byName = new Map(protectedBranches.map((branch) => [String(branch.name), branch.id]));
|
|
33
|
+
const ids = [];
|
|
34
|
+
for (const name of branches) {
|
|
35
|
+
const id = byName.get(name);
|
|
36
|
+
if (typeof id !== 'number') {
|
|
37
|
+
throw new ConfigError(`Approval rule references protected branch "${name}", which is not protected on this project. ` +
|
|
38
|
+
'Declare it under protectedBranches so it exists before the rule is written.');
|
|
39
|
+
}
|
|
40
|
+
ids.push(id);
|
|
41
|
+
}
|
|
42
|
+
resolved.protected_branch_ids = ids;
|
|
43
|
+
}
|
|
44
|
+
if (groups !== undefined && groups.length > 0) {
|
|
45
|
+
const ids = [];
|
|
46
|
+
/* Each group is one lookup; there are rarely more than a couple on a rule. */
|
|
47
|
+
/* eslint-disable no-await-in-loop */
|
|
48
|
+
for (const path of groups) {
|
|
49
|
+
const group = asRecord(await client.getGroup(path));
|
|
50
|
+
if (typeof group.id !== 'number') {
|
|
51
|
+
throw new ConfigError(`Approval rule references group "${path}", which could not be resolved to an id.`);
|
|
52
|
+
}
|
|
53
|
+
ids.push(group.id);
|
|
54
|
+
}
|
|
55
|
+
/* eslint-enable no-await-in-loop */
|
|
56
|
+
resolved.group_ids = ids;
|
|
57
|
+
}
|
|
58
|
+
return resolved;
|
|
59
|
+
}
|
|
60
|
+
/** Executes one action. Split out so the switch stays exhaustive as actions are added. */
|
|
61
|
+
async function execute(client, target, action) {
|
|
62
|
+
const ref = target.path;
|
|
63
|
+
switch (action.kind) {
|
|
64
|
+
case 'updateProject':
|
|
65
|
+
await client.updateProject(ref, action.body);
|
|
66
|
+
return;
|
|
67
|
+
case 'updateGroup':
|
|
68
|
+
await client.updateGroup(ref, action.body);
|
|
69
|
+
return;
|
|
70
|
+
case 'protectBranch':
|
|
71
|
+
await client.protectBranch(ref, action.body);
|
|
72
|
+
return;
|
|
73
|
+
case 'patchProtectedBranch':
|
|
74
|
+
await client.patchProtectedBranch(ref, action.name, action.body);
|
|
75
|
+
return;
|
|
76
|
+
case 'unprotectBranch':
|
|
77
|
+
await client.unprotectBranch(ref, action.name);
|
|
78
|
+
return;
|
|
79
|
+
case 'protectTag':
|
|
80
|
+
await client.protectTag(ref, action.body);
|
|
81
|
+
return;
|
|
82
|
+
case 'unprotectTag':
|
|
83
|
+
await client.unprotectTag(ref, action.name);
|
|
84
|
+
return;
|
|
85
|
+
case 'updateApprovalSettings':
|
|
86
|
+
await client.updateApprovalSettings(ref, action.body);
|
|
87
|
+
return;
|
|
88
|
+
case 'createApprovalRule': {
|
|
89
|
+
const groups = Array.isArray(action.body.groups) ? action.body.groups : undefined;
|
|
90
|
+
const body = await resolveRuleReferences(client, ref, action.body, action.branches, groups);
|
|
91
|
+
await client.createApprovalRule(ref, body);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
case 'updateApprovalRule': {
|
|
95
|
+
const groups = Array.isArray(action.body.groups) ? action.body.groups : undefined;
|
|
96
|
+
const body = await resolveRuleReferences(client, ref, action.body, action.branches, groups);
|
|
97
|
+
await client.updateApprovalRule(ref, action.ruleId, body);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
case 'deleteApprovalRule':
|
|
101
|
+
await client.deleteApprovalRule(ref, action.ruleId);
|
|
102
|
+
return;
|
|
103
|
+
case 'setPushRules':
|
|
104
|
+
// POST creates the rule set, PUT edits it. Which one applies was decided at plan time from
|
|
105
|
+
// whether the project already had push rules.
|
|
106
|
+
if (action.exists)
|
|
107
|
+
await client.updatePushRules(ref, action.body);
|
|
108
|
+
else
|
|
109
|
+
await client.createPushRules(ref, action.body);
|
|
110
|
+
return;
|
|
111
|
+
default: {
|
|
112
|
+
const exhaustive = action;
|
|
113
|
+
throw new ConfigError(`Unknown action ${JSON.stringify(exhaustive)}`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Executes one target's plan, in the order the sections were planned.
|
|
119
|
+
*
|
|
120
|
+
* There is no transaction across GitLab endpoints and this does not pretend otherwise: a failure
|
|
121
|
+
* part-way leaves the earlier sections applied, and the result says which section stopped it so a
|
|
122
|
+
* following `plan` can be read against that.
|
|
123
|
+
*/
|
|
124
|
+
export async function applyTarget(client, target) {
|
|
125
|
+
let applied = 0;
|
|
126
|
+
for (const section of target.sections) {
|
|
127
|
+
for (const action of section.actions) {
|
|
128
|
+
try {
|
|
129
|
+
// eslint-disable-next-line no-await-in-loop -- order across sections is the contract
|
|
130
|
+
await execute(client, target, action);
|
|
131
|
+
applied += 1;
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
return {
|
|
135
|
+
path: target.path,
|
|
136
|
+
kind: target.kind,
|
|
137
|
+
applied,
|
|
138
|
+
failedSection: section.section,
|
|
139
|
+
error: error instanceof Error ? error.message : String(error),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return { path: target.path, kind: target.kind, applied };
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Executes a whole plan.
|
|
148
|
+
*
|
|
149
|
+
* One target failing does not abandon the other forty-nine — that is the default, because a run
|
|
150
|
+
* that stopped at the twelfth project would leave the operator worse off than one that reported
|
|
151
|
+
* twelve successes and one failure. `--fail-fast` is there for the systematic problem where the
|
|
152
|
+
* rest are pointless.
|
|
153
|
+
*/
|
|
154
|
+
export async function applyPlan(client, plan, options = {}) {
|
|
155
|
+
const concurrency = options.concurrency ?? DEFAULT_CONCURRENCY;
|
|
156
|
+
// A target that failed to plan is not applied: acting on a half-read project is how a baseline
|
|
157
|
+
// makes things worse than it found them.
|
|
158
|
+
const runnable = plan.targets.filter((target) => target.error === undefined);
|
|
159
|
+
const unplanned = plan.targets
|
|
160
|
+
.filter((target) => target.error !== undefined)
|
|
161
|
+
.map((target) => ({ path: target.path, kind: target.kind, applied: 0, error: target.error }));
|
|
162
|
+
const groups = runnable.filter((target) => target.kind === 'group');
|
|
163
|
+
const projects = runnable.filter((target) => target.kind === 'project');
|
|
164
|
+
const stopAfter = options.failFast === true ? (result) => result.error !== undefined : undefined;
|
|
165
|
+
// Groups first: a group setting that projects inherit should be in place before the projects are
|
|
166
|
+
// reconciled against it.
|
|
167
|
+
const groupResults = await mapPool(groups, concurrency, (target) => applyTarget(client, target), stopAfter);
|
|
168
|
+
const projectResults = options.failFast === true && groupResults.some((result) => result.error !== undefined)
|
|
169
|
+
? []
|
|
170
|
+
: await mapPool(projects, concurrency, (target) => applyTarget(client, target), stopAfter);
|
|
171
|
+
return { targets: [...unplanned, ...groupResults, ...projectResults] };
|
|
172
|
+
}
|
|
173
|
+
/** How many targets an apply failed on, for the exit code. */
|
|
174
|
+
export function applyFailures(result) {
|
|
175
|
+
return result.targets.filter((target) => target.error !== undefined);
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=baseline-apply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseline-apply.js","sourceRoot":"","sources":["../src/baseline-apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,OAAO,EAAmB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkB1C,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAA4B,CAAC;AAC/F,CAAC;AAED;;;;;;GAMG;AACH,KAAK,UAAU,qBAAqB,CAClC,MAAoB,EACpB,GAAe,EACf,IAA6B,EAC7B,QAAuC,EACvC,MAAqC;IAErC,MAAM,QAAQ,GAA4B,EAAE,GAAG,IAAI,EAAE,CAAC;IAEtD,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClD,MAAM,iBAAiB,GAAG,CAAC,MAAM,MAAM,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACxF,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,iBAAiB,CAAC,GAAG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