@sentry/junior-github 0.301.0 → 0.303.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 (97) hide show
  1. package/dist/events-CrbJHQ0w.js +2466 -0
  2. package/dist/index.d.ts +71 -3
  3. package/dist/index.js +7294 -7881
  4. package/dist/testing.d.ts +51 -1
  5. package/dist/testing.js +1 -6
  6. package/migrations/0012_pull_request_next_action.sql +5 -0
  7. package/migrations/meta/0012_snapshot.json +434 -0
  8. package/migrations/meta/_journal.json +7 -0
  9. package/package.json +11 -13
  10. package/skills/github-code/SKILL.md +1 -1
  11. package/skills/github-code/SPEC.md +2 -2
  12. package/skills/github-code/references/workflow.md +1 -1
  13. package/dist/account-links.d.ts +0 -8
  14. package/dist/annotations.d.ts +0 -33
  15. package/dist/chunk-YUF5P5I7.js +0 -2507
  16. package/dist/clone-command.d.ts +0 -5
  17. package/dist/configured-repository.d.ts +0 -10
  18. package/dist/conversation-title-context.d.ts +0 -20
  19. package/dist/credential-support.d.ts +0 -107
  20. package/dist/db/database.d.ts +0 -5
  21. package/dist/db/schema.d.ts +0 -1403
  22. package/dist/default-branch.d.ts +0 -15
  23. package/dist/egress-policy.d.ts +0 -25
  24. package/dist/events/comment.d.ts +0 -14
  25. package/dist/events/declarations.d.ts +0 -18
  26. package/dist/events/deployment.d.ts +0 -38
  27. package/dist/events/issue.d.ts +0 -42
  28. package/dist/events/pull-request.d.ts +0 -75
  29. package/dist/events/release.d.ts +0 -42
  30. package/dist/events/repository.d.ts +0 -23
  31. package/dist/events/resource-url.d.ts +0 -5
  32. package/dist/events/scope.d.ts +0 -13
  33. package/dist/git-config.d.ts +0 -52
  34. package/dist/github-status.d.ts +0 -16
  35. package/dist/graphql-documents.d.ts +0 -31
  36. package/dist/images.d.ts +0 -8
  37. package/dist/issue-outcomes/store.d.ts +0 -42
  38. package/dist/merge-conflict-checks/heartbeat.d.ts +0 -27
  39. package/dist/merge-conflict-checks/store.d.ts +0 -44
  40. package/dist/merge-conflict-checks/webhooks.d.ts +0 -23
  41. package/dist/object-facts.d.ts +0 -29
  42. package/dist/permissions.d.ts +0 -6
  43. package/dist/plugin.d.ts +0 -45
  44. package/dist/pull-request-outcomes/apply.d.ts +0 -22
  45. package/dist/pull-request-outcomes/commit-composition.d.ts +0 -6
  46. package/dist/pull-request-outcomes/reconcile.d.ts +0 -41
  47. package/dist/pull-request-outcomes/store.d.ts +0 -115
  48. package/dist/pull-request-requesters/draft-reviewers.d.ts +0 -15
  49. package/dist/pull-request-requesters/store.d.ts +0 -41
  50. package/dist/pull-request-review-policy.d.ts +0 -6
  51. package/dist/receive-pack-policy.d.ts +0 -21
  52. package/dist/reply-markdown.d.ts +0 -18
  53. package/dist/sandbox-paths.d.ts +0 -4
  54. package/dist/tool-support/attribution.d.ts +0 -52
  55. package/dist/tool-support/github-api.d.ts +0 -51
  56. package/dist/tool-support/github-text.d.ts +0 -8
  57. package/dist/tool-support/pull-request-description.d.ts +0 -8
  58. package/dist/tools/clone-repository.d.ts +0 -205
  59. package/dist/tools/comment-on-issue.d.ts +0 -205
  60. package/dist/tools/comment-on-pull-request.d.ts +0 -210
  61. package/dist/tools/create-issue.d.ts +0 -218
  62. package/dist/tools/create-pull-request.d.ts +0 -240
  63. package/dist/tools/footer.d.ts +0 -17
  64. package/dist/tools/get-deployment.d.ts +0 -264
  65. package/dist/tools/get-issue.d.ts +0 -248
  66. package/dist/tools/get-pull-request.d.ts +0 -255
  67. package/dist/tools/get-release.d.ts +0 -243
  68. package/dist/tools/get-repository.d.ts +0 -226
  69. package/dist/tools/get-status.d.ts +0 -213
  70. package/dist/tools/react-to-issue.d.ts +0 -205
  71. package/dist/tools/resolve-pull-request-review-thread.d.ts +0 -206
  72. package/dist/tools/stack-pull-request.d.ts +0 -43
  73. package/dist/tools/submit-pull-request-review.d.ts +0 -216
  74. package/dist/tools/update-issue-comment.d.ts +0 -206
  75. package/dist/tools/update-issue.d.ts +0 -249
  76. package/dist/tools/update-pull-request-feedback.d.ts +0 -242
  77. package/dist/tools/update-pull-request.d.ts +0 -255
  78. package/dist/tools.d.ts +0 -13
  79. package/dist/webhooks/check-suite.d.ts +0 -94
  80. package/dist/webhooks/event-targets.d.ts +0 -44
  81. package/dist/webhooks/events.d.ts +0 -23
  82. package/dist/webhooks/fail-open-log.d.ts +0 -10
  83. package/dist/webhooks/handler.d.ts +0 -55
  84. package/dist/webhooks/installation-requests.d.ts +0 -98
  85. package/dist/webhooks/issue-outcome.d.ts +0 -11
  86. package/dist/webhooks/issue-update.d.ts +0 -8
  87. package/dist/webhooks/merge-conflict.d.ts +0 -48
  88. package/dist/webhooks/ownership.d.ts +0 -14
  89. package/dist/webhooks/pull-request-activity.d.ts +0 -11
  90. package/dist/webhooks/pull-request-match-data.d.ts +0 -31
  91. package/dist/webhooks/pull-request-outcome.d.ts +0 -16
  92. package/dist/webhooks/pull-request-people.d.ts +0 -51
  93. package/dist/webhooks/pull-request-preview.d.ts +0 -12
  94. package/dist/webhooks/pull-request-ready-reviewers.d.ts +0 -25
  95. package/dist/webhooks/pull-request-ready.d.ts +0 -31
  96. package/dist/webhooks/pull-request-review-request.d.ts +0 -32
  97. package/dist/workspace-prepare.d.ts +0 -3
