Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(github): github codecheck notifications (#4087)

Will Hutchinsonb02e3654dc5d
diff --git a/js/app/packages/entity/src/extractors-notification/notification-description-helpers.ts b/js/app/packages/entity/src/extractors-notification/notification-description-helpers.ts
index 2936b06621..13dd84b25c 100644
--- a/js/app/packages/entity/src/extractors-notification/notification-description-helpers.ts
+++ b/js/app/packages/entity/src/extractors-notification/notification-description-helpers.ts
@@ -35,6 +35,7 @@ export function getActionVerb(type: NotificationType): string {
.with('invite_to_team', () => 'invited you')
.with('task_assigned', () => 'assigned you')
.with('github_pr_status_changed', () => 'updated a pull request')
+ .with('github_pr_check_run', () => 'completed a check')
.with('github_review_requested', () => 'requested your review')
.with('github_pr_comment', () => 'commented on a pull request')
.with('github_pr_mention', () => 'mentioned you on a pull request')
@@ -70,6 +71,7 @@ export function getTypeNoun(type: NotificationType, count: number): string {
.with('github_pr_status_changed', () =>
count === 1 ? 'pull request' : 'pull requests'
)
+ .with('github_pr_check_run', () => (count === 1 ? 'check' : 'checks'))
.with('github_review_requested', () =>
count === 1 ? 'review request' : 'review requests'
)
diff --git a/js/app/packages/entity/src/extractors-notification/notification-icon.tsx b/js/app/packages/entity/src/extractors-notification/notification-icon.tsx
index 807174b79d..34b1c9798f 100644
--- a/js/app/packages/entity/src/extractors-notification/notification-icon.tsx
+++ b/js/app/packages/entity/src/extractors-notification/notification-icon.tsx
@@ -43,6 +43,7 @@ function getNotificationIcon(
.with(
P.union(
'github_pr_status_changed',
+ 'github_pr_check_run',
'github_review_requested',
'github_pr_comment',
'github_pr_mention',
diff --git a/js/app/packages/entity/src/utils/notification.ts b/js/app/packages/entity/src/utils/notification.ts
index 8f6ab43f78..5074c7ceee 100644
--- a/js/app/packages/entity/src/utils/notification.ts
+++ b/js/app/packages/entity/src/utils/notification.ts
@@ -1,7 +1,7 @@
import { ENABLE_DOCUMENT_MENTION_NOTIFICATIONS } from '@core/constant/featureFlags';
import type { Entity, NotificationType } from '@core/types';
-import { notificationIsRead, type UnifiedNotification } from '@notifications';
import type { NotificationStack } from '@notifications/notification-stacking';
+import type { UnifiedNotification } from '@notifications/types';
import { match, P } from 'ts-pattern';
import type { EntityData } from '../types/entity';
import type { Notification } from '../types/notification';
@@ -17,6 +17,29 @@ type KnownNotificationMetadata =
| UnifiedNotification['notification_metadata']
| CallStartedNotificationMetadata;
+const CHANNEL_NOTIFICATION_TYPES = [
+ 'channel_mention',
+ 'channel_message_send',
+ 'channel_message_reply',
+] as const;
+
+function notificationIsRead(notification: UnifiedNotification): boolean {
+ if (notification.viewed_at || notification.done) return true;
+
+ if (notification.entity_type === 'channel') {
+ const notificationType = notification.notification_metadata?.tag ?? '';
+ if (
+ !(CHANNEL_NOTIFICATION_TYPES as readonly string[]).includes(
+ notificationType
+ )
+ ) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
export function toNotificationEntity(entity: EntityData): Entity {
if (entity.type === 'email') {
return { type: 'email_thread', id: entity.id };
@@ -98,6 +121,17 @@ export function getNotificationActionText(n: Notification): string {
.with('task_assigned', () => 'assigned')
.with('ai_response', () => 'responded')
.with('github_pr_status_changed', () => 'updated')
+ .with('github_pr_check_run', () => {
+ const meta = n.notification_metadata;
+ if (
+ meta.tag === 'github_pr_check_run' &&
+ meta.content.state === 'failed'
+ ) {
+ return 'failed';
+ }
+
+ return 'completed';
+ })
.with('github_review_requested', () => 'requested')
.with('github_pr_comment', () => 'commented')
.with('github_pr_mention', () => 'mentioned')
@@ -134,6 +168,11 @@ export function extractMessageContent(notification: Notification): string {
{ tag: P.union('github_pr_status_changed', 'github_review_requested') },
(m) => m.content.title || m.content.displayName || ''
)
+ .with(
+ { tag: 'github_pr_check_run' },
+ (m) =>
+ m.content.checkName || m.content.title || m.content.displayName || ''
+ )
.with(
{ tag: 'github_pr_comment' },
(m) =>
diff --git a/js/app/packages/entity/tests/notification-description.test.ts b/js/app/packages/entity/tests/notification-description.test.ts
index a7b4273522..db0ec14b31 100644
--- a/js/app/packages/entity/tests/notification-description.test.ts
+++ b/js/app/packages/entity/tests/notification-description.test.ts
@@ -116,6 +116,10 @@ describe('notification-description helpers', () => {
'updated a pull request'
);
});
+
+ it('returns correct verb for github_pr_check_run', () => {
+ expect(getActionVerb('github_pr_check_run')).toBe('completed a check');
+ });
});
describe('getTypeNoun', () => {
@@ -225,6 +229,16 @@ describe('notification-description helpers', () => {
});
});
+ describe('github_pr_check_run', () => {
+ it('returns singular for count of 1', () => {
+ expect(getTypeNoun('github_pr_check_run', 1)).toBe('check');
+ });
+
+ it('returns plural for count greater than 1', () => {
+ expect(getTypeNoun('github_pr_check_run', 2)).toBe('checks');
+ });
+ });
+
describe('edge cases', () => {
it('handles count of 0 as plural', () => {
expect(getTypeNoun('channel_message_send', 0)).toBe('messages');
diff --git a/js/app/packages/entity/tests/notification.test.ts b/js/app/packages/entity/tests/notification.test.ts
index e307fcb7f4..9fef11dc13 100644
--- a/js/app/packages/entity/tests/notification.test.ts
+++ b/js/app/packages/entity/tests/notification.test.ts
@@ -1,4 +1,7 @@
-import type { GithubPrStatusChanged } from '@service-notification/generated/schemas';
+import type {
+ GithubPrCheckRun,
+ GithubPrStatusChanged,
+} from '@service-notification/generated/schemas';
import { describe, expect, it } from 'vitest';
import type { Notification } from '../src/types/notification';
import {
@@ -19,6 +22,13 @@ type GithubPrNotification = Notification & {
};
};
+type GithubPrCheckRunNotification = Notification & {
+ notification_metadata: {
+ content: GithubPrCheckRun;
+ tag: 'github_pr_check_run';
+ };
+};
+
function githubPrStatusChanged(
overrides: Partial<GithubPrStatusChanged> = {}
): GithubPrStatusChanged {
@@ -48,6 +58,40 @@ function githubPrNotification(
} as GithubPrNotification;
}
+function githubPrCheckRun(
+ overrides: Partial<GithubPrCheckRun> = {}
+): GithubPrCheckRun {
+ return {
+ checkName: 'CI / tests',
+ checkRunGithubId: 987654321,
+ checkStatus: 'completed',
+ checkUrl: 'https://github.com/macro/macro/runs/987654321',
+ completedAt: '2026-06-15T20:00:00Z',
+ conclusion: 'success',
+ displayName: 'macro/macro#42',
+ foreignEntityId: GITHUB_PR_FOREIGN_ENTITY_ID,
+ githubKey: 'macro/macro/pull/42',
+ number: 42,
+ owner: 'macro',
+ repo: 'macro',
+ state: 'completed',
+ title: 'Add notification support',
+ url: 'https://github.com/macro/macro/pull/42',
+ ...overrides,
+ };
+}
+
+function githubPrCheckRunNotification(
+ overrides: Partial<GithubPrCheckRun> = {}
+): GithubPrCheckRunNotification {
+ return {
+ notification_metadata: {
+ content: githubPrCheckRun(overrides),
+ tag: 'github_pr_check_run',
+ },
+ } as GithubPrCheckRunNotification;
+}
+
describe('notification utils', () => {
describe('filterValidNotifications', () => {
it('returns empty array for undefined input', () => {
@@ -291,6 +335,23 @@ describe('notification utils', () => {
it('returns correct action text for github_pr_status_changed', () => {
expect(getNotificationActionText(githubPrNotification())).toBe('updated');
});
+
+ it('returns completed action text for github_pr_check_run', () => {
+ expect(getNotificationActionText(githubPrCheckRunNotification())).toBe(
+ 'completed'
+ );
+ });
+
+ it('returns failed action text for failed github_pr_check_run', () => {
+ expect(
+ getNotificationActionText(
+ githubPrCheckRunNotification({
+ conclusion: 'failure',
+ state: 'failed',
+ })
+ )
+ ).toBe('failed');
+ });
});
describe('extractMessageContent', () => {
@@ -390,6 +451,26 @@ describe('notification utils', () => {
);
});
+ it('extracts GitHub PR check-run check name', () => {
+ expect(extractMessageContent(githubPrCheckRunNotification())).toBe(
+ 'CI / tests'
+ );
+ });
+
+ it('falls back to GitHub PR title when check-run check name is empty', () => {
+ expect(
+ extractMessageContent(githubPrCheckRunNotification({ checkName: '' }))
+ ).toBe('Add notification support');
+ });
+
+ it('falls back to GitHub PR display name when check-run name and title are empty', () => {
+ expect(
+ extractMessageContent(
+ githubPrCheckRunNotification({ checkName: '', title: '' })
+ )
+ ).toBe('macro/macro#42');
+ });
+
it('returns empty string for channel_invite', () => {
const notification = {
notification_metadata: {
diff --git a/js/app/packages/notifications/github-event-types.ts b/js/app/packages/notifications/github-event-types.ts
index d81ef380f1..ca473d5f34 100644
--- a/js/app/packages/notifications/github-event-types.ts
+++ b/js/app/packages/notifications/github-event-types.ts
@@ -6,6 +6,7 @@
*/
export const GITHUB_EVENT_TYPES = [
'github_pr_status_changed',
+ 'github_pr_check_run',
'github_review_requested',
'github_pr_comment',
'github_pr_mention',
diff --git a/js/app/packages/notifications/notification-metadata.ts b/js/app/packages/notifications/notification-metadata.ts
index f324641b23..f5c3514580 100644
--- a/js/app/packages/notifications/notification-metadata.ts
+++ b/js/app/packages/notifications/notification-metadata.ts
@@ -19,6 +19,17 @@ export function getNotificationAction(n: UnifiedNotification): string {
.with('invite_to_team', () => 'invited you to')
.with('task_assigned', () => 'assigned you a task')
.with('github_pr_status_changed', () => 'updated a pull request')
+ .with('github_pr_check_run', () => {
+ const meta = n.notification_metadata;
+ if (
+ meta.tag === 'github_pr_check_run' &&
+ meta.content.state === 'failed'
+ ) {
+ return 'failed a check on';
+ }
+
+ return 'completed a check on';
+ })
.with('github_review_requested', () => 'requested your review on')
.with('github_pr_comment', () => 'commented on')
.with('github_pr_mention', () => 'mentioned you in')
@@ -75,6 +86,10 @@ export function getNotificationContent(
{ tag: P.union('github_pr_status_changed', 'github_review_requested') },
(m) => m.content.title || m.content.displayName
)
+ .with(
+ { tag: 'github_pr_check_run' },
+ (m) => m.content.checkName || m.content.title || m.content.displayName
+ )
.with(
{ tag: 'github_pr_comment' },
(m) =>
diff --git a/js/app/packages/notifications/notification-navigation.ts b/js/app/packages/notifications/notification-navigation.ts
index 36e583c22e..7246ebe9ba 100644
--- a/js/app/packages/notifications/notification-navigation.ts
+++ b/js/app/packages/notifications/notification-navigation.ts
@@ -246,13 +246,19 @@ function getSupportedHandler(
meta.tag !== 'github_review_requested' &&
meta.tag !== 'github_pr_comment' &&
meta.tag !== 'github_pr_mention' &&
- meta.tag !== 'github_pr_review'
+ meta.tag !== 'github_pr_review' &&
+ meta.tag !== 'github_pr_check_run'
) {
return null;
}
return async () => {
// TODO(dev-rb/github): Route GitHub PR notifications to /pr.
- openExternalUrl(meta.content.url);
+ let url = meta.content.url;
+ if (meta.tag === 'github_pr_check_run') {
+ url = meta.content.checkUrl || meta.content.url;
+ }
+
+ openExternalUrl(url);
};
})
.with('mentioned_in_document_comment', () => {
diff --git a/js/app/packages/notifications/notification-preview.ts b/js/app/packages/notifications/notification-preview.ts
index 8533120d00..1b93b035ac 100644
--- a/js/app/packages/notifications/notification-preview.ts
+++ b/js/app/packages/notifications/notification-preview.ts
@@ -14,6 +14,7 @@ export const NOTIFICATION_LABEL_BY_TYPE: Record<NotificationType, string> = {
task_assigned: 'ASSIGNED',
ai_response: 'AI',
github_pr_status_changed: 'GITHUB',
+ github_pr_check_run: 'CHECK',
github_review_requested: 'REVIEW',
github_pr_comment: 'COMMENT',
github_pr_mention: 'MENTION',
diff --git a/js/app/packages/notifications/tests/notification-platform.test.ts b/js/app/packages/notifications/tests/notification-platform.test.ts
index 7dbc3341d5..b88b6ea982 100644
--- a/js/app/packages/notifications/tests/notification-platform.test.ts
+++ b/js/app/packages/notifications/tests/notification-platform.test.ts
@@ -89,6 +89,34 @@ function createGithubPrNotification(): UnifiedNotification {
});
}
+function createGithubPrCheckRunNotification(): UnifiedNotification {
+ return baseNotification({
+ entity_id: '123e4567-e89b-12d3-a456-426614174000',
+ entity_type: 'foreign_entity',
+ notification_event_type: 'github_pr_check_run',
+ notification_metadata: {
+ tag: 'github_pr_check_run',
+ content: {
+ checkName: 'CI / tests',
+ checkRunGithubId: 987654321,
+ checkStatus: 'completed',
+ checkUrl: 'https://github.com/macro/macro/runs/987654321',
+ completedAt: '2026-06-15T20:00:00Z',
+ conclusion: 'success',
+ displayName: 'macro/macro#42',
+ foreignEntityId: '123e4567-e89b-12d3-a456-426614174000',
+ githubKey: 'macro/macro/pull/42',
+ number: 42,
+ owner: 'macro',
+ repo: 'macro',
+ state: 'completed',
+ title: 'Add notification support',
+ url: 'https://github.com/macro/macro/pull/42',
+ },
+ },
+ });
+}
+
function createNotificationInterface(
showNotification: PlatformNotificationState['showNotification']
): PlatformNotificationState {
@@ -124,6 +152,21 @@ describe('maybeHandlePlatformNotification', () => {
expect(showNotification).not.toHaveBeenCalled();
});
+ it('skips GitHub PR check-run events as browser notifications', async () => {
+ const showNotification = vi.fn<
+ PlatformNotificationState['showNotification']
+ >(async () => 'not-granted');
+ const notificationInterface = createNotificationInterface(showNotification);
+
+ await maybeHandlePlatformNotification(
+ createGithubPrCheckRunNotification(),
+ notificationInterface,
+ {} as SplitManager
+ );
+
+ expect(showNotification).not.toHaveBeenCalled();
+ });
+
it('still renders non-GitHub browser notifications', async () => {
const handle = createNotificationHandle();
const showNotification = vi.fn<
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/githubPrCheckRun.ts b/js/app/packages/service-clients/service-notification/generated/schemas/githubPrCheckRun.ts
new file mode 100644
index 0000000000..fa220cefb5
--- /dev/null
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/githubPrCheckRun.ts
@@ -0,0 +1,15 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * notification_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+import type { GithubPrCheckRunAllOf } from './githubPrCheckRunAllOf';
+import type { GithubPrNotificationCommon } from './githubPrNotificationCommon';
+
+/**
+ * Metadata for a notification that a GitHub pull request check run completed.
+ */
+export type GithubPrCheckRun = GithubPrNotificationCommon &
+ GithubPrCheckRunAllOf;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/githubPrCheckRunAllOf.ts b/js/app/packages/service-clients/service-notification/generated/schemas/githubPrCheckRunAllOf.ts
new file mode 100644
index 0000000000..fd57069e02
--- /dev/null
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/githubPrCheckRunAllOf.ts
@@ -0,0 +1,27 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * notification_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { GithubPrCheckRunState } from './githubPrCheckRunState';
+
+export type GithubPrCheckRunAllOf = {
+ /** The display name GitHub reported for the check run. */
+ checkName: string;
+ /**
+ * The GitHub numeric id of the check run.
+ * @minimum 0
+ */
+ checkRunGithubId: number;
+ /** The raw GitHub check run status. */
+ checkStatus: string;
+ /** The public GitHub URL for the check run. */
+ checkUrl: string;
+ /** When GitHub marked the check run as complete. */
+ completedAt: string;
+ /** The raw GitHub check run conclusion. */
+ conclusion: string;
+ /** The normalized notification state for this check run. */
+ state: GithubPrCheckRunState;
+};
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/githubPrCheckRunState.ts b/js/app/packages/service-clients/service-notification/generated/schemas/githubPrCheckRunState.ts
new file mode 100644
index 0000000000..3daddaedaa
--- /dev/null
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/githubPrCheckRunState.ts
@@ -0,0 +1,18 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * notification_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The normalized result state for a GitHub pull request check-run notification.
+ */
+export type GithubPrCheckRunState =
+ (typeof GithubPrCheckRunState)[keyof typeof GithubPrCheckRunState];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const GithubPrCheckRunState = {
+ completed: 'completed',
+ failed: 'failed',
+} as const;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/index.ts b/js/app/packages/service-clients/service-notification/generated/schemas/index.ts
index c1fc2692c8..09388c9b75 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/index.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/index.ts
@@ -60,6 +60,9 @@ export * from './getAllUserNotificationsResponse';
export * from './getAllUserNotificationsResponseNextCursor';
export * from './getNotificationTypePreferencesResponse';
export * from './getTypedNotificationsByEventItemIdParams';
+export * from './githubPrCheckRun';
+export * from './githubPrCheckRunAllOf';
+export * from './githubPrCheckRunState';
export * from './githubPrComment';
export * from './githubPrCommentAllOf';
export * from './githubPrCommentAllOfCommentGithubId';
@@ -126,6 +129,8 @@ export * from './notifEventOneOfSeven';
export * from './notifEventOneOfSevenTag';
export * from './notifEventOneOfTag';
export * from './notifEventOneOfThree';
+export * from './notifEventOneOfThreefive';
+export * from './notifEventOneOfThreefiveTag';
export * from './notifEventOneOfThreeone';
export * from './notifEventOneOfThreeoneTag';
export * from './notifEventOneOfThreeTag';
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/notifEvent.ts b/js/app/packages/service-clients/service-notification/generated/schemas/notifEvent.ts
index d1a1602aa2..df641102a9 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/notifEvent.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/notifEvent.ts
@@ -14,6 +14,7 @@ import type { NotifEventOneOfOneseven } from './notifEventOneOfOneseven';
import type { NotifEventOneOfOnethree } from './notifEventOneOfOnethree';
import type { NotifEventOneOfSeven } from './notifEventOneOfSeven';
import type { NotifEventOneOfThree } from './notifEventOneOfThree';
+import type { NotifEventOneOfThreefive } from './notifEventOneOfThreefive';
import type { NotifEventOneOfThreeone } from './notifEventOneOfThreeone';
import type { NotifEventOneOfThreethree } from './notifEventOneOfThreethree';
import type { NotifEventOneOfTwofive } from './notifEventOneOfTwofive';
@@ -47,4 +48,5 @@ export type NotifEvent =
| NotifEventOneOfTwoseven
| NotifEventOneOfTwonine
| NotifEventOneOfThreeone
- | NotifEventOneOfThreethree;
+ | NotifEventOneOfThreethree
+ | NotifEventOneOfThreefive;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreefive.ts b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreefive.ts
new file mode 100644
index 0000000000..255a149e29
--- /dev/null
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreefive.ts
@@ -0,0 +1,17 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * notification_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { GithubPrReview } from './githubPrReview';
+import type { NotifEventOneOfThreefiveTag } from './notifEventOneOfThreefiveTag';
+
+/**
+ * A review was submitted on the user's GitHub pull request.
+ */
+export type NotifEventOneOfThreefive = {
+ /** A review was submitted on the user's GitHub pull request. */
+ content: GithubPrReview;
+ tag: NotifEventOneOfThreefiveTag;
+};
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreefiveTag.ts b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreefiveTag.ts
new file mode 100644
index 0000000000..7299adb547
--- /dev/null
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreefiveTag.ts
@@ -0,0 +1,14 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * notification_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type NotifEventOneOfThreefiveTag =
+ (typeof NotifEventOneOfThreefiveTag)[keyof typeof NotifEventOneOfThreefiveTag];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const NotifEventOneOfThreefiveTag = {
+ github_pr_review: 'github_pr_review',
+} as const;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreeone.ts b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreeone.ts
index 30a475f962..4ad56ee64e 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreeone.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreeone.ts
@@ -4,14 +4,14 @@
* notification_service
* OpenAPI spec version: 0.1.0
*/
-import type { GithubPrMention } from './githubPrMention';
+import type { GithubPrComment } from './githubPrComment';
import type { NotifEventOneOfThreeoneTag } from './notifEventOneOfThreeoneTag';
/**
- * The user was mentioned on a GitHub pull request.
+ * A GitHub pull request was commented on.
*/
export type NotifEventOneOfThreeone = {
- /** The user was mentioned on a GitHub pull request. */
- content: GithubPrMention;
+ /** A GitHub pull request was commented on. */
+ content: GithubPrComment;
tag: NotifEventOneOfThreeoneTag;
};
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreeoneTag.ts b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreeoneTag.ts
index cb019c1e9d..9e15a9b28f 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreeoneTag.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreeoneTag.ts
@@ -10,5 +10,5 @@ export type NotifEventOneOfThreeoneTag =
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NotifEventOneOfThreeoneTag = {
- github_pr_mention: 'github_pr_mention',
+ github_pr_comment: 'github_pr_comment',
} as const;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreethree.ts b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreethree.ts
index ce826e9322..e59d1b5deb 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreethree.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreethree.ts
@@ -4,14 +4,14 @@
* notification_service
* OpenAPI spec version: 0.1.0
*/
-import type { GithubPrReview } from './githubPrReview';
+import type { GithubPrMention } from './githubPrMention';
import type { NotifEventOneOfThreethreeTag } from './notifEventOneOfThreethreeTag';
/**
- * A review was submitted on the user's GitHub pull request.
+ * The user was mentioned on a GitHub pull request.
*/
export type NotifEventOneOfThreethree = {
- /** A review was submitted on the user's GitHub pull request. */
- content: GithubPrReview;
+ /** The user was mentioned on a GitHub pull request. */
+ content: GithubPrMention;
tag: NotifEventOneOfThreethreeTag;
};
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreethreeTag.ts b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreethreeTag.ts
index 4d60611c72..a622eb81a9 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreethreeTag.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfThreethreeTag.ts
@@ -10,5 +10,5 @@ export type NotifEventOneOfThreethreeTag =
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NotifEventOneOfThreethreeTag = {
- github_pr_review: 'github_pr_review',
+ github_pr_mention: 'github_pr_mention',
} as const;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwonine.ts b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwonine.ts
index 88b141c373..d60b749701 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwonine.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwonine.ts
@@ -4,14 +4,14 @@
* notification_service
* OpenAPI spec version: 0.1.0
*/
-import type { GithubPrComment } from './githubPrComment';
+import type { GithubReviewRequested } from './githubReviewRequested';
import type { NotifEventOneOfTwonineTag } from './notifEventOneOfTwonineTag';
/**
- * A GitHub pull request was commented on.
+ * The user's review was requested on a GitHub pull request.
*/
export type NotifEventOneOfTwonine = {
- /** A GitHub pull request was commented on. */
- content: GithubPrComment;
+ /** The user's review was requested on a GitHub pull request. */
+ content: GithubReviewRequested;
tag: NotifEventOneOfTwonineTag;
};
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwonineTag.ts b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwonineTag.ts
index 920c0cce78..7bf8b23007 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwonineTag.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwonineTag.ts
@@ -10,5 +10,5 @@ export type NotifEventOneOfTwonineTag =
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NotifEventOneOfTwonineTag = {
- github_pr_comment: 'github_pr_comment',
+ github_review_requested: 'github_review_requested',
} as const;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwoseven.ts b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwoseven.ts
index b52a2e2929..241401619e 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwoseven.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwoseven.ts
@@ -4,14 +4,14 @@
* notification_service
* OpenAPI spec version: 0.1.0
*/
-import type { GithubReviewRequested } from './githubReviewRequested';
+import type { GithubPrCheckRun } from './githubPrCheckRun';
import type { NotifEventOneOfTwosevenTag } from './notifEventOneOfTwosevenTag';
/**
- * The user's review was requested on a GitHub pull request.
+ * A GitHub pull request check run completed.
*/
export type NotifEventOneOfTwoseven = {
- /** The user's review was requested on a GitHub pull request. */
- content: GithubReviewRequested;
+ /** A GitHub pull request check run completed. */
+ content: GithubPrCheckRun;
tag: NotifEventOneOfTwosevenTag;
};
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwosevenTag.ts b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwosevenTag.ts
index 3cbaa37699..9eb3f2a036 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwosevenTag.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/notifEventOneOfTwosevenTag.ts
@@ -10,5 +10,5 @@ export type NotifEventOneOfTwosevenTag =
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NotifEventOneOfTwosevenTag = {
- github_review_requested: 'github_review_requested',
+ github_pr_check_run: 'github_pr_check_run',
} as const;
diff --git a/js/app/packages/service-clients/service-notification/generated/zod.ts b/js/app/packages/service-clients/service-notification/generated/zod.ts
index f47fcca25e..073dcb8148 100644
--- a/js/app/packages/service-clients/service-notification/generated/zod.ts
+++ b/js/app/packages/service-clients/service-notification/generated/zod.ts
@@ -103,15 +103,19 @@ export const listTypedNotificationsResponseItemsItemNotificationMetadataContentN
export const listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinOne = 0;
+export const listTypedNotificationsResponseItemsItemNotificationMetadataContentCheckRunGithubIdMin = 0;
+
export const listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinTwo = 0;
+export const listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinThree = 0;
+
export const listTypedNotificationsResponseItemsItemNotificationMetadataContentCommentGithubIdMin = 0;
-export const listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinThree = 0;
+export const listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinFour = 0;
export const listTypedNotificationsResponseItemsItemNotificationMetadataContentCommentGithubIdMinOne = 0;
-export const listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinFour = 0;
+export const listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinFive = 0;
export const listTypedNotificationsResponseItemsItemNotificationMetadataContentReviewGithubIdMin = 0;
@@ -806,6 +810,115 @@ export const listTypedNotificationsResponse = zod
.describe(
'Fields shared by every GitHub pull request notification type.\n\nEmbedded with `#[serde(flatten)]` so the wire shape keeps these keys at the\ntop level of the metadata object.'
)
+ .and(
+ zod.object({
+ checkName: zod
+ .string()
+ .describe(
+ 'The display name GitHub reported for the check run.'
+ ),
+ checkRunGithubId: zod
+ .number()
+ .min(
+ listTypedNotificationsResponseItemsItemNotificationMetadataContentCheckRunGithubIdMin
+ )
+ .describe(
+ 'The GitHub numeric id of the check run.'
+ ),
+ checkStatus: zod
+ .string()
+ .describe('The raw GitHub check run status.'),
+ checkUrl: zod
+ .string()
+ .describe(
+ 'The public GitHub URL for the check run.'
+ ),
+ completedAt: zod.iso
+ .datetime({})
+ .describe(
+ 'When GitHub marked the check run as complete.'
+ ),
+ conclusion: zod
+ .string()
+ .describe('The raw GitHub check run conclusion.'),
+ state: zod
+ .enum(['completed', 'failed'])
+ .describe(
+ 'The normalized result state for a GitHub pull request check-run notification.'
+ ),
+ })
+ )
+ .describe(
+ 'Metadata for a notification that a GitHub pull request check run completed.'
+ ),
+ tag: zod.enum(['github_pr_check_run']),
+ })
+ .describe('A GitHub pull request check run completed.'),
+ zod
+ .object({
+ content: zod
+ .object({
+ displayName: zod
+ .string()
+ .describe(
+ 'A compact label suitable for display in the UI.'
+ ),
+ foreignEntityId: zod
+ .uuid()
+ .describe(
+ 'The source-specific internal foreign entity row id for this pull request.'
+ ),
+ githubKey: zod
+ .string()
+ .describe(
+ 'The external GitHub key, in `owner\/repo\/pull\/number` format.'
+ ),
+ number: zod
+ .number()
+ .min(
+ listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinTwo
+ )
+ .describe('The GitHub pull request number.'),
+ owner: zod
+ .string()
+ .describe(
+ 'The GitHub repository owner or organization.'
+ ),
+ repo: zod
+ .string()
+ .describe('The GitHub repository name.'),
+ senderGithubAvatarUrl: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The GitHub avatar URL for the sender, when available.'
+ ),
+ senderGithubLogin: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The GitHub login for the sender, when available.'
+ ),
+ senderGithubUserId: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The stable GitHub numeric user id for the sender, serialized as a string.'
+ ),
+ title: zod
+ .string()
+ .describe(
+ 'The GitHub pull request title. Falls back to `display_name` when GitHub has no title.'
+ ),
+ url: zod
+ .string()
+ .describe(
+ 'The public GitHub URL for the pull request.'
+ ),
+ })
+ .describe(
+ 'Fields shared by every GitHub pull request notification type.\n\nEmbedded with `#[serde(flatten)]` so the wire shape keeps these keys at the\ntop level of the metadata object.'
+ )
.and(
zod.object({
requestedReviewerGithubLogin: zod
@@ -852,7 +965,7 @@ export const listTypedNotificationsResponse = zod
number: zod
.number()
.min(
- listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinTwo
+ listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinThree
)
.describe('The GitHub pull request number.'),
owner: zod
@@ -952,7 +1065,7 @@ export const listTypedNotificationsResponse = zod
number: zod
.number()
.min(
- listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinThree
+ listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinFour
)
.describe('The GitHub pull request number.'),
owner: zod
@@ -1059,7 +1172,7 @@ export const listTypedNotificationsResponse = zod
number: zod
.number()
.min(
- listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinFour
+ listTypedNotificationsResponseItemsItemNotificationMetadataContentNumberMinFive
)
.describe('The GitHub pull request number.'),
owner: zod
@@ -1207,15 +1320,19 @@ export const bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificatio
export const bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinOne = 0;
+export const bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentCheckRunGithubIdMin = 0;
+
export const bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinTwo = 0;
+export const bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinThree = 0;
+
export const bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentCommentGithubIdMin = 0;
-export const bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinThree = 0;
+export const bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinFour = 0;
export const bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentCommentGithubIdMinOne = 0;
-export const bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinFour = 0;
+export const bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinFive = 0;
export const bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentReviewGithubIdMin = 0;
@@ -1910,6 +2027,115 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zod
.describe(
'Fields shared by every GitHub pull request notification type.\n\nEmbedded with `#[serde(flatten)]` so the wire shape keeps these keys at the\ntop level of the metadata object.'
)
+ .and(
+ zod.object({
+ checkName: zod
+ .string()
+ .describe(
+ 'The display name GitHub reported for the check run.'
+ ),
+ checkRunGithubId: zod
+ .number()
+ .min(
+ bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentCheckRunGithubIdMin
+ )
+ .describe(
+ 'The GitHub numeric id of the check run.'
+ ),
+ checkStatus: zod
+ .string()
+ .describe('The raw GitHub check run status.'),
+ checkUrl: zod
+ .string()
+ .describe(
+ 'The public GitHub URL for the check run.'
+ ),
+ completedAt: zod.iso
+ .datetime({})
+ .describe(
+ 'When GitHub marked the check run as complete.'
+ ),
+ conclusion: zod
+ .string()
+ .describe('The raw GitHub check run conclusion.'),
+ state: zod
+ .enum(['completed', 'failed'])
+ .describe(
+ 'The normalized result state for a GitHub pull request check-run notification.'
+ ),
+ })
+ )
+ .describe(
+ 'Metadata for a notification that a GitHub pull request check run completed.'
+ ),
+ tag: zod.enum(['github_pr_check_run']),
+ })
+ .describe('A GitHub pull request check run completed.'),
+ zod
+ .object({
+ content: zod
+ .object({
+ displayName: zod
+ .string()
+ .describe(
+ 'A compact label suitable for display in the UI.'
+ ),
+ foreignEntityId: zod
+ .uuid()
+ .describe(
+ 'The source-specific internal foreign entity row id for this pull request.'
+ ),
+ githubKey: zod
+ .string()
+ .describe(
+ 'The external GitHub key, in `owner\/repo\/pull\/number` format.'
+ ),
+ number: zod
+ .number()
+ .min(
+ bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinTwo
+ )
+ .describe('The GitHub pull request number.'),
+ owner: zod
+ .string()
+ .describe(
+ 'The GitHub repository owner or organization.'
+ ),
+ repo: zod
+ .string()
+ .describe('The GitHub repository name.'),
+ senderGithubAvatarUrl: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The GitHub avatar URL for the sender, when available.'
+ ),
+ senderGithubLogin: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The GitHub login for the sender, when available.'
+ ),
+ senderGithubUserId: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The stable GitHub numeric user id for the sender, serialized as a string.'
+ ),
+ title: zod
+ .string()
+ .describe(
+ 'The GitHub pull request title. Falls back to `display_name` when GitHub has no title.'
+ ),
+ url: zod
+ .string()
+ .describe(
+ 'The public GitHub URL for the pull request.'
+ ),
+ })
+ .describe(
+ 'Fields shared by every GitHub pull request notification type.\n\nEmbedded with `#[serde(flatten)]` so the wire shape keeps these keys at the\ntop level of the metadata object.'
+ )
.and(
zod.object({
requestedReviewerGithubLogin: zod
@@ -1956,7 +2182,7 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zod
number: zod
.number()
.min(
- bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinTwo
+ bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinThree
)
.describe('The GitHub pull request number.'),
owner: zod
@@ -2056,7 +2282,7 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zod
number: zod
.number()
.min(
- bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinThree
+ bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinFour
)
.describe('The GitHub pull request number.'),
owner: zod
@@ -2163,7 +2389,7 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zod
number: zod
.number()
.min(
- bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinFour
+ bulkGetTypedNotificationsByEventItemIdsResponseItemsItemNotificationMetadataContentNumberMinFive
)
.describe('The GitHub pull request number.'),
owner: zod
@@ -2305,15 +2531,19 @@ export const getTypedNotificationsByEventItemIdResponseItemsItemNotificationMeta
export const getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinOne = 0;
+export const getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentCheckRunGithubIdMin = 0;
+
export const getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinTwo = 0;
+export const getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinThree = 0;
+
export const getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentCommentGithubIdMin = 0;
-export const getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinThree = 0;
+export const getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinFour = 0;
export const getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentCommentGithubIdMinOne = 0;
-export const getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinFour = 0;
+export const getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinFive = 0;
export const getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentReviewGithubIdMin = 0;
@@ -3008,6 +3238,115 @@ export const getTypedNotificationsByEventItemIdResponse = zod
.describe(
'Fields shared by every GitHub pull request notification type.\n\nEmbedded with `#[serde(flatten)]` so the wire shape keeps these keys at the\ntop level of the metadata object.'
)
+ .and(
+ zod.object({
+ checkName: zod
+ .string()
+ .describe(
+ 'The display name GitHub reported for the check run.'
+ ),
+ checkRunGithubId: zod
+ .number()
+ .min(
+ getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentCheckRunGithubIdMin
+ )
+ .describe(
+ 'The GitHub numeric id of the check run.'
+ ),
+ checkStatus: zod
+ .string()
+ .describe('The raw GitHub check run status.'),
+ checkUrl: zod
+ .string()
+ .describe(
+ 'The public GitHub URL for the check run.'
+ ),
+ completedAt: zod.iso
+ .datetime({})
+ .describe(
+ 'When GitHub marked the check run as complete.'
+ ),
+ conclusion: zod
+ .string()
+ .describe('The raw GitHub check run conclusion.'),
+ state: zod
+ .enum(['completed', 'failed'])
+ .describe(
+ 'The normalized result state for a GitHub pull request check-run notification.'
+ ),
+ })
+ )
+ .describe(
+ 'Metadata for a notification that a GitHub pull request check run completed.'
+ ),
+ tag: zod.enum(['github_pr_check_run']),
+ })
+ .describe('A GitHub pull request check run completed.'),
+ zod
+ .object({
+ content: zod
+ .object({
+ displayName: zod
+ .string()
+ .describe(
+ 'A compact label suitable for display in the UI.'
+ ),
+ foreignEntityId: zod
+ .uuid()
+ .describe(
+ 'The source-specific internal foreign entity row id for this pull request.'
+ ),
+ githubKey: zod
+ .string()
+ .describe(
+ 'The external GitHub key, in `owner\/repo\/pull\/number` format.'
+ ),
+ number: zod
+ .number()
+ .min(
+ getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinTwo
+ )
+ .describe('The GitHub pull request number.'),
+ owner: zod
+ .string()
+ .describe(
+ 'The GitHub repository owner or organization.'
+ ),
+ repo: zod
+ .string()
+ .describe('The GitHub repository name.'),
+ senderGithubAvatarUrl: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The GitHub avatar URL for the sender, when available.'
+ ),
+ senderGithubLogin: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The GitHub login for the sender, when available.'
+ ),
+ senderGithubUserId: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The stable GitHub numeric user id for the sender, serialized as a string.'
+ ),
+ title: zod
+ .string()
+ .describe(
+ 'The GitHub pull request title. Falls back to `display_name` when GitHub has no title.'
+ ),
+ url: zod
+ .string()
+ .describe(
+ 'The public GitHub URL for the pull request.'
+ ),
+ })
+ .describe(
+ 'Fields shared by every GitHub pull request notification type.\n\nEmbedded with `#[serde(flatten)]` so the wire shape keeps these keys at the\ntop level of the metadata object.'
+ )
.and(
zod.object({
requestedReviewerGithubLogin: zod
@@ -3054,7 +3393,7 @@ export const getTypedNotificationsByEventItemIdResponse = zod
number: zod
.number()
.min(
- getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinTwo
+ getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinThree
)
.describe('The GitHub pull request number.'),
owner: zod
@@ -3154,7 +3493,7 @@ export const getTypedNotificationsByEventItemIdResponse = zod
number: zod
.number()
.min(
- getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinThree
+ getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinFour
)
.describe('The GitHub pull request number.'),
owner: zod
@@ -3261,7 +3600,7 @@ export const getTypedNotificationsByEventItemIdResponse = zod
number: zod
.number()
.min(
- getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinFour
+ getTypedNotificationsByEventItemIdResponseItemsItemNotificationMetadataContentNumberMinFive
)
.describe('The GitHub pull request number.'),
owner: zod
@@ -3418,15 +3757,19 @@ export const getTypedNotificationByIdResponseNotificationMetadataContentNumberMi
export const getTypedNotificationByIdResponseNotificationMetadataContentNumberMinOne = 0;
+export const getTypedNotificationByIdResponseNotificationMetadataContentCheckRunGithubIdMin = 0;
+
export const getTypedNotificationByIdResponseNotificationMetadataContentNumberMinTwo = 0;
+export const getTypedNotificationByIdResponseNotificationMetadataContentNumberMinThree = 0;
+
export const getTypedNotificationByIdResponseNotificationMetadataContentCommentGithubIdMin = 0;
-export const getTypedNotificationByIdResponseNotificationMetadataContentNumberMinThree = 0;
+export const getTypedNotificationByIdResponseNotificationMetadataContentNumberMinFour = 0;
export const getTypedNotificationByIdResponseNotificationMetadataContentCommentGithubIdMinOne = 0;
-export const getTypedNotificationByIdResponseNotificationMetadataContentNumberMinFour = 0;
+export const getTypedNotificationByIdResponseNotificationMetadataContentNumberMinFive = 0;
export const getTypedNotificationByIdResponseNotificationMetadataContentReviewGithubIdMin = 0;
@@ -4073,6 +4416,105 @@ export const getTypedNotificationByIdResponse = zod
.describe(
'Fields shared by every GitHub pull request notification type.\n\nEmbedded with `#[serde(flatten)]` so the wire shape keeps these keys at the\ntop level of the metadata object.'
)
+ .and(
+ zod.object({
+ checkName: zod
+ .string()
+ .describe(
+ 'The display name GitHub reported for the check run.'
+ ),
+ checkRunGithubId: zod
+ .number()
+ .min(
+ getTypedNotificationByIdResponseNotificationMetadataContentCheckRunGithubIdMin
+ )
+ .describe('The GitHub numeric id of the check run.'),
+ checkStatus: zod
+ .string()
+ .describe('The raw GitHub check run status.'),
+ checkUrl: zod
+ .string()
+ .describe('The public GitHub URL for the check run.'),
+ completedAt: zod.iso
+ .datetime({})
+ .describe(
+ 'When GitHub marked the check run as complete.'
+ ),
+ conclusion: zod
+ .string()
+ .describe('The raw GitHub check run conclusion.'),
+ state: zod
+ .enum(['completed', 'failed'])
+ .describe(
+ 'The normalized result state for a GitHub pull request check-run notification.'
+ ),
+ })
+ )
+ .describe(
+ 'Metadata for a notification that a GitHub pull request check run completed.'
+ ),
+ tag: zod.enum(['github_pr_check_run']),
+ })
+ .describe('A GitHub pull request check run completed.'),
+ zod
+ .object({
+ content: zod
+ .object({
+ displayName: zod
+ .string()
+ .describe(
+ 'A compact label suitable for display in the UI.'
+ ),
+ foreignEntityId: zod
+ .uuid()
+ .describe(
+ 'The source-specific internal foreign entity row id for this pull request.'
+ ),
+ githubKey: zod
+ .string()
+ .describe(
+ 'The external GitHub key, in `owner\/repo\/pull\/number` format.'
+ ),
+ number: zod
+ .number()
+ .min(
+ getTypedNotificationByIdResponseNotificationMetadataContentNumberMinTwo
+ )
+ .describe('The GitHub pull request number.'),
+ owner: zod
+ .string()
+ .describe('The GitHub repository owner or organization.'),
+ repo: zod.string().describe('The GitHub repository name.'),
+ senderGithubAvatarUrl: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The GitHub avatar URL for the sender, when available.'
+ ),
+ senderGithubLogin: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The GitHub login for the sender, when available.'
+ ),
+ senderGithubUserId: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The stable GitHub numeric user id for the sender, serialized as a string.'
+ ),
+ title: zod
+ .string()
+ .describe(
+ 'The GitHub pull request title. Falls back to `display_name` when GitHub has no title.'
+ ),
+ url: zod
+ .string()
+ .describe('The public GitHub URL for the pull request.'),
+ })
+ .describe(
+ 'Fields shared by every GitHub pull request notification type.\n\nEmbedded with `#[serde(flatten)]` so the wire shape keeps these keys at the\ntop level of the metadata object.'
+ )
.and(
zod.object({
requestedReviewerGithubLogin: zod
@@ -4119,7 +4561,7 @@ export const getTypedNotificationByIdResponse = zod
number: zod
.number()
.min(
- getTypedNotificationByIdResponseNotificationMetadataContentNumberMinTwo
+ getTypedNotificationByIdResponseNotificationMetadataContentNumberMinThree
)
.describe('The GitHub pull request number.'),
owner: zod
@@ -4211,7 +4653,7 @@ export const getTypedNotificationByIdResponse = zod
number: zod
.number()
.min(
- getTypedNotificationByIdResponseNotificationMetadataContentNumberMinThree
+ getTypedNotificationByIdResponseNotificationMetadataContentNumberMinFour
)
.describe('The GitHub pull request number.'),
owner: zod
@@ -4305,7 +4747,7 @@ export const getTypedNotificationByIdResponse = zod
number: zod
.number()
.min(
- getTypedNotificationByIdResponseNotificationMetadataContentNumberMinFour
+ getTypedNotificationByIdResponseNotificationMetadataContentNumberMinFive
)
.describe('The GitHub pull request number.'),
owner: zod
diff --git a/js/app/packages/service-clients/service-notification/openapi.json b/js/app/packages/service-clients/service-notification/openapi.json
index 469e70e43b..4c8bd4b034 100644
--- a/js/app/packages/service-clients/service-notification/openapi.json
+++ b/js/app/packages/service-clients/service-notification/openapi.json
@@ -1534,6 +1534,65 @@
}
}
},
+ "GithubPrCheckRun": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/GithubPrNotificationCommon",
+ "description": "Fields shared with the other GitHub pull request notifications."
+ },
+ {
+ "type": "object",
+ "required": [
+ "checkRunGithubId",
+ "checkName",
+ "checkStatus",
+ "conclusion",
+ "state",
+ "checkUrl",
+ "completedAt"
+ ],
+ "properties": {
+ "checkName": {
+ "type": "string",
+ "description": "The display name GitHub reported for the check run."
+ },
+ "checkRunGithubId": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The GitHub numeric id of the check run.",
+ "minimum": 0
+ },
+ "checkStatus": {
+ "type": "string",
+ "description": "The raw GitHub check run status."
+ },
+ "checkUrl": {
+ "type": "string",
+ "description": "The public GitHub URL for the check run."
+ },
+ "completedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When GitHub marked the check run as complete."
+ },
+ "conclusion": {
+ "type": "string",
+ "description": "The raw GitHub check run conclusion."
+ },
+ "state": {
+ "$ref": "#/components/schemas/GithubPrCheckRunState",
+ "description": "The normalized notification state for this check run."
+ }
+ }
+ }
+ ],
+ "description": "Metadata for a notification that a GitHub pull request check run completed."
+ },
+ "GithubPrCheckRunState": {
+ "type": "string",
+ "description": "The normalized result state for a GitHub pull request check-run notification.",
+ "enum": ["completed", "failed"]
+ },
"GithubPrComment": {
"allOf": [
{
@@ -2135,6 +2194,21 @@
}
}
},
+ {
+ "type": "object",
+ "description": "A GitHub pull request check run completed.",
+ "required": ["content", "tag"],
+ "properties": {
+ "content": {
+ "$ref": "#/components/schemas/GithubPrCheckRun",
+ "description": "A GitHub pull request check run completed."
+ },
+ "tag": {
+ "type": "string",
+ "enum": ["github_pr_check_run"]
+ }
+ }
+ },
{
"type": "object",
"description": "The user's review was requested on a GitHub pull request.",
diff --git a/rust/cloud-storage/github/src/domain/service/sync/mod.rs b/rust/cloud-storage/github/src/domain/service/sync/mod.rs
index 23d224832f..6f634edec7 100644
--- a/rust/cloud-storage/github/src/domain/service/sync/mod.rs
+++ b/rust/cloud-storage/github/src/domain/service/sync/mod.rs
@@ -8,6 +8,7 @@ mod handle_installation;
mod handle_pr;
mod notify_pr;
mod notify_pr_activity;
+mod notify_pr_checks;
use crate::domain::{
models::{
@@ -924,9 +925,13 @@ impl<
}
GithubWebhookEventType::CheckRun => {
if webhook_event.is_associated_with_pull_request() {
- let _ = self
+ if let Some((pull_request, upserts)) = self
.upsert_pull_request_foreign_entities(webhook_event)
- .await;
+ .await
+ {
+ self.notify_pr_check_run(webhook_event, &pull_request, &upserts)
+ .await;
+ }
} else {
tracing::debug!("skipping check_run event without an associated PR");
}
diff --git a/rust/cloud-storage/github/src/domain/service/sync/notify_pr_checks.rs b/rust/cloud-storage/github/src/domain/service/sync/notify_pr_checks.rs
new file mode 100644
index 0000000000..2a4ecce880
--- /dev/null
+++ b/rust/cloud-storage/github/src/domain/service/sync/notify_pr_checks.rs
@@ -0,0 +1,188 @@
+//! GitHub pull request check-run notification helpers.
+
+use chrono::{DateTime, Utc};
+use documents::domain::ports::DocumentService;
+use foreign_entity::domain::ports::ForeignEntityService;
+use model_notifications::{GithubPrCheckRun, GithubPrCheckRunState};
+use notification::domain::service::NotificationIngress;
+
+use crate::domain::{
+ models::{EnrichedGithubPullRequest, ValidatedGithubWebhookEvent},
+ ports::{GithubSyncClient, GithubSyncRepo},
+};
+
+use super::{GithubSyncServiceImpl, PullRequestForeignEntityUpsert};
+
+struct CheckRunNotificationFields {
+ check_run_github_id: u64,
+ check_name: String,
+ check_status: String,
+ conclusion: String,
+ state: GithubPrCheckRunState,
+ check_url: String,
+ completed_at: DateTime<Utc>,
+}
+
+impl<
+ D: DocumentService,
+ R: GithubSyncRepo,
+ C: GithubSyncClient,
+ F: ForeignEntityService,
+ N: NotificationIngress,
+> GithubSyncServiceImpl<D, R, C, F, N>
+{
+ /// Notify pull request participants when an associated GitHub check run finishes.
+ ///
+ /// Fires only for completed `check_run` webhooks whose conclusion is either successful or
+ /// failure-like. Recipients are scoped to PR participants that also belong to the installation
+ /// source that owns the foreign entity.
+ pub(super) async fn notify_pr_check_run(
+ &self,
+ event: &ValidatedGithubWebhookEvent,
+ pull_request: &EnrichedGithubPullRequest,
+ upserts: &[PullRequestForeignEntityUpsert],
+ ) {
+ let Some(check_run) = Self::check_run_notification_fields(event) else {
+ return;
+ };
+
+ let participant_user_ids = self
+ .pull_request_participant_macro_user_ids(pull_request, upserts)
+ .await;
+ if participant_user_ids.is_empty() {
+ return;
+ }
+
+ let sender_id = self.notification_sender_id(event).await;
+ for upsert in upserts {
+ let recipient_ids = self
+ .participant_scoped_recipient_ids(&upsert.source, &participant_user_ids)
+ .await;
+ if recipient_ids.is_empty() {
+ tracing::trace!(
+ source_id=%upsert.source.source_id(),
+ source_type=%upsert.source.source_type(),
+ foreign_entity_id=%upsert.foreign_entity_id,
+ "skipping GitHub PR check-run notification without participant-scoped recipients"
+ );
+ continue;
+ }
+
+ let notification = Self::github_pr_check_run(
+ event,
+ pull_request,
+ upsert.foreign_entity_id,
+ &check_run,
+ );
+ self.send_github_notification(
+ notification,
+ upsert.foreign_entity_id,
+ sender_id.clone(),
+ recipient_ids,
+ )
+ .await;
+ }
+ }
+
+ fn github_pr_check_run(
+ event: &ValidatedGithubWebhookEvent,
+ pull_request: &EnrichedGithubPullRequest,
+ foreign_entity_id: uuid::Uuid,
+ check_run: &CheckRunNotificationFields,
+ ) -> GithubPrCheckRun {
+ GithubPrCheckRun {
+ common: Self::github_pr_common(event, pull_request, foreign_entity_id),
+ check_run_github_id: check_run.check_run_github_id,
+ check_name: check_run.check_name.clone(),
+ check_status: check_run.check_status.clone(),
+ conclusion: check_run.conclusion.clone(),
+ state: check_run.state,
+ check_url: check_run.check_url.clone(),
+ completed_at: check_run.completed_at,
+ }
+ }
+
+ fn check_run_notification_fields(
+ event: &ValidatedGithubWebhookEvent,
+ ) -> Option<CheckRunNotificationFields> {
+ if event.action() != Some("completed") {
+ tracing::trace!(
+ action = event.action(),
+ "skipping check-run notification for non-completed action"
+ );
+ return None;
+ }
+
+ let Some(check_run) = event.payload.get("check_run") else {
+ tracing::trace!("skipping check-run notification without check_run payload");
+ return None;
+ };
+
+ let check_status = Self::check_run_string(check_run, "status")?;
+ if check_status != "completed" {
+ tracing::trace!(
+ check_status,
+ "skipping check-run notification for non-completed status"
+ );
+ return None;
+ }
+
+ let conclusion = Self::check_run_string(check_run, "conclusion")?;
+ let Some(state) = Self::check_run_state(&conclusion) else {
+ tracing::trace!(
+ conclusion,
+ "skipping check-run notification for unhandled conclusion"
+ );
+ return None;
+ };
+
+ Some(CheckRunNotificationFields {
+ check_run_github_id: check_run.get("id").and_then(|value| value.as_u64())?,
+ check_name: Self::check_run_string(check_run, "name").unwrap_or_default(),
+ check_status,
+ conclusion,
+ state,
+ check_url: Self::check_run_url(check_run)?,
+ completed_at: Self::check_run_completed_at(check_run)?,
+ })
+ }
+
+ fn check_run_state(conclusion: &str) -> Option<GithubPrCheckRunState> {
+ match conclusion {
+ "success" => Some(GithubPrCheckRunState::Completed),
+ "failure" | "timed_out" | "cancelled" | "action_required" => {
+ Some(GithubPrCheckRunState::Failed)
+ }
+ _ => None,
+ }
+ }
+
+ fn check_run_string(check_run: &serde_json::Value, field: &str) -> Option<String> {
+ check_run
+ .get(field)
+ .and_then(|value| value.as_str())
+ .filter(|value| !value.is_empty())
+ .map(str::to_string)
+ }
+
+ fn check_run_url(check_run: &serde_json::Value) -> Option<String> {
+ ["html_url", "details_url"]
+ .into_iter()
+ .find_map(|field| Self::check_run_string(check_run, field))
+ }
+
+ fn check_run_completed_at(check_run: &serde_json::Value) -> Option<DateTime<Utc>> {
+ let completed_at = Self::check_run_string(check_run, "completed_at")?;
+ match DateTime::parse_from_rfc3339(&completed_at) {
+ Ok(completed_at) => Some(completed_at.with_timezone(&Utc)),
+ Err(error) => {
+ tracing::warn!(
+ error=?error,
+ completed_at,
+ "failed to parse GitHub check_run completed_at timestamp for notification"
+ );
+ None
+ }
+ }
+ }
+}
diff --git a/rust/cloud-storage/github/src/domain/service/sync/test.rs b/rust/cloud-storage/github/src/domain/service/sync/test.rs
index 70ab66a54b..69899c10e6 100644
--- a/rust/cloud-storage/github/src/domain/service/sync/test.rs
+++ b/rust/cloud-storage/github/src/domain/service/sync/test.rs
@@ -1293,6 +1293,50 @@ fn seed_pull_request_details_with_participants(
.set_pull_request_details("my-org", "my-repo", 42, details);
}
+fn notification_check_run_event(
+ action: &str,
+ status: &str,
+ conclusion: Option<&str>,
+ pull_number: Option<u64>,
+ sender_id: u64,
+ sender_login: &str,
+ sender_type: &str,
+) -> ValidatedGithubWebhookEvent {
+ let pull_requests = pull_number
+ .map(|number| serde_json::json!([{ "number": number }]))
+ .unwrap_or_else(|| serde_json::json!([]));
+ let mut check_run = serde_json::json!({
+ "id": 987_654_321,
+ "name": "CI / tests",
+ "status": status,
+ "html_url": "https://github.com/my-org/my-repo/runs/987654321",
+ "completed_at": "2026-05-25T19:01:02Z",
+ "pull_requests": pull_requests,
+ });
+ if let Some(conclusion) = conclusion {
+ check_run["conclusion"] = serde_json::json!(conclusion);
+ }
+
+ ValidatedGithubWebhookEvent::new(
+ "check_run".to_string(),
+ serde_json::json!({
+ "action": action,
+ "check_run": check_run,
+ "repository": {
+ "name": "my-repo",
+ "owner": { "login": "my-org" }
+ },
+ "installation": { "id": 12345 },
+ "sender": {
+ "login": sender_login,
+ "id": sender_id,
+ "type": sender_type,
+ "avatar_url": format!("https://avatars.example/{sender_login}.png")
+ }
+ }),
+ )
+}
+
#[tokio::test]
async fn pr_with_task_id_in_title() {
let service = make_sync_service();
@@ -2490,6 +2534,300 @@ async fn github_pr_status_changed_send_failure_does_not_fail_webhook_processing(
assert_github_pr_notification_realtime_enabled_apns_disabled(&requests[0]);
}
+#[tokio::test]
+async fn github_pr_check_run_success_notifies_participant_team_members_from_bot_sender() {
+ let team_id: uuid::Uuid = "dddddddd-dddd-dddd-dddd-dddddddddddd".parse().unwrap();
+ let repo = StubSyncRepo::new()
+ .with_installation_sources("12345", vec![GithubAppInstallationSource::Team(team_id)])
+ .with_team_members(
+ team_id,
+ vec![
+ ],
+ )
+ .with_github_link("222", "macro|[email protected]")
+ .with_github_link("333", "macro|[email protected]")
+ .with_github_link("444", "macro|[email protected]");
+ let service = make_sync_service_with_repo(repo);
+ seed_pull_request_details_with_participants(&service, &["333", "444", "999"]);
+ let event = notification_check_run_event(
+ "completed",
+ "completed",
+ Some("success"),
+ Some(42),
+ 222,
+ "macro-app",
+ "Bot",
+ );
+
+ service.process_webhook_event(&event).await.unwrap();
+
+ let foreign_entity_id = service.foreign_entity_service.foreign_entities()[0].id;
+ let requests = service.notification_ingress.requests();
+ assert_eq!(requests.len(), 1);
+
+ let request = &requests[0];
+ assert_github_notification_realtime_enabled_apns_disabled(request, "github_pr_check_run");
+ assert_eq!(
+ notification_request_recipients(request),
+ vec![
+ "macro|[email protected]".to_string(),
+ "macro|[email protected]".to_string(),
+ ]
+ );
+ assert_eq!(
+ request
+ .pointer("/req/sender_id")
+ .and_then(|value| value.as_str()),
+ Some("macro|[email protected]")
+ );
+
+ let content = notification_request_content(request);
+ assert_eq!(
+ content
+ .get("foreignEntityId")
+ .and_then(|value| value.as_str()),
+ Some(foreign_entity_id.to_string().as_str())
+ );
+ assert_eq!(
+ content.get("githubKey").and_then(|value| value.as_str()),
+ Some("my-org/my-repo/pull/42")
+ );
+ assert_eq!(
+ content.get("title").and_then(|value| value.as_str()),
+ Some("Add GitHub notifications")
+ );
+ assert_eq!(
+ content
+ .get("checkRunGithubId")
+ .and_then(|value| value.as_u64()),
+ Some(987_654_321)
+ );
+ assert_eq!(
+ content.get("checkName").and_then(|value| value.as_str()),
+ Some("CI / tests")
+ );
+ assert_eq!(
+ content.get("checkStatus").and_then(|value| value.as_str()),
+ Some("completed")
+ );
+ assert_eq!(
+ content.get("conclusion").and_then(|value| value.as_str()),
+ Some("success")
+ );
+ assert_eq!(
+ content.get("state").and_then(|value| value.as_str()),
+ Some("completed")
+ );
+ assert_eq!(
+ content.get("checkUrl").and_then(|value| value.as_str()),
+ Some("https://github.com/my-org/my-repo/runs/987654321")
+ );
+ assert_eq!(
+ content.get("completedAt").and_then(|value| value.as_str()),
+ Some("2026-05-25T19:01:02Z")
+ );
+}
+
+#[tokio::test]
+async fn github_pr_check_run_failure_notifies_participant_user_source() {
+ for conclusion in ["failure", "timed_out", "cancelled", "action_required"] {
+ let repo = StubSyncRepo::new()
+ .with_installation_sources(
+ "12345",
+ vec![GithubAppInstallationSource::User(
+ "macro|[email protected]".to_string(),
+ )],
+ )
+ .with_github_link("222", "macro|[email protected]")
+ .with_github_link("444", "macro|[email protected]");
+ let service = make_sync_service_with_repo(repo);
+ seed_pull_request_details_with_participants(&service, &["444"]);
+ let event = notification_check_run_event(
+ "completed",
+ "completed",
+ Some(conclusion),
+ Some(42),
+ 222,
+ "octocat",
+ "User",
+ );
+
+ service.process_webhook_event(&event).await.unwrap();
+
+ let requests = service.notification_ingress.requests();
+ assert_eq!(requests.len(), 1, "expected notification for {conclusion}");
+ assert_github_notification_realtime_enabled_apns_disabled(
+ &requests[0],
+ "github_pr_check_run",
+ );
+ assert_eq!(
+ notification_request_recipients(&requests[0]),
+ vec!["macro|[email protected]".to_string()]
+ );
+
+ let content = notification_request_content(&requests[0]);
+ assert_eq!(
+ content.get("conclusion").and_then(|value| value.as_str()),
+ Some(conclusion)
+ );
+ assert_eq!(
+ content.get("state").and_then(|value| value.as_str()),
+ Some("failed")
+ );
+ }
+}
+
+#[tokio::test]
+async fn github_pr_check_run_noncompleted_and_ignored_conclusions_do_not_notify() {
+ let cases = [
+ ("created action", "created", "completed", Some("success")),
+ ("queued status", "completed", "queued", Some("success")),
+ (
+ "in_progress status",
+ "completed",
+ "in_progress",
+ Some("success"),
+ ),
+ (
+ "neutral conclusion",
+ "completed",
+ "completed",
+ Some("neutral"),
+ ),
+ (
+ "skipped conclusion",
+ "completed",
+ "completed",
+ Some("skipped"),
+ ),
+ ("missing conclusion", "completed", "completed", None),
+ ];
+
+ for (case_name, action, status, conclusion) in cases {
+ let repo = StubSyncRepo::new()
+ .with_installation_sources(
+ "12345",
+ vec![GithubAppInstallationSource::User(
+ "macro|[email protected]".to_string(),
+ )],
+ )
+ .with_github_link("444", "macro|[email protected]");
+ let service = make_sync_service_with_repo(repo);
+ seed_pull_request_details_with_participants(&service, &["444"]);
+ let event = notification_check_run_event(
+ action,
+ status,
+ conclusion,
+ Some(42),
+ 222,
+ "octocat",
+ "User",
+ );
+
+ service.process_webhook_event(&event).await.unwrap();
+
+ assert_eq!(service.foreign_entity_service.foreign_entities().len(), 1);
+ assert!(
+ service.notification_ingress.requests().is_empty(),
+ "expected no notification for {case_name}"
+ );
+ }
+}
+
+#[tokio::test]
+async fn github_pr_check_run_nonparticipant_recipient_does_not_notify() {
+ let repo = StubSyncRepo::new()
+ .with_installation_sources(
+ "12345",
+ vec![GithubAppInstallationSource::User(
+ "macro|[email protected]".to_string(),
+ )],
+ )
+ .with_github_link("333", "macro|[email protected]")
+ .with_github_link("444", "macro|[email protected]");
+ let service = make_sync_service_with_repo(repo);
+ seed_pull_request_details_with_participants(&service, &["333"]);
+ let event = notification_check_run_event(
+ "completed",
+ "completed",
+ Some("success"),
+ Some(42),
+ 222,
+ "octocat",
+ "User",
+ );
+
+ service.process_webhook_event(&event).await.unwrap();
+
+ assert_eq!(service.foreign_entity_service.foreign_entities().len(), 1);
+ assert!(service.notification_ingress.requests().is_empty());
+}
+
+#[tokio::test]
+async fn github_pr_check_run_without_pull_request_does_not_notify_or_upsert() {
+ let repo = StubSyncRepo::new().with_installation_sources(
+ "12345",
+ vec![GithubAppInstallationSource::User(
+ "macro|[email protected]".to_string(),
+ )],
+ );
+ let service = make_sync_service_with_repo(repo);
+ let event = notification_check_run_event(
+ "completed",
+ "completed",
+ Some("success"),
+ None,
+ 222,
+ "octocat",
+ "User",
+ );
+
+ let result = service.process_webhook_event(&event).await;
+
+ assert!(result.is_ok());
+ assert!(service.foreign_entity_service.foreign_entities().is_empty());
+ assert!(service.client.pull_request_details_calls().is_empty());
+ assert!(service.notification_ingress.requests().is_empty());
+}
+
+#[tokio::test]
+async fn github_pr_check_run_send_failure_does_not_fail_webhook_processing() {
+ let repo = StubSyncRepo::new()
+ .with_installation_sources(
+ "12345",
+ vec![GithubAppInstallationSource::User(
+ "macro|[email protected]".to_string(),
+ )],
+ )
+ .with_github_link("444", "macro|[email protected]");
+ let service = make_sync_service_with_repo_and_notification_ingress(
+ repo,
+ StubNotificationIngress::failing(),
+ );
+ seed_pull_request_details_with_participants(&service, &["444"]);
+ let event = notification_check_run_event(
+ "completed",
+ "completed",
+ Some("success"),
+ Some(42),
+ 222,
+ "octocat",
+ "User",
+ );
+
+ let result = service.process_webhook_event(&event).await;
+
+ assert!(result.is_ok());
+ assert_eq!(service.foreign_entity_service.foreign_entities().len(), 1);
+
+ let requests = service.notification_ingress.requests();
+ assert_eq!(requests.len(), 1);
+ assert_github_notification_realtime_enabled_apns_disabled(&requests[0], "github_pr_check_run");
+}
+
#[tokio::test]
async fn pr_edit_patches_existing_foreign_entity_metadata() {
let (service, foreign_entity_service) = make_sync_service_with_foreign_entity_service();
diff --git a/rust/cloud-storage/model_notifications/src/lib.rs b/rust/cloud-storage/model_notifications/src/lib.rs
index 51f338470d..2bd6924977 100644
--- a/rust/cloud-storage/model_notifications/src/lib.rs
+++ b/rust/cloud-storage/model_notifications/src/lib.rs
@@ -12,12 +12,12 @@ pub use device::DeviceType;
pub use metadata::{
AiResponseMetadata, ChannelInviteMetadata, ChannelMentionMetadata, ChannelMessageSendMetadata,
ChannelReplyMetadata, ChannelType, CommentedOnDocumentMetadata, CommonChannelMetadata,
- DocumentMentionMetadata, GithubPrComment, GithubPrCommentKind, GithubPrEventAction,
- GithubPrEventStatus, GithubPrMention, GithubPrMentionLocation, GithubPrNotificationCommon,
- GithubPrReview, GithubPrReviewState, GithubPrStatusChanged, GithubReviewRequested,
- InviteToTeamMetadata, ItemSharedMetadata, MentionedInDocumentCommentMetadata, NewEmailMetadata,
- NotificationDocumentSubType, NotificationTitle, RepliedToDocumentCommentThreadMetadata,
- TaskAssignedMetadata,
+ DocumentMentionMetadata, GithubPrCheckRun, GithubPrCheckRunState, GithubPrComment,
+ GithubPrCommentKind, GithubPrEventAction, GithubPrEventStatus, GithubPrMention,
+ GithubPrMentionLocation, GithubPrNotificationCommon, GithubPrReview, GithubPrReviewState,
+ GithubPrStatusChanged, GithubReviewRequested, InviteToTeamMetadata, ItemSharedMetadata,
+ MentionedInDocumentCommentMetadata, NewEmailMetadata, NotificationDocumentSubType,
+ NotificationTitle, RepliedToDocumentCommentThreadMetadata, TaskAssignedMetadata,
};
pub use unsubscribe::UserUnsubscribe;
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
@@ -211,6 +211,9 @@ define_notif_event!(
#[serde(alias = "github_pr_event")]
GithubPrStatusChanged(GithubPrStatusChanged),
+ /// A GitHub pull request check run completed.
+ GithubPrCheckRun(GithubPrCheckRun),
+
/// The user's review was requested on a GitHub pull request.
GithubReviewRequested(GithubReviewRequested),
@@ -260,6 +263,9 @@ impl NotificationTitle for NotifEvent {
NotifEvent::GithubPrStatusChanged(github_pr_status_changed) => {
github_pr_status_changed.format_title(sender_id)
}
+ NotifEvent::GithubPrCheckRun(github_pr_check_run) => {
+ github_pr_check_run.format_title(sender_id)
+ }
NotifEvent::GithubReviewRequested(github_review_requested) => {
github_review_requested.format_title(sender_id)
}
@@ -309,6 +315,9 @@ impl NotificationTitle for NotifEvent {
NotifEvent::GithubPrStatusChanged(github_pr_status_changed) => {
github_pr_status_changed.format_body(sender_id)
}
+ NotifEvent::GithubPrCheckRun(github_pr_check_run) => {
+ github_pr_check_run.format_body(sender_id)
+ }
NotifEvent::GithubReviewRequested(github_review_requested) => {
github_review_requested.format_body(sender_id)
}
diff --git a/rust/cloud-storage/model_notifications/src/metadata.rs b/rust/cloud-storage/model_notifications/src/metadata.rs
index 833f80f69a..3608de1cdd 100644
--- a/rust/cloud-storage/model_notifications/src/metadata.rs
+++ b/rust/cloud-storage/model_notifications/src/metadata.rs
@@ -195,6 +195,81 @@ impl NotificationTitle for GithubPrStatusChanged {
}
}
+/// The normalized result state for a GitHub pull request check-run notification.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, ToSchema, Serialize, Deserialize)]
+#[serde(rename_all = "lowercase")]
+pub enum GithubPrCheckRunState {
+ /// The check run completed successfully.
+ Completed,
+ /// The check run completed with a failure-like conclusion.
+ Failed,
+}
+
+/// Metadata for a notification that a GitHub pull request check run completed.
+#[derive(Debug, Clone, PartialEq, Eq, ToSchema, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct GithubPrCheckRun {
+ /// Fields shared with the other GitHub pull request notifications.
+ #[serde(flatten)]
+ pub common: GithubPrNotificationCommon,
+ /// The GitHub numeric id of the check run.
+ pub check_run_github_id: u64,
+ /// The display name GitHub reported for the check run.
+ pub check_name: String,
+ /// The raw GitHub check run status.
+ pub check_status: String,
+ /// The raw GitHub check run conclusion.
+ pub conclusion: String,
+ /// The normalized notification state for this check run.
+ pub state: GithubPrCheckRunState,
+ /// The public GitHub URL for the check run.
+ pub check_url: String,
+ /// When GitHub marked the check run as complete.
+ pub completed_at: DateTime<Utc>,
+}
+
+impl GithubPrCheckRun {
+ fn state_verb(&self) -> &'static str {
+ match self.state {
+ GithubPrCheckRunState::Completed => "completed",
+ GithubPrCheckRunState::Failed => "failed",
+ }
+ }
+
+ fn display_check_name(&self) -> &str {
+ let check_name = self.check_name.trim();
+ if check_name.is_empty() {
+ return "Check";
+ }
+
+ check_name
+ }
+}
+
+impl Notification for GithubPrCheckRun {
+ const TYPE_NAME: &'static str = "github_pr_check_run";
+}
+
+impl NotificationTitle for GithubPrCheckRun {
+ fn format_title(
+ &self,
+ _sender_id: Option<MacroUserIdStr<'_>>,
+ ) -> Result<String, rootcause::Report> {
+ Ok(format!(
+ "{} {} on a pull request",
+ self.display_check_name(),
+ self.state_verb()
+ ))
+ }
+
+ fn format_body(
+ &self,
+ _sender_id: Option<MacroUserIdStr<'_>>,
+ ) -> Result<String, rootcause::Report> {
+ Ok(self.common.format_body())
+ }
+}
+
/// Metadata for a notification that the user's review was requested on a GitHub pull request.
#[derive(Debug, Clone, PartialEq, Eq, ToSchema, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
diff --git a/rust/cloud-storage/model_notifications/src/metadata/test.rs b/rust/cloud-storage/model_notifications/src/metadata/test.rs
index f67ee8d79b..c3ba81a31c 100644
--- a/rust/cloud-storage/model_notifications/src/metadata/test.rs
+++ b/rust/cloud-storage/model_notifications/src/metadata/test.rs
@@ -40,6 +40,24 @@ fn github_pr_status_changed() -> GithubPrStatusChanged {
}
}
+fn github_pr_check_run(state: GithubPrCheckRunState) -> GithubPrCheckRun {
+ let conclusion = match state {
+ GithubPrCheckRunState::Completed => "success",
+ GithubPrCheckRunState::Failed => "failure",
+ };
+
+ GithubPrCheckRun {
+ common: github_pr_common(),
+ check_run_github_id: 987_654_321,
+ check_name: "CI / tests".to_string(),
+ check_status: "completed".to_string(),
+ conclusion: conclusion.to_string(),
+ state,
+ check_url: "https://github.com/macro/app/runs/987654321".to_string(),
+ completed_at: utc_datetime("2026-05-25T19:01:02Z"),
+ }
+}
+
#[test]
fn github_pr_status_changed_serializes_with_camel_case_fields_and_lowercase_enums() {
let event = github_pr_status_changed();
@@ -166,6 +184,99 @@ fn github_pr_status_changed_deserializes_from_legacy_github_pr_event_tag() {
assert_eq!(actual, expected);
}
+#[test]
+fn github_pr_check_run_serializes_with_camel_case_fields_and_lowercase_state() {
+ let event = github_pr_check_run(GithubPrCheckRunState::Completed);
+
+ let value = serde_json::to_value(&event).unwrap();
+
+ assert_eq!(
+ value,
+ serde_json::json!({
+ "foreignEntityId": "11111111-1111-4111-8111-111111111111",
+ "githubKey": "macro/app/pull/42",
+ "owner": "macro",
+ "repo": "app",
+ "number": 42,
+ "url": "https://github.com/macro/app/pull/42",
+ "displayName": "macro/app#42",
+ "title": "Add GitHub PR notifications",
+ "senderGithubLogin": "octocat",
+ "senderGithubUserId": "12345",
+ "senderGithubAvatarUrl": "https://avatars.githubusercontent.com/u/12345?v=4",
+ "checkRunGithubId": 987654321,
+ "checkName": "CI / tests",
+ "checkStatus": "completed",
+ "conclusion": "success",
+ "state": "completed",
+ "checkUrl": "https://github.com/macro/app/runs/987654321",
+ "completedAt": "2026-05-25T19:01:02Z"
+ })
+ );
+}
+
+#[test]
+fn github_pr_check_run_tagged_content_serializes_with_type_name() {
+ let event = github_pr_check_run(GithubPrCheckRunState::Completed);
+ let foreign_entity_id = event.common.foreign_entity_id.to_string();
+
+ let value =
+ serde_json::to_value(notification::domain::models::TaggedContent::new(event)).unwrap();
+
+ assert_eq!(value["tag"], "github_pr_check_run");
+ assert_eq!(value["content"]["checkRunGithubId"], 987_654_321);
+ assert_eq!(
+ value["content"]["foreignEntityId"],
+ serde_json::json!(foreign_entity_id)
+ );
+}
+
+#[test]
+fn github_pr_check_run_formats_title_and_body_by_state() {
+ let completed = github_pr_check_run(GithubPrCheckRunState::Completed);
+ let failed = github_pr_check_run(GithubPrCheckRunState::Failed);
+
+ assert_eq!(
+ completed
+ .format_title(Some(uid("macro|[email protected]")))
+ .unwrap(),
+ "CI / tests completed on a pull request"
+ );
+ assert_eq!(
+ failed.format_title(None).unwrap(),
+ "CI / tests failed on a pull request"
+ );
+ assert_eq!(
+ completed.format_body(None).unwrap(),
+ "macro/app#42: Add GitHub PR notifications"
+ );
+}
+
+#[test]
+fn github_pr_check_run_notif_event_deserializes_and_renders_in_app() {
+ let expected = github_pr_check_run(GithubPrCheckRunState::Failed);
+ let value = serde_json::json!({
+ "tag": "github_pr_check_run",
+ "content": serde_json::to_value(&expected).unwrap(),
+ });
+
+ let event: crate::NotifEvent = serde_json::from_value(value).unwrap();
+
+ assert_eq!(
+ event.format_title(None).unwrap(),
+ "CI / tests failed on a pull request"
+ );
+ assert_eq!(
+ event.format_body(None).unwrap(),
+ "macro/app#42: Add GitHub PR notifications"
+ );
+
+ let crate::NotifEvent::GithubPrCheckRun(actual) = event else {
+ panic!("expected github_pr_check_run variant");
+ };
+ assert_eq!(actual, expected);
+}
+
#[test]
fn github_review_requested_serializes_flat_and_formats() {
let notification = GithubReviewRequested {
diff --git a/rust/cloud-storage/notification/src/outbound/repository.rs b/rust/cloud-storage/notification/src/outbound/repository.rs
index 0d9625495d..70423ffa18 100644
--- a/rust/cloud-storage/notification/src/outbound/repository.rs
+++ b/rust/cloud-storage/notification/src/outbound/repository.rs
@@ -132,7 +132,16 @@ fn push_notification_status_filters(
/// SQL fragment matching every GitHub notification event type. Keep in sync with
/// the `Notification::TYPE_NAME`s of the GitHub metadata types in `model_notifications`
/// (this crate sits below `model_notifications`, so it cannot reference them directly).
-const GITHUB_EVENT_TYPES_SQL: &str = "n.notification_event_type IN ('github_pr_status_changed', 'github_review_requested', 'github_pr_comment', 'github_pr_mention', 'github_pr_review')";
+const GITHUB_EVENT_TYPES_SQL: &str = concat!(
+ "n.notification_event_type IN (",
+ "'github_pr_status_changed', ",
+ "'github_review_requested', ",
+ "'github_pr_comment', ",
+ "'github_pr_mention', ",
+ "'github_pr_review', ",
+ "'github_pr_check_run'",
+ ")",
+);
fn push_include_types_filter(builder: &mut QueryBuilder<'_, Postgres>, include_types: &[String]) {
if !include_types.is_empty() {
diff --git a/rust/cloud-storage/notification/src/outbound/repository/test.rs b/rust/cloud-storage/notification/src/outbound/repository/test.rs
index ea8eeacc22..fff4b7693a 100644
--- a/rust/cloud-storage/notification/src/outbound/repository/test.rs
+++ b/rust/cloud-storage/notification/src/outbound/repository/test.rs
@@ -29,6 +29,15 @@ impl Notification for TestGithubNotification {
const TYPE_NAME: &'static str = "github_pr_status_changed";
}
+#[derive(Debug, Clone, Serialize, Deserialize)]
+struct TestGithubCheckRunNotification {
+ message: String,
+}
+
+impl Notification for TestGithubCheckRunNotification {
+ const TYPE_NAME: &'static str = "github_pr_check_run";
+}
+
fn test_user(email: &str) -> MacroUserIdStr<'static> {
MacroUserIdStr::try_from_email(email).unwrap()
}
@@ -483,7 +492,9 @@ async fn test_get_user_notifications_filters_type_and_entity(pool: Pool<Postgres
async fn test_get_user_notifications_filters_github_type_and_entity(pool: Pool<Postgres>) {
let user = test_user("[email protected]");
let foreign_entity_id = uuid::Uuid::new_v4().to_string();
+ let check_run_foreign_entity_id = uuid::Uuid::new_v4().to_string();
let github_notification_id = uuid::Uuid::new_v4();
+ let check_run_notification_id = uuid::Uuid::new_v4();
let github_request = SendNotificationRequestBuilder {
notification_entity: EntityType::ForeignEntity
@@ -498,6 +509,24 @@ async fn test_get_user_notifications_filters_github_type_and_entity(pool: Pool<P
.await
.unwrap();
+ let check_run_request = SendNotificationRequestBuilder {
+ notification_entity: EntityType::ForeignEntity
+ .with_entity_string(check_run_foreign_entity_id.clone()),
+ notification: TaggedContent::new(TestGithubCheckRunNotification {
+ message: "check run".to_string(),
+ }),
+ sender_id: None,
+ recipient_ids: std::collections::HashSet::from([user.clone()]),
+ };
+ pool.create_notification(
+ check_run_request,
+ check_run_notification_id,
+ "test_service",
+ None,
+ )
+ .await
+ .unwrap();
+
let non_github_request = SendNotificationRequestBuilder {
notification_entity: EntityType::ForeignEntity
.with_entity_string(foreign_entity_id.clone()),
@@ -530,22 +559,41 @@ async fn test_get_user_notifications_filters_github_type_and_entity(pool: Pool<P
)
.await
.unwrap();
- assert_eq!(github_type_results.len(), 1);
+ assert_eq!(github_type_results.len(), 2);
+
+ let github_type_result_ids: std::collections::HashSet<_> = github_type_results
+ .iter()
+ .map(|row| row.notification_id)
+ .collect();
assert_eq!(
- github_type_results[0].notification_id,
- github_notification_id
+ github_type_result_ids,
+ std::collections::HashSet::from([github_notification_id, check_run_notification_id])
);
+
+ let github_type_event_types: std::collections::HashSet<_> = github_type_results
+ .iter()
+ .map(|row| row.notification_event_type.as_str())
+ .collect();
assert_eq!(
- github_type_results[0].notification_event_type,
- "github_pr_status_changed"
+ github_type_event_types,
+ std::collections::HashSet::from(["github_pr_status_changed", "github_pr_check_run"])
);
+
+ let github_type_entity_ids: std::collections::HashSet<_> = github_type_results
+ .iter()
+ .map(|row| row.entity.entity_id.as_ref())
+ .collect();
assert_eq!(
- github_type_results[0].entity.entity_type,
- EntityType::ForeignEntity
+ github_type_entity_ids,
+ std::collections::HashSet::from([
+ foreign_entity_id.as_str(),
+ check_run_foreign_entity_id.as_str(),
+ ])
);
- assert_eq!(
- github_type_results[0].entity.entity_id.as_ref(),
- foreign_entity_id.as_str()
+ assert!(
+ github_type_results
+ .iter()
+ .all(|row| row.entity.entity_type == EntityType::ForeignEntity)
);
let github_entity_results: Vec<UserNotificationRow<serde_json::Value>> = pool
@@ -571,6 +619,37 @@ async fn test_get_user_notifications_filters_github_type_and_entity(pool: Pool<P
github_notification_id
);
+ let check_run_entity_results: Vec<UserNotificationRow<serde_json::Value>> = pool
+ .get_user_notifications(
+ user.clone(),
+ 10,
+ Query::Sort(CreatedAt, ()),
+ NotificationListFilters {
+ done: Some(false),
+ seen: None,
+ include_types: Vec::new(),
+ entities: vec![NotificationEntityRef {
+ entity_type: NotificationItemType::Github,
+ id: check_run_foreign_entity_id.clone(),
+ }],
+ },
+ )
+ .await
+ .unwrap();
+ assert_eq!(check_run_entity_results.len(), 1);
+ assert_eq!(
+ check_run_entity_results[0].notification_id,
+ check_run_notification_id
+ );
+ assert_eq!(
+ check_run_entity_results[0].notification_event_type,
+ "github_pr_check_run"
+ );
+ assert_eq!(
+ check_run_entity_results[0].entity.entity_id.as_ref(),
+ check_run_foreign_entity_id.as_str()
+ );
+
let wrong_entity_results: Vec<UserNotificationRow<serde_json::Value>> = pool
.get_user_notifications(
user,
diff --git a/rust/cloud-storage/notification_service/src/api/swagger.rs b/rust/cloud-storage/notification_service/src/api/swagger.rs
index 21f755f2c7..f863b06d66 100644
--- a/rust/cloud-storage/notification_service/src/api/swagger.rs
+++ b/rust/cloud-storage/notification_service/src/api/swagger.rs
@@ -8,11 +8,11 @@ use model::{
use model_notifications::{
ChannelInviteMetadata, ChannelMentionMetadata, ChannelMessageSendMetadata,
ChannelReplyMetadata, CommentedOnDocumentMetadata, CommonChannelMetadata, DeviceType,
- DocumentMentionMetadata, GithubPrComment, GithubPrCommentKind, GithubPrEventAction,
- GithubPrEventStatus, GithubPrMention, GithubPrMentionLocation, GithubPrNotificationCommon,
- GithubPrReview, GithubPrReviewState, GithubPrStatusChanged, GithubReviewRequested,
- InviteToTeamMetadata, ItemSharedMetadata, NewEmailMetadata,
- RepliedToDocumentCommentThreadMetadata, UserUnsubscribe,
+ DocumentMentionMetadata, GithubPrCheckRun, GithubPrCheckRunState, GithubPrComment,
+ GithubPrCommentKind, GithubPrEventAction, GithubPrEventStatus, GithubPrMention,
+ GithubPrMentionLocation, GithubPrNotificationCommon, GithubPrReview, GithubPrReviewState,
+ GithubPrStatusChanged, GithubReviewRequested, InviteToTeamMetadata, ItemSharedMetadata,
+ NewEmailMetadata, RepliedToDocumentCommentThreadMetadata, UserUnsubscribe,
};
use utoipa::OpenApi;
@@ -88,6 +88,8 @@ use crate::{
GithubPrStatusChanged,
GithubPrEventStatus,
GithubPrEventAction,
+ GithubPrCheckRun,
+ GithubPrCheckRunState,
GithubReviewRequested,
GithubPrComment,
GithubPrCommentKind,