@sentry/junior-github 0.298.0 → 0.300.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.
Files changed (49) hide show
  1. package/dist/{chunk-OK6BNAGC.js → chunk-YUF5P5I7.js} +50 -20
  2. package/dist/credential-support.d.ts +7 -0
  3. package/dist/db/schema.d.ts +34 -0
  4. package/dist/events/pull-request.d.ts +8 -2
  5. package/dist/graphql-documents.d.ts +31 -0
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +1532 -785
  8. package/dist/object-facts.d.ts +16 -1
  9. package/dist/plugin.d.ts +3 -0
  10. package/dist/pull-request-outcomes/apply.d.ts +3 -1
  11. package/dist/pull-request-outcomes/reconcile.d.ts +10 -5
  12. package/dist/pull-request-outcomes/store.d.ts +5 -0
  13. package/dist/pull-request-requesters/draft-reviewers.d.ts +15 -0
  14. package/dist/testing.js +1 -1
  15. package/dist/tool-support/attribution.d.ts +4 -2
  16. package/dist/tool-support/pull-request-description.d.ts +8 -0
  17. package/dist/tools/clone-repository.d.ts +70 -2
  18. package/dist/tools/comment-on-issue.d.ts +70 -2
  19. package/dist/tools/comment-on-pull-request.d.ts +70 -2
  20. package/dist/tools/create-issue.d.ts +70 -2
  21. package/dist/tools/create-pull-request.d.ts +75 -4
  22. package/dist/tools/get-deployment.d.ts +70 -2
  23. package/dist/tools/get-issue.d.ts +70 -2
  24. package/dist/tools/get-pull-request.d.ts +90 -2
  25. package/dist/tools/get-release.d.ts +70 -2
  26. package/dist/tools/get-repository.d.ts +70 -2
  27. package/dist/tools/get-status.d.ts +70 -2
  28. package/dist/tools/react-to-issue.d.ts +70 -2
  29. package/dist/tools/resolve-pull-request-review-thread.d.ts +70 -2
  30. package/dist/tools/submit-pull-request-review.d.ts +70 -2
  31. package/dist/tools/update-issue-comment.d.ts +70 -2
  32. package/dist/tools/update-issue.d.ts +70 -2
  33. package/dist/tools/update-pull-request-feedback.d.ts +70 -4
  34. package/dist/tools/update-pull-request.d.ts +74 -4
  35. package/dist/tools.d.ts +10 -1
  36. package/dist/webhooks/check-suite.d.ts +2 -4
  37. package/dist/webhooks/fail-open-log.d.ts +10 -0
  38. package/dist/webhooks/handler.d.ts +1 -1
  39. package/dist/webhooks/installation-requests.d.ts +12 -1
  40. package/dist/webhooks/merge-conflict.d.ts +1 -1
  41. package/dist/webhooks/pull-request-preview.d.ts +12 -0
  42. package/dist/webhooks/pull-request-ready-reviewers.d.ts +25 -0
  43. package/dist/webhooks/pull-request-ready.d.ts +1 -1
  44. package/migrations/0011_pull_request_draft.sql +1 -0
  45. package/migrations/meta/0011_snapshot.json +434 -0
  46. package/migrations/meta/_journal.json +7 -0
  47. package/package.json +7 -4
  48. package/skills/github-code/SKILL.md +1 -1
  49. package/skills/github-code/SPEC.md +1 -1
@@ -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" | "document" | "item" | "message" | "person" | "task" | "web_page";
37
37
  title: string;
38
38
  url: string | null;
39
39
  description?: string | undefined;
