@effected/github 0.4.0 → 0.4.2
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/GitHubIssue.js +32 -4
- package/index.d.ts +21 -0
- package/package.json +1 -1
package/GitHubIssue.js
CHANGED
|
@@ -107,6 +107,30 @@ var GitHubIssue = class GitHubIssue extends Context.Service()("@effected/github/
|
|
|
107
107
|
const unstubbed = (member) => {
|
|
108
108
|
throw new Error(`GitHubIssue.makeTest: ${member}() was called but not stubbed — pass an override.`);
|
|
109
109
|
};
|
|
110
|
+
/**
|
|
111
|
+
* The REST calendar version this module's requests pin.
|
|
112
|
+
*
|
|
113
|
+
* @remarks
|
|
114
|
+
* The routes are not deprecated — the **default api-version** is. When no
|
|
115
|
+
* `x-github-api-version` header is sent (octokit sends none), GitHub serves
|
|
116
|
+
* calendar version 2022-11-28, which it deprecated when 2026-03-10 shipped and
|
|
117
|
+
* sunsets on 2028-03-10. Every response from an endpoint the new version
|
|
118
|
+
* changed then carries a `Deprecation` header, which `@octokit/request` prints
|
|
119
|
+
* straight to the consumer's console — the constructor's `log` option cannot
|
|
120
|
+
* silence it, because the fetch wrapper resolves `request.log ?? console`.
|
|
121
|
+
* `PATCH /repos/{owner}/{repo}/issues/{issue_number}` is on that list (the
|
|
122
|
+
* singular `assignee` parameter was removed), so every `close` warned once per
|
|
123
|
+
* issue in consumer workflow logs (effected#189).
|
|
124
|
+
*
|
|
125
|
+
* Nothing this module sends or reads changed in 2026-03-10: `state` and
|
|
126
|
+
* `state_reason` are untouched, and the projections read only fields both
|
|
127
|
+
* versions carry. Pinning the current version is therefore the whole fix, and
|
|
128
|
+
* it deliberately does **not** hide future deprecations — when GitHub
|
|
129
|
+
* deprecates 2026-03-10 in turn, the header comes back and octokit warns
|
|
130
|
+
* again. Verified live 2026-08-14: the pinned request answers with no
|
|
131
|
+
* `Deprecation`/`Sunset` headers.
|
|
132
|
+
*/
|
|
133
|
+
const API_VERSION_HEADERS = { "x-github-api-version": "2026-03-10" };
|
|
110
134
|
/** GitHub sends a label as either a string or an object; callers want the name. */
|
|
111
135
|
const labelNames = (labels) => labels.flatMap((label) => typeof label === "string" ? [label] : label.name !== void 0 ? [label.name] : []);
|
|
112
136
|
const project = (raw) => IssueInfo.make({
|
|
@@ -128,7 +152,8 @@ const make = (client) => ({
|
|
|
128
152
|
const raw = yield* client.request("GET /repos/{owner}/{repo}/issues/{issue_number}", {
|
|
129
153
|
owner,
|
|
130
154
|
repo,
|
|
131
|
-
issue_number: number
|
|
155
|
+
issue_number: number,
|
|
156
|
+
headers: API_VERSION_HEADERS
|
|
132
157
|
});
|
|
133
158
|
return project(raw);
|
|
134
159
|
}),
|
|
@@ -142,7 +167,8 @@ const make = (client) => ({
|
|
|
142
167
|
owner,
|
|
143
168
|
repo,
|
|
144
169
|
...options?.state !== void 0 ? { state: options.state } : {},
|
|
145
|
-
...options?.labels !== void 0 ? { labels: options.labels.join(",") } : {}
|
|
170
|
+
...options?.labels !== void 0 ? { labels: options.labels.join(",") } : {},
|
|
171
|
+
headers: API_VERSION_HEADERS
|
|
146
172
|
}, options?.page)).map(project);
|
|
147
173
|
}),
|
|
148
174
|
close: Effect.fn("GitHubIssue.close")(function* (number, reason) {
|
|
@@ -157,7 +183,8 @@ const make = (client) => ({
|
|
|
157
183
|
repo,
|
|
158
184
|
issue_number: number,
|
|
159
185
|
state: "closed",
|
|
160
|
-
...reason !== void 0 ? { state_reason: reason } : {}
|
|
186
|
+
...reason !== void 0 ? { state_reason: reason } : {},
|
|
187
|
+
headers: API_VERSION_HEADERS
|
|
161
188
|
});
|
|
162
189
|
}),
|
|
163
190
|
comment: Effect.fn("GitHubIssue.comment")(function* (number, body) {
|
|
@@ -171,7 +198,8 @@ const make = (client) => ({
|
|
|
171
198
|
owner,
|
|
172
199
|
repo,
|
|
173
200
|
issue_number: number,
|
|
174
|
-
body
|
|
201
|
+
body,
|
|
202
|
+
headers: API_VERSION_HEADERS
|
|
175
203
|
})).id;
|
|
176
204
|
}),
|
|
177
205
|
linkedIssues: Effect.fn("GitHubIssue.linkedIssues")(function* (prNumber) {
|
package/index.d.ts
CHANGED
|
@@ -1165,6 +1165,15 @@ interface CodeScanningShape {
|
|
|
1165
1165
|
* The endpoint answers **202 Accepted** and configures asynchronously.
|
|
1166
1166
|
* Nothing here polls: a successful call means GitHub accepted the request,
|
|
1167
1167
|
* not that scanning is running.
|
|
1168
|
+
*
|
|
1169
|
+
* **Turning it back off does not undo everything it did.** Setting `state`
|
|
1170
|
+
* to `not-configured` stops default setup, but the synthetic CodeQL workflow
|
|
1171
|
+
* GitHub created when it was enabled **survives** — it remains listed among
|
|
1172
|
+
* the repository's workflows afterwards. A caller that treats "default setup
|
|
1173
|
+
* is off" as "no CodeQL workflow exists" will be wrong, and one that counts
|
|
1174
|
+
* workflows to decide whether a repository has any CI will count that one.
|
|
1175
|
+
* Reported by `@spencerbeggs/reposets` (dogfood round 8, 2026-08-14) from a
|
|
1176
|
+
* real organization, not inferred from the API description.
|
|
1168
1177
|
*/
|
|
1169
1178
|
readonly configure: (setup: CodeScanningSetup) => Effect.Effect<void, GitHubError, Repo>;
|
|
1170
1179
|
/**
|
|
@@ -2827,6 +2836,18 @@ interface RepositoryVariableShape {
|
|
|
2827
2836
|
* `notFound` is absorbed — a 403 from a mis-scoped token still fails, where
|
|
2828
2837
|
* treating any error as absence would turn a permissions problem into a
|
|
2829
2838
|
* spurious create.
|
|
2839
|
+
*
|
|
2840
|
+
* **The 404-for-absent behaviour is documented, not probed.** Neither this
|
|
2841
|
+
* suite nor the first consumer's has issued this read against real GitHub —
|
|
2842
|
+
* both run against doubles.
|
|
2843
|
+
*
|
|
2844
|
+
* Only `notFound` selects the create branch: a successful read selects the
|
|
2845
|
+
* update branch, and any other failure propagates rather than being guessed
|
|
2846
|
+
* at. So if GitHub answers something *other* than 404 for an absent
|
|
2847
|
+
* variable, the write does not silently take the wrong branch — it either
|
|
2848
|
+
* `PATCH`es a variable that is not there, or fails with the error GitHub
|
|
2849
|
+
* actually sent. Read either as evidence about this assumption rather than
|
|
2850
|
+
* about the caller.
|
|
2830
2851
|
*/
|
|
2831
2852
|
readonly set: (name: string, value: string) => Effect.Effect<void, GitHubError, Repo>;
|
|
2832
2853
|
/** The repository's variables, with their values. */
|
package/package.json
CHANGED