package/dist/testing.d.ts CHANGED
@@ -1,2 +1,52 @@
1
1
  /** Test-only access to GitHub webhook normalization for runtime eval fixtures. */
2
- export { normalizeGitHubEvents } from "./webhooks/events.js";
2
+ import { EventInput } from "@sentry/junior-plugin-api";
3
+ /** One incident from githubstatus.com. */
4
+ type GitHubStatusIncident = {
5
+ components: string[];
6
+ impact: string;
7
+ name: string;
8
+ resolvedAt?: string;
9
+ startedAt: string;
10
+ status: string;
11
+ url: string;
12
+ };
13
+ type GitHubFailingCheck = {
14
+ checkRunId: number;
15
+ conclusion: string;
16
+ htmlUrl?: string;
17
+ name: string;
18
+ };
19
+ /** Pull request values filled in when a match filter needs them. */
20
+ type GitHubCheckSuitePullRequestFacts = {
21
+ openerEmail?: string;
22
+ openerUsername?: string;
23
+ isDraft?: boolean;
24
+ };
25
+ /** Optional values for one check suite event. */
26
+ type GitHubCheckSuiteFacts = {
27
+ failingChecks?: GitHubFailingCheck[];
28
+ /** Open or recent githubstatus.com incidents when the suite failed. */
29
+ githubIncidents?: GitHubStatusIncident[];
30
+ /**
31
+ * True when this suite passed and every other check suite on its head
32
+ * commit passed too. Set only when something listens for
33
+ * `pull_request.checks.passed`.
34
+ */
35
+ allCheckSuitesPassed?: boolean;
36
+ /** Pull request values by number when a match filter needs them. */
37
+ pullRequestFactsByNumber?: Record<number, GitHubCheckSuitePullRequestFacts>;
38
+ };
39
+ /**
40
+ * Normalize one verified GitHub delivery into conversation events.
41
+ *
42
+ * Comments and reviews written by the configured bot are dropped, so Junior
43
+ * does not react to or act on its own feedback.
44
+ */
45
+ export declare function normalizeGitHubEvents(args: {
46
+ body: unknown;
47
+ botEmail?: string | undefined;
48
+ checkSuiteFacts?: GitHubCheckSuiteFacts;
49
+ deliveryId: string;
50
+ eventName: string;
51
+ }): EventInput[];
52
+ export {};
package/dist/testing.js CHANGED
@@ -1,6 +1 @@
1
- import {
2
- normalizeGitHubEvents
3
- } from "./chunk-YUF5P5I7.js";
4
- export {
5
- normalizeGitHubEvents
6
- };
1
+ export { n as normalizeGitHubEvents } from "./events-CrbJHQ0w.js";
@@ -0,0 +1,5 @@
1
+ -- `ready_to_merge_at` stays for one release, so workers from before this
2
+ -- migration keep working during the rollout. A later migration drops it.
3
+ -- `next_action` starts empty: the next check of each pull request derives
4
+ -- its action and moves an open item from the old keys to the new one.
5
+ ALTER TABLE "junior_github_pull_requests" ADD COLUMN "next_action" text;
@@ -0,0 +1,434 @@
1
+ {
2
+ "id": "055a183e-3fe9-4077-a93f-6fd5f0786389",
3
+ "prevId": "7b0a99a8-d5c9-4810-a220-3b6c8517c9cf",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.junior_github_issues": {
8
+ "name": "junior_github_issues",
9
+ "schema": "",
10
+ "columns": {
11
+ "issue_id": {
12
+ "name": "issue_id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "repository_id": {
18
+ "name": "repository_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "repository_full_name": {
24
+ "name": "repository_full_name",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "number": {
30
+ "name": "number",
31
+ "type": "integer",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "state": {
36
+ "name": "state",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "state_reason": {
42
+ "name": "state_reason",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "conversation_ids": {
48
+ "name": "conversation_ids",
49
+ "type": "text[]",
50
+ "primaryKey": false,
51
+ "notNull": true,
52
+ "default": "ARRAY[]::text[]"
53
+ },
54
+ "opened_at": {
55
+ "name": "opened_at",
56
+ "type": "timestamp with time zone",
57
+ "primaryKey": false,
58
+ "notNull": true
59
+ },
60
+ "closed_at": {
61
+ "name": "closed_at",
62
+ "type": "timestamp with time zone",
63
+ "primaryKey": false,
64
+ "notNull": false
65
+ },
66
+ "updated_at": {
67
+ "name": "updated_at",
68
+ "type": "timestamp with time zone",
69
+ "primaryKey": false,
70
+ "notNull": true
71
+ }
72
+ },
73
+ "indexes": {
74
+ "junior_github_issues_opened_at_idx": {
75
+ "name": "junior_github_issues_opened_at_idx",
76
+ "columns": [
77
+ {
78
+ "expression": "opened_at",
79
+ "isExpression": false,
80
+ "asc": true,
81
+ "nulls": "last"
82
+ }
83
+ ],
84
+ "isUnique": false,
85
+ "concurrently": false,
86
+ "method": "btree",
87
+ "with": {}
88
+ },
89
+ "junior_github_issues_closed_at_idx": {
90
+ "name": "junior_github_issues_closed_at_idx",
91
+ "columns": [
92
+ {
93
+ "expression": "closed_at",
94
+ "isExpression": false,
95
+ "asc": true,
96
+ "nulls": "last"
97
+ }
98
+ ],
99
+ "isUnique": false,
100
+ "concurrently": false,
101
+ "method": "btree",
102
+ "with": {}
103
+ },
104
+ "junior_github_issues_open_idx": {
105
+ "name": "junior_github_issues_open_idx",
106
+ "columns": [
107
+ {
108
+ "expression": "issue_id",
109
+ "isExpression": false,
110
+ "asc": true,
111
+ "nulls": "last"
112
+ }
113
+ ],
114
+ "isUnique": false,
115
+ "where": "\"junior_github_issues\".\"state\" = 'open'",
116
+ "concurrently": false,
117
+ "method": "btree",
118
+ "with": {}
119
+ }
120
+ },
121
+ "foreignKeys": {},
122
+ "compositePrimaryKeys": {},
123
+ "uniqueConstraints": {},
124
+ "policies": {},
125
+ "checkConstraints": {},
126
+ "isRLSEnabled": false
127
+ },
128
+ "public.junior_github_pull_request_issues": {
129
+ "name": "junior_github_pull_request_issues",
130
+ "schema": "",
131
+ "columns": {
132
+ "pull_request_id": {
133
+ "name": "pull_request_id",
134
+ "type": "text",
135
+ "primaryKey": false,
136
+ "notNull": true
137
+ },
138
+ "issue_repository_full_name": {
139
+ "name": "issue_repository_full_name",
140
+ "type": "text",
141
+ "primaryKey": false,
142
+ "notNull": true
143
+ },
144
+ "issue_number": {
145
+ "name": "issue_number",
146
+ "type": "integer",
147
+ "primaryKey": false,
148
+ "notNull": true
149
+ }
150
+ },
151
+ "indexes": {},
152
+ "foreignKeys": {
153
+ "junior_github_pull_request_issues_pull_request_id_junior_github_pull_requests_pull_request_id_fk": {
154
+ "name": "junior_github_pull_request_issues_pull_request_id_junior_github_pull_requests_pull_request_id_fk",
155
+ "tableFrom": "junior_github_pull_request_issues",
156
+ "tableTo": "junior_github_pull_requests",
157
+ "columnsFrom": ["pull_request_id"],
158
+ "columnsTo": ["pull_request_id"],
159
+ "onDelete": "cascade",
160
+ "onUpdate": "no action"
161
+ }
162
+ },
163
+ "compositePrimaryKeys": {
164
+ "junior_github_pull_request_issues_pull_request_id_issue_repository_full_name_issue_number_pk": {
165
+ "name": "junior_github_pull_request_issues_pull_request_id_issue_repository_full_name_issue_number_pk",
166
+ "columns": [
167
+ "pull_request_id",
168
+ "issue_repository_full_name",
169
+ "issue_number"
170
+ ]
171
+ }
172
+ },
173
+ "uniqueConstraints": {},
174
+ "policies": {},
175
+ "checkConstraints": {},
176
+ "isRLSEnabled": false
177
+ },
178
+ "public.junior_github_pull_request_requesters": {
179
+ "name": "junior_github_pull_request_requesters",
180
+ "schema": "",
181
+ "columns": {
182
+ "repository_full_name": {
183
+ "name": "repository_full_name",
184
+ "type": "text",
185
+ "primaryKey": false,
186
+ "notNull": true
187
+ },
188
+ "number": {
189
+ "name": "number",
190
+ "type": "integer",
191
+ "primaryKey": false,
192
+ "notNull": true
193
+ },
194
+ "identity_id": {
195
+ "name": "identity_id",
196
+ "type": "text",
197
+ "primaryKey": false,
198
+ "notNull": true
199
+ },
200
+ "conversation_id": {
201
+ "name": "conversation_id",
202
+ "type": "text",
203
+ "primaryKey": false,
204
+ "notNull": false
205
+ },
206
+ "created_at": {
207
+ "name": "created_at",
208
+ "type": "timestamp with time zone",
209
+ "primaryKey": false,
210
+ "notNull": true
211
+ },
212
+ "updated_at": {
213
+ "name": "updated_at",
214
+ "type": "timestamp with time zone",
215
+ "primaryKey": false,
216
+ "notNull": true
217
+ }
218
+ },
219
+ "indexes": {},
220
+ "foreignKeys": {},
221
+ "compositePrimaryKeys": {
222
+ "junior_github_pull_request_requesters_repository_full_name_number_identity_id_pk": {
223
+ "name": "junior_github_pull_request_requesters_repository_full_name_number_identity_id_pk",
224
+ "columns": ["repository_full_name", "number", "identity_id"]
225
+ }
226
+ },
227
+ "uniqueConstraints": {},
228
+ "policies": {},
229
+ "checkConstraints": {},
230
+ "isRLSEnabled": false
231
+ },
232
+ "public.junior_github_pull_requests": {
233
+ "name": "junior_github_pull_requests",
234
+ "schema": "",
235
+ "columns": {
236
+ "pull_request_id": {
237
+ "name": "pull_request_id",
238
+ "type": "text",
239
+ "primaryKey": true,
240
+ "notNull": true
241
+ },
242
+ "repository_id": {
243
+ "name": "repository_id",
244
+ "type": "text",
245
+ "primaryKey": false,
246
+ "notNull": true
247
+ },
248
+ "repository_full_name": {
249
+ "name": "repository_full_name",
250
+ "type": "text",
251
+ "primaryKey": false,
252
+ "notNull": true
253
+ },
254
+ "number": {
255
+ "name": "number",
256
+ "type": "integer",
257
+ "primaryKey": false,
258
+ "notNull": true
259
+ },
260
+ "state": {
261
+ "name": "state",
262
+ "type": "text",
263
+ "primaryKey": false,
264
+ "notNull": true
265
+ },
266
+ "commit_composition": {
267
+ "name": "commit_composition",
268
+ "type": "text",
269
+ "primaryKey": false,
270
+ "notNull": false
271
+ },
272
+ "conversation_ids": {
273
+ "name": "conversation_ids",
274
+ "type": "text[]",
275
+ "primaryKey": false,
276
+ "notNull": true,
277
+ "default": "ARRAY[]::text[]"
278
+ },
279
+ "draft": {
280
+ "name": "draft",
281
+ "type": "boolean",
282
+ "primaryKey": false,
283
+ "notNull": true,
284
+ "default": false
285
+ },
286
+ "opened_at": {
287
+ "name": "opened_at",
288
+ "type": "timestamp with time zone",
289
+ "primaryKey": false,
290
+ "notNull": true
291
+ },
292
+ "merged_at": {
293
+ "name": "merged_at",
294
+ "type": "timestamp with time zone",
295
+ "primaryKey": false,
296
+ "notNull": false
297
+ },
298
+ "closed_at": {
299
+ "name": "closed_at",
300
+ "type": "timestamp with time zone",
301
+ "primaryKey": false,
302
+ "notNull": false
303
+ },
304
+ "updated_at": {
305
+ "name": "updated_at",
306
+ "type": "timestamp with time zone",
307
+ "primaryKey": false,
308
+ "notNull": true
309
+ },
310
+ "next_action": {
311
+ "name": "next_action",
312
+ "type": "text",
313
+ "primaryKey": false,
314
+ "notNull": false
315
+ },
316
+ "ready_sync_requests": {
317
+ "name": "ready_sync_requests",
318
+ "type": "integer",
319
+ "primaryKey": false,
320
+ "notNull": true,
321
+ "default": 0
322
+ },
323
+ "ready_sync_id": {
324
+ "name": "ready_sync_id",
325
+ "type": "integer",
326
+ "primaryKey": false,
327
+ "notNull": false
328
+ },
329
+ "ready_sync_at": {
330
+ "name": "ready_sync_at",
331
+ "type": "timestamp with time zone",
332
+ "primaryKey": false,
333
+ "notNull": false
334
+ }
335
+ },
336
+ "indexes": {
337
+ "junior_github_pull_requests_opened_at_idx": {
338
+ "name": "junior_github_pull_requests_opened_at_idx",
339
+ "columns": [
340
+ {
341
+ "expression": "opened_at",
342
+ "isExpression": false,
343
+ "asc": true,
344
+ "nulls": "last"
345
+ }
346
+ ],
347
+ "isUnique": false,
348
+ "concurrently": false,
349
+ "method": "btree",
350
+ "with": {}
351
+ },
352
+ "junior_github_pull_requests_merged_at_idx": {
353
+ "name": "junior_github_pull_requests_merged_at_idx",
354
+ "columns": [
355
+ {
356
+ "expression": "merged_at",
357
+ "isExpression": false,
358
+ "asc": true,
359
+ "nulls": "last"
360
+ }
361
+ ],
362
+ "isUnique": false,
363
+ "concurrently": false,
364
+ "method": "btree",
365
+ "with": {}
366
+ },
367
+ "junior_github_pull_requests_closed_at_idx": {
368
+ "name": "junior_github_pull_requests_closed_at_idx",
369
+ "columns": [
370
+ {
371
+ "expression": "closed_at",
372
+ "isExpression": false,
373
+ "asc": true,
374
+ "nulls": "last"
375
+ }
376
+ ],
377
+ "isUnique": false,
378
+ "concurrently": false,
379
+ "method": "btree",
380
+ "with": {}
381
+ },
382
+ "junior_github_pull_requests_open_idx": {
383
+ "name": "junior_github_pull_requests_open_idx",
384
+ "columns": [
385
+ {
386
+ "expression": "pull_request_id",
387
+ "isExpression": false,
388
+ "asc": true,
389
+ "nulls": "last"
390
+ }
391
+ ],
392
+ "isUnique": false,
393
+ "where": "\"junior_github_pull_requests\".\"state\" = 'open'",
394
+ "concurrently": false,
395
+ "method": "btree",
396
+ "with": {}
397
+ },
398
+ "junior_github_pull_requests_unmerged_conversations_idx": {
399
+ "name": "junior_github_pull_requests_unmerged_conversations_idx",
400
+ "columns": [
401
+ {
402
+ "expression": "conversation_ids",
403
+ "isExpression": false,
404
+ "asc": true,
405
+ "nulls": "last"
406
+ }
407
+ ],
408
+ "isUnique": false,
409
+ "where": "\"junior_github_pull_requests\".\"state\" <> 'merged'",
410
+ "concurrently": false,
411
+ "method": "gin",
412
+ "with": {}
413
+ }
414
+ },
415
+ "foreignKeys": {},
416
+ "compositePrimaryKeys": {},
417
+ "uniqueConstraints": {},
418
+ "policies": {},
419
+ "checkConstraints": {},
420
+ "isRLSEnabled": false
421
+ }
422
+ },
423
+ "enums": {},
424
+ "schemas": {},
425
+ "sequences": {},
426
+ "roles": {},
427
+ "policies": {},
428
+ "views": {},
429
+ "_meta": {
430
+ "columns": {},
431
+ "schemas": {},
432
+ "tables": {}
433
+ }
434
+ }
@@ -85,6 +85,13 @@
85
85
  "when": 1794493724681,
86
86
  "tag": "0011_pull_request_draft",
87
87
  "breakpoints": true
88
+ },
89
+ {
90
+ "idx": 12,
91
+ "version": "7",
92
+ "when": 1794605938191,
93
+ "tag": "0012_pull_request_next_action",
94
+ "breakpoints": true
88
95
  }
89
96
  ]
