@sentry/junior-github 0.155.0 → 0.156.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +31 -14
- package/dist/pull-request-outcomes/store.d.ts +2 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2021,6 +2021,18 @@ async function recordGitHubPullRequestOutcome(db, input) {
|
|
|
2021
2021
|
conversationIds: inserted[0]?.conversationIds ?? []
|
|
2022
2022
|
};
|
|
2023
2023
|
}
|
|
2024
|
+
function conversationIdsForPullRequests(rows, conversationIds) {
|
|
2025
|
+
const candidates = new Set(conversationIds);
|
|
2026
|
+
return [
|
|
2027
|
+
...new Set(
|
|
2028
|
+
rows.flatMap(
|
|
2029
|
+
(row) => row.conversationIds.filter(
|
|
2030
|
+
(conversationId) => candidates.has(conversationId)
|
|
2031
|
+
)
|
|
2032
|
+
)
|
|
2033
|
+
)
|
|
2034
|
+
];
|
|
2035
|
+
}
|
|
2024
2036
|
async function listGitHubUnfinishedWork(db, conversationIds) {
|
|
2025
2037
|
if (conversationIds.length === 0) return [];
|
|
2026
2038
|
const values = sql3.join(
|
|
@@ -2033,16 +2045,18 @@ async function listGitHubUnfinishedWork(db, conversationIds) {
|
|
|
2033
2045
|
sql3`${juniorGitHubPullRequests.conversationIds} && ARRAY[${values}]::text[]`
|
|
2034
2046
|
)
|
|
2035
2047
|
);
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2048
|
+
return conversationIdsForPullRequests(rows, conversationIds);
|
|
2049
|
+
}
|
|
2050
|
+
async function listGitHubAssignedWork(db, conversationIds) {
|
|
2051
|
+
if (conversationIds.length === 0) return [];
|
|
2052
|
+
const values = sql3.join(
|
|
2053
|
+
conversationIds.map((id) => sql3`${id}`),
|
|
2054
|
+
sql3`, `
|
|
2055
|
+
);
|
|
2056
|
+
const rows = await db.select({ conversationIds: juniorGitHubPullRequests.conversationIds }).from(juniorGitHubPullRequests).where(
|
|
2057
|
+
sql3`${juniorGitHubPullRequests.conversationIds} && ARRAY[${values}]::text[]`
|
|
2058
|
+
);
|
|
2059
|
+
return conversationIdsForPullRequests(rows, conversationIds);
|
|
2046
2060
|
}
|
|
2047
2061
|
async function recordGitHubPullRequestConversations(db, input) {
|
|
2048
2062
|
const association = githubPullRequestConversationsInputSchema.parse(input);
|
|
@@ -4706,11 +4720,14 @@ function githubPlugin(options = {}) {
|
|
|
4706
4720
|
},
|
|
4707
4721
|
hooks: {
|
|
4708
4722
|
async unfinishedWork(ctx) {
|
|
4723
|
+
const db = ctx.db;
|
|
4724
|
+
const [conversationIds, assignedConversationIds] = await Promise.all([
|
|
4725
|
+
listGitHubUnfinishedWork(db, ctx.conversationIds),
|
|
4726
|
+
listGitHubAssignedWork(db, ctx.conversationIds)
|
|
4727
|
+
]);
|
|
4709
4728
|
return {
|
|
4710
|
-
conversationIds
|
|
4711
|
-
|
|
4712
|
-
ctx.conversationIds
|
|
4713
|
-
)
|
|
4729
|
+
conversationIds,
|
|
4730
|
+
assignedConversationIds
|
|
4714
4731
|
};
|
|
4715
4732
|
},
|
|
4716
4733
|
routes(ctx) {
|
|
@@ -48,6 +48,8 @@ export declare function recordGitHubPullRequestOutcome(db: GitHubDb, input: GitH
|
|
|
48
48
|
}>;
|
|
49
49
|
/** Return candidate conversations that have an associated unmerged pull request. */
|
|
50
50
|
export declare function listGitHubUnfinishedWork(db: GitHubDb, conversationIds: string[]): Promise<string[]>;
|
|
51
|
+
/** Return candidate conversations linked to any Junior-owned pull request. */
|
|
52
|
+
export declare function listGitHubAssignedWork(db: GitHubDb, conversationIds: string[]): Promise<string[]>;
|
|
51
53
|
/** Append native conversation ids to an existing Junior-owned PR projection. */
|
|
52
54
|
export declare function recordGitHubPullRequestConversations(db: GitHubDb, input: GitHubPullRequestConversationsInput): Promise<boolean>;
|
|
53
55
|
/** Link an existing Junior-owned PR to tracked issues across repositories. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-github",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.156.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.4.3",
|
|
34
|
-
"@sentry/junior-plugin-api": "0.
|
|
34
|
+
"@sentry/junior-plugin-api": "0.156.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^25.9.1",
|