@sentry/junior-github 0.107.1 → 0.108.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/README.md CHANGED
@@ -24,6 +24,6 @@ export const plugins = defineJuniorPlugins([
24
24
 
25
25
  Full setup guide: https://junior.sentry.dev/extend/github-plugin/
26
26
 
27
- The plugin owns its signed webhook route, normalized pull request outcome
28
- projection, and dashboard operational report. Core only owns delivery from
29
- plugin-published resource events into matching conversation subscriptions.
27
+ The plugin owns its signed webhook route, normalized pull request and issue
28
+ outcome projections, and dashboard operational report. Core only owns delivery
29
+ from plugin-published resource events into matching conversation subscriptions.
package/SETUP.md CHANGED
@@ -68,14 +68,14 @@ vercel env update GITHUB_APP_PRIVATE_KEY production --sensitive < ./github-app-p
68
68
 
69
69
  Repeat for `preview` and `development` as needed. After env changes, redeploy so the new deployment picks up updated values.
70
70
 
71
- ### Optional pull request webhooks and outcome reporting
71
+ ### Optional GitHub webhooks and outcome reporting
72
72
 
73
- To report Junior-created PR outcomes, use the standard GitHub noreply format
74
- `<bot-user-id>+<app-slug>[bot]@users.noreply.github.com` for
73
+ To report Junior-created pull request and issue outcomes, use the standard
74
+ GitHub noreply format `<bot-user-id>+<app-slug>[bot]@users.noreply.github.com` for
75
75
  `GITHUB_APP_BOT_EMAIL` and configure `GITHUB_WEBHOOK_SECRET`. Junior derives
76
76
  the App bot login from that email. Set the GitHub App webhook URL to
77
77
  `https://<junior-host>/api/webhooks/github` and subscribe to Pull request
78
- events. The secret in GitHub must match the deployment environment.
78
+ and Issues events. The secret in GitHub must match the deployment environment.
79
79
 
80
80
  Conversation watches additionally use Check suite, Issue comment, Pull request
81
81
  review, and Pull request review comment events.
@@ -91,8 +91,13 @@ deployed app environment:
91
91
  pnpm exec junior upgrade
92
92
  ```
93
93
 
94
- The migration creates `junior_github_pull_requests`, which backs webhook
95
- ingestion and the `/system` outcome report.
94
+ The migrations create `junior_github_pull_requests` and
95
+ `junior_github_issues`, which back webhook ingestion and the `/system` outcome
96
+ report. When a tracked pull request merges, Junior also reads its commit list
97
+ and records whether every Git author was Junior's configured bot or whether the
98
+ pull request contained non-Junior-authored commits.
99
+ The pull request projection also stores associated native Junior conversation
100
+ ids as an opaque, deduplicated `text[]` without a foreign key.
96
101
 
97
102
  ### Optional permission declaration
98
103
 
@@ -0,0 +1,5 @@
1
+ import type { PgDatabase } from "drizzle-orm/pg-core";
2
+ import type { PgQueryResultHKT } from "drizzle-orm/pg-core/session";
3
+ import { githubSqlSchema } from "./schema.js";
4
+ /** Database contract for GitHub-owned projections and reports. */
5
+ export type GitHubDb = PgDatabase<PgQueryResultHKT, typeof githubSqlSchema>;
@@ -5,6 +5,162 @@ export declare const githubPullRequestStateSchema: z.ZodEnum<{
5
5
  closed_unmerged: "closed_unmerged";
6
6
  }>;
7
7
  export type GitHubPullRequestState = z.output<typeof githubPullRequestStateSchema>;
8
+ export declare const githubPullRequestCommitCompositionSchema: z.ZodEnum<{
9
+ junior_only: "junior_only";
10
+ mixed: "mixed";
11
+ }>;
12
+ export type GitHubPullRequestCommitComposition = z.output<typeof githubPullRequestCommitCompositionSchema>;
13
+ export declare const githubIssueStateSchema: z.ZodEnum<{
14
+ open: "open";
15
+ closed: "closed";
16
+ }>;
17
+ export type GitHubIssueState = z.output<typeof githubIssueStateSchema>;
18
+ /** Current provider projection for issues classified as Junior-owned. */
19
+ export declare const juniorGitHubIssues: import("drizzle-orm/pg-core").PgTableWithColumns<{
20
+ name: "junior_github_issues";
21
+ schema: undefined;
22
+ columns: {
23
+ issueId: import("drizzle-orm/pg-core").PgColumn<{
24
+ name: "issue_id";
25
+ tableName: "junior_github_issues";
26
+ dataType: "string";
27
+ columnType: "PgText";
28
+ data: string;
29
+ driverParam: string;
30
+ notNull: true;
31
+ hasDefault: false;
32
+ isPrimaryKey: true;
33
+ isAutoincrement: false;
34
+ hasRuntimeDefault: false;
35
+ enumValues: [string, ...string[]];
36
+ baseColumn: never;
37
+ identity: undefined;
38
+ generated: undefined;
39
+ }, {}, {}>;
40
+ repositoryId: import("drizzle-orm/pg-core").PgColumn<{
41
+ name: "repository_id";
42
+ tableName: "junior_github_issues";
43
+ dataType: "string";
44
+ columnType: "PgText";
45
+ data: string;
46
+ driverParam: string;
47
+ notNull: true;
48
+ hasDefault: false;
49
+ isPrimaryKey: false;
50
+ isAutoincrement: false;
51
+ hasRuntimeDefault: false;
52
+ enumValues: [string, ...string[]];
53
+ baseColumn: never;
54
+ identity: undefined;
55
+ generated: undefined;
56
+ }, {}, {}>;
57
+ repositoryFullName: import("drizzle-orm/pg-core").PgColumn<{
58
+ name: "repository_full_name";
59
+ tableName: "junior_github_issues";
60
+ dataType: "string";
61
+ columnType: "PgText";
62
+ data: string;
63
+ driverParam: string;
64
+ notNull: true;
65
+ hasDefault: false;
66
+ isPrimaryKey: false;
67
+ isAutoincrement: false;
68
+ hasRuntimeDefault: false;
69
+ enumValues: [string, ...string[]];
70
+ baseColumn: never;
71
+ identity: undefined;
72
+ generated: undefined;
73
+ }, {}, {}>;
74
+ number: import("drizzle-orm/pg-core").PgColumn<{
75
+ name: "number";
76
+ tableName: "junior_github_issues";
77
+ dataType: "number";
78
+ columnType: "PgInteger";
79
+ data: number;
80
+ driverParam: string | number;
81
+ notNull: true;
82
+ hasDefault: false;
83
+ isPrimaryKey: false;
84
+ isAutoincrement: false;
85
+ hasRuntimeDefault: false;
86
+ enumValues: undefined;
87
+ baseColumn: never;
88
+ identity: undefined;
89
+ generated: undefined;
90
+ }, {}, {}>;
91
+ state: import("drizzle-orm/pg-core").PgColumn<{
92
+ name: "state";
93
+ tableName: "junior_github_issues";
94
+ dataType: "string";
95
+ columnType: "PgText";
96
+ data: "open" | "closed";
97
+ driverParam: string;
98
+ notNull: true;
99
+ hasDefault: false;
100
+ isPrimaryKey: false;
101
+ isAutoincrement: false;
102
+ hasRuntimeDefault: false;
103
+ enumValues: [string, ...string[]];
104
+ baseColumn: never;
105
+ identity: undefined;
106
+ generated: undefined;
107
+ }, {}, {
108
+ $type: "open" | "closed";
109
+ }>;
110
+ openedAt: import("drizzle-orm/pg-core").PgColumn<{
111
+ name: "opened_at";
112
+ tableName: "junior_github_issues";
113
+ dataType: "date";
114
+ columnType: "PgTimestamp";
115
+ data: Date;
116
+ driverParam: string;
117
+ notNull: true;
118
+ hasDefault: false;
119
+ isPrimaryKey: false;
120
+ isAutoincrement: false;
121
+ hasRuntimeDefault: false;
122
+ enumValues: undefined;
123
+ baseColumn: never;
124
+ identity: undefined;
125
+ generated: undefined;
126
+ }, {}, {}>;
127
+ closedAt: import("drizzle-orm/pg-core").PgColumn<{
128
+ name: "closed_at";
129
+ tableName: "junior_github_issues";
130
+ dataType: "date";
131
+ columnType: "PgTimestamp";
132
+ data: Date;
133
+ driverParam: string;
134
+ notNull: false;
135
+ hasDefault: false;
136
+ isPrimaryKey: false;
137
+ isAutoincrement: false;
138
+ hasRuntimeDefault: false;
139
+ enumValues: undefined;
140
+ baseColumn: never;
141
+ identity: undefined;
142
+ generated: undefined;
143
+ }, {}, {}>;
144
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
145
+ name: "updated_at";
146
+ tableName: "junior_github_issues";
147
+ dataType: "date";
148
+ columnType: "PgTimestamp";
149
+ data: Date;
150
+ driverParam: string;
151
+ notNull: true;
152
+ hasDefault: false;
153
+ isPrimaryKey: false;
154
+ isAutoincrement: false;
155
+ hasRuntimeDefault: false;
156
+ enumValues: undefined;
157
+ baseColumn: never;
158
+ identity: undefined;
159
+ generated: undefined;
160
+ }, {}, {}>;
161
+ };
162
+ dialect: "pg";
163
+ }>;
8
164
  /** Current provider projection for pull requests classified as Junior-owned. */
9
165
  export declare const juniorGitHubPullRequests: import("drizzle-orm/pg-core").PgTableWithColumns<{
10
166
  name: "junior_github_pull_requests";
@@ -97,6 +253,68 @@ export declare const juniorGitHubPullRequests: import("drizzle-orm/pg-core").PgT
97
253
  }, {}, {
98
254
  $type: "merged" | "open" | "closed_unmerged";
99
255
  }>;
256
+ commitComposition: import("drizzle-orm/pg-core").PgColumn<{
257
+ name: "commit_composition";
258
+ tableName: "junior_github_pull_requests";
259
+ dataType: "string";
260
+ columnType: "PgText";
261
+ data: "junior_only" | "mixed";
262
+ driverParam: string;
263
+ notNull: false;
264
+ hasDefault: false;
265
+ isPrimaryKey: false;
266
+ isAutoincrement: false;
267
+ hasRuntimeDefault: false;
268
+ enumValues: [string, ...string[]];
269
+ baseColumn: never;
270
+ identity: undefined;
271
+ generated: undefined;
272
+ }, {}, {
273
+ $type: "junior_only" | "mixed";
274
+ }>;
275
+ conversationIds: import("drizzle-orm/pg-core").PgColumn<{
276
+ name: "conversation_ids";
277
+ tableName: "junior_github_pull_requests";
278
+ dataType: "array";
279
+ columnType: "PgArray";
280
+ data: string[];
281
+ driverParam: string | string[];
282
+ notNull: true;
283
+ hasDefault: true;
284
+ isPrimaryKey: false;
285
+ isAutoincrement: false;
286
+ hasRuntimeDefault: false;
287
+ enumValues: [string, ...string[]];
288
+ baseColumn: import("drizzle-orm").Column<{
289
+ name: "conversation_ids";
290
+ tableName: "junior_github_pull_requests";
291
+ dataType: "string";
292
+ columnType: "PgText";
293
+ data: string;
294
+ driverParam: string;
295
+ notNull: false;
296
+ hasDefault: false;
297
+ isPrimaryKey: false;
298
+ isAutoincrement: false;
299
+ hasRuntimeDefault: false;
300
+ enumValues: [string, ...string[]];
301
+ baseColumn: never;
302
+ identity: undefined;
303
+ generated: undefined;
304
+ }, {}, {}>;
305
+ identity: undefined;
306
+ generated: undefined;
307
+ }, {}, {
308
+ baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
309
+ name: "conversation_ids";
310
+ dataType: "string";
311
+ columnType: "PgText";
312
+ data: string;
313
+ enumValues: [string, ...string[]];
314
+ driverParam: string;
315
+ }, {}, {}, import("drizzle-orm").ColumnBuilderExtraConfig>;
316
+ size: undefined;
317
+ }>;
100
318
  openedAt: import("drizzle-orm/pg-core").PgColumn<{
101
319
  name: "opened_at";
102
320
  tableName: "junior_github_pull_requests";
@@ -169,6 +387,151 @@ export declare const juniorGitHubPullRequests: import("drizzle-orm/pg-core").PgT
169
387
  dialect: "pg";
170
388
  }>;
171
389
  export declare const githubSqlSchema: {
390
+ juniorGitHubIssues: import("drizzle-orm/pg-core").PgTableWithColumns<{
391
+ name: "junior_github_issues";
392
+ schema: undefined;
393
+ columns: {
394
+ issueId: import("drizzle-orm/pg-core").PgColumn<{
395
+ name: "issue_id";
396
+ tableName: "junior_github_issues";
397
+ dataType: "string";
398
+ columnType: "PgText";
399
+ data: string;
400
+ driverParam: string;
401
+ notNull: true;
402
+ hasDefault: false;
403
+ isPrimaryKey: true;
404
+ isAutoincrement: false;
405
+ hasRuntimeDefault: false;
406
+ enumValues: [string, ...string[]];
407
+ baseColumn: never;
408
+ identity: undefined;
409
+ generated: undefined;
410
+ }, {}, {}>;
411
+ repositoryId: import("drizzle-orm/pg-core").PgColumn<{
412
+ name: "repository_id";
413
+ tableName: "junior_github_issues";
414
+ dataType: "string";
415
+ columnType: "PgText";
416
+ data: string;
417
+ driverParam: string;
418
+ notNull: true;
419
+ hasDefault: false;
420
+ isPrimaryKey: false;
421
+ isAutoincrement: false;
422
+ hasRuntimeDefault: false;
423
+ enumValues: [string, ...string[]];
424
+ baseColumn: never;
425
+ identity: undefined;
426
+ generated: undefined;
427
+ }, {}, {}>;
428
+ repositoryFullName: import("drizzle-orm/pg-core").PgColumn<{
429
+ name: "repository_full_name";
430
+ tableName: "junior_github_issues";
431
+ dataType: "string";
432
+ columnType: "PgText";
433
+ data: string;
434
+ driverParam: string;
435
+ notNull: true;
436
+ hasDefault: false;
437
+ isPrimaryKey: false;
438
+ isAutoincrement: false;
439
+ hasRuntimeDefault: false;
440
+ enumValues: [string, ...string[]];
441
+ baseColumn: never;
442
+ identity: undefined;
443
+ generated: undefined;
444
+ }, {}, {}>;
445
+ number: import("drizzle-orm/pg-core").PgColumn<{
446
+ name: "number";
447
+ tableName: "junior_github_issues";
448
+ dataType: "number";
449
+ columnType: "PgInteger";
450
+ data: number;
451
+ driverParam: string | number;
452
+ notNull: true;
453
+ hasDefault: false;
454
+ isPrimaryKey: false;
455
+ isAutoincrement: false;
456
+ hasRuntimeDefault: false;
457
+ enumValues: undefined;
458
+ baseColumn: never;
459
+ identity: undefined;
460
+ generated: undefined;
461
+ }, {}, {}>;
462
+ state: import("drizzle-orm/pg-core").PgColumn<{
463
+ name: "state";
464
+ tableName: "junior_github_issues";
465
+ dataType: "string";
466
+ columnType: "PgText";
467
+ data: "open" | "closed";
468
+ driverParam: string;
469
+ notNull: true;
470
+ hasDefault: false;
471
+ isPrimaryKey: false;
472
+ isAutoincrement: false;
473
+ hasRuntimeDefault: false;
474
+ enumValues: [string, ...string[]];
475
+ baseColumn: never;
476
+ identity: undefined;
477
+ generated: undefined;
478
+ }, {}, {
479
+ $type: "open" | "closed";
480
+ }>;
481
+ openedAt: import("drizzle-orm/pg-core").PgColumn<{
482
+ name: "opened_at";
483
+ tableName: "junior_github_issues";
484
+ dataType: "date";
485
+ columnType: "PgTimestamp";
486
+ data: Date;
487
+ driverParam: string;
488
+ notNull: true;
489
+ hasDefault: false;
490
+ isPrimaryKey: false;
491
+ isAutoincrement: false;
492
+ hasRuntimeDefault: false;
493
+ enumValues: undefined;
494
+ baseColumn: never;
495
+ identity: undefined;
496
+ generated: undefined;
497
+ }, {}, {}>;
498
+ closedAt: import("drizzle-orm/pg-core").PgColumn<{
499
+ name: "closed_at";
500
+ tableName: "junior_github_issues";
501
+ dataType: "date";
502
+ columnType: "PgTimestamp";
503
+ data: Date;
504
+ driverParam: string;
505
+ notNull: false;
506
+ hasDefault: false;
507
+ isPrimaryKey: false;
508
+ isAutoincrement: false;
509
+ hasRuntimeDefault: false;
510
+ enumValues: undefined;
511
+ baseColumn: never;
512
+ identity: undefined;
513
+ generated: undefined;
514
+ }, {}, {}>;
515
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
516
+ name: "updated_at";
517
+ tableName: "junior_github_issues";
518
+ dataType: "date";
519
+ columnType: "PgTimestamp";
520
+ data: Date;
521
+ driverParam: string;
522
+ notNull: true;
523
+ hasDefault: false;
524
+ isPrimaryKey: false;
525
+ isAutoincrement: false;
526
+ hasRuntimeDefault: false;
527
+ enumValues: undefined;
528
+ baseColumn: never;
529
+ identity: undefined;
530
+ generated: undefined;
531
+ }, {}, {}>;
532
+ };
533
+ dialect: "pg";
534
+ }>;
172
535
  juniorGitHubPullRequests: import("drizzle-orm/pg-core").PgTableWithColumns<{
173
536
  name: "junior_github_pull_requests";
174
537
  schema: undefined;
@@ -260,6 +623,68 @@ export declare const githubSqlSchema: {
260
623
  }, {}, {
261
624
  $type: "merged" | "open" | "closed_unmerged";
262
625
  }>;
626
+ commitComposition: import("drizzle-orm/pg-core").PgColumn<{
627
+ name: "commit_composition";
628
+ tableName: "junior_github_pull_requests";
629
+ dataType: "string";
630
+ columnType: "PgText";
631
+ data: "junior_only" | "mixed";
632
+ driverParam: string;
633
+ notNull: false;
634
+ hasDefault: false;
635
+ isPrimaryKey: false;
636
+ isAutoincrement: false;
637
+ hasRuntimeDefault: false;
638
+ enumValues: [string, ...string[]];
639
+ baseColumn: never;
640
+ identity: undefined;
641
+ generated: undefined;
642
+ }, {}, {
643
+ $type: "junior_only" | "mixed";
644
+ }>;
645
+ conversationIds: import("drizzle-orm/pg-core").PgColumn<{
646
+ name: "conversation_ids";
647
+ tableName: "junior_github_pull_requests";
648
+ dataType: "array";
649
+ columnType: "PgArray";
650
+ data: string[];
651
+ driverParam: string | string[];
652
+ notNull: true;
653
+ hasDefault: true;
654
+ isPrimaryKey: false;
655
+ isAutoincrement: false;
656
+ hasRuntimeDefault: false;
657
+ enumValues: [string, ...string[]];
658
+ baseColumn: import("drizzle-orm").Column<{
659
+ name: "conversation_ids";
660
+ tableName: "junior_github_pull_requests";
661
+ dataType: "string";
662
+ columnType: "PgText";
663
+ data: string;
664
+ driverParam: string;
665
+ notNull: false;
666
+ hasDefault: false;
667
+ isPrimaryKey: false;
668
+ isAutoincrement: false;
669
+ hasRuntimeDefault: false;
670
+ enumValues: [string, ...string[]];
671
+ baseColumn: never;
672
+ identity: undefined;
673
+ generated: undefined;
674
+ }, {}, {}>;
675
+ identity: undefined;
676
+ generated: undefined;
677
+ }, {}, {
678
+ baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
679
+ name: "conversation_ids";
680
+ dataType: "string";
681
+ columnType: "PgText";
682
+ data: string;
683
+ enumValues: [string, ...string[]];
684
+ driverParam: string;
685
+ }, {}, {}, import("drizzle-orm").ColumnBuilderExtraConfig>;
686
+ size: undefined;
687
+ }>;
263
688
  openedAt: import("drizzle-orm/pg-core").PgColumn<{
264
689
  name: "opened_at";
265
690
  tableName: "junior_github_pull_requests";