90
97
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-github",
3
- "version": "0.301.0",
3
+ "version": "0.303.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -29,35 +29,33 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@0no-co/graphql.web": "^1.3.4",
32
+ "@sentry/junior-plugin-api": "0.303.0",
32
33
  "@sinclair/typebox": "^0.34.49",
33
34
  "drizzle-orm": "^0.45.4",
35
+ "ignore": "^7.0.5",
34
36
  "marked": "^18.1.2",
35
- "mdast-util-from-markdown": "^2.0.3",
37
+ "mdast-util-from-markdown": "^2.1.0",
36
38
  "mdast-util-gfm": "^3.1.0",
37
39
  "micromark-extension-gfm": "^3.0.0",
38
40
  "parse5": "^7.3.0",
39
- "zod": "^4.6.7",
40
- "@sentry/junior-plugin-api": "0.301.0"
41
+ "zod": "^4.6.7"
41
42
  },
42
43
  "devDependencies": {
43
- "@oxlint/plugins": "1.79.0",
44
+ "@sentry/junior-testing": "0.0.0",
44
45
  "@types/mdast": "^4.0.4",
45
- "@types/node": "^25.9.1",
46
+ "@types/node": "^24.19.2",
46
47
  "@types/pg": "^8.15.6",
47
48
  "drizzle-kit": "^0.31.8",
48
49
  "graphql": "^16.14.0",
49
50
  "msw": "^2.14.6",
50
- "oxlint": "^1.79.0",
51
51
  "pg": "^8.16.3",
52
- "tsup": "^8.5.1",
53
- "typescript": "^7.0.2",
54
- "vitest": "^4.1.12",
55
- "@sentry/junior-testing": "0.0.0"
52
+ "tsdown": "0.23.7",
53
+ "typescript": "7.0.2",
54
+ "vitest": "^4.1.12"
56
55
  },
