@sentry/junior-github 0.199.0 → 0.201.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.
@@ -82,6 +82,20 @@ var GITHUB_PULL_REQUEST_EVENTS = [
82
82
  "pull_request.merged",
83
83
  "pull_request.closed_unmerged"
84
84
  ];
85
+ var GITHUB_PULL_REQUEST_EVENT_GUIDANCE = {
86
+ "pull_request.comment.created": 'After acting on actionable feedback, call github_updatePullRequestFeedback with the exact repo, commentId, and commentKind from Verified details, and status "addressed" or "declined".',
87
+ "pull_request.review_comment.created": 'After acting on actionable feedback, call github_updatePullRequestFeedback with the exact repo, commentId, and commentKind from Verified details, and status "addressed" or "declined". Then resolve the thread with github_resolvePullRequestReviewThread.'
88
+ };
89
+ function gitHubPullRequestEventGuidance(guidance) {
90
+ const merged = { ...GITHUB_PULL_REQUEST_EVENT_GUIDANCE };
91
+ for (const eventType of GITHUB_PULL_REQUEST_EVENTS) {
92
+ const extra = guidance?.[eventType]?.trim();
93
+ if (!extra) continue;
94
+ const base = merged[eventType];
95
+ merged[eventType] = base ? `${base} ${extra}` : extra;
96
+ }
97
+ return merged;
98
+ }
85
99
  var GITHUB_PULL_REQUEST_SUGGESTED_EVENTS = [
86
100
  "pull_request.checks.failed",
87
101
  "pull_request.comment.created",
@@ -1374,6 +1388,7 @@ var issueCommentWebhookSchema = z2.object({
1374
1388
  action: z2.string(),
1375
1389
  comment: z2.object({
1376
1390
  body: z2.string(),
1391
+ id: z2.number(),
1377
1392
  user: z2.object({ login: z2.string().optional() }).optional()
1378
1393
  }),
1379
1394
  issue: z2.object({
@@ -1400,7 +1415,13 @@ function normalizeIssueCommentEvents(deliveryId, body) {
1400
1415
  const resource = gitHubPullRequestResource(input);
1401
1416
  const data = pullRequestMatchData([
1402
1417
  pullRequestDraftData(parsed.data.issue.draft),
1403
- pullRequestAuthorData(parsed.data.issue.user)
1418
+ pullRequestAuthorData(parsed.data.issue.user),
1419
+ {
1420
+ repo: input.repo,
1421
+ pullRequest: input.number,
1422
+ commentId: parsed.data.comment.id,
1423
+ commentKind: "conversation"
1424
+ }
1404
1425
  ]);
1405
1426
  return pullRequestTargets2(
1406
1427
  {
@@ -1493,6 +1514,7 @@ var pullRequestReviewCommentWebhookSchema = z2.object({
1493
1514
  action: z2.string(),
1494
1515
  comment: z2.object({
1495
1516
  body: z2.string(),
1517
+ id: z2.number(),
1496
1518
  user: z2.object({ login: z2.string().optional() }).optional()
1497
1519
  }),
1498
1520
  pull_request: z2.object({
@@ -1521,7 +1543,13 @@ function normalizePullRequestReviewCommentEvent(deliveryId, body) {
1521
1543
  const data = pullRequestMatchData([
1522
1544
  pullRequestDraftData(parsed.data.pull_request.draft),
1523
1545
  pullRequestAuthorData(parsed.data.pull_request.user),
1524
- pullRequestHeadBranchData(parsed.data.pull_request.head?.ref)
1546
+ pullRequestHeadBranchData(parsed.data.pull_request.head?.ref),
1547
+ {
1548
+ repo,
1549
+ pullRequest: parsed.data.pull_request.number,
1550
+ commentId: parsed.data.comment.id,
1551
+ commentKind: "review"
1552
+ }
1525
1553
  ]);
1526
1554
  return pullRequestTargets2(
1527
1555
  {
@@ -1810,6 +1838,7 @@ export {
1810
1838
  GITHUB_DEPLOYMENT_SUGGESTED_EVENTS,
1811
1839
  gitHubDeploymentSourceSubscribable,
1812
1840
  GITHUB_PULL_REQUEST_EVENTS,
1841
+ gitHubPullRequestEventGuidance,
1813
1842
  GITHUB_PULL_REQUEST_SUGGESTED_EVENTS,
1814
1843
  GITHUB_PULL_REQUEST_MATCH_FIELDS,
1815
1844
  gitHubPullRequestSubscribable,