@sentry/junior-github 0.275.0 → 0.277.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-EALXNZGU.js → chunk-IR7D5MR7.js} +45 -19
- package/dist/events/resource-url.d.ts +5 -0
- package/dist/github-status.d.ts +16 -0
- package/dist/index.js +743 -476
- package/dist/pull-request-outcomes/store.d.ts +7 -2
- package/dist/testing.js +1 -1
- package/dist/tools/clone-repository.d.ts +1 -1
- package/dist/tools/create-issue.d.ts +4 -4
- package/dist/tools/create-pull-request.d.ts +12 -4
- package/dist/tools/get-deployment.d.ts +19 -19
- package/dist/tools/get-pull-request.d.ts +6 -6
- package/dist/tools/get-release.d.ts +14 -14
- package/dist/tools/get-repository.d.ts +8 -8
- package/dist/tools/get-status.d.ts +137 -0
- package/dist/tools/resolve-pull-request-review-thread.d.ts +3 -3
- package/dist/tools/stack-pull-request.d.ts +42 -0
- package/dist/tools/submit-pull-request-review.d.ts +4 -4
- package/dist/tools/update-issue.d.ts +4 -4
- package/dist/tools/update-pull-request-feedback.d.ts +6 -6
- package/dist/tools/update-pull-request.d.ts +4 -4
- package/dist/webhooks/check-suite.d.ts +6 -0
- package/dist/webhooks/handler.d.ts +3 -0
- package/package.json +2 -2
- package/skills/github-code/SKILL.md +5 -5
- package/skills/github-code/SPEC.md +1 -0
- package/skills/github-code/references/api-surface.md +1 -1
- package/skills/github-code/references/troubleshooting-workarounds.md +15 -1
- package/skills/github-code/references/workflow.md +5 -3
- package/skills/github-issues/references/troubleshooting-workarounds.md +1 -1
|
@@ -47,9 +47,14 @@ export declare function recordGitHubPullRequestOutcome(db: GitHubDb, input: GitH
|
|
|
47
47
|
commitComposition: GitHubPullRequestCommitComposition | undefined;
|
|
48
48
|
conversationIds: string[];
|
|
49
49
|
}>;
|
|
50
|
-
/** Return candidate conversations that have an associated
|
|
50
|
+
/** Return candidate conversations that have an associated open pull request. */
|
|
51
51
|
export declare function listGitHubUnfinishedWork(db: GitHubDb, conversationIds: string[]): Promise<string[]>;
|
|
52
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Return the latest merge or close time for each candidate conversation.
|
|
54
|
+
* A closed pull request is finished even when it did not merge. A
|
|
55
|
+
* conversation with an open pull request is still unfinished; the caller
|
|
56
|
+
* combines this with `listGitHubUnfinishedWork`.
|
|
57
|
+
*/
|
|
53
58
|
export declare function listGitHubFinishedWork(db: GitHubDb, conversationIds: string[]): Promise<Record<string, string>>;
|
|
54
59
|
/** Return candidate conversations linked to any Junior-owned pull request. */
|
|
55
60
|
export declare function listGitHubAssignedWork(db: GitHubDb, conversationIds: string[]): Promise<string[]>;
|
package/dist/testing.js
CHANGED
|
@@ -7,7 +7,7 @@ export declare function createGitHubCloneRepositoryTool(ctx: {
|
|
|
7
7
|
}): import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
8
8
|
repo: string;
|
|
9
9
|
directory?: string | undefined;
|
|
10
|
-
|
|
10
|
+
allow_ad_hoc?: boolean | undefined;
|
|
11
11
|
}, {
|
|
12
12
|
objectAnnotations?: {
|
|
13
13
|
kind: "object";
|
|
@@ -66,8 +66,8 @@ export declare function createGitHubIssueTool(ctx: ToolRegistrationHookContext):
|
|
|
66
66
|
label: string;
|
|
67
67
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
68
68
|
namespace: string;
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
suggested_events?: string[] | undefined;
|
|
70
|
+
supported_events: string[];
|
|
71
71
|
type: string;
|
|
72
72
|
} | undefined;
|
|
73
73
|
url: string;
|
|
@@ -133,8 +133,8 @@ export declare function createGitHubIssueTool(ctx: ToolRegistrationHookContext):
|
|
|
133
133
|
label: string;
|
|
134
134
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
135
135
|
namespace: string;
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
suggested_events?: string[] | undefined;
|
|
137
|
+
supported_events: string[];
|
|
138
138
|
type: string;
|
|
139
139
|
} | undefined;
|
|
140
140
|
url: string;
|
|
@@ -65,13 +65,17 @@ export declare function createGitHubPullRequestTool(ctx: ToolRegistrationHookCon
|
|
|
65
65
|
} | undefined;
|
|
66
66
|
number: number;
|
|
67
67
|
url: string;
|
|
68
|
+
stack?: {
|
|
69
|
+
number: number;
|
|
70
|
+
pull_requests: number[];
|
|
71
|
+
} | undefined;
|
|
68
72
|
subscribable?: {
|
|
69
73
|
identifier: string;
|
|
70
74
|
label: string;
|
|
71
75
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
72
76
|
namespace: string;
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
suggested_events?: string[] | undefined;
|
|
78
|
+
supported_events: string[];
|
|
75
79
|
type: string;
|
|
76
80
|
} | undefined;
|
|
77
81
|
subscription?: {
|
|
@@ -136,13 +140,17 @@ export declare function createGitHubPullRequestTool(ctx: ToolRegistrationHookCon
|
|
|
136
140
|
} | undefined;
|
|
137
141
|
number: number;
|
|
138
142
|
url: string;
|
|
143
|
+
stack?: {
|
|
144
|
+
number: number;
|
|
145
|
+
pull_requests: number[];
|
|
146
|
+
} | undefined;
|
|
139
147
|
subscribable?: {
|
|
140
148
|
identifier: string;
|
|
141
149
|
label: string;
|
|
142
150
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
143
151
|
namespace: string;
|
|
144
|
-
|
|
145
|
-
|
|
152
|
+
suggested_events?: string[] | undefined;
|
|
153
|
+
supported_events: string[];
|
|
146
154
|
type: string;
|
|
147
155
|
} | undefined;
|
|
148
156
|
subscription?: {
|
|
@@ -7,7 +7,7 @@ export declare function createGitHubGetDeploymentTool(ctx: {
|
|
|
7
7
|
};
|
|
8
8
|
}): import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
9
9
|
repo: string;
|
|
10
|
-
|
|
10
|
+
commit_sha: string;
|
|
11
11
|
environment?: string | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
objectAnnotations?: {
|
|
@@ -64,25 +64,25 @@ export declare function createGitHubGetDeploymentTool(ctx: {
|
|
|
64
64
|
arguments: Record<string, unknown>;
|
|
65
65
|
reason?: string | undefined;
|
|
66
66
|
} | undefined;
|
|
67
|
-
|
|
67
|
+
commit_sha: string;
|
|
68
68
|
deployment: {
|
|
69
|
-
|
|
69
|
+
created_at: string;
|
|
70
70
|
creator: string | null;
|
|
71
71
|
description: string | null;
|
|
72
72
|
environment: string;
|
|
73
73
|
id: number;
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
latest_status: {
|
|
75
|
+
created_at: string;
|
|
76
76
|
creator: string | null;
|
|
77
77
|
description: string | null;
|
|
78
|
-
|
|
78
|
+
environment_url: string | null;
|
|
79
79
|
id: number;
|
|
80
|
-
|
|
80
|
+
log_url: string | null;
|
|
81
81
|
state: string;
|
|
82
82
|
} | null;
|
|
83
83
|
ref: string;
|
|
84
84
|
sha: string;
|
|
85
|
-
|
|
85
|
+
updated_at: string;
|
|
86
86
|
url: string;
|
|
87
87
|
} | null;
|
|
88
88
|
environment: string | null;
|
|
@@ -92,8 +92,8 @@ export declare function createGitHubGetDeploymentTool(ctx: {
|
|
|
92
92
|
label: string;
|
|
93
93
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
94
94
|
namespace: string;
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
suggested_events?: string[] | undefined;
|
|
96
|
+
supported_events: string[];
|
|
97
97
|
type: string;
|
|
98
98
|
} | undefined;
|
|
99
99
|
target: "getDeployment";
|
|
@@ -152,25 +152,25 @@ export declare function createGitHubGetDeploymentTool(ctx: {
|
|
|
152
152
|
arguments: Record<string, unknown>;
|
|
153
153
|
reason?: string | undefined;
|
|
154
154
|
} | undefined;
|
|
155
|
-
|
|
155
|
+
commit_sha: string;
|
|
156
156
|
deployment: {
|
|
157
|
-
|
|
157
|
+
created_at: string;
|
|
158
158
|
creator: string | null;
|
|
159
159
|
description: string | null;
|
|
160
160
|
environment: string;
|
|
161
161
|
id: number;
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
latest_status: {
|
|
163
|
+
created_at: string;
|
|
164
164
|
creator: string | null;
|
|
165
165
|
description: string | null;
|
|
166
|
-
|
|
166
|
+
environment_url: string | null;
|
|
167
167
|
id: number;
|
|
168
|
-
|
|
168
|
+
log_url: string | null;
|
|
169
169
|
state: string;
|
|
170
170
|
} | null;
|
|
171
171
|
ref: string;
|
|
172
172
|
sha: string;
|
|
173
|
-
|
|
173
|
+
updated_at: string;
|
|
174
174
|
url: string;
|
|
175
175
|
} | null;
|
|
176
176
|
environment: string | null;
|
|
@@ -180,8 +180,8 @@ export declare function createGitHubGetDeploymentTool(ctx: {
|
|
|
180
180
|
label: string;
|
|
181
181
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
182
182
|
namespace: string;
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
suggested_events?: string[] | undefined;
|
|
184
|
+
supported_events: string[];
|
|
185
185
|
type: string;
|
|
186
186
|
} | undefined;
|
|
187
187
|
target: "getDeployment";
|
|
@@ -66,7 +66,7 @@ export declare function createGitHubGetPullRequestTool(ctx: {
|
|
|
66
66
|
base: string;
|
|
67
67
|
draft: boolean;
|
|
68
68
|
head: string;
|
|
69
|
-
|
|
69
|
+
head_sha: string;
|
|
70
70
|
merged: boolean;
|
|
71
71
|
number: number;
|
|
72
72
|
state: string;
|
|
@@ -75,8 +75,8 @@ export declare function createGitHubGetPullRequestTool(ctx: {
|
|
|
75
75
|
label: string;
|
|
76
76
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
77
77
|
namespace: string;
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
suggested_events?: string[] | undefined;
|
|
79
|
+
supported_events: string[];
|
|
80
80
|
type: string;
|
|
81
81
|
} | undefined;
|
|
82
82
|
title: string;
|
|
@@ -140,7 +140,7 @@ export declare function createGitHubGetPullRequestTool(ctx: {
|
|
|
140
140
|
base: string;
|
|
141
141
|
draft: boolean;
|
|
142
142
|
head: string;
|
|
143
|
-
|
|
143
|
+
head_sha: string;
|
|
144
144
|
merged: boolean;
|
|
145
145
|
number: number;
|
|
146
146
|
state: string;
|
|
@@ -149,8 +149,8 @@ export declare function createGitHubGetPullRequestTool(ctx: {
|
|
|
149
149
|
label: string;
|
|
150
150
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
151
151
|
namespace: string;
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
suggested_events?: string[] | undefined;
|
|
153
|
+
supported_events: string[];
|
|
154
154
|
type: string;
|
|
155
155
|
} | undefined;
|
|
156
156
|
title: string;
|
|
@@ -64,15 +64,15 @@ export declare function createGitHubGetReleaseTool(ctx: {
|
|
|
64
64
|
reason?: string | undefined;
|
|
65
65
|
} | undefined;
|
|
66
66
|
release: {
|
|
67
|
-
|
|
67
|
+
created_at: string;
|
|
68
68
|
draft: boolean;
|
|
69
|
-
|
|
69
|
+
html_url: string;
|
|
70
70
|
id: number;
|
|
71
71
|
name: string | null;
|
|
72
72
|
prerelease: boolean;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
published_at: string | null;
|
|
74
|
+
tag_name: string;
|
|
75
|
+
target_commitish: string;
|
|
76
76
|
} | null;
|
|
77
77
|
repo: string;
|
|
78
78
|
subscribable?: {
|
|
@@ -80,8 +80,8 @@ export declare function createGitHubGetReleaseTool(ctx: {
|
|
|
80
80
|
label: string;
|
|
81
81
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
82
82
|
namespace: string;
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
suggested_events?: string[] | undefined;
|
|
84
|
+
supported_events: string[];
|
|
85
85
|
type: string;
|
|
86
86
|
} | undefined;
|
|
87
87
|
tag: string | null;
|
|
@@ -142,15 +142,15 @@ export declare function createGitHubGetReleaseTool(ctx: {
|
|
|
142
142
|
reason?: string | undefined;
|
|
143
143
|
} | undefined;
|
|
144
144
|
release: {
|
|
145
|
-
|
|
145
|
+
created_at: string;
|
|
146
146
|
draft: boolean;
|
|
147
|
-
|
|
147
|
+
html_url: string;
|
|
148
148
|
id: number;
|
|
149
149
|
name: string | null;
|
|
150
150
|
prerelease: boolean;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
published_at: string | null;
|
|
152
|
+
tag_name: string;
|
|
153
|
+
target_commitish: string;
|
|
154
154
|
} | null;
|
|
155
155
|
repo: string;
|
|
156
156
|
subscribable?: {
|
|
@@ -158,8 +158,8 @@ export declare function createGitHubGetReleaseTool(ctx: {
|
|
|
158
158
|
label: string;
|
|
159
159
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
160
160
|
namespace: string;
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
suggested_events?: string[] | undefined;
|
|
162
|
+
supported_events: string[];
|
|
163
163
|
type: string;
|
|
164
164
|
} | undefined;
|
|
165
165
|
tag: string | null;
|
|
@@ -62,17 +62,17 @@ export declare function createGitHubGetRepositoryTool(ctx: {
|
|
|
62
62
|
arguments: Record<string, unknown>;
|
|
63
63
|
reason?: string | undefined;
|
|
64
64
|
} | undefined;
|
|
65
|
-
|
|
65
|
+
default_branch: string;
|
|
66
66
|
description: string | null;
|
|
67
|
-
|
|
67
|
+
full_name: string;
|
|
68
68
|
private: boolean;
|
|
69
69
|
subscribable?: {
|
|
70
70
|
identifier: string;
|
|
71
71
|
label: string;
|
|
72
72
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
73
73
|
namespace: string;
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
suggested_events?: string[] | undefined;
|
|
75
|
+
supported_events: string[];
|
|
76
76
|
type: string;
|
|
77
77
|
} | undefined;
|
|
78
78
|
url: string;
|
|
@@ -132,17 +132,17 @@ export declare function createGitHubGetRepositoryTool(ctx: {
|
|
|
132
132
|
arguments: Record<string, unknown>;
|
|
133
133
|
reason?: string | undefined;
|
|
134
134
|
} | undefined;
|
|
135
|
-
|
|
135
|
+
default_branch: string;
|
|
136
136
|
description: string | null;
|
|
137
|
-
|
|
137
|
+
full_name: string;
|
|
138
138
|
private: boolean;
|
|
139
139
|
subscribable?: {
|
|
140
140
|
identifier: string;
|
|
141
141
|
label: string;
|
|
142
142
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
143
143
|
namespace: string;
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
suggested_events?: string[] | undefined;
|
|
145
|
+
supported_events: string[];
|
|
146
146
|
type: string;
|
|
147
147
|
} | undefined;
|
|
148
148
|
url: string;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { type PluginCache } from "@sentry/junior-plugin-api";
|
|
2
|
+
/** Read open and recent GitHub incidents to tell outages from other failures. */
|
|
3
|
+
export declare function createGitHubGetStatusTool(ctx: {
|
|
4
|
+
cache: PluginCache;
|
|
5
|
+
}): import("@sentry/junior-plugin-api").PluginToolDefinition<Record<string, never>, {
|
|
6
|
+
[x: string]: unknown;
|
|
7
|
+
objectAnnotations?: {
|
|
8
|
+
kind: "object";
|
|
9
|
+
key: string;
|
|
10
|
+
label: string;
|
|
11
|
+
objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
|
|
12
|
+
title: string;
|
|
13
|
+
url: string | null;
|
|
14
|
+
description?: string | undefined;
|
|
15
|
+
status?: string | undefined;
|
|
16
|
+
trigger?: string | undefined;
|
|
17
|
+
warning?: string | undefined;
|
|
18
|
+
displayType?: string | undefined;
|
|
19
|
+
sourceUpdatedAt?: string | undefined;
|
|
20
|
+
facts?: {
|
|
21
|
+
type: "code_change";
|
|
22
|
+
author?: string | undefined;
|
|
23
|
+
sourceBranch?: string | undefined;
|
|
24
|
+
targetBranch?: string | undefined;
|
|
25
|
+
reviewers?: string[] | undefined;
|
|
26
|
+
review?: "approved" | "changes_requested" | "required" | undefined;
|
|
27
|
+
checks?: {
|
|
28
|
+
passed: number;
|
|
29
|
+
failed: number;
|
|
30
|
+
pending: number;
|
|
31
|
+
} | undefined;
|
|
32
|
+
mergeable?: boolean | undefined;
|
|
33
|
+
changedFiles?: number | undefined;
|
|
34
|
+
additions?: number | undefined;
|
|
35
|
+
deletions?: number | undefined;
|
|
36
|
+
} | {
|
|
37
|
+
type: "task";
|
|
38
|
+
assignees?: string[] | undefined;
|
|
39
|
+
priority?: string | undefined;
|
|
40
|
+
project?: string | undefined;
|
|
41
|
+
cycle?: string | undefined;
|
|
42
|
+
dueDate?: string | undefined;
|
|
43
|
+
labels?: string[] | undefined;
|
|
44
|
+
} | {
|
|
45
|
+
type: "deployment";
|
|
46
|
+
project?: string | undefined;
|
|
47
|
+
environment?: string | undefined;
|
|
48
|
+
revision?: string | undefined;
|
|
49
|
+
branch?: string | undefined;
|
|
50
|
+
} | {
|
|
51
|
+
type: "calendar_event";
|
|
52
|
+
when?: string | undefined;
|
|
53
|
+
attendees?: string[] | undefined;
|
|
54
|
+
} | undefined;
|
|
55
|
+
}[] | undefined;
|
|
56
|
+
truncated?: boolean | undefined;
|
|
57
|
+
continuation?: {
|
|
58
|
+
arguments: Record<string, unknown>;
|
|
59
|
+
reason?: string | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
target: "getStatus";
|
|
62
|
+
incidents: {
|
|
63
|
+
components: string[];
|
|
64
|
+
impact: string;
|
|
65
|
+
name: string;
|
|
66
|
+
resolved_at?: string | undefined;
|
|
67
|
+
started_at: string;
|
|
68
|
+
status: string;
|
|
69
|
+
url: string;
|
|
70
|
+
}[];
|
|
71
|
+
}, {
|
|
72
|
+
[x: string]: unknown;
|
|
73
|
+
objectAnnotations?: {
|
|
74
|
+
kind: "object";
|
|
75
|
+
key: string;
|
|
76
|
+
label: string;
|
|
77
|
+
objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
|
|
78
|
+
title: string;
|
|
79
|
+
url: string | null;
|
|
80
|
+
description?: string | undefined;
|
|
81
|
+
status?: string | undefined;
|
|
82
|
+
trigger?: string | undefined;
|
|
83
|
+
warning?: string | undefined;
|
|
84
|
+
displayType?: string | undefined;
|
|
85
|
+
sourceUpdatedAt?: string | undefined;
|
|
86
|
+
facts?: {
|
|
87
|
+
type: "code_change";
|
|
88
|
+
author?: string | undefined;
|
|
89
|
+
sourceBranch?: string | undefined;
|
|
90
|
+
targetBranch?: string | undefined;
|
|
91
|
+
reviewers?: string[] | undefined;
|
|
92
|
+
review?: "approved" | "changes_requested" | "required" | undefined;
|
|
93
|
+
checks?: {
|
|
94
|
+
passed: number;
|
|
95
|
+
failed: number;
|
|
96
|
+
pending: number;
|
|
97
|
+
} | undefined;
|
|
98
|
+
mergeable?: boolean | undefined;
|
|
99
|
+
changedFiles?: number | undefined;
|
|
100
|
+
additions?: number | undefined;
|
|
101
|
+
deletions?: number | undefined;
|
|
102
|
+
} | {
|
|
103
|
+
type: "task";
|
|
104
|
+
assignees?: string[] | undefined;
|
|
105
|
+
priority?: string | undefined;
|
|
106
|
+
project?: string | undefined;
|
|
107
|
+
cycle?: string | undefined;
|
|
108
|
+
dueDate?: string | undefined;
|
|
109
|
+
labels?: string[] | undefined;
|
|
110
|
+
} | {
|
|
111
|
+
type: "deployment";
|
|
112
|
+
project?: string | undefined;
|
|
113
|
+
environment?: string | undefined;
|
|
114
|
+
revision?: string | undefined;
|
|
115
|
+
branch?: string | undefined;
|
|
116
|
+
} | {
|
|
117
|
+
type: "calendar_event";
|
|
118
|
+
when?: string | undefined;
|
|
119
|
+
attendees?: string[] | undefined;
|
|
120
|
+
} | undefined;
|
|
121
|
+
}[] | undefined;
|
|
122
|
+
truncated?: boolean | undefined;
|
|
123
|
+
continuation?: {
|
|
124
|
+
arguments: Record<string, unknown>;
|
|
125
|
+
reason?: string | undefined;
|
|
126
|
+
} | undefined;
|
|
127
|
+
target: "getStatus";
|
|
128
|
+
incidents: {
|
|
129
|
+
components: string[];
|
|
130
|
+
impact: string;
|
|
131
|
+
name: string;
|
|
132
|
+
resolved_at?: string | undefined;
|
|
133
|
+
started_at: string;
|
|
134
|
+
status: string;
|
|
135
|
+
url: string;
|
|
136
|
+
}[];
|
|
137
|
+
}>;
|
|
@@ -4,7 +4,7 @@ export declare function createGitHubResolvePullRequestReviewThreadTool(ctx: {
|
|
|
4
4
|
egress: PluginEgress;
|
|
5
5
|
}, botEmail: string | undefined): import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
6
6
|
repo: string;
|
|
7
|
-
|
|
7
|
+
thread_id: string;
|
|
8
8
|
}, {
|
|
9
9
|
[x: string]: unknown;
|
|
10
10
|
objectAnnotations?: {
|
|
@@ -64,7 +64,7 @@ export declare function createGitHubResolvePullRequestReviewThreadTool(ctx: {
|
|
|
64
64
|
target: "resolvePullRequestReviewThread";
|
|
65
65
|
repo: string;
|
|
66
66
|
number: number;
|
|
67
|
-
|
|
67
|
+
thread_id: string;
|
|
68
68
|
resolved: boolean;
|
|
69
69
|
}, {
|
|
70
70
|
[x: string]: unknown;
|
|
@@ -125,6 +125,6 @@ export declare function createGitHubResolvePullRequestReviewThreadTool(ctx: {
|
|
|
125
125
|
target: "resolvePullRequestReviewThread";
|
|
126
126
|
repo: string;
|
|
127
127
|
number: number;
|
|
128
|
-
|
|
128
|
+
thread_id: string;
|
|
129
129
|
resolved: boolean;
|
|
130
130
|
}>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Link a new pull request into a GitHub stack.
|
|
3
|
+
*
|
|
4
|
+
* A pull request whose base is the head branch of another open pull request
|
|
5
|
+
* is stacked work. GitHub stacks merge as one group, rebase the next pull
|
|
6
|
+
* request after a merge, and check each pull request against the trunk. So
|
|
7
|
+
* the create tool links the pull request into a stack instead of leaving a
|
|
8
|
+
* chain of base branches.
|
|
9
|
+
*/
|
|
10
|
+
import type { ToolRegistrationHookContext } from "@sentry/junior-plugin-api";
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
/** The fields of a created pull request that decide if it is stacked work. */
|
|
13
|
+
export declare const stackTargetSchema: z.ZodObject<{
|
|
14
|
+
number: z.ZodNumber;
|
|
15
|
+
head: z.ZodObject<{
|
|
16
|
+
repo: z.ZodNullable<z.ZodObject<{
|
|
17
|
+
full_name: z.ZodString;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
base: z.ZodObject<{
|
|
21
|
+
ref: z.ZodString;
|
|
22
|
+
repo: z.ZodObject<{
|
|
23
|
+
default_branch: z.ZodString;
|
|
24
|
+
full_name: z.ZodString;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type GitHubStackTarget = z.infer<typeof stackTargetSchema>;
|
|
29
|
+
/** The stack that a created pull request joined. */
|
|
30
|
+
export interface GitHubPullRequestStack {
|
|
31
|
+
number: number;
|
|
32
|
+
pull_requests: number[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Link a created pull request into a GitHub stack when its base is the head
|
|
36
|
+
* branch of another open pull request. Add it to the stack of that pull
|
|
37
|
+
* request when that one is on top, or create a stack from the chain of base
|
|
38
|
+
* branches down to the trunk. Return the stack, or nothing when the pull
|
|
39
|
+
* request is not stacked work or GitHub cannot stack it. Stacking is
|
|
40
|
+
* optional, so failures never fail pull request creation.
|
|
41
|
+
*/
|
|
42
|
+
export declare function stackGitHubPullRequest(ctx: ToolRegistrationHookContext, target: GitHubStackTarget): Promise<GitHubPullRequestStack | undefined>;
|
|
@@ -10,8 +10,8 @@ export declare function createGitHubSubmitPullRequestReviewTool(egress: PluginEg
|
|
|
10
10
|
body: string;
|
|
11
11
|
line: number;
|
|
12
12
|
side: "LEFT" | "RIGHT";
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
start_line?: number | undefined;
|
|
14
|
+
start_side?: "LEFT" | "RIGHT" | undefined;
|
|
15
15
|
}[] | undefined;
|
|
16
16
|
}, {
|
|
17
17
|
[x: string]: unknown;
|
|
@@ -72,7 +72,7 @@ export declare function createGitHubSubmitPullRequestReviewTool(egress: PluginEg
|
|
|
72
72
|
target: "submitPullRequestReview";
|
|
73
73
|
repo: string;
|
|
74
74
|
number: number;
|
|
75
|
-
|
|
75
|
+
review_id: number;
|
|
76
76
|
state: string;
|
|
77
77
|
url: string;
|
|
78
78
|
}, {
|
|
@@ -134,7 +134,7 @@ export declare function createGitHubSubmitPullRequestReviewTool(egress: PluginEg
|
|
|
134
134
|
target: "submitPullRequestReview";
|
|
135
135
|
repo: string;
|
|
136
136
|
number: number;
|
|
137
|
-
|
|
137
|
+
review_id: number;
|
|
138
138
|
state: string;
|
|
139
139
|
url: string;
|
|
140
140
|
}>;
|
|
@@ -92,8 +92,8 @@ export declare function createGitHubUpdateIssueTool(ctx: {
|
|
|
92
92
|
label: string;
|
|
93
93
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
94
94
|
namespace: string;
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
suggested_events?: string[] | undefined;
|
|
96
|
+
supported_events: string[];
|
|
97
97
|
type: string;
|
|
98
98
|
} | undefined;
|
|
99
99
|
title: string;
|
|
@@ -162,8 +162,8 @@ export declare function createGitHubUpdateIssueTool(ctx: {
|
|
|
162
162
|
label: string;
|
|
163
163
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
164
164
|
namespace: string;
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
suggested_events?: string[] | undefined;
|
|
166
|
+
supported_events: string[];
|
|
167
167
|
type: string;
|
|
168
168
|
} | undefined;
|
|
169
169
|
title: string;
|
|
@@ -29,8 +29,8 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
|
|
|
29
29
|
egress: PluginEgress;
|
|
30
30
|
}, botEmail: string | undefined): import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
31
31
|
repo: string;
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
comment_kind: "conversation" | "review";
|
|
33
|
+
comment_id: number;
|
|
34
34
|
status: "addressed" | "declined";
|
|
35
35
|
}, {
|
|
36
36
|
[x: string]: unknown;
|
|
@@ -90,9 +90,9 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
|
|
|
90
90
|
} | undefined;
|
|
91
91
|
target: "updatePullRequestFeedback";
|
|
92
92
|
repo: string;
|
|
93
|
-
|
|
93
|
+
comment_id: number;
|
|
94
94
|
status: "addressed" | "declined";
|
|
95
|
-
|
|
95
|
+
reaction_id: number;
|
|
96
96
|
}, {
|
|
97
97
|
[x: string]: unknown;
|
|
98
98
|
objectAnnotations?: {
|
|
@@ -151,8 +151,8 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
|
|
|
151
151
|
} | undefined;
|
|
152
152
|
target: "updatePullRequestFeedback";
|
|
153
153
|
repo: string;
|
|
154
|
-
|
|
154
|
+
comment_id: number;
|
|
155
155
|
status: "addressed" | "declined";
|
|
156
|
-
|
|
156
|
+
reaction_id: number;
|
|
157
157
|
}>;
|
|
158
158
|
export {};
|
|
@@ -97,8 +97,8 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
|
|
|
97
97
|
label: string;
|
|
98
98
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
99
99
|
namespace: string;
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
suggested_events?: string[] | undefined;
|
|
101
|
+
supported_events: string[];
|
|
102
102
|
type: string;
|
|
103
103
|
} | undefined;
|
|
104
104
|
title: string;
|
|
@@ -169,8 +169,8 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
|
|
|
169
169
|
label: string;
|
|
170
170
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
171
171
|
namespace: string;
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
suggested_events?: string[] | undefined;
|
|
173
|
+
supported_events: string[];
|
|
174
174
|
type: string;
|
|
175
175
|
} | undefined;
|
|
176
176
|
title: string;
|