Open History to see the last commit
1import * as Schema from "effect/Schema";
2import * as Effect from "effect/Effect";
3import * as HttpServerRespondable from "effect/http/HttpServerRespondable";
4import * as HttpServerResponse from "effect/http/HttpServerResponse";
5
6import {
7 GitRefName,
8 ForwardCompatibleArray,
9 IsoDateTime,
10 NonNegativeInt,
11 PositiveInt,
12 ProjectId,
13 ThreadId,
14 TrimmedNonEmptyString,
15} from "./baseSchemas.ts";
16import { SourceControlProviderKind } from "./sourceControl.ts";
17
18export const PullRequestInvolvement = Schema.Literals(["all", "reviewing", "authored"]);
19export type PullRequestInvolvement = typeof PullRequestInvolvement.Type;
20
21export const PullRequestState = Schema.Literals(["open", "closed", "merged"]);
22export type PullRequestState = typeof PullRequestState.Type;
23
24export const PullRequestListState = Schema.Literals(["all", "open", "closed", "merged"]);
25export type PullRequestListState = typeof PullRequestListState.Type;
26
27export const PullRequestReviewDecision = Schema.Literals([
28 "approved",
29 "changes-requested",
30 "review-required",
31]);
32export type PullRequestReviewDecision = typeof PullRequestReviewDecision.Type;
33
34const PullRequestQualifierValue = TrimmedNonEmptyString.check(Schema.isMaxLength(200));
35const PullRequestQualifierValues = Schema.Array(PullRequestQualifierValue).check(
36 Schema.isMaxLength(10),
37);
38
39export const PullRequestListFilters = Schema.Struct({
40 draft: Schema.optional(Schema.Literals(["only", "hide"])),
41 review: Schema.optional(
42 Schema.Literals(["approved", "changes-requested", "review-required", "none"]),
43 ),
44 checks: Schema.optional(Schema.Literals(["passing", "failing"])),
45 /** GitHub label qualifiers: every group must match; any name within a group suffices. */
46 labels: Schema.optional(Schema.Array(PullRequestQualifierValues).check(Schema.isMaxLength(10))),
47 excludedLabels: Schema.optional(PullRequestQualifierValues),
48 author: Schema.optional(PullRequestQualifierValue),
49});
50export type PullRequestListFilters = typeof PullRequestListFilters.Type;
51
52export const PullRequestChecksState = Schema.Literals(["passing", "failing", "pending"]);
53export type PullRequestChecksState = typeof PullRequestChecksState.Type;
54
55export const PullRequestMergeability = Schema.Literals(["mergeable", "conflicting", "unknown"]);
56export type PullRequestMergeability = typeof PullRequestMergeability.Type;
57
58/** `fast-forward` refuses unless the head contains the base, where `rebase` rewrites the branch onto it. */
59export const PullRequestMergeMethod = Schema.Literals([
60 "merge",
61 "squash",
62 "rebase",
63 "fast-forward",
64]);
65export type PullRequestMergeMethod = typeof PullRequestMergeMethod.Type;
66
67export const PullRequestAction = Schema.Literals([
68 "merge",
69 "ready",
70 "draft",
71 "close",
72 "reopen",
73 "delete-branch",
74 "update-branch",
75 "enable-auto-merge",
76 "disable-auto-merge",
77 "revert",
78 "approve-workflows",
79]);
80export type PullRequestAction = typeof PullRequestAction.Type;
81
82export const PullRequestUpdateMethod = Schema.Literals(["merge", "rebase"]);
83export type PullRequestUpdateMethod = typeof PullRequestUpdateMethod.Type;
84
85export const PullRequestBaseComparison = Schema.Literals(["up-to-date", "behind", "unknown"]);
86export type PullRequestBaseComparison = typeof PullRequestBaseComparison.Type;
87
88export const PullRequestActor = Schema.Struct({
89 isBot: Schema.optional(Schema.Boolean),
90 login: TrimmedNonEmptyString,
91 name: Schema.NullOr(Schema.String),
92 avatarUrl: Schema.NullOr(Schema.String),
93});
94export type PullRequestActor = typeof PullRequestActor.Type;
95
96export const PullRequestLabel = Schema.Struct({
97 name: TrimmedNonEmptyString,
98 color: Schema.NullOr(Schema.String),
99 description: Schema.optional(Schema.NullOr(Schema.String)),
100});
101export type PullRequestLabel = typeof PullRequestLabel.Type;
102
103export const PullRequestCheckStatus = Schema.Literals([
104 "pending",
105 "action-required",
106 "success",
107 "failure",
108 "skipped",
109 "neutral",
110 "cancelled",
111]);
112export type PullRequestCheckStatus = typeof PullRequestCheckStatus.Type;
113
114export const PullRequestCheck = Schema.Struct({
115 name: TrimmedNonEmptyString,
116 status: PullRequestCheckStatus,
117 description: Schema.NullOr(Schema.String),
118 url: Schema.NullOr(Schema.String),
119 required: Schema.optional(Schema.Boolean),
120 /**
121 * Not a check: it stands for ones the host could not list, such as workflow runs awaiting
122 * approval when that read fails, so nothing waits on it or counts it as passing.
123 */
124 placeholder: Schema.optional(Schema.Boolean),
125});
126export type PullRequestCheck = typeof PullRequestCheck.Type;
127
128export const PullRequestReactionContent = Schema.Literals([
129 "thumbs-up",
130 "thumbs-down",
131 "laugh",
132 "hooray",
133 "confused",
134 "heart",
135 "rocket",
136 "eyes",
137]);
138export type PullRequestReactionContent = typeof PullRequestReactionContent.Type;
139
140export const PullRequestReaction = Schema.Struct({
141 content: PullRequestReactionContent,
142 count: PositiveInt,
143 /** Excludes the viewer's login when viewerHasReacted; count still includes them. */
144 actors: Schema.Array(TrimmedNonEmptyString),
145 viewerHasReacted: Schema.Boolean,
146});
147export type PullRequestReaction = typeof PullRequestReaction.Type;
148
149export const PullRequestCommentKind = Schema.Literals([
150 "issue-comment",
151 "review-comment",
152 "review",
153]);
154export type PullRequestCommentKind = typeof PullRequestCommentKind.Type;
155
156export const PullRequestComment = Schema.Struct({
157 id: TrimmedNonEmptyString,
158 kind: PullRequestCommentKind,
159 author: Schema.NullOr(PullRequestActor),
160 body: Schema.String,
161 createdAt: IsoDateTime,
162 editedAt: Schema.optional(Schema.NullOr(IsoDateTime)),
163 url: Schema.NullOr(Schema.String),
164 path: Schema.NullOr(Schema.String),
165 reviewState: Schema.NullOr(Schema.String),
166 reactions: Schema.optional(Schema.Array(PullRequestReaction)),
167 canEdit: Schema.optional(Schema.Boolean),
168});
169export type PullRequestComment = typeof PullRequestComment.Type;
170
171export const PullRequestDiffSide = Schema.Literals(["left", "right"]);
172export type PullRequestDiffSide = typeof PullRequestDiffSide.Type;
173
174export const PullRequestReviewVerdict = Schema.Literals(["comment", "approve", "request-changes"]);
175export type PullRequestReviewVerdict = typeof PullRequestReviewVerdict.Type;
176
177export const PullRequestThreadComment = Schema.Struct({
178 id: TrimmedNonEmptyString,
179 author: Schema.NullOr(PullRequestActor),
180 body: Schema.String,
181 createdAt: IsoDateTime,
182 editedAt: Schema.optional(Schema.NullOr(IsoDateTime)),
183 url: Schema.NullOr(Schema.String),
184 /** The review that posted the comment, so a link to a review with no text finds its comments. */
185 reviewUrl: Schema.optional(Schema.NullOr(Schema.String)),
186 reactions: Schema.optional(Schema.Array(PullRequestReaction)),
187 canEdit: Schema.optional(Schema.Boolean),
188});
189export type PullRequestThreadComment = typeof PullRequestThreadComment.Type;
190
191export const PullRequestReviewThread = Schema.Struct({
192 id: TrimmedNonEmptyString,
193 path: TrimmedNonEmptyString,
194 line: Schema.NullOr(PositiveInt),
195 side: PullRequestDiffSide,
196 isResolved: Schema.Boolean,
197 isOutdated: Schema.Boolean,
198 comments: Schema.Array(PullRequestThreadComment),
199 commentCount: Schema.optional(NonNegativeInt),
200 nextCommentsCursor: Schema.optional(TrimmedNonEmptyString),
201 /** Can only narrow repository-wide resolve permission. Absent when unreported. */
202 canResolve: Schema.optional(Schema.Boolean),
203});
204export type PullRequestReviewThread = typeof PullRequestReviewThread.Type;
205
206/** A thread on the change request as a whole, such as a GitLab overview thread. */
207export const PullRequestOverviewThread = Schema.Struct({
208 ...PullRequestReviewThread.fields,
209 path: Schema.Null,
210 line: Schema.Null,
211});
212export type PullRequestOverviewThread = typeof PullRequestOverviewThread.Type;
213
214export type PullRequestConversationThread = PullRequestReviewThread | PullRequestOverviewThread;
215
216export const PullRequestReviewerKind = Schema.Literals(["user", "team"]);
217export type PullRequestReviewerKind = typeof PullRequestReviewerKind.Type;
218
219export const PullRequestReviewerCandidate = Schema.Struct({
220 ...PullRequestActor.fields,
221 id: TrimmedNonEmptyString,
222 kind: PullRequestReviewerKind,
223 isRequested: Schema.Boolean,
224});
225export type PullRequestReviewerCandidate = typeof PullRequestReviewerCandidate.Type;
226
227export const PullRequestReviewerCandidateList = Schema.Struct({
228 candidates: Schema.Array(PullRequestReviewerCandidate),
229 truncated: Schema.Boolean,
230});
231export type PullRequestReviewerCandidateList = typeof PullRequestReviewerCandidateList.Type;
232
233export const PullRequestLabelCandidate = Schema.Struct({
234 ...PullRequestLabel.fields,
235 description: Schema.NullOr(Schema.String),
236 isApplied: Schema.Boolean,
237});
238export type PullRequestLabelCandidate = typeof PullRequestLabelCandidate.Type;
239
240export const PullRequestLabelCandidateList = Schema.Struct({
241 candidates: Schema.Array(PullRequestLabelCandidate),
242 truncated: Schema.Boolean,
243});
244export type PullRequestLabelCandidateList = typeof PullRequestLabelCandidateList.Type;
245
246export const PullRequestCommit = Schema.Struct({
247 oid: TrimmedNonEmptyString,
248 messageHeadline: Schema.String,
249 committedDate: IsoDateTime,
250 additions: Schema.optional(NonNegativeInt),
251 deletions: Schema.optional(NonNegativeInt),
252 changedFiles: Schema.optional(NonNegativeInt),
253 authors: Schema.optional(Schema.Array(PullRequestActor)),
254});
255export type PullRequestCommit = typeof PullRequestCommit.Type;
256
257export const PullRequestReviewCapabilities = Schema.Struct({
258 inlineComment: Schema.Boolean,
259 /**
260 * An inline comment can cover a range of lines rather than its last one. Absent, as from a
261 * server that predates it, means one line.
262 */
263 rangeComment: Schema.optional(Schema.Boolean),
264 reply: Schema.Boolean,
265 resolve: Schema.Boolean,
266 verdicts: ForwardCompatibleArray(PullRequestReviewVerdict),
267});
268export type PullRequestReviewCapabilities = typeof PullRequestReviewCapabilities.Type;
269
270export const PullRequestEditCapabilities = Schema.Struct({
271 changeRequest: Schema.Boolean,
272 comment: Schema.Boolean,
273 maintainerEdits: Schema.optional(Schema.Boolean),
274});
275export type PullRequestEditCapabilities = typeof PullRequestEditCapabilities.Type;
276
277export const PullRequestReviewerCapabilities = Schema.Struct({
278 request: Schema.Boolean,
279 listCandidates: Schema.Boolean,
280 /**
281 * Reviewer candidates take a `query` the host matches past the first page. Absent, as from a
282 * server that predates it, means the client narrows the loaded page itself.
283 */
284 searchCandidates: Schema.optional(Schema.Boolean),
285});
286export type PullRequestReviewerCapabilities = typeof PullRequestReviewerCapabilities.Type;
287
288export const PullRequestViewedFilesStore = Schema.Literals(["host", "environment"]);
289export type PullRequestViewedFilesStore = typeof PullRequestViewedFilesStore.Type;
290
291/** `#` references issues (and GitHub pull requests); `!` references GitLab merge requests. */
292export const PullRequestReferenceSigil = Schema.Literals(["#", "!"]);
293export type PullRequestReferenceSigil = typeof PullRequestReferenceSigil.Type;
294
295export const PullRequestCapabilities = Schema.Struct({
296 diff: Schema.Boolean,
297 comment: Schema.Boolean,
298 actions: ForwardCompatibleArray(PullRequestAction),
299 mergeMethods: ForwardCompatibleArray(PullRequestMergeMethod),
300 deleteBranch: Schema.optional(Schema.Boolean),
301 /**
302 * Absent where it cannot at all, which is every host that has not said otherwise — so a
303 * provider that says nothing offers nothing.
304 */
305 updateMethods: Schema.optional(ForwardCompatibleArray(PullRequestUpdateMethod)),
306 search: Schema.Boolean,
307 reactions: Schema.optional(Schema.Boolean),
308 viewedFiles: Schema.optional(PullRequestViewedFilesStore),
309 review: PullRequestReviewCapabilities,
310 reviewers: PullRequestReviewerCapabilities,
311 edit: Schema.optional(PullRequestEditCapabilities),
312 stacks: Schema.optional(Schema.Boolean),
313 stackActions: Schema.optional(Schema.Boolean),
314 /** Stack actions also arm and cancel auto-merge for a layer and the open layers below it. */
315 stackAutoMerge: Schema.optional(Schema.Boolean),
316 labels: Schema.optional(Schema.Boolean),
317 /** The host searches the repository's users, so composers can complete `@login`. */
318 mentions: Schema.optional(Schema.Boolean),
319 /** The sigils whose issue and change request references composers can complete. */
320 referenceSigils: Schema.optional(ForwardCompatibleArray(PullRequestReferenceSigil)),
321 /**
322 * Every head gets at least one check, so a head that has gone a while without any means none
323 * reported rather than that the repository runs none. Absent means an empty list says nothing.
324 */
325 checksAlwaysReport: Schema.optional(Schema.Boolean),
326 /** The diff can read one file the paged diff withheld as too large (`PullRequestDiffInput.path`). */
327 withheldFileDiff: Schema.optional(Schema.Boolean),
328});
329export type PullRequestCapabilities = typeof PullRequestCapabilities.Type;
330
331/** Unreported host permissions are granted. */
332export const PullRequestViewerPermissions = Schema.Struct({
333 stackRebase: Schema.optional(Schema.Boolean),
334 actions: ForwardCompatibleArray(PullRequestAction),
335 comment: Schema.Boolean,
336 resolve: Schema.Boolean,
337 verdicts: ForwardCompatibleArray(PullRequestReviewVerdict),
338 requestReviewers: Schema.Boolean,
339 updateMethods: Schema.optional(ForwardCompatibleArray(PullRequestUpdateMethod)),
340 labels: Schema.optional(Schema.Boolean),
341 editChangeRequest: Schema.optional(Schema.Boolean),
342 maintainerEdits: Schema.optional(Schema.Boolean),
343});
344export type PullRequestViewerPermissions = typeof PullRequestViewerPermissions.Type;
345
346export const PullRequestMergeCapabilities = Schema.Struct({
347 merge: Schema.Boolean,
348 squash: Schema.Boolean,
349 rebase: Schema.Boolean,
350 /** Optional so servers that predate it still decode; absent means not allowed. */
351 "fast-forward": Schema.optional(Schema.Boolean),
352});
353export type PullRequestMergeCapabilities = typeof PullRequestMergeCapabilities.Type;
354
355export const PullRequestStackMembership = Schema.Struct({
356 number: PositiveInt,
357 position: PositiveInt,
358 size: PositiveInt,
359 base: GitRefName,
360});
361export type PullRequestStackMembership = typeof PullRequestStackMembership.Type;
362
363/** Who can read a pull request on a host that can hide one in a public repository. */
364export const PullRequestVisibility = Schema.Literals(["public", "private"]);
365export type PullRequestVisibility = typeof PullRequestVisibility.Type;
366
367export const PullRequestListEntry = Schema.Struct({
368 stack: Schema.optional(PullRequestStackMembership),
369 provider: SourceControlProviderKind,
370 host: TrimmedNonEmptyString,
371 projectId: ProjectId,
372 projectTitle: TrimmedNonEmptyString,
373 repository: TrimmedNonEmptyString,
374 number: PositiveInt,
375 title: TrimmedNonEmptyString,
376 url: TrimmedNonEmptyString,
377 author: Schema.NullOr(PullRequestActor),
378 headBranch: GitRefName,
379 baseBranch: GitRefName,
380 state: PullRequestState,
381 isDraft: Schema.Boolean,
382 mergeability: PullRequestMergeability,
383 rebaseRequired: Schema.optional(Schema.Boolean),
384 /** Zero until fetched through `PullRequestListStatsInput`; GitHub listings omit counts. */
385 additions: NonNegativeInt,
386 deletions: NonNegativeInt,
387 createdAt: IsoDateTime,
388 updatedAt: IsoDateTime,
389 observedAt: Schema.optional(Schema.Finite),
390 viewerReviewRequested: Schema.Boolean,
391 labels: Schema.Array(PullRequestLabel),
392 reviewDecision: Schema.optional(PullRequestReviewDecision),
393 checksState: Schema.optional(PullRequestChecksState),
394 /** Absent where the host has no private pull requests or names no visibility. */
395 visibility: Schema.optional(PullRequestVisibility),
396});
397export type PullRequestListEntry = typeof PullRequestListEntry.Type;
398
399export const PullRequestListCursors = Schema.Record(
400 TrimmedNonEmptyString,
401 TrimmedNonEmptyString.check(Schema.isMaxLength(4096)),
402);
403export type PullRequestListCursors = typeof PullRequestListCursors.Type;
404
405export const PULL_REQUEST_LIST_PROJECT_LIMIT = 100;
406
407export const PullRequestListInput = Schema.Struct({
408 state: PullRequestListState,
409 involvement: Schema.optional(PullRequestInvolvement),
410 filters: Schema.optional(PullRequestListFilters),
411 projectId: Schema.optional(ProjectId),
412 projectIds: Schema.optional(
413 Schema.Array(ProjectId).check(Schema.isMaxLength(PULL_REQUEST_LIST_PROJECT_LIMIT)),
414 ),
415 host: Schema.optional(TrimmedNonEmptyString),
416 limit: Schema.optional(Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 500 }))),
417 cursors: Schema.optional(PullRequestListCursors),
418 query: Schema.optional(TrimmedNonEmptyString.check(Schema.isMaxLength(200))),
419});
420export type PullRequestListInput = typeof PullRequestListInput.Type;
421
422export const PullRequestProviderSummary = Schema.Struct({
423 host: TrimmedNonEmptyString,
424 kind: SourceControlProviderKind,
425 searchesOnHost: Schema.Boolean,
426 actions: Schema.optional(ForwardCompatibleArray(PullRequestAction)),
427 projectCount: PositiveInt,
428 /** SSH checkouts can resolve to an HTTP authority different from their stored identity. */
429 projectIds: Schema.optional(Schema.Array(ProjectId)),
430 configured: Schema.Boolean,
431 detail: Schema.NullOr(TrimmedNonEmptyString),
432});
433export type PullRequestProviderSummary = typeof PullRequestProviderSummary.Type;
434
435export const PullRequestListProjectError = Schema.Struct({
436 projectId: ProjectId,
437 projectTitle: TrimmedNonEmptyString,
438 message: TrimmedNonEmptyString,
439});
440export type PullRequestListProjectError = typeof PullRequestListProjectError.Type;
441
442export const PullRequestListResult = Schema.Struct({
443 /** Unreadable hosts are absent; JSON codecs reject optional record values. */
444 viewers: Schema.Record(TrimmedNonEmptyString, TrimmedNonEmptyString),
445 providers: Schema.Array(PullRequestProviderSummary),
446 /** Re-sort after appending: one repository's older slice may outrank another's existing rows. */
447 entries: Schema.Array(PullRequestListEntry),
448 errors: Schema.Array(PullRequestListProjectError),
449 truncated: Schema.Boolean,
450 nextCursors: PullRequestListCursors,
451});
452export type PullRequestListResult = typeof PullRequestListResult.Type;
453
454export const PullRequestRef = Schema.Struct({
455 projectId: ProjectId,
456 host: Schema.optional(TrimmedNonEmptyString),
457 expectedAccountId: Schema.optional(TrimmedNonEmptyString),
458 allowStale: Schema.optional(Schema.Boolean),
459 repository: TrimmedNonEmptyString,
460 number: PositiveInt,
461});
462export type PullRequestRef = typeof PullRequestRef.Type;
463
464/** `query` asks the host for matches past the first page of candidates. */
465export const PullRequestReviewerCandidatesInput = Schema.Struct({
466 ...PullRequestRef.fields,
467 query: Schema.optional(TrimmedNonEmptyString.check(Schema.isMaxLength(100))),
468});
469export type PullRequestReviewerCandidatesInput = typeof PullRequestReviewerCandidatesInput.Type;
470
471export const PullRequestRoutingIdentityInput = Schema.Struct({
472 host: TrimmedNonEmptyString,
473});
474export type PullRequestRoutingIdentityInput = typeof PullRequestRoutingIdentityInput.Type;
475
476export const PullRequestRoutingIdentityResult = Schema.Struct({
477 accountId: TrimmedNonEmptyString,
478 host: TrimmedNonEmptyString,
479 provider: SourceControlProviderKind,
480 viewer: TrimmedNonEmptyString,
481});
482export type PullRequestRoutingIdentityResult = typeof PullRequestRoutingIdentityResult.Type;
483
484export const PullRequestRoutingResult = Schema.Struct({
485 accountId: TrimmedNonEmptyString,
486 host: TrimmedNonEmptyString,
487 provider: SourceControlProviderKind,
488 viewer: TrimmedNonEmptyString,
489 projectTitle: TrimmedNonEmptyString,
490 workspaceRoot: TrimmedNonEmptyString,
491});
492export type PullRequestRoutingResult = typeof PullRequestRoutingResult.Type;
493
494export const PullRequestLinkedThreadsResult = Schema.Struct({
495 threads: Schema.Array(
496 Schema.Struct({
497 id: ThreadId,
498 projectId: ProjectId,
499 title: Schema.String,
500 archivedAt: Schema.NullOr(IsoDateTime),
501 settled: Schema.optionalKey(Schema.Boolean),
502 }),
503 ),
504});
505export type PullRequestLinkedThreadsResult = typeof PullRequestLinkedThreadsResult.Type;
506
507export const PullRequestPreview = Schema.Struct({
508 projectId: ProjectId,
509 repository: TrimmedNonEmptyString,
510 number: PositiveInt,
511 title: TrimmedNonEmptyString,
512 url: TrimmedNonEmptyString,
513 author: Schema.NullOr(PullRequestActor),
514 state: PullRequestState,
515 isDraft: Schema.Boolean,
516 createdAt: IsoDateTime,
517 updatedAt: Schema.optional(IsoDateTime),
518 observedAt: Schema.optional(Schema.Finite),
519});
520export type PullRequestPreview = typeof PullRequestPreview.Type;
521
522export const PullRequestSummary = Schema.Struct({
523 provider: SourceControlProviderKind,
524 projectId: ProjectId,
525 repository: TrimmedNonEmptyString,
526 number: PositiveInt,
527 title: TrimmedNonEmptyString,
528 url: TrimmedNonEmptyString,
529 state: PullRequestState,
530 isDraft: Schema.optional(Schema.Boolean),
531 headBranch: GitRefName,
532 baseBranch: GitRefName,
533 closedAt: Schema.optional(Schema.NullOr(Schema.String)),
534 mergedAt: Schema.optional(Schema.NullOr(Schema.String)),
535 updatedAt: IsoDateTime,
536 observedAt: Schema.optional(Schema.Finite),
537 author: Schema.optional(Schema.NullOr(PullRequestActor)),
538 additions: Schema.optional(NonNegativeInt),
539 deletions: Schema.optional(NonNegativeInt),
540 changedFiles: Schema.optional(NonNegativeInt),
541 reviewDecision: Schema.optional(Schema.NullOr(PullRequestReviewDecision)),
542 checksState: Schema.optional(Schema.NullOr(PullRequestChecksState)),
543 mergeability: Schema.optional(PullRequestMergeability),
544 rebaseRequired: Schema.optional(Schema.Boolean),
545 /** Null when the host says the pull request is in no stack; absent when the read did not ask. */
546 stack: Schema.optional(Schema.NullOr(PullRequestStackMembership)),
547 headSha: Schema.optional(TrimmedNonEmptyString),
548 /** Absent means the read did not report auto-merge state, not that it is off. */
549 autoMergeEnabled: Schema.optional(Schema.Boolean),
550 autoMergeMethod: Schema.optional(PullRequestMergeMethod),
551});
552export type PullRequestSummary = typeof PullRequestSummary.Type;
553
554export const PullRequestStack = Schema.Struct({
555 id: TrimmedNonEmptyString,
556 number: PositiveInt,
557 url: TrimmedNonEmptyString,
558 base: GitRefName,
559 layers: Schema.Array(
560 Schema.Struct({
561 number: PositiveInt,
562 title: Schema.optional(Schema.String),
563 isDraft: Schema.optional(Schema.Boolean),
564 headSha: Schema.optional(TrimmedNonEmptyString),
565 headBranch: GitRefName,
566 state: PullRequestState,
567 }),
568 ),
569});
570export type PullRequestStack = typeof PullRequestStack.Type;
571
572export const PullRequestDiffStat = Schema.Struct({
573 projectId: ProjectId,
574 /** Tells apart same-named repositories one project tracks on several hosts. Absent from older servers. */
575 host: Schema.optional(TrimmedNonEmptyString),
576 repository: TrimmedNonEmptyString,
577 number: PositiveInt,
578 additions: NonNegativeInt,
579 deletions: NonNegativeInt,
580});
581export type PullRequestDiffStat = typeof PullRequestDiffStat.Type;
582
583export const PullRequestListStatsInput = Schema.Struct({
584 refs: Schema.Array(PullRequestRef).check(Schema.isMaxLength(500)),
585});
586export type PullRequestListStatsInput = typeof PullRequestListStatsInput.Type;
587
588export const PullRequestListStatsResult = Schema.Struct({
589 stats: Schema.Array(PullRequestDiffStat),
590});
591export type PullRequestListStatsResult = typeof PullRequestListStatsResult.Type;
592
593export const PullRequestFilterOptionKind = Schema.Literals(["labels", "authors", "references"]);
594export type PullRequestFilterOptionKind = typeof PullRequestFilterOptionKind.Type;
595
596/** Scoped like `PullRequestListInput`, so the options come from the repositories it lists. */
597export const PullRequestFilterOptionsInput = Schema.Struct({
598 kind: PullRequestFilterOptionKind,
599 projectId: Schema.optional(ProjectId),
600 projectIds: Schema.optional(Schema.Array(ProjectId).check(Schema.isMaxLength(100))),
601 host: Schema.optional(TrimmedNonEmptyString),
602 query: Schema.optional(TrimmedNonEmptyString.check(Schema.isMaxLength(100))),
603 /** For `references`, the sigil typed, so a host can search only what it links. */
604 sigil: Schema.optional(PullRequestReferenceSigil),
605});
606export type PullRequestFilterOptionsInput = typeof PullRequestFilterOptionsInput.Type;
607
608/** An issue or change request a composer can reference, with the text the host links. */
609export const PullRequestReferenceCandidate = Schema.Struct({
610 reference: TrimmedNonEmptyString,
611 kind: Schema.Literals(["issue", "change-request"]),
612 number: PositiveInt,
613 title: Schema.String,
614 state: Schema.Literals(["open", "closed", "merged"]),
615});
616export type PullRequestReferenceCandidate = typeof PullRequestReferenceCandidate.Type;
617
618export const PullRequestFilterOptions = Schema.Struct({
619 labels: Schema.Array(PullRequestLabel),
620 authors: Schema.Array(PullRequestActor),
621 // Servers from before reference completion send no key.
622 references: Schema.Array(PullRequestReferenceCandidate).pipe(
623 Schema.withDecodingDefault(Effect.succeed([])),
624 ),
625 truncated: Schema.Boolean,
626});
627export type PullRequestFilterOptions = typeof PullRequestFilterOptions.Type;
628
629/**
630 * A separate request rather than a flag on the reads, so an explicit "refresh" one person
631 * presses is the only thing that spends host requests — every ordinary read shares.
632 */
633export const PullRequestInvalidateInput = Schema.Struct({
634 reference: Schema.optional(PullRequestRef),
635 filesViewedOnly: Schema.optional(Schema.Boolean),
636});
637export type PullRequestInvalidateInput = typeof PullRequestInvalidateInput.Type;
638
639export const PullRequestReportStateInput = Schema.Struct({
640 reference: PullRequestRef,
641 state: PullRequestState,
642 isDraft: Schema.optional(Schema.Boolean),
643});
644export type PullRequestReportStateInput = typeof PullRequestReportStateInput.Type;
645
646/** The host's merge queue letting go of a pull request without merging it, newest first. */
647export const PullRequestMergeQueueRemoval = Schema.Struct({
648 id: TrimmedNonEmptyString,
649 removedAt: IsoDateTime,
650 reason: Schema.NullOr(Schema.String),
651});
652export type PullRequestMergeQueueRemoval = typeof PullRequestMergeQueueRemoval.Type;
653
654export const PullRequestDetail = Schema.Struct({
655 provider: SourceControlProviderKind,
656 capabilities: PullRequestCapabilities,
657 viewerPermissions: PullRequestViewerPermissions,
658 projectId: ProjectId,
659 projectTitle: TrimmedNonEmptyString,
660 workspaceRoot: TrimmedNonEmptyString,
661 repository: TrimmedNonEmptyString,
662 number: PositiveInt,
663 title: TrimmedNonEmptyString,
664 body: Schema.String,
665 url: TrimmedNonEmptyString,
666 author: Schema.NullOr(PullRequestActor),
667 state: PullRequestState,
668 isDraft: Schema.Boolean,
669 mergeability: PullRequestMergeability,
670 rebaseRequired: Schema.optional(Schema.Boolean),
671 additions: NonNegativeInt,
672 deletions: NonNegativeInt,
673 changedFiles: NonNegativeInt,
674 headBranch: GitRefName,
675 headRepositoryNameWithOwner: Schema.optional(Schema.NullOr(TrimmedNonEmptyString)),
676 headSha: Schema.optional(TrimmedNonEmptyString),
677 baseBranch: GitRefName,
678 createdAt: IsoDateTime,
679 updatedAt: IsoDateTime,
680 observedAt: Schema.optional(Schema.Finite),
681 mergedAt: Schema.NullOr(IsoDateTime),
682 mergeCommitSha: Schema.optional(TrimmedNonEmptyString),
683 mergedBy: Schema.optional(PullRequestActor),
684 closedAt: Schema.NullOr(IsoDateTime),
685 reviewers: Schema.Array(PullRequestActor),
686 labels: Schema.Array(PullRequestLabel),
687 checks: Schema.Array(PullRequestCheck),
688 mergeCapabilities: PullRequestMergeCapabilities,
689 viewer: Schema.optional(TrimmedNonEmptyString),
690 baseComparison: Schema.optional(PullRequestBaseComparison),
691 behindBy: Schema.optional(NonNegativeInt),
692 /** Absent means the host does not report auto-merge state, not that it is off. */
693 autoMergeEnabled: Schema.optional(Schema.Boolean),
694 autoMergeMethod: Schema.optional(PullRequestMergeMethod),
695 workflowApprovalsRequired: Schema.optional(NonNegativeInt),
696 /** Absent where the host has no merge queue or does not report one. */
697 mergeQueueRemoval: Schema.optional(PullRequestMergeQueueRemoval),
698 maintainerCanModify: Schema.optional(Schema.Boolean),
699 /** Absent where the host has no private pull requests or names no visibility. */
700 visibility: Schema.optional(PullRequestVisibility),
701});
702export type PullRequestDetail = typeof PullRequestDetail.Type;
703
704export const PullRequestChecks = Schema.Struct({
705 observedAt: Schema.optional(Schema.Finite),
706 state: PullRequestState,
707 checks: Schema.Array(PullRequestCheck),
708 workflowApprovalsRequired: Schema.optional(NonNegativeInt),
709});
710export type PullRequestChecks = typeof PullRequestChecks.Type;
711
712export const PullRequestActivity = Schema.Struct({
713 author: Schema.optional(Schema.NullOr(PullRequestActor)),
714 reviewers: Schema.optional(Schema.Array(PullRequestActor)),
715 comments: Schema.Array(PullRequestComment),
716 commentCount: NonNegativeInt,
717 commentsTruncated: Schema.Boolean,
718 reviewThreadsTruncated: Schema.optional(Schema.Boolean),
719 reviewThreads: Schema.Array(PullRequestReviewThread),
720 // Apart from reviewThreads so clients that require a thread path still decode the activity.
721 overviewThreads: Schema.optional(Schema.Array(PullRequestOverviewThread)),
722 commits: Schema.Array(PullRequestCommit),
723 reactions: Schema.optional(Schema.Array(PullRequestReaction)),
724});
725export type PullRequestActivity = typeof PullRequestActivity.Type;
726
727export const pullRequestConversationThreads = (
728 activity: Pick<PullRequestActivity, "reviewThreads" | "overviewThreads">,
729): ReadonlyArray<PullRequestConversationThread> =>
730 activity.overviewThreads === undefined || activity.overviewThreads.length === 0
731 ? activity.reviewThreads
732 : [...activity.reviewThreads, ...activity.overviewThreads];
733
734export const PullRequestDetailView = Schema.Struct({
735 ...PullRequestDetail.fields,
736 ...PullRequestActivity.fields,
737 author: Schema.NullOr(PullRequestActor),
738 reviewers: Schema.Array(PullRequestActor),
739});
740export type PullRequestDetailView = typeof PullRequestDetailView.Type;
741
742/** GitHub refuses diffs past 300 files, so callers must page large changes. */
743export const PullRequestDiffInput = Schema.Struct({
744 ...PullRequestRef.fields,
745 cursor: Schema.optional(TrimmedNonEmptyString),
746 commit: Schema.optional(TrimmedNonEmptyString),
747 /** Reads one file the paged diff withheld as too large; ignores `cursor`. */
748 path: Schema.optional(Schema.NonEmptyString),
749});
750export type PullRequestDiffInput = typeof PullRequestDiffInput.Type;
751
752export const PullRequestOmittedFileStat = Schema.Struct({
753 path: Schema.NonEmptyString,
754 additions: Schema.Number,
755 deletions: Schema.Number,
756});
757export type PullRequestOmittedFileStat = typeof PullRequestOmittedFileStat.Type;
758
759export const PullRequestDiffResult = Schema.Struct({
760 patch: Schema.String,
761 /** Content omitted within this slice; nextCursor separately indicates more slices. */
762 truncated: Schema.Boolean,
763 nextCursor: Schema.NullOr(TrimmedNonEmptyString),
764 omittedFileStats: Schema.optional(Schema.Array(PullRequestOmittedFileStat)),
765 /** On the first page: files this diff withholds can be read one at a time with `path`. */
766 withheldFilesReadable: Schema.optional(Schema.Boolean),
767});
768export type PullRequestDiffResult = typeof PullRequestDiffResult.Type;
769
770export const PullRequestDiffFileContentsInput = Schema.Struct({
771 ...PullRequestRef.fields,
772 commit: Schema.optional(TrimmedNonEmptyString),
773 changeType: Schema.Literals(["change", "rename-pure", "rename-changed", "new", "deleted"]),
774 oldPath: Schema.NonEmptyString,
775 newPath: Schema.NonEmptyString,
776});
777export type PullRequestDiffFileContentsInput = typeof PullRequestDiffFileContentsInput.Type;
778
779export const PullRequestDiffFileContentsResult = Schema.Struct({
780 oldContents: Schema.String,
781 newContents: Schema.String,
782});
783export type PullRequestDiffFileContentsResult = typeof PullRequestDiffFileContentsResult.Type;
784
785const MAX_FILE_PATH_LENGTH = 4096;
786// Preserve filename whitespace so viewed marks match host paths.
787const FilePath = Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(MAX_FILE_PATH_LENGTH));
788
789export const PullRequestFileViewedState = Schema.Literals(["unviewed", "viewed", "dismissed"]);
790export type PullRequestFileViewedState = typeof PullRequestFileViewedState.Type;
791
792export const PullRequestFileViewed = Schema.Struct({
793 path: FilePath,
794 state: PullRequestFileViewedState,
795});
796export type PullRequestFileViewed = typeof PullRequestFileViewed.Type;
797
798export const PullRequestFilesViewedResult = Schema.Struct({
799 /** Only the files the host reported a state for. A file missing from this list is unviewed. */
800 files: Schema.Array(PullRequestFileViewed),
801 truncated: Schema.Boolean,
802});
803export type PullRequestFilesViewedResult = typeof PullRequestFilesViewedResult.Type;
804
805const PullRequestLineCount = Schema.Struct({
806 additions: NonNegativeInt,
807 deletions: NonNegativeInt,
808});
809
810/**
811 * A change's line counts split by what the changed files are, judged from their paths. Null when
812 * the host gives no per-file counts, or has more files than one read covers: a split of part of
813 * the change would not add up to the totals shown beside it.
814 */
815export const PullRequestChangeBreakdown = Schema.NullOr(
816 Schema.Struct({
817 code: PullRequestLineCount,
818 tests: PullRequestLineCount,
819 mocks: PullRequestLineCount,
820 generated: PullRequestLineCount,
821 // Servers from before the docs split send no key; their docs lines sit in `code`.
822 docs: PullRequestLineCount.pipe(
823 Schema.withDecodingDefault(Effect.succeed({ additions: 0, deletions: 0 })),
824 ),
825 }),
826);
827export type PullRequestChangeBreakdown = typeof PullRequestChangeBreakdown.Type;
828
829const MAX_FILES_VIEWED_PRESSES = 500;
830
831export const PullRequestSetFilesViewedInput = Schema.Struct({
832 ...PullRequestRef.fields,
833 files: Schema.Array(
834 Schema.Struct({
835 path: FilePath,
836 viewed: Schema.Boolean,
837 /** The file's version in the diff the reader was shown; without it the head's is recorded. */
838 revision: Schema.optional(TrimmedNonEmptyString.check(Schema.isMaxLength(256))),
839 }),
840 ).check(Schema.isMaxLength(MAX_FILES_VIEWED_PRESSES)),
841});
842export type PullRequestSetFilesViewedInput = typeof PullRequestSetFilesViewedInput.Type;
843
844export const PullRequestStackHead = Schema.Struct({
845 number: PositiveInt,
846 headSha: TrimmedNonEmptyString,
847});
848export type PullRequestStackHead = typeof PullRequestStackHead.Type;
849
850export const PullRequestActionInput = Schema.Struct({
851 /** Native stack scope; only send to environments advertising pullRequestStackActions. */
852 stackNumber: Schema.optional(PositiveInt),
853 expectedStackHeads: Schema.optional(Schema.Array(PullRequestStackHead)),
854 /** Merges refuse when the head commit is no longer this one. */
855 expectedHeadSha: Schema.optional(TrimmedNonEmptyString),
856 ...PullRequestRef.fields,
857 action: PullRequestAction,
858 mergeMethod: Schema.optional(PullRequestMergeMethod),
859 updateMethod: Schema.optional(PullRequestUpdateMethod),
860 /** Opt-in, because older clients decode the action's success as void and reject a summary. */
861 replyWithSummary: Schema.optional(Schema.Literal(true)),
862});
863export type PullRequestActionInput = typeof PullRequestActionInput.Type;
864
865// Preserve whitespace because it affects Markdown formatting.
866const CommentBody = Schema.String.check(Schema.isNonEmpty()).check(Schema.isMaxLength(65_536));
867
868export const PullRequestCommentInput = Schema.Struct({
869 ...PullRequestRef.fields,
870 body: CommentBody,
871});
872export type PullRequestCommentInput = typeof PullRequestCommentInput.Type;
873
874export const PullRequestUpdateInput = Schema.Struct({
875 ...PullRequestRef.fields,
876 title: Schema.optional(TrimmedNonEmptyString.check(Schema.isMaxLength(1024))),
877 body: Schema.optional(Schema.String.check(Schema.isMaxLength(65_536))),
878 maintainerCanModify: Schema.optional(Schema.Boolean),
879});
880export type PullRequestUpdateInput = typeof PullRequestUpdateInput.Type;
881
882/** Comment kind selects the endpoint; GitHub uses separate mutations for conversation and line comments. */
883export const PullRequestCommentUpdateInput = Schema.Struct({
884 ...PullRequestRef.fields,
885 commentId: TrimmedNonEmptyString,
886 kind: Schema.Literals(["issue-comment", "review-comment"]),
887 body: CommentBody,
888});
889export type PullRequestCommentUpdateInput = typeof PullRequestCommentUpdateInput.Type;
890
891export const PullRequestReviewPosition = Schema.Union([
892 Schema.Struct({
893 kind: Schema.Literal("added"),
894 newLine: PositiveInt,
895 }),
896 Schema.Struct({
897 kind: Schema.Literal("deleted"),
898 oldLine: PositiveInt,
899 }),
900 Schema.Struct({
901 kind: Schema.Literal("context"),
902 oldLine: PositiveInt,
903 newLine: PositiveInt,
904 side: PullRequestDiffSide,
905 }),
906]);
907export type PullRequestReviewPosition = typeof PullRequestReviewPosition.Type;
908
909export const PullRequestReviewCommentDraft = Schema.Struct({
910 path: TrimmedNonEmptyString,
911 /** GitLab needs both names for renamed-file comments; hosts using one path ignore this. */
912 oldPath: Schema.optional(TrimmedNonEmptyString),
913 position: PullRequestReviewPosition,
914 /**
915 * The first line of a comment on a range, which ends at `position`. Sent only to a host whose
916 * capabilities include `review.rangeComment`.
917 */
918 startPosition: Schema.optional(PullRequestReviewPosition),
919 body: CommentBody,
920});
921export type PullRequestReviewCommentDraft = typeof PullRequestReviewCommentDraft.Type;
922
923export const PullRequestSubmitReviewInput = Schema.Struct({
924 ...PullRequestRef.fields,
925 /** Reviews refuse when the head commit is no longer this one. */
926 expectedHeadSha: Schema.optional(TrimmedNonEmptyString),
927 verdict: PullRequestReviewVerdict,
928 body: Schema.String.check(Schema.isMaxLength(65_536)),
929 comments: Schema.Array(PullRequestReviewCommentDraft),
930});
931export type PullRequestSubmitReviewInput = typeof PullRequestSubmitReviewInput.Type;
932
933export const PullRequestThreadCommentsInput = Schema.Struct({
934 ...PullRequestRef.fields,
935 threadId: TrimmedNonEmptyString,
936 cursor: TrimmedNonEmptyString,
937});
938export type PullRequestThreadCommentsInput = typeof PullRequestThreadCommentsInput.Type;
939
940export const PullRequestThreadCommentsResult = Schema.Struct({
941 comments: Schema.Array(PullRequestThreadComment),
942 nextCursor: Schema.NullOr(TrimmedNonEmptyString),
943 // Comments the host hid that this page left out; the thread's `commentCount` still counts them.
944 hiddenCount: Schema.optional(NonNegativeInt),
945});
946export type PullRequestThreadCommentsResult = typeof PullRequestThreadCommentsResult.Type;
947
948export const PullRequestThreadReplyInput = Schema.Struct({
949 ...PullRequestRef.fields,
950 threadId: TrimmedNonEmptyString,
951 body: CommentBody,
952});
953export type PullRequestThreadReplyInput = typeof PullRequestThreadReplyInput.Type;
954
955export const PullRequestThreadResolutionInput = Schema.Struct({
956 ...PullRequestRef.fields,
957 threadId: TrimmedNonEmptyString,
958 resolved: Schema.Boolean,
959});
960export type PullRequestThreadResolutionInput = typeof PullRequestThreadResolutionInput.Type;
961
962export const PullRequestReactionInput = Schema.Struct({
963 ...PullRequestRef.fields,
964 subjectId: Schema.optional(TrimmedNonEmptyString),
965 content: PullRequestReactionContent,
966 reacted: Schema.Boolean,
967});
968export type PullRequestReactionInput = typeof PullRequestReactionInput.Type;
969
970/** The most labels or reviewers one write may change. */
971export const PULL_REQUEST_CHANGE_BATCH_LIMIT = 25;
972
973export const PullRequestReviewerRequestInput = Schema.Struct({
974 ...PullRequestRef.fields,
975 reviewers: Schema.Array(
976 Schema.Struct({ id: TrimmedNonEmptyString, kind: PullRequestReviewerKind }),
977 ).check(Schema.isMinLength(1), Schema.isMaxLength(PULL_REQUEST_CHANGE_BATCH_LIMIT)),
978 requested: Schema.Boolean,
979});
980export type PullRequestReviewerRequestInput = typeof PullRequestReviewerRequestInput.Type;
981
982export const PullRequestLabelChangeInput = Schema.Struct({
983 ...PullRequestRef.fields,
984 labels: Schema.Array(TrimmedNonEmptyString).check(
985 Schema.isMinLength(1),
986 Schema.isMaxLength(PULL_REQUEST_CHANGE_BATCH_LIMIT),
987 ),
988 applied: Schema.Boolean,
989});
990export type PullRequestLabelChangeInput = typeof PullRequestLabelChangeInput.Type;
991
992/**
993 * The names keep their `cli-` prefix for wire compatibility; for a host read with a credential
994 * rather than a tool they mean "no credential" and "a refused credential".
995 */
996export const PullRequestUnavailableReason = Schema.Literals([
997 "cli-missing",
998 "cli-unauthenticated",
999 "provider-unsupported",
1000 "repository-without-project",
1001]);
1002export type PullRequestUnavailableReason = typeof PullRequestUnavailableReason.Type;
1003
1004/**
1005 * `author:me` names whoever is signed in to the host being read, GitHub's `@me` spelled either
1006 * way. A host's own search would answer it, but the page and the server both re-check an author
1007 * against the row's login, so the name is resolved before either comparison rather than being
1008 * matched as the literal login "me".
1009 */
1010export function resolvePullRequestAuthorFilter(
1011 author: string,
1012 viewer: string | null | undefined,
1013): string {
1014 const trimmed = author.trim();
1015 if (!/^@?me$/i.test(trimmed)) return trimmed;
1016 return viewer === null || viewer === undefined || viewer.trim().length === 0 ? trimmed : viewer;
1017}
1018
1019export class PullRequestUnavailableError extends Schema.TaggedError<PullRequestUnavailableError>()(
1020 "PullRequestUnavailableError",
1021 {
1022 reason: PullRequestUnavailableReason,
1023 provider: Schema.optional(SourceControlProviderKind),
1024 listResult: Schema.optional(PullRequestListResult),
1025 /**
1026 * What the host needs on the server, in its own words. Absent from older servers, which
1027 * shipped no such field, and for a host that names nothing.
1028 */
1029 requirement: Schema.optional(TrimmedNonEmptyString),
1030 /** The repository no project has, for `repository-without-project`. */
1031 repository: Schema.optional(TrimmedNonEmptyString),
1032 /**
1033 * For `repository-without-project` on a host read through any checkout on it: the host no
1034 * project is on.
1035 */
1036 host: Schema.optional(TrimmedNonEmptyString),
1037 cause: Schema.optional(Schema.Defect()),
1038 },
1039 { httpApiStatus: 503 },
1040) {
1041 [HttpServerRespondable.symbol]() {
1042 return HttpServerResponse.schemaJson(PullRequestUnavailableError)(this, { status: 503 });
1043 }
1044
1045 override get message(): string {
1046 switch (this.reason) {
1047 case "cli-missing":
1048 return this.requirement ?? "The tool this host is read through is not installed or set up.";
1049 case "cli-unauthenticated":
1050 return this.requirement ?? "This host has no working credentials.";
1051 case "provider-unsupported":
1052 return "Change requests cannot be browsed for this project's host yet.";
1053 case "repository-without-project":
1054 if (this.host !== undefined) {
1055 return `No project in T3 Code is on ${this.host}. Add any ${this.host} project to read its change requests.`;
1056 }
1057 return `${this.repository ?? "This repository"} is not a project in T3 Code. Add it as a project to read its change requests.`;
1058 }
1059 }
1060}
1061
1062export class PullRequestOperationError extends Schema.TaggedError<PullRequestOperationError>()(
1063 "PullRequestOperationError",
1064 {
1065 operation: Schema.String,
1066 detail: TrimmedNonEmptyString,
1067 reason: Schema.optional(Schema.Literal("not-found")),
1068 listResult: Schema.optional(PullRequestListResult),
1069 cause: Schema.optional(Schema.Defect()),
1070 },
1071 // Not 502: Cloudflare, in front of T3 Connect, swaps an origin 502 for its own page.
1072 { httpApiStatus: 503 },
1073) {
1074 [HttpServerRespondable.symbol]() {
1075 return HttpServerResponse.schemaJson(PullRequestOperationError)(this, { status: 503 });
1076 }
1077
1078 override get message(): string {
1079 return `Pull request operation ${this.operation} failed: ${this.detail}`;
1080 }
1081}