@sentry/junior-github 0.226.0 → 0.228.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.
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export declare const githubPullRequestStateSchema: z.ZodEnum<{
3
- open: "open";
4
3
  merged: "merged";
4
+ open: "open";
5
5
  closed_unmerged: "closed_unmerged";
6
6
  }>;
7
7
  export type GitHubPullRequestState = z.output<typeof githubPullRequestStateSchema>;
@@ -11,8 +11,8 @@ export declare const githubPullRequestCommitCompositionSchema: z.ZodEnum<{
11
11
  }>;
12
12
  export type GitHubPullRequestCommitComposition = z.output<typeof githubPullRequestCommitCompositionSchema>;
13
13
  export declare const githubIssueStateSchema: z.ZodEnum<{
14
- open: "open";
15
14
  closed: "closed";
15
+ open: "open";
16
16
  }>;
17
17
  export type GitHubIssueState = z.output<typeof githubIssueStateSchema>;
18
18
  export declare const githubIssueStateReasonSchema: z.ZodEnum<{
@@ -100,7 +100,7 @@ export declare const juniorGitHubIssues: import("drizzle-orm/pg-core").PgTableWi
100
100
  tableName: "junior_github_issues";
101
101
  dataType: "string";
102
102
  columnType: "PgText";
103
- data: "open" | "closed";
103
+ data: "closed" | "open";
104
104
  driverParam: string;
105
105
  notNull: true;
106
106
  hasDefault: false;
@@ -112,7 +112,7 @@ export declare const juniorGitHubIssues: import("drizzle-orm/pg-core").PgTableWi
112
112
  identity: undefined;
113
113
  generated: undefined;
114
114
  }, {}, {
115
- $type: "open" | "closed";
115
+ $type: "closed" | "open";
116
116
  }>;
117
117
  stateReason: import("drizzle-orm/pg-core").PgColumn<{
118
118
  name: "state_reason";
@@ -308,7 +308,7 @@ export declare const juniorGitHubPullRequests: import("drizzle-orm/pg-core").PgT
308
308
  tableName: "junior_github_pull_requests";
309
309
  dataType: "string";
310
310
  columnType: "PgText";
311
- data: "open" | "merged" | "closed_unmerged";
311
+ data: "merged" | "open" | "closed_unmerged";
312
312
  driverParam: string;
313
313
  notNull: true;
314
314
  hasDefault: false;
@@ -320,7 +320,7 @@ export declare const juniorGitHubPullRequests: import("drizzle-orm/pg-core").PgT
320
320
  identity: undefined;
321
321
  generated: undefined;
322
322
  }, {}, {
323
- $type: "open" | "merged" | "closed_unmerged";
323
+ $type: "merged" | "open" | "closed_unmerged";
324
324
  }>;