57
56
  "scripts": {
58
- "build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
57
+ "build": "tsdown",
59
58
  "db:generate": "pnpm exec drizzle-kit generate --config drizzle.config.ts",
60
- "lint": "oxlint --config ../junior/.oxlintrc.json --deny-warnings src tests tsup.config.ts vitest.config.ts",
61
59
  "test": "vitest run",
62
60
  "typecheck": "tsc --noEmit"
63
61
  }
@@ -37,7 +37,7 @@ Use `git` and `gh` for repository work.
37
37
  - When an error names a tool, use it. Change permissions only when GitHub rejected the request.
38
38
  - Stop for an unclear target, missing access, destructive work, or a GitHub permission failure.
39
39
  - Code changes always end in a pushed branch and a PR. Do not ask whether to open one. Skip it only when the user opts out or asks for investigation only.
40
- - Open the PR ready for review when the work is complete and the checks pass. Open a draft when work, checks, or decisions remain. A scope or follow-up question is not a reason to stop: open the PR, and name the question in the PR body and the report. Name each open decision of a draft in its PR body: when the required checks pass, the Watch marks a draft with no open decision ready for review.
40
+ - Open the PR as a draft, unless the requester asks for a ready PR. A scope or follow-up question is not a reason to stop: open the PR, and name the question in the PR body and the report. Name each open decision of a draft in its PR body: when the required checks pass, the Watch marks a draft with no open decision ready for review. It checks the changed files against CODEOWNERS first: a draft that would ask code owners to review, or whose repo's `AGENTS.md` asks for drafts, stays a draft, and the Watch tells the requester that it waits for their review.
41
41
  - Link the PR. Mention checks only when they failed or were skipped.
