@sentry/junior-github 0.298.0 → 0.299.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/dist/{chunk-OK6BNAGC.js → chunk-O74CQGTZ.js} +50 -20
- package/dist/credential-support.d.ts +7 -0
- package/dist/db/schema.d.ts +34 -0
- package/dist/events/pull-request.d.ts +8 -2
- package/dist/graphql-documents.d.ts +31 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1510 -771
- package/dist/object-facts.d.ts +16 -1
- package/dist/plugin.d.ts +3 -0
- package/dist/pull-request-outcomes/apply.d.ts +3 -1
- package/dist/pull-request-outcomes/reconcile.d.ts +10 -5
- package/dist/pull-request-outcomes/store.d.ts +5 -0
- package/dist/pull-request-requesters/draft-reviewers.d.ts +15 -0
- package/dist/testing.js +1 -1
- package/dist/tool-support/attribution.d.ts +4 -2
- package/dist/tool-support/pull-request-description.d.ts +8 -0
- package/dist/tools/clone-repository.d.ts +34 -2
- package/dist/tools/comment-on-issue.d.ts +34 -2
- package/dist/tools/comment-on-pull-request.d.ts +34 -2
- package/dist/tools/create-issue.d.ts +34 -2
- package/dist/tools/create-pull-request.d.ts +39 -4
- package/dist/tools/get-deployment.d.ts +34 -2
- package/dist/tools/get-issue.d.ts +34 -2
- package/dist/tools/get-pull-request.d.ts +54 -2
- package/dist/tools/get-release.d.ts +34 -2
- package/dist/tools/get-repository.d.ts +34 -2
- package/dist/tools/get-status.d.ts +34 -2
- package/dist/tools/react-to-issue.d.ts +34 -2
- package/dist/tools/resolve-pull-request-review-thread.d.ts +34 -2
- package/dist/tools/submit-pull-request-review.d.ts +34 -2
- package/dist/tools/update-issue-comment.d.ts +34 -2
- package/dist/tools/update-issue.d.ts +34 -2
- package/dist/tools/update-pull-request-feedback.d.ts +34 -4
- package/dist/tools/update-pull-request.d.ts +38 -4
- package/dist/tools.d.ts +10 -1
- package/dist/webhooks/check-suite.d.ts +2 -4
- package/dist/webhooks/fail-open-log.d.ts +10 -0
- package/dist/webhooks/handler.d.ts +1 -1
- package/dist/webhooks/installation-requests.d.ts +12 -1
- package/dist/webhooks/merge-conflict.d.ts +1 -1
- package/dist/webhooks/pull-request-preview.d.ts +12 -0
- package/dist/webhooks/pull-request-ready-reviewers.d.ts +25 -0
- package/dist/webhooks/pull-request-ready.d.ts +1 -1
- package/migrations/0011_pull_request_draft.sql +1 -0
- package/migrations/meta/0011_snapshot.json +434 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -2
- package/skills/github-code/SKILL.md +1 -1
- package/skills/github-code/SPEC.md +1 -1
|
@@ -13,7 +13,7 @@ export declare function createGitHubUpdateIssueCommentTool(egress: PluginEgress,
|
|
|
13
13
|
kind: "object";
|
|
14
14
|
key: string;
|
|
15
15
|
label: string;
|
|
16
|
-
objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
|
|
16
|
+
objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "item" | "message" | "person" | "task";
|
|
17
17
|
title: string;
|
|
18
18
|
url: string | null;
|
|
19
19
|
description?: string | undefined;
|
|
@@ -38,6 +38,7 @@ export declare function createGitHubUpdateIssueCommentTool(egress: PluginEgress,
|
|
|
38
38
|
changedFiles?: number | undefined;
|
|
39
39
|
additions?: number | undefined;
|
|
40
40
|
deletions?: number | undefined;
|
|
41
|
+
previewImageUrls?: string[] | undefined;
|
|
41
42
|
} | {
|
|
42
43
|
type: "task";
|
|
43
44
|
assignees?: string[] | undefined;
|
|
@@ -56,6 +57,21 @@ export declare function createGitHubUpdateIssueCommentTool(egress: PluginEgress,
|
|
|
56
57
|
type: "calendar_event";
|
|
57
58
|
when?: string | undefined;
|
|
58
59
|
attendees?: string[] | undefined;
|
|
60
|
+
} | {
|
|
61
|
+
type: "conversation";
|
|
62
|
+
participants?: string[] | undefined;
|
|
63
|
+
lastActivityAt?: string | undefined;
|
|
64
|
+
} | {
|
|
65
|
+
type: "message";
|
|
66
|
+
channel?: string | undefined;
|
|
67
|
+
author?: string | undefined;
|
|
68
|
+
sentAt?: string | undefined;
|
|
69
|
+
} | {
|
|
70
|
+
type: "person";
|
|
71
|
+
email?: string | undefined;
|
|
72
|
+
slackHandle?: string | undefined;
|
|
73
|
+
githubHandle?: string | undefined;
|
|
74
|
+
avatarUrl?: string | undefined;
|
|
59
75
|
} | undefined;
|
|
60
76
|
}[] | undefined;
|
|
61
77
|
reply?: {
|
|
@@ -77,7 +93,7 @@ export declare function createGitHubUpdateIssueCommentTool(egress: PluginEgress,
|
|
|
77
93
|
kind: "object";
|
|
78
94
|
key: string;
|
|
79
95
|
label: string;
|
|
80
|
-
objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
|
|
96
|
+
objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "item" | "message" | "person" | "task";
|
|
81
97
|
title: string;
|
|
82
98
|
url: string | null;
|
|
83
99
|
description?: string | undefined;
|
|
@@ -102,6 +118,7 @@ export declare function createGitHubUpdateIssueCommentTool(egress: PluginEgress,
|
|
|
102
118
|
changedFiles?: number | undefined;
|
|
103
119
|
additions?: number | undefined;
|
|
104
120
|
deletions?: number | undefined;
|
|
121
|
+
previewImageUrls?: string[] | undefined;
|
|
105
122
|
} | {
|
|
106
123
|
type: "task";
|
|
107
124
|
assignees?: string[] | undefined;
|
|
@@ -120,6 +137,21 @@ export declare function createGitHubUpdateIssueCommentTool(egress: PluginEgress,
|
|
|
120
137
|
type: "calendar_event";
|
|
121
138
|
when?: string | undefined;
|
|
122
139
|
attendees?: string[] | undefined;
|
|
140
|
+
} | {
|
|
141
|
+
type: "conversation";
|
|
142
|
+
participants?: string[] | undefined;
|
|
143
|
+
lastActivityAt?: string | undefined;
|
|
144
|
+
} | {
|
|
145
|
+
type: "message";
|
|
146
|
+
channel?: string | undefined;
|
|
147
|
+
author?: string | undefined;
|
|
148
|
+
sentAt?: string | undefined;
|
|
149
|
+
} | {
|
|
150
|
+
type: "person";
|
|
151
|
+
email?: string | undefined;
|
|
152
|
+
slackHandle?: string | undefined;
|
|
153
|
+
githubHandle?: string | undefined;
|
|
154
|
+
avatarUrl?: string | undefined;
|
|
123
155
|
} | undefined;
|
|
124
156
|
}[] | undefined;
|
|
125
157
|
reply?: {
|
|
@@ -33,7 +33,7 @@ export declare function createGitHubUpdateIssueTool(ctx: {
|
|
|
33
33
|
kind: "object";
|
|
34
34
|
key: string;
|
|
35
35
|
label: string;
|
|
36
|
-
objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
|
|
36
|
+
objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "item" | "message" | "person" | "task";
|
|
37
37
|
title: string;
|
|
38
38
|
url: string | null;
|
|
39
39
|
description?: string | undefined;
|
|
@@ -58,6 +58,7 @@ export declare function createGitHubUpdateIssueTool(ctx: {
|
|
|
58
58
|
changedFiles?: number | undefined;
|
|
59
59
|
additions?: number | undefined;
|
|
60
60
|
deletions?: number | undefined;
|
|
61
|
+
previewImageUrls?: string[] | undefined;
|
|
61
62
|
} | {
|
|
62
63
|
type: "task";
|
|
63
64
|
assignees?: string[] | undefined;
|
|
@@ -76,6 +77,21 @@ export declare function createGitHubUpdateIssueTool(ctx: {
|
|
|
76
77
|
type: "calendar_event";
|
|
77
78
|
when?: string | undefined;
|
|
78
79
|
attendees?: string[] | undefined;
|
|
80
|
+
} | {
|
|
81
|
+
type: "conversation";
|
|
82
|
+
participants?: string[] | undefined;
|
|
83
|
+
lastActivityAt?: string | undefined;
|
|
84
|
+
} | {
|
|
85
|
+
type: "message";
|
|
86
|
+
channel?: string | undefined;
|
|
87
|
+
author?: string | undefined;
|
|
88
|
+
sentAt?: string | undefined;
|
|
89
|
+
} | {
|
|
90
|
+
type: "person";
|
|
91
|
+
email?: string | undefined;
|
|
92
|
+
slackHandle?: string | undefined;
|
|
93
|
+
githubHandle?: string | undefined;
|
|
94
|
+
avatarUrl?: string | undefined;
|
|
79
95
|
} | undefined;
|
|
80
96
|
}[] | undefined;
|
|
81
97
|
reply?: {
|
|
@@ -108,7 +124,7 @@ export declare function createGitHubUpdateIssueTool(ctx: {
|
|
|
108
124
|
kind: "object";
|
|
109
125
|
key: string;
|
|
110
126
|
label: string;
|
|
111
|
-
objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
|
|
127
|
+
objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "item" | "message" | "person" | "task";
|
|
112
128
|
title: string;
|
|
113
129
|
url: string | null;
|
|
114
130
|
description?: string | undefined;
|
|
@@ -133,6 +149,7 @@ export declare function createGitHubUpdateIssueTool(ctx: {
|
|
|
133
149
|
changedFiles?: number | undefined;
|
|
134
150
|
additions?: number | undefined;
|
|
135
151
|
deletions?: number | undefined;
|
|
152
|
+
previewImageUrls?: string[] | undefined;
|
|
136
153
|
} | {
|
|
137
154
|
type: "task";
|
|
138
155
|
assignees?: string[] | undefined;
|
|
@@ -151,6 +168,21 @@ export declare function createGitHubUpdateIssueTool(ctx: {
|
|
|
151
168
|
type: "calendar_event";
|
|
152
169
|
when?: string | undefined;
|
|
153
170
|
attendees?: string[] | undefined;
|
|
171
|
+
} | {
|
|
172
|
+
type: "conversation";
|
|
173
|
+
participants?: string[] | undefined;
|
|
174
|
+
lastActivityAt?: string | undefined;
|
|
175
|
+
} | {
|
|
176
|
+
type: "message";
|
|
177
|
+
channel?: string | undefined;
|
|
178
|
+
author?: string | undefined;
|
|
179
|
+
sentAt?: string | undefined;
|
|
180
|
+
} | {
|
|
181
|
+
type: "person";
|
|
182
|
+
email?: string | undefined;
|
|
183
|
+
slackHandle?: string | undefined;
|
|
184
|
+
githubHandle?: string | undefined;
|
|
185
|
+
avatarUrl?: string | undefined;
|
|
154
186
|
} | undefined;
|
|
155
187
|
}[] | undefined;
|
|
156
188
|
reply?: {
|
|
@@ -30,8 +30,6 @@ export declare function pullRequestReviewPath(input: {
|
|
|
30
30
|
}): string;
|
|
31
31
|
/** Return the GraphQL name of one REST reaction content. */
|
|
32
32
|
export declare function graphqlReactionContent(content: string): string;
|
|
33
|
-
/** The GraphQL mutation that adds one reaction to a review body. */
|
|
34
|
-
export declare const ADD_REVIEW_REACTION_MUTATION = "mutation AddReviewReaction($subjectId: ID!, $content: ReactionContent!) {\n addReaction(input: {subjectId: $subjectId, content: $content}) {\n reaction { content }\n }\n}";
|
|
35
33
|
/**
|
|
36
34
|
* Set Junior's feedback reaction on a pull request comment or review body.
|
|
37
35
|
* Replace only state reactions Junior previously added to the same comment.
|
|
@@ -50,7 +48,7 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
|
|
|
50
48
|
kind: "object";
|
|
51
49
|
key: string;
|
|
52
50
|
label: string;
|
|
53
|
-
objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
|
|
51
|
+
objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "item" | "message" | "person" | "task";
|
|
54
52
|
title: string;
|
|
55
53
|
url: string | null;
|
|
56
54
|
description?: string | undefined;
|
|
@@ -75,6 +73,7 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
|
|
|
75
73
|
changedFiles?: number | undefined;
|
|
76
74
|
additions?: number | undefined;
|
|
77
75
|
deletions?: number | undefined;
|
|
76
|
+
previewImageUrls?: string[] | undefined;
|
|
78
77
|
} | {
|
|
79
78
|
type: "task";
|
|
80
79
|
assignees?: string[] | undefined;
|
|
@@ -93,6 +92,21 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
|
|
|
93
92
|
type: "calendar_event";
|
|
94
93
|
when?: string | undefined;
|
|
95
94
|
attendees?: string[] | undefined;
|
|
95
|
+
} | {
|
|
96
|
+
type: "conversation";
|
|
97
|
+
participants?: string[] | undefined;
|
|
98
|
+
lastActivityAt?: string | undefined;
|
|
99
|
+
} | {
|
|
100
|
+
type: "message";
|
|
101
|
+
channel?: string | undefined;
|
|
102
|
+
author?: string | undefined;
|
|
103
|
+
sentAt?: string | undefined;
|
|
104
|
+
} | {
|
|
105
|
+
type: "person";
|
|
106
|
+
email?: string | undefined;
|
|
107
|
+
slackHandle?: string | undefined;
|
|
108
|
+
githubHandle?: string | undefined;
|
|
109
|
+
avatarUrl?: string | undefined;
|
|
96
110
|
} | undefined;
|
|
97
111
|
}[] | undefined;
|
|
98
112
|
reply?: {
|
|
@@ -114,7 +128,7 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
|
|
|
114
128
|
kind: "object";
|
|
115
129
|
key: string;
|
|
116
130
|
label: string;
|
|
117
|
-
objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
|
|
131
|
+
objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "item" | "message" | "person" | "task";
|
|
118
132
|
title: string;
|
|
119
133
|
url: string | null;
|
|
120
134
|
description?: string | undefined;
|
|
@@ -139,6 +153,7 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
|
|
|
139
153
|
changedFiles?: number | undefined;
|
|
140
154
|
additions?: number | undefined;
|
|
141
155
|
deletions?: number | undefined;
|
|
156
|
+
previewImageUrls?: string[] | undefined;
|
|
142
157
|
} | {
|
|
143
158
|
type: "task";
|
|
144
159
|
assignees?: string[] | undefined;
|
|
@@ -157,6 +172,21 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
|
|
|
157
172
|
type: "calendar_event";
|
|
158
173
|
when?: string | undefined;
|
|
159
174
|
attendees?: string[] | undefined;
|
|
175
|
+
} | {
|
|
176
|
+
type: "conversation";
|
|
177
|
+
participants?: string[] | undefined;
|
|
178
|
+
lastActivityAt?: string | undefined;
|
|
179
|
+
} | {
|
|
180
|
+
type: "message";
|
|
181
|
+
channel?: string | undefined;
|
|
182
|
+
author?: string | undefined;
|
|
183
|
+
sentAt?: string | undefined;
|
|
184
|
+
} | {
|
|
185
|
+
type: "person";
|
|
186
|
+
email?: string | undefined;
|
|
187
|
+
slackHandle?: string | undefined;
|
|
188
|
+
githubHandle?: string | undefined;
|
|
189
|
+
avatarUrl?: string | undefined;
|
|
160
190
|
} | undefined;
|
|
161
191
|
}[] | undefined;
|
|
162
192
|
reply?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Identity, type User, type Actor, type PluginLogger, type PluginEgress, type Source } from "@sentry/junior-plugin-api";
|
|
1
|
+
import { type Identity, type User, type Actor, type PluginLogger, type PluginDecider, type PluginEgress, type Source } from "@sentry/junior-plugin-api";
|
|
2
2
|
/** Update mutable PR metadata while preserving runtime-owned body attribution. */
|
|
3
3
|
export declare function createGitHubUpdatePullRequestTool(ctx: {
|
|
4
4
|
actor?: Actor;
|
|
@@ -22,7 +22,9 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
|
|
|
22
22
|
user?: User;
|
|
23
23
|
} | undefined>;
|
|
24
24
|
};
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
|
+
/** Set when the description check experiment is on. */
|
|
27
|
+
descriptionDecider?: PluginDecider): import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
26
28
|
repo: string;
|
|
27
29
|
number: number;
|
|
28
30
|
title?: string | undefined;
|
|
@@ -35,7 +37,7 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
|
|
|
35
37
|
kind: "object";
|
|
36
38
|
key: string;
|
|
37
39
|
label: string;
|
|
38
|
-
objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
|
|
40
|
+
objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "item" | "message" | "person" | "task";
|
|
39
41
|
title: string;
|
|
40
42
|
url: string | null;
|
|
41
43
|
description?: string | undefined;
|
|
@@ -60,6 +62,7 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
|
|
|
60
62
|
changedFiles?: number | undefined;
|
|
61
63
|
additions?: number | undefined;
|
|
62
64
|
deletions?: number | undefined;
|
|
65
|
+
previewImageUrls?: string[] | undefined;
|
|
63
66
|
} | {
|
|
64
67
|
type: "task";
|
|
65
68
|
assignees?: string[] | undefined;
|
|
@@ -78,6 +81,21 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
|
|
|
78
81
|
type: "calendar_event";
|
|
79
82
|
when?: string | undefined;
|
|
80
83
|
attendees?: string[] | undefined;
|
|
84
|
+
} | {
|
|
85
|
+
type: "conversation";
|
|
86
|
+
participants?: string[] | undefined;
|
|
87
|
+
lastActivityAt?: string | undefined;
|
|
88
|
+
} | {
|
|
89
|
+
type: "message";
|
|
90
|
+
channel?: string | undefined;
|
|
91
|
+
author?: string | undefined;
|
|
92
|
+
sentAt?: string | undefined;
|
|
93
|
+
} | {
|
|
94
|
+
type: "person";
|
|
95
|
+
email?: string | undefined;
|
|
96
|
+
slackHandle?: string | undefined;
|
|
97
|
+
githubHandle?: string | undefined;
|
|
98
|
+
avatarUrl?: string | undefined;
|
|
81
99
|
} | undefined;
|
|
82
100
|
}[] | undefined;
|
|
83
101
|
reply?: {
|
|
@@ -111,7 +129,7 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
|
|
|
111
129
|
kind: "object";
|
|
112
130
|
key: string;
|
|
113
131
|
label: string;
|
|
114
|
-
objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
|
|
132
|
+
objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "item" | "message" | "person" | "task";
|
|
115
133
|
title: string;
|
|
116
134
|
url: string | null;
|
|
117
135
|
description?: string | undefined;
|
|
@@ -136,6 +154,7 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
|
|
|
136
154
|
changedFiles?: number | undefined;
|
|
137
155
|
additions?: number | undefined;
|
|
138
156
|
deletions?: number | undefined;
|
|
157
|
+
previewImageUrls?: string[] | undefined;
|
|
139
158
|
} | {
|
|
140
159
|
type: "task";
|
|
141
160
|
assignees?: string[] | undefined;
|
|
@@ -154,6 +173,21 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
|
|
|
154
173
|
type: "calendar_event";
|
|
155
174
|
when?: string | undefined;
|
|
156
175
|
attendees?: string[] | undefined;
|
|
176
|
+
} | {
|
|
177
|
+
type: "conversation";
|
|
178
|
+
participants?: string[] | undefined;
|
|
179
|
+
lastActivityAt?: string | undefined;
|
|
180
|
+
} | {
|
|
181
|
+
type: "message";
|
|
182
|
+
channel?: string | undefined;
|
|
183
|
+
author?: string | undefined;
|
|
184
|
+
sentAt?: string | undefined;
|
|
185
|
+
} | {
|
|
186
|
+
type: "person";
|
|
187
|
+
email?: string | undefined;
|
|
188
|
+
slackHandle?: string | undefined;
|
|
189
|
+
githubHandle?: string | undefined;
|
|
190
|
+
avatarUrl?: string | undefined;
|
|
157
191
|
} | undefined;
|
|
158
192
|
}[] | undefined;
|
|
159
193
|
reply?: {
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import type { PluginToolDefinition, ToolRegistrationHookContext } from "@sentry/junior-plugin-api";
|
|
2
2
|
import type { GitHubPullRequestSubscriptionConfig } from "./events/pull-request.js";
|
|
3
|
+
/** Opt-ins for GitHub plugin behavior that is still being tested. */
|
|
4
|
+
export interface GitHubPluginExperiments {
|
|
5
|
+
/**
|
|
6
|
+
* Check pull request descriptions with the decision model before a create
|
|
7
|
+
* or update, and reject ones with check results, a work log, chat talk, or
|
|
8
|
+
* no reason.
|
|
9
|
+
*/
|
|
10
|
+
pullRequestDescriptionChecks?: boolean;
|
|
11
|
+
}
|
|
3
12
|
/** Build the GitHub plugin's runtime tools from their per-tool modules. */
|
|
4
|
-
export declare function createGitHubTools(ctx: ToolRegistrationHookContext, botEmail?: string, pullRequestSubscription?: GitHubPullRequestSubscriptionConfig): Record<string, PluginToolDefinition>;
|
|
13
|
+
export declare function createGitHubTools(ctx: ToolRegistrationHookContext, botEmail?: string, pullRequestSubscription?: GitHubPullRequestSubscriptionConfig, experimental?: GitHubPluginExperiments): Record<string, PluginToolDefinition>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GitHub check suite events.
|
|
3
3
|
*/
|
|
4
|
-
import type { EventInput } from "@sentry/junior-plugin-api";
|
|
4
|
+
import type { EventInput, PluginLogger } from "@sentry/junior-plugin-api";
|
|
5
5
|
import type { GitHubStatusIncident } from "../github-status.js";
|
|
6
6
|
export type GitHubFailingCheck = {
|
|
7
7
|
checkRunId: number;
|
|
@@ -89,8 +89,6 @@ export declare function loadCheckSuiteFacts(args: {
|
|
|
89
89
|
/** Open or recent githubstatus.com incidents, shared through a cache. */
|
|
90
90
|
loadGitHubIncidents?(): Promise<GitHubStatusIncident[]>;
|
|
91
91
|
loadPullRequestFacts?: boolean;
|
|
92
|
-
log?:
|
|
93
|
-
error(message: string, metadata?: Record<string, unknown>): void;
|
|
94
|
-
};
|
|
92
|
+
log?: Pick<PluginLogger, "error" | "warn">;
|
|
95
93
|
privateKeyEnv: string;
|
|
96
94
|
}): Promise<GitHubCheckSuiteFacts | undefined>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logging for optional webhook work that fails open.
|
|
3
|
+
*/
|
|
4
|
+
import type { PluginLogger } from "@sentry/junior-plugin-api";
|
|
5
|
+
/**
|
|
6
|
+
* Log a failure of optional webhook work. A GitHub 5xx is a GitHub outage,
|
|
7
|
+
* not a Junior bug, so it is a warning with the HTTP status. Other failures
|
|
8
|
+
* stay errors.
|
|
9
|
+
*/
|
|
10
|
+
export declare function logFailOpenFailure(log: Pick<PluginLogger, "error" | "warn"> | undefined, message: string, error: unknown, metadata: Record<string, unknown>): void;
|
|
@@ -44,7 +44,7 @@ export declare function createGitHubWebhookRoute(args: {
|
|
|
44
44
|
loadRepositoryRole?(target: GitHubRoleTarget): Promise<string>;
|
|
45
45
|
/** Linked GitHub login of the user of one Junior identity, if any. */
|
|
46
46
|
loadGitHubLogin?(identityId: string): Promise<string | undefined>;
|
|
47
|
-
log?: Pick<PluginLogger, "error">;
|
|
47
|
+
log?: Pick<PluginLogger, "error" | "warn">;
|
|
48
48
|
markFeedbackReviewing(input: FeedbackTarget): Promise<void>;
|
|
49
49
|
privateKeyEnv: string;
|
|
50
50
|
events: EventPublisher;
|
|
@@ -21,13 +21,18 @@ export declare function loadPullRequest(env: GitHubInstallationEnv, pullRequest:
|
|
|
21
21
|
number: number;
|
|
22
22
|
repositoryFullName: string;
|
|
23
23
|
}): Promise<unknown>;
|
|
24
|
+
/** GitHub cannot reach a repository: it is gone, or the installation lost it. */
|
|
25
|
+
export declare class GitHubRepositoryUnreachableError extends Error {
|
|
26
|
+
constructor(repositoryId: number);
|
|
27
|
+
}
|
|
24
28
|
/**
|
|
25
29
|
* Read the lifecycle of some pull requests of one repository in one GraphQL
|
|
26
30
|
* query, with a read-only token. Each pull request has the alias `pr<index>`.
|
|
31
|
+
* The repository is found by its id, because a rename changes its name.
|
|
27
32
|
*/
|
|
28
33
|
export declare function loadPullRequestLifecycles(env: GitHubInstallationEnv, input: {
|
|
29
34
|
numbers: number[];
|
|
30
|
-
|
|
35
|
+
repositoryId: number;
|
|
31
36
|
}): Promise<unknown>;
|
|
32
37
|
/**
|
|
33
38
|
* Read one page of a repository's open pull requests by one author, with
|
|
@@ -38,6 +43,12 @@ export declare function searchOpenPullRequestMergeability(env: GitHubInstallatio
|
|
|
38
43
|
author: string;
|
|
39
44
|
repositoryFullName: string;
|
|
40
45
|
}): Promise<unknown>;
|
|
46
|
+
/** Ask people to review one pull request, with a pull request write token. */
|
|
47
|
+
export declare function requestPullRequestReviewers(env: GitHubInstallationEnv, input: {
|
|
48
|
+
number: number;
|
|
49
|
+
repositoryFullName: string;
|
|
50
|
+
reviewers: string[];
|
|
51
|
+
}): Promise<void>;
|
|
41
52
|
/** Add the "reviewing" reaction to one pull request comment or review body. */
|
|
42
53
|
export declare function markPullRequestFeedbackReviewing(env: GitHubInstallationEnv, target: {
|
|
43
54
|
commentId: number;
|
|
@@ -42,7 +42,7 @@ export declare function loadGitHubMergeConflictEvents(args: {
|
|
|
42
42
|
events: EventInput[];
|
|
43
43
|
hasMatch: EventPublisher["hasMatch"];
|
|
44
44
|
loadPullRequest?(ref: GitHubPullRequestRef): Promise<unknown>;
|
|
45
|
-
log?: Pick<PluginLogger, "error">;
|
|
45
|
+
log?: Pick<PluginLogger, "error" | "warn">;
|
|
46
46
|
/** The body of a `pull_request` webhook. */
|
|
47
47
|
pullRequestPayload?: unknown;
|
|
48
48
|
}): Promise<EventInput[]>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PluginConversationAnnotations, PluginLogger } from "@sentry/junior-plugin-api";
|
|
2
|
+
import type { GitHubDb } from "../db/database.js";
|
|
3
|
+
/**
|
|
4
|
+
* Set or clear the preview image fact on each chip of a Junior pull request
|
|
5
|
+
* from the webhook body. One failed conversation does not stop the others.
|
|
6
|
+
*/
|
|
7
|
+
export declare function refreshGitHubPullRequestPreview(args: {
|
|
8
|
+
annotations: PluginConversationAnnotations;
|
|
9
|
+
body: unknown;
|
|
10
|
+
db: GitHubDb;
|
|
11
|
+
log?: Pick<PluginLogger, "error">;
|
|
12
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The review request for a Junior draft pull request when it becomes ready.
|
|
3
|
+
*
|
|
4
|
+
* Junior asks for no review while a pull request is a draft. When GitHub
|
|
5
|
+
* marks the draft ready for review, Junior asks the reviewers that the person
|
|
6
|
+
* named, or else the requester's linked GitHub account.
|
|
7
|
+
*/
|
|
8
|
+
import type { PluginLogger, PluginState } from "@sentry/junior-plugin-api";
|
|
9
|
+
import type { GitHubDb } from "../db/database.js";
|
|
10
|
+
import { type GitHubInstallationEnv } from "./installation-requests.js";
|
|
11
|
+
/**
|
|
12
|
+
* Ask for the review of a Junior pull request that GitHub marked ready for
|
|
13
|
+
* review. The request is optional, so a failure is logged and does not fail
|
|
14
|
+
* the delivery.
|
|
15
|
+
*/
|
|
16
|
+
export declare function requestGitHubReviewersWhenReady(args: {
|
|
17
|
+
body: unknown;
|
|
18
|
+
db: GitHubDb;
|
|
19
|
+
deliveryId: string;
|
|
20
|
+
env: GitHubInstallationEnv;
|
|
21
|
+
eventName: string;
|
|
22
|
+
loadGitHubLogin?(identityId: string): Promise<string | undefined>;
|
|
23
|
+
log?: Pick<PluginLogger, "warn">;
|
|
24
|
+
state: PluginState;
|
|
25
|
+
}): Promise<void>;
|
|
@@ -25,7 +25,7 @@ export declare function syncGitHubPullRequestReadyNotices(args: {
|
|
|
25
25
|
db: GitHubDb;
|
|
26
26
|
deliveryId: string;
|
|
27
27
|
env: GitHubInstallationEnv;
|
|
28
|
-
log?: Pick<PluginLogger, "error">;
|
|
28
|
+
log?: Pick<PluginLogger, "error" | "warn">;
|
|
29
29
|
reviewItems: PluginConversationReviewItems;
|
|
30
30
|
targets: GitHubPullRequestTarget[];
|
|
31
31
|
}): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "junior_github_pull_requests" ADD COLUMN "draft" boolean DEFAULT false NOT NULL;
|