325
325
  commitComposition: import("drizzle-orm/pg-core").PgColumn<{
326
326
  name: "commit_composition";
@@ -592,7 +592,7 @@ export declare const githubSqlSchema: {
592
592
  tableName: "junior_github_issues";
593
593
  dataType: "string";
594
594
  columnType: "PgText";
595
- data: "open" | "closed";
595
+ data: "closed" | "open";
596
596
  driverParam: string;
597
597
  notNull: true;
598
598
  hasDefault: false;
@@ -604,7 +604,7 @@ export declare const githubSqlSchema: {
604
604
  identity: undefined;
605
605
  generated: undefined;
606
606
  }, {}, {
607
- $type: "open" | "closed";
607
+ $type: "closed" | "open";
608
608
  }>;
609
609
  stateReason: import("drizzle-orm/pg-core").PgColumn<{
610
610
  name: "state_reason";
@@ -857,7 +857,7 @@ export declare const githubSqlSchema: {
857
857
  tableName: "junior_github_pull_requests";
858
858
  dataType: "string";
859
859
  columnType: "PgText";
860
- data: "open" | "merged" | "closed_unmerged";
860
+ data: "merged" | "open" | "closed_unmerged";
861
861
  driverParam: string;
862
862
  notNull: true;
863
863
  hasDefault: false;
@@ -869,7 +869,7 @@ export declare const githubSqlSchema: {
869
869
  identity: undefined;
870
870
  generated: undefined;
871
871
  }, {}, {
872
- $type: "open" | "merged" | "closed_unmerged";
872
+ $type: "merged" | "open" | "closed_unmerged";
873
873
  }>;
874
874
  commitComposition: import("drizzle-orm/pg-core").PgColumn<{
875
875
  name: "commit_composition";
package/dist/index.js CHANGED
@@ -282,23 +282,11 @@ function githubObjectFacts(type, response) {
282
282
  }
283
283
 
284
284
  // src/annotations.ts
285
- var STATUS_ICON = {
286
- warning: "triangle-alert",
287
- open: "circle-dot",
288
- draft: "circle-dashed",
289
- merged: "git-merge",
290
- closed: "circle-x"
291
- };
292
- function isPullRequestUrl(url) {
293
- try {
294
- return /^\/[^/]+\/[^/]+\/pull\/\d+(?:\/|$)/.test(new URL(url).pathname);
295
- } catch {
296
- return false;
285
+ function githubObjectType(annotation) {
286
+ if (annotation.objectType === "task" || annotation.objectType === "code_change") {
287
+ return annotation.objectType;
297
288
  }
298
- }
299
- function sidebarIconForStatus(status, url) {
300
- if (status === "open" && isPullRequestUrl(url)) return "git-pull-request";
301
- return STATUS_ICON[status];
289
+ return annotation.url && /^\/[^/]+\/[^/]+\/pull\/\d+(?:\/|$)/.test(new URL(annotation.url).pathname) ? "code_change" : "task";
302
290
  }
303
291
  function repositoryName(annotation) {
304
292
  try {
@@ -312,10 +300,11 @@ function githubSidebarAnnotations(annotations) {
312
300
  return annotations.flatMap((annotation) => {
313
301
  const status = annotation.status;
314
302
  const label = repositoryName(annotation);
315
- return status && status in STATUS_ICON && label ? [
303
+ return label ? [
316
304
  {
317
305
  annotation: {
318
- icon: sidebarIconForStatus(status, annotation.url ?? ""),
306
+ objectType: githubObjectType(annotation),
307
+ status,
319
308
  key: annotation.key,
320
309
  label
321
310
  },
@@ -350,11 +339,16 @@ async function updateGitHubAnnotation(store, input) {
350
339
  updatedAt: _updatedAt,
351
340
  ...annotation
352
341
  } = current;
353
- await store.upsert({ ...annotation, status: input.status });
342
+ await store.upsert({
343
+ ...annotation,
344
+ objectType: input.objectType,
345
+ status: input.status
346
+ });
354
347
  return;
355
348
  }
356
349
  await store.upsert({
357
350
  kind: "resource_link",
351
+ objectType: input.objectType,
358
352
  key,
359
353
  label: `${input.repo}#${input.number}`,
360
354
  url: `https://github.com/${input.repo}/${input.objectType === "code_change" ? "pull" : "issues"}/${input.number}`,
@@ -3619,7 +3613,10 @@ function createGitHubWebhookRoute(args) {
3619
3613
  }
3620
3614
  }
3621
3615
  for (const event of events) {
3622
- await args.events.publish(event);
3616
+ await args.events.publish({
3617
+ ...event,
3618
+ objectType: event.eventType.startsWith("pull_request.") ? "code_change" : event.eventType.startsWith("issue.") ? "task" : event.eventType.startsWith("deployment.") ? "deployment" : "item"
3619
+ });
3623
3620
  }
3624
3621
  if (!pullRequestOutcome && !issueOutcome && !recordedIssueConversations && !recordedPullRequestConversations && !recordedPullRequestLinkedIssues && events.length === 0) {
3625
3622
  return new Response("Ignored", { status: 202 });
@@ -9,8 +9,8 @@ declare const githubIssueOutcomeInputSchema: z.ZodObject<{
9
9
  repositoryFullName: z.ZodString;
10
10
  repositoryId: z.ZodString;
11
11
  state: z.ZodEnum<{
12
- open: "open";
13
12
  closed: "closed";
13
+ open: "open";
14
14
  }>;
15
15
  stateReason: z.ZodOptional<z.ZodEnum<{
16
16
  completed: "completed";
@@ -15,8 +15,8 @@ declare const githubPullRequestOutcomeInputSchema: z.ZodObject<{
15
15
  repositoryFullName: z.ZodString;
16
16
  repositoryId: z.ZodString;
17
17
  state: z.ZodEnum<{
18
- open: "open";
19
18
  merged: "merged";
19
+ open: "open";
20
20
  closed_unmerged: "closed_unmerged";
21
21
  }>;
22
22
  title: z.ZodOptional<z.ZodString>;
@@ -16,7 +16,7 @@ export declare function createGitHubCloneRepositoryTool(ctx: {
16
16
  kind: "object";
17
17
  key: string;
18
18
  label: string;
19
- objectType: "code_change" | "task" | "automation" | "item";
19
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
20
20
  title: string;
21
21
  url: string | null;
22
22
  description?: string | undefined;
@@ -70,7 +70,7 @@ export declare function createGitHubCloneRepositoryTool(ctx: {
70
70
  kind: "object";
71
71
  key: string;
72
72
  label: string;
73
- objectType: "code_change" | "task" | "automation" | "item";
73
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
74
74
  title: string;
75
75
  url: string | null;
76
76
  description?: string | undefined;
@@ -13,7 +13,7 @@ export declare function createGitHubIssueTool(ctx: ToolRegistrationHookContext):
13
13
  kind: "object";
14
14
  key: string;
15
15
  label: string;
16
- objectType: "code_change" | "task" | "automation" | "item";
16
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
17
17
  title: string;
18
18
  url: string | null;
19
19
  description?: string | undefined;
@@ -75,7 +75,7 @@ export declare function createGitHubIssueTool(ctx: ToolRegistrationHookContext):
75
75
  kind: "object";
76
76
  key: string;
77
77
  label: string;
78
- objectType: "code_change" | "task" | "automation" | "item";
78
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
79
79
  title: string;
80
80
  url: string | null;
81
81
  description?: string | undefined;
@@ -16,7 +16,7 @@ export declare function createGitHubPullRequestTool(ctx: ToolRegistrationHookCon
16
16
  kind: "object";
17
17
  key: string;
18
18
  label: string;
19
- objectType: "code_change" | "task" | "automation" | "item";
19
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
20
20
  title: string;
21
21
  url: string | null;
22
22
  description?: string | undefined;
@@ -82,7 +82,7 @@ export declare function createGitHubPullRequestTool(ctx: ToolRegistrationHookCon
82
82
  kind: "object";
83
83
  key: string;
84
84
  label: string;
85
- objectType: "code_change" | "task" | "automation" | "item";
85
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
86
86
  title: string;
87
87
  url: string | null;
88
88
  description?: string | undefined;
@@ -38,7 +38,7 @@ export declare function createGitHubGetDeploymentTool(ctx: {
38
38
  kind: "object";
39
39
  key: string;
40
40
  label: string;
41
- objectType: "code_change" | "task" | "automation" | "item";
41
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
42
42
  title: string;
43
43
  url: string | null;
44
44
  description?: string | undefined;
@@ -121,7 +121,7 @@ export declare function createGitHubGetDeploymentTool(ctx: {
121
121
  kind: "object";
122
122
  key: string;
123
123
  label: string;
124
- objectType: "code_change" | "task" | "automation" | "item";
124
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
125
125
  title: string;
126
126
  url: string | null;
127
127
  description?: string | undefined;
@@ -23,7 +23,7 @@ export declare function createGitHubGetPullRequestTool(ctx: {
23
23
  kind: "object";
24
24
  key: string;
25
25
  label: string;
26
- objectType: "code_change" | "task" | "automation" | "item";
26
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
27
27
  title: string;
28
28
  url: string | null;
29
29
  description?: string | undefined;
@@ -92,7 +92,7 @@ export declare function createGitHubGetPullRequestTool(ctx: {
92
92
  kind: "object";
93
93
  key: string;
94
94
  label: string;
95
- objectType: "code_change" | "task" | "automation" | "item";
95
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
96
96
  title: string;
97
97
  url: string | null;
98
98
  description?: string | undefined;
@@ -27,7 +27,7 @@ export declare function createGitHubGetReleaseTool(ctx: {
27
27
  kind: "object";
28
28
  key: string;
29
29
  label: string;
30
- objectType: "code_change" | "task" | "automation" | "item";
30
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
31
31
  title: string;
32
32
  url: string | null;
33
33
  description?: string | undefined;
@@ -100,7 +100,7 @@ export declare function createGitHubGetReleaseTool(ctx: {
100
100
  kind: "object";
101
101
  key: string;
102
102
  label: string;
103
- objectType: "code_change" | "task" | "automation" | "item";
103
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
104
104
  title: string;
105
105
  url: string | null;
106
106
  description?: string | undefined;
@@ -18,7 +18,7 @@ export declare function createGitHubGetRepositoryTool(ctx: {
18
18
  kind: "object";
19
19
  key: string;
20
20
  label: string;
21
- objectType: "code_change" | "task" | "automation" | "item";
21
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
22
22
  title: string;
23
23
  url: string | null;
24
24
  description?: string | undefined;
@@ -83,7 +83,7 @@ export declare function createGitHubGetRepositoryTool(ctx: {
83
83
  kind: "object";
84
84
  key: string;
85
85
  label: string;
86
- objectType: "code_change" | "task" | "automation" | "item";
86
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
87
87
  title: string;
88
88
  url: string | null;
89
89
  description?: string | undefined;
@@ -16,7 +16,7 @@ export declare function createGitHubResolvePullRequestReviewThreadTool(ctx: {
16
16
  kind: "object";
17
17
  key: string;
18
18
  label: string;
19
- objectType: "code_change" | "task" | "automation" | "item";
19
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
20
20
  title: string;
21
21
  url: string | null;
22
22
  description?: string | undefined;
@@ -73,7 +73,7 @@ export declare function createGitHubResolvePullRequestReviewThreadTool(ctx: {
73
73
  kind: "object";
74
74
  key: string;
75
75
  label: string;
76
- objectType: "code_change" | "task" | "automation" | "item";
76
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
77
77
  title: string;
78
78
  url: string | null;
79
79
  description?: string | undefined;
@@ -25,7 +25,7 @@ export declare function createGitHubSubmitPullRequestReviewTool(egress: PluginEg
25
25
  kind: "object";
26
26
  key: string;
27
27
  label: string;
28
- objectType: "code_change" | "task" | "automation" | "item";
28
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
29
29
  title: string;
30
30
  url: string | null;
31
31
  description?: string | undefined;
@@ -83,7 +83,7 @@ export declare function createGitHubSubmitPullRequestReviewTool(egress: PluginEg
83
83
  kind: "object";
84
84
  key: string;
85
85
  label: string;
86
- objectType: "code_change" | "task" | "automation" | "item";
86
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
87
87
  title: string;
88
88
  url: string | null;
89
89
  description?: string | undefined;
@@ -24,7 +24,7 @@ export declare function createGitHubUpdateIssueTool(ctx: {
24
24
  number: number;
25
25
  title?: string | undefined;
26
26
  body?: string | undefined;
27
- state?: "open" | "closed" | undefined;
27
+ state?: "closed" | "open" | undefined;
28
28
  }, {
29
29
  body: string | null;
30
30
  number: number;
@@ -36,7 +36,7 @@ export declare function createGitHubUpdateIssueTool(ctx: {
36
36
  kind: "object";
37
37
  key: string;
38
38
  label: string;
39
- objectType: "code_change" | "task" | "automation" | "item";
39
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
40
40
  title: string;
41
41
  url: string | null;
42
42
  description?: string | undefined;
@@ -101,7 +101,7 @@ export declare function createGitHubUpdateIssueTool(ctx: {
101
101
  kind: "object";
102
102
  key: string;
103
103
  label: string;
104
- objectType: "code_change" | "task" | "automation" | "item";
104
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
105
105
  title: string;
106
106
  url: string | null;
107
107
  description?: string | undefined;
@@ -42,7 +42,7 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
42
42
  kind: "object";
43
43
  key: string;
44
44
  label: string;
45
- objectType: "code_change" | "task" | "automation" | "item";
45
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
46
46
  title: string;
47
47
  url: string | null;
48
48
  description?: string | undefined;
@@ -99,7 +99,7 @@ export declare function createGitHubUpdatePullRequestFeedbackTool(ctx: {
99
99
  kind: "object";
100
100
  key: string;
101
101
  label: string;
102
- objectType: "code_change" | "task" | "automation" | "item";
102
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
103
103
  title: string;
104
104
  url: string | null;
105
105
  description?: string | undefined;
@@ -25,7 +25,7 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
25
25
  title?: string | undefined;
26
26
  body?: string | undefined;
27
27
  base?: string | undefined;
28
- state?: "open" | "closed" | undefined;
28
+ state?: "closed" | "open" | undefined;
29
29
  }, {
30
30
  base: string;
31
31
  body: string | null;
@@ -39,7 +39,7 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
39
39
  kind: "object";
40
40
  key: string;
41
41
  label: string;
42
- objectType: "code_change" | "task" | "automation" | "item";
42
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
43
43
  title: string;
44
44
  url: string | null;
45
45
  description?: string | undefined;
@@ -106,7 +106,7 @@ export declare function createGitHubUpdatePullRequestTool(ctx: {
106
106
  kind: "object";
107
107
  key: string;
108
108
  label: string;
109
- objectType: "code_change" | "task" | "automation" | "item";
109
+ objectType: "code_change" | "task" | "deployment" | "automation" | "item";
110
110
  title: string;
111
111
  url: string | null;
112
112
  description?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-github",
3
- "version": "0.226.0",
3
+ "version": "0.228.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -31,7 +31,7 @@
31
31
  "@sinclair/typebox": "^0.34.49",
32
32
  "drizzle-orm": "^0.45.2",
33
33
  "zod": "^4.5.4",
34
- "@sentry/junior-plugin-api": "0.226.0"
34
+ "@sentry/junior-plugin-api": "0.228.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@oxlint/plugins": "1.79.0",