42
42
  - The runtime adds the requester `via` line. Do not write one.
43
43
  - Credit other people, such as a reporter, by GitHub `@login` so GitHub notifies them. Get the login from `userLookup` (`linked_identities` with provider `github`, else a GitHub link in `profile_fields`). Pass the Slack user ID when known. With no login, write the name. Never guess a login. When you delegate the write, put the `@login` in the brief.
@@ -10,8 +10,8 @@ Guide evidence-first GitHub repository work from inspection through a reviewable
10
10
  - Preserve unrelated work; reject destructive Git operations except `--force-with-lease` pushes to branches Junior pushed or the requester named.
11
11
  - Treat shallow clones as inspection checkouts; deepen before history work; never force-push around missing ancestry.
12
12
  - Install dependencies with the lockfile frozen mode before verification when needed.
13
- - Finish every code change with a pushed PR, without asking, unless the user opts out or asked for investigation only. Open it ready when work and checks are done; open a draft when work, checks, or decisions remain. An open scope question goes in the PR body, not in a stop. The Watch of a draft marks it ready when its required checks pass and no decision is open, so open decisions of a draft go in its PR body.
14
- - After each push to a branch with an open PR, check mergeability. Resolve conflicts without asking, by merging the PR base branch (usually the default branch). Never rebase for this, except in a stack: a stack merges only with a linear history, so stacked PRs restack with `gh stack`. GitHub sends no event for a new conflict, and conflicted PRs get no new checks. The plugin publishes `pull_request.merge_conflict` for a watched PR only when another webhook event arrives for it, so the post-push check stays.
13
+ - Finish every code change with a pushed PR, without asking, unless the user opts out or asked for investigation only. Open it as a draft unless the requester asks for a ready PR: opening a PR ready asks its code owners at once, and only the draft Watch checks the changed files against CODEOWNERS. An open scope question goes in the PR body, not in a stop. The Watch of a draft marks it ready when its required checks pass and no decision is open, so open decisions of a draft go in its PR body. A draft whose changed files have CODEOWNERS owners, or whose repo's root AGENTS.md asks for draft PRs or for a person to mark them ready, stays a draft unless the requester said to mark it ready, and Junior tells the requester that it waits for their review.
14
+ - After each push to a branch with an open PR, check mergeability. Resolve conflicts without asking, by merging the PR base branch (usually the default branch). Never rebase for this, except in a stack: a stack merges only with a linear history, so stacked PRs restack with `gh stack`. GitHub sends no event for a new conflict, and conflicted PRs get no new checks. The plugin publishes `pull_request.merge_conflict` for a watched PR only when another webhook event arrives for it, and for a Junior PR only while people work on it and never for a draft, so the post-push check stays.
15
15
  - Write conventional PR titles and short plain-English bodies; keep check results out of the PR body.