@@ -44,6 +44,7 @@ export declare function createGitHubUpdateIssueTool(ctx: {
44
44
  sourceUpdatedAt?: string | undefined;
45
45
  facts?: {
46
46
  type: "code_change";
47
+ summary?: string | undefined;
47
48
  author?: string | undefined;
48
49
  sourceBranch?: string | undefined;
49
50
  targetBranch?: string | undefined;
@@ -58,8 +59,10 @@ export declare function createGitHubUpdateIssueTool(ctx: {
58
59
  changedFiles?: number | undefined;
59
60
  additions?: number | undefined;
60
61
  deletions?: number | undefined;
62
+ previewImageUrls?: string[] | undefined;
61
63
  } | {
62
64
  type: "task";
65
+ summary?: string | undefined;
63
66
  assignees?: string[] | undefined;
64
67
  priority?: string | undefined;
65
68
  project?: string | undefined;
@@ -68,14 +71,45 @@ export declare function createGitHubUpdateIssueTool(ctx: {
68
71
  labels?: string[] | undefined;
69
72
  } | {
70
73
  type: "deployment";
74
+ summary?: string | undefined;
71
75
  project?: string | undefined;
72
76
  environment?: string | undefined;
73
77
  revision?: string | undefined;
74
78
  branch?: string | undefined;
75
79
  } | {
76
80
  type: "calendar_event";
81
+ summary?: string | undefined;
77
82
  when?: string | undefined;
78
83
  attendees?: string[] | undefined;
84
+ } | {
85
+ type: "conversation";
86
+ summary?: string | undefined;
87
+ participants?: string[] | undefined;
88
+ lastActivityAt?: string | undefined;
89
+ } | {
90
+ type: "document";
91
+ summary?: string | undefined;
92
+ owner?: string | undefined;
93
+ modifiedAt?: string | undefined;
94
+ } | {
95
+ type: "message";
96
+ summary?: string | undefined;
97
+ channel?: string | undefined;
98
+ author?: string | undefined;
99
+ sentAt?: string | undefined;
100
+ } | {
101
+ type: "web_page";
102
+ summary?: string | undefined;
103
+ siteName?: string | undefined;
104
+ author?: string | undefined;
105
+ thumbnailUrl?: string | undefined;
106
+ } | {
107
+ type: "person";
108
+ summary?: string | undefined;
109
+ email?: string | undefined;
110
+ slackHandle?: string | undefined;
111
+ githubHandle?: string | undefined;
112
+ avatarUrl?: string | undefined;
79
113
  } | undefined;
80
114
  }[] | undefined;
81
115
  reply?: {
@@ -108,7 +142,7 @@ export declare function createGitHubUpdateIssueTool(ctx: {
108
142
  kind: "object";
109
143
  key: string;
110
144
  label: string;
111
- objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
145
+ objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
112
146
  title: string;
113
147
  url: string | null;
114
148
  description?: string | undefined;
@@ -119,6 +153,7 @@ export declare function createGitHubUpdateIssueTool(ctx: {
119
153
  sourceUpdatedAt?: string | undefined;
120
154
  facts?: {
121
155
  type: "code_change";
156
+ summary?: string | undefined;
122
157
  author?: string | undefined;
123
158
  sourceBranch?: string | undefined;
124
159
  targetBranch?: string | undefined;
@@ -133,8 +168,10 @@ export declare function createGitHubUpdateIssueTool(ctx: {
133
168
  changedFiles?: number | undefined;
134
169
  additions?: number | undefined;
135
170
  deletions?: number | undefined;
171
+ previewImageUrls?: string[] | undefined;
136
172
  } | {
137
173
  type: "task";
174
+ summary?: string | undefined;
138
175
  assignees?: string[] | undefined;
139
176
  priority?: string | undefined;
140
177
  project?: string | undefined;
@@ -143,14 +180,45 @@ export declare function createGitHubUpdateIssueTool(ctx: {
143
180
  labels?: string[] | undefined;
144
181
  } | {
145
182
  type: "deployment";
183
+ summary?: string | undefined;
146
184
  project?: string | undefined;
147
185
  environment?: string | undefined;
148
186
  revision?: string | undefined;
149
187
  branch?: string | undefined;
150
188
  } | {
151
189
  type: "calendar_event";
190
+ summary?: string | undefined;
152
191
  when?: string | undefined;
153
192
  attendees?: string[] | undefined;
193
+ } | {
194
+ type: "conversation";
195
+ summary?: string | undefined;
196
+ participants?: string[] | undefined;
197
+ lastActivityAt?: string | undefined;
198
+ } | {
199
+ type: "document";
200
+ summary?: string | undefined;
201
+ owner?: string | undefined;
202
+ modifiedAt?: string | undefined;
203
+ } | {
204
+ type: "message";
205
+ summary?: string | undefined;
206
+ channel?: string | undefined;
207
+ author?: string | undefined;
208
+ sentAt?: string | undefined;
209
+ } | {
210
+ type: "web_page";
211
+ summary?: string | undefined;
212
+ siteName?: string | undefined;
213
+ author?: string | undefined;
214
+ thumbnailUrl?: string | undefined;
215
+ } | {
216
+ type: "person";
217
+ summary?: string | undefined;
218
+ email?: string | undefined;
219
+ slackHandle?: string | undefined;
220
+ githubHandle?: string | undefined;
221
+ avatarUrl?: string | undefined;
154
222
  } | undefined;
155
223
  }[] | undefined;
156
224
  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" | "document" | "item" | "message" | "person" | "task" | "web_page";
54
52
  title: string;
55
53
  url: string | null;
56
54
  description?: string | undefined;
@@ -61,6 +59,7 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
61
59
  sourceUpdatedAt?: string | undefined;
62
60
  facts?: {
63
61
  type: "code_change";
62
+ summary?: string | undefined;
64
63
  author?: string | undefined;
65
64
  sourceBranch?: string | undefined;
66
65
  targetBranch?: string | undefined;
@@ -75,8 +74,10 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
75
74
  changedFiles?: number | undefined;
76
75
  additions?: number | undefined;
77
76
  deletions?: number | undefined;
77
+ previewImageUrls?: string[] | undefined;
78
78
  } | {
79
79
  type: "task";
80
+ summary?: string | undefined;
80
81
  assignees?: string[] | undefined;
81
82
  priority?: string | undefined;
82
83
  project?: string | undefined;
@@ -85,14 +86,45 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
85
86
  labels?: string[] | undefined;
86
87
  } | {
87
88
  type: "deployment";
89
+ summary?: string | undefined;
88
90
  project?: string | undefined;
89
91
  environment?: string | undefined;
90
92
  revision?: string | undefined;
91
93
  branch?: string | undefined;
92
94
  } | {
93
95
  type: "calendar_event";
96
+ summary?: string | undefined;
94
97
  when?: string | undefined;
95
98
  attendees?: string[] | undefined;
99
+ } | {
100
+ type: "conversation";
101
+ summary?: string | undefined;
102
+ participants?: string[] | undefined;
103
+ lastActivityAt?: string | undefined;
104
+ } | {
105
+ type: "document";
106
+ summary?: string | undefined;
107
+ owner?: string | undefined;
108
+ modifiedAt?: string | undefined;
109
+ } | {
110
+ type: "message";
111
+ summary?: string | undefined;
112
+ channel?: string | undefined;
113
+ author?: string | undefined;
114
+ sentAt?: string | undefined;
115
+ } | {
116
+ type: "web_page";
117
+ summary?: string | undefined;
118
+ siteName?: string | undefined;
119
+ author?: string | undefined;
120
+ thumbnailUrl?: string | undefined;
121
+ } | {
122
+ type: "person";
123
+ summary?: string | undefined;
124
+ email?: string | undefined;
125
+ slackHandle?: string | undefined;
126
+ githubHandle?: string | undefined;
127
+ avatarUrl?: string | undefined;
96
128
  } | undefined;
97
129
  }[] | undefined;
98
130
  reply?: {
@@ -114,7 +146,7 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
114
146
  kind: "object";
115
147
  key: string;
116
148
  label: string;
117
- objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
149
+ objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
118
150
  title: string;
119
151
  url: string | null;
120
152
  description?: string | undefined;
@@ -125,6 +157,7 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
125
157
  sourceUpdatedAt?: string | undefined;
126
158
  facts?: {
127
159
  type: "code_change";
160
+ summary?: string | undefined;
128
161
  author?: string | undefined;
129
162
  sourceBranch?: string | undefined;
130
163
  targetBranch?: string | undefined;
@@ -139,8 +172,10 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
139
172
  changedFiles?: number | undefined;
140
173
  additions?: number | undefined;
141
174
  deletions?: number | undefined;
175
+ previewImageUrls?: string[] | undefined;
142
176
  } | {
143
177
  type: "task";
178
+ summary?: string | undefined;
144
179
  assignees?: string[] | undefined;
145
180
  priority?: string | undefined;
146
181
  project?: string | undefined;
@@ -149,14 +184,45 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
149
184
  labels?: string[] | undefined;
150
185
  } | {
151
186
  type: "deployment";
187
+ summary?: string | undefined;
152
188
  project?: string | undefined;
153
189
  environment?: string | undefined;
154
190
  revision?: string | undefined;
155
191
  branch?: string | undefined;
156
192
  } | {
157
193
  type: "calendar_event";
194
+ summary?: string | undefined;
158
195
  when?: string | undefined;
159
196
  attendees?: string[] | undefined;
197
+ } | {
198
+ type: "conversation";
199
+ summary?: string | undefined;
200
+ participants?: string[] | undefined;
201
+ lastActivityAt?: string | undefined;
202
+ } | {
203
+ type: "document";
204
+ summary?: string | undefined;
205
+ owner?: string | undefined;
206
+ modifiedAt?: string | undefined;
207
+ } | {
208
+ type: "message";
209
+ summary?: string | undefined;
210
+ channel?: string | undefined;
211
+ author?: string | undefined;
212
+ sentAt?: string | undefined;
213
+ } | {
214
+ type: "web_page";
215
+ summary?: string | undefined;
216
+ siteName?: string | undefined;
217
+ author?: string | undefined;
218
+ thumbnailUrl?: string | undefined;
219
+ } | {
220
+ type: "person";
221
+ summary?: string | undefined;
222
+ email?: string | undefined;
223
+ slackHandle?: string | undefined;
224
+ githubHandle?: string | undefined;
225
+ avatarUrl?: string | undefined;
160
226
  } | undefined;
161
227
  }[] | undefined;
162
228
  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
- }): import("@sentry/junior-plugin-api").PluginToolDefinition<{
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" | "document" | "item" | "message" | "person" | "task" | "web_page";
39
41
  title: string;
40
42
  url: string | null;
41
43
  description?: string | undefined;
@@ -46,6 +48,7 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
46
48
  sourceUpdatedAt?: string | undefined;
47
49
  facts?: {
48
50
  type: "code_change";
51
+ summary?: string | undefined;
49
52
  author?: string | undefined;
50
53
  sourceBranch?: string | undefined;
51
54
  targetBranch?: string | undefined;
@@ -60,8 +63,10 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
60
63
  changedFiles?: number | undefined;
61
64
  additions?: number | undefined;
62
65
  deletions?: number | undefined;
66
+ previewImageUrls?: string[] | undefined;
63
67
  } | {
64
68
  type: "task";
69
+ summary?: string | undefined;
65
70
  assignees?: string[] | undefined;
66
71
  priority?: string | undefined;
67
72
  project?: string | undefined;
@@ -70,14 +75,45 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
70
75
  labels?: string[] | undefined;
71
76
  } | {
72
77
  type: "deployment";
78
+ summary?: string | undefined;
73
79
  project?: string | undefined;
74
80
  environment?: string | undefined;
75
81
  revision?: string | undefined;
76
82
  branch?: string | undefined;
77
83
  } | {
78
84
  type: "calendar_event";
85
+ summary?: string | undefined;
79
86
  when?: string | undefined;
80
87
  attendees?: string[] | undefined;
88
+ } | {
89
+ type: "conversation";
90
+ summary?: string | undefined;
91
+ participants?: string[] | undefined;
92
+ lastActivityAt?: string | undefined;
93
+ } | {
94
+ type: "document";
95
+ summary?: string | undefined;
96
+ owner?: string | undefined;
97
+ modifiedAt?: string | undefined;
98
+ } | {
99
+ type: "message";
100
+ summary?: string | undefined;
101
+ channel?: string | undefined;
102
+ author?: string | undefined;
103
+ sentAt?: string | undefined;
104
+ } | {
105
+ type: "web_page";
106
+ summary?: string | undefined;
107
+ siteName?: string | undefined;
108
+ author?: string | undefined;
109
+ thumbnailUrl?: string | undefined;
110
+ } | {
111
+ type: "person";
112
+ summary?: string | undefined;
113
+ email?: string | undefined;
114
+ slackHandle?: string | undefined;
115
+ githubHandle?: string | undefined;
116
+ avatarUrl?: string | undefined;
81
117
  } | undefined;
82
118
  }[] | undefined;
83
119
  reply?: {
@@ -111,7 +147,7 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
111
147
  kind: "object";
112
148
  key: string;
113
149
  label: string;
114
- objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
150
+ objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
115
151
  title: string;
116
152
  url: string | null;
117
153
  description?: string | undefined;
@@ -122,6 +158,7 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
122
158
  sourceUpdatedAt?: string | undefined;
123
159
  facts?: {
124
160
  type: "code_change";
161
+ summary?: string | undefined;
125
162
  author?: string | undefined;
126
163
  sourceBranch?: string | undefined;
127
164
  targetBranch?: string | undefined;
@@ -136,8 +173,10 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
136
173
  changedFiles?: number | undefined;
137
174
  additions?: number | undefined;
138
175
  deletions?: number | undefined;
176
+ previewImageUrls?: string[] | undefined;
139
177
  } | {
140
178
  type: "task";
179
+ summary?: string | undefined;
141
180
  assignees?: string[] | undefined;
142
181
  priority?: string | undefined;
143
182
  project?: string | undefined;
@@ -146,14 +185,45 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
146
185
  labels?: string[] | undefined;
147
186
  } | {
148
187
  type: "deployment";
188
+ summary?: string | undefined;
149
189
  project?: string | undefined;
150
190
  environment?: string | undefined;
151
191
  revision?: string | undefined;
152
192
  branch?: string | undefined;
153
193
  } | {
154
194
  type: "calendar_event";
195
+ summary?: string | undefined;
155
196
  when?: string | undefined;
156
197
  attendees?: string[] | undefined;
198
+ } | {
199
+ type: "conversation";
200
+ summary?: string | undefined;
201
+ participants?: string[] | undefined;
202
+ lastActivityAt?: string | undefined;
203
+ } | {
204
+ type: "document";
205
+ summary?: string | undefined;
206
+ owner?: string | undefined;
207
+ modifiedAt?: string | undefined;
208
+ } | {
209
+ type: "message";
210
+ summary?: string | undefined;
211
+ channel?: string | undefined;
212
+ author?: string | undefined;
213
+ sentAt?: string | undefined;
214
+ } | {
215
+ type: "web_page";
216
+ summary?: string | undefined;
217
+ siteName?: string | undefined;
218
+ author?: string | undefined;
219
+ thumbnailUrl?: string | undefined;
220
+ } | {
221
+ type: "person";
222
+ summary?: string | undefined;
223
+ email?: string | undefined;
224
+ slackHandle?: string | undefined;
225
+ githubHandle?: string | undefined;
226
+ avatarUrl?: string | undefined;
157
227
  } | undefined;
158
228
  }[] | undefined;
159
229
  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
- repositoryFullName: string;
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;