16
16
  - Report exact validation and permission failures.
17
17
  - For 5xx, timeout, and connection failures, and for stalled or unexplained check failures, check GitHub status with `github_getStatus` (or the incidents on a `pull_request.checks.failed` event) before diagnosing. Report a matching incident as the likely cause; with no match, do not blame an outage.
@@ -42,7 +42,7 @@ Open this when making repository edits, not for read-only inspection.
42
42
  - Not in a stack: GitHub checks mergeability against the PR base (`baseRefName`), which is usually the default branch. Fetch the base and merge `origin/BASE` into the PR branch. Do not rebase. Resolve each conflict so that both the PR change and the base branch change stay intact. Run the checks again and push.
43
43
  - Then check mergeability again.
44
44
  4. Resolve the actual default branch.
45
- 5. Update an existing PR for the branch with `github_updatePullRequest`, or create with `github_createPullRequest` (`draft: true` only when work, checks, or decisions remain; otherwise ready for review).
45
+ 5. Update an existing PR for the branch with `github_updatePullRequest`, or create with `github_createPullRequest` (`draft: true` unless the requester asked for a ready PR).
46
46
  6. PR title matches the current dominant change, same conventional form as commits.
47
47
  7. PR body: short, plain English, what changed and why. Only context the diff cannot show. No empty sections, file lists, commit logs, or Checks/Verification/Test plan blocks.
48
48
  8. After material follow-up commits, refresh title and body against the current diff.
@@ -1,8 +0,0 @@
1
- import type { PluginObjectLinkDefinition } from "@sentry/junior-plugin-api";
2
- /**
3
- * GitHub profile links, such as `https://github.com/octocat`. A login that
4
- * links to a known person shows their Junior person card. Any other login
5
- * shows a GitHub account card. Both come from the link alone, so the card
6
- * needs no GitHub request.
7
- */
8
- export declare const githubAccountLinks: PluginObjectLinkDefinition;
@@ -1,33 +0,0 @@
1
- import { type ConversationAnnotation, type ConversationSidebarAnnotation, type ObjectAnnotation, type PluginAnnotations, type PluginConversationAnnotations, type PluginLogger } from "@sentry/junior-plugin-api";
2
- /** Return GitHub annotations for a conversation row, newest first. */
3
- export declare function githubSidebarAnnotations(annotations: ConversationAnnotation[]): ConversationSidebarAnnotation[];
4
- /** Build the annotation returned by GitHub create and update tools. */
5
- export declare function githubObjectAnnotation(input: {
6
- repo: string;
7
- number: number;
8
- title: string;
9
- url: string;
10
- objectType: "task" | "code_change";
11
- status: string;
12
- facts?: ObjectAnnotation["facts"];
13
- sourceUpdatedAt?: string;
14
- description?: string;
15
- }): ObjectAnnotation;
16
- /** Refresh an existing object's status without selecting a card for delivery. */
17
- declare function updateGitHubAnnotation(store: PluginAnnotations, input: {
18
- repo: string;
19
- number: number;
20
- objectType: "task" | "code_change";
21
- status: "merged" | "closed";
22
- }): Promise<void>;
23
- /**
24
- * Refresh the status of one object in each linked conversation. One failed
25
- * conversation does not stop the others. Each failure is logged.
26
- */
27
- export declare function updateGitHubAnnotations(args: {
28
- annotations: PluginConversationAnnotations;
29
- conversationIds: string[];
30
- log?: Pick<PluginLogger, "error">;
31
- update: Parameters<typeof updateGitHubAnnotation>[1];
32
- }): Promise<void>;
33
- export {};