pierre-review 0.1.88 → 0.1.90
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/api/routes/bot-triage.js +4 -48
- package/dist/api/routes/prs.js +1 -1
- package/dist/app.js +1 -1
- package/dist/bot-triage/resolve.js +4 -3
- package/dist/db/queries.js +429 -258
- package/dist/db/schema.pg.js +3 -18
- package/dist/db/schema.sqlite.js +5 -20
- package/dist/pro/bind.js +2 -0
- package/dist/sync/scheduler.js +0 -20
- package/package.json +1 -1
- package/public/assets/{AiFixTab-xunM4Dcn.js → AiFixTab-B7j9QWQS.js} +1 -1
- package/public/assets/{ClaudeReviewTab-BSbuovsJ.js → ClaudeReviewTab-XiJKw7r_.js} +1 -1
- package/public/assets/{PrBotBehaviourTab-DiMPFSk-.js → PrBotBehaviourTab-C_AhuZDF.js} +1 -1
- package/public/assets/index-CaFTJbcz.css +1 -0
- package/public/assets/index-DE514GSq.js +54 -0
- package/public/index.html +2 -2
- package/dist/bot-triage/auto-triage.js +0 -63
- package/public/assets/index-FNWDcDl6.js +0 -54
- package/public/assets/index-eMcv5bjI.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getBotAnalytics, getBotBehaviourAnalytics, getBotOnlyPrs, getBotVendorPrs, getBotDedupClusters, getResolvableBotThreadPrs, getResolvableBotThreadsForScope, listDetectedReviewers, resolveScopeRepoIds, setReviewerOverride, SCOPE_RESOLVE_THREAD_CAP, } from '../../db/queries.js';
|
|
2
2
|
import { resolveThreadsOnGitHub } from '../../bot-triage/resolve.js';
|
|
3
3
|
import { accountIdOf } from '../plugins/auth.js';
|
|
4
4
|
// Parse a comma-separated id list into a positive-int array, or null when empty/absent (so
|
|
@@ -82,29 +82,6 @@ const prIdParamSchema = {
|
|
|
82
82
|
properties: { id: { type: 'integer' } },
|
|
83
83
|
},
|
|
84
84
|
};
|
|
85
|
-
// POST /api/bot-mute-rules — `action` is a closed enum; `autoResolveDays` is floored at 1 so a
|
|
86
|
-
// 0/negative-day auto-resolve rule (which would immediately clear everything) is rejected.
|
|
87
|
-
const muteRuleSchema = {
|
|
88
|
-
body: {
|
|
89
|
-
type: 'object',
|
|
90
|
-
required: ['action'],
|
|
91
|
-
additionalProperties: false,
|
|
92
|
-
properties: {
|
|
93
|
-
vendorKind: { type: ['string', 'null'] },
|
|
94
|
-
pathGlob: { type: ['string', 'null'] },
|
|
95
|
-
severity: { type: ['string', 'null'] },
|
|
96
|
-
action: { type: 'string', enum: ['hide', 'auto_resolve'] },
|
|
97
|
-
autoResolveDays: { type: ['integer', 'null'], minimum: 1, maximum: 365 },
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
const ruleIdParamSchema = {
|
|
102
|
-
params: {
|
|
103
|
-
type: 'object',
|
|
104
|
-
required: ['id'],
|
|
105
|
-
properties: { id: { type: 'integer' } },
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
85
|
// GET /api/bot-threads/resolvable?scope=&repoIds= — the scope-wide review list. Same
|
|
109
86
|
// scope/repoIds resolution as the analytics routes (an explicit `repoIds` wins over `scope`).
|
|
110
87
|
const resolvableSchema = {
|
|
@@ -139,8 +116,8 @@ const scopeResolveSchema = {
|
|
|
139
116
|
},
|
|
140
117
|
};
|
|
141
118
|
// Bot-triage platform routes (CORE, always registered). Detection/override, ROI analytics,
|
|
142
|
-
// per-PR cross-bot dedup, and the
|
|
143
|
-
// scoped via accountIdOf(req); id-addressed reads/writes verify ownership → 404. No AI.
|
|
119
|
+
// per-PR cross-bot dedup, and the confirm-gated scope-wide bot-thread resolve. Every handler is
|
|
120
|
+
// account-scoped via accountIdOf(req); id-addressed reads/writes verify ownership → 404. No AI.
|
|
144
121
|
export async function botTriageRoutes(app) {
|
|
145
122
|
// Every distinct reviewer in the account (human + automated), classified, with 90-day
|
|
146
123
|
// volume + a sample body — powers the Settings "Review bots" detected-reviewers table.
|
|
@@ -232,27 +209,6 @@ export async function botTriageRoutes(app) {
|
|
|
232
209
|
}
|
|
233
210
|
return resp;
|
|
234
211
|
});
|
|
235
|
-
// The account's mute / auto-triage rules.
|
|
236
|
-
app.get('/api/bot-mute-rules', async (req) => {
|
|
237
|
-
const rules = await listBotMuteRules(accountIdOf(req));
|
|
238
|
-
const resp = { rules };
|
|
239
|
-
return resp;
|
|
240
|
-
});
|
|
241
|
-
app.post('/api/bot-mute-rules', { schema: muteRuleSchema }, async (req) => {
|
|
242
|
-
const input = req.body;
|
|
243
|
-
const rule = await addBotMuteRule(accountIdOf(req), input);
|
|
244
|
-
return rule;
|
|
245
|
-
});
|
|
246
|
-
app.delete('/api/bot-mute-rules/:id', { schema: ruleIdParamSchema }, async (req, reply) => {
|
|
247
|
-
const { id } = req.params;
|
|
248
|
-
const ok = await deleteBotMuteRule(accountIdOf(req), id);
|
|
249
|
-
if (!ok) {
|
|
250
|
-
reply.status(404);
|
|
251
|
-
return { error: 'NotFound', message: `Mute rule ${id} not found` };
|
|
252
|
-
}
|
|
253
|
-
reply.status(204);
|
|
254
|
-
return null;
|
|
255
|
-
});
|
|
256
212
|
// The scope-wide review list: every PR with ≥1 `likely_addressed` automated-reviewer thread
|
|
257
213
|
// across the account (or a repo scope), UNCAPPED, newest-thread-first, each row carrying all
|
|
258
214
|
// its resolvable thread ids + a bot thread-state mix + `totalThreads` (the whole backlog). The
|
|
@@ -273,7 +229,7 @@ export async function botTriageRoutes(app) {
|
|
|
273
229
|
// The confirm-gated scope-wide resolve. NEVER blind: the server RE-DERIVES the eligible set
|
|
274
230
|
// (owned + automated-reviewer-originated + `likely_addressed` + unresolved) ∩ the client's
|
|
275
231
|
// explicit reviewed ids, scoped to `repoIds`, then resolves each via the SAME shared helper the
|
|
276
|
-
// per-PR route
|
|
232
|
+
// per-PR route uses. An empty list is a no-op (not an error);
|
|
277
233
|
// per-thread failures are reported, not fatal. The re-derive path passes `threadIds` so the
|
|
278
234
|
// page cap is bypassed — no requested-and-eligible id is silently dropped.
|
|
279
235
|
app.post('/api/bot-threads/resolve', { schema: scopeResolveSchema }, async (req) => {
|
package/dist/api/routes/prs.js
CHANGED
|
@@ -279,7 +279,7 @@ export async function prRoutes(app) {
|
|
|
279
279
|
const accountId = accountIdOf(req);
|
|
280
280
|
// Server RE-DERIVES the eligible set (owned + automated-reviewer-originated +
|
|
281
281
|
// `likely_addressed` + unresolved) ∩ the client's reviewed list, then resolves each via
|
|
282
|
-
// the shared helper (the SAME code path the
|
|
282
|
+
// the shared helper (the SAME code path the scope-wide resolve uses). An empty
|
|
283
283
|
// eligible set — PR not owned / no such threads / a fully-stale client list — is a no-op,
|
|
284
284
|
// not an error (the helper short-circuits before any token fetch). Status stays 200 even
|
|
285
285
|
// on partial failure; the body carries per-thread outcomes.
|
package/dist/app.js
CHANGED
|
@@ -140,7 +140,7 @@ export async function buildApp() {
|
|
|
140
140
|
await app.register(activityRoutes);
|
|
141
141
|
await app.register(mentionsRoutes);
|
|
142
142
|
// Bot-triage platform (CORE, always registered): detection/override, ROI analytics,
|
|
143
|
-
// cross-bot dedup,
|
|
143
|
+
// cross-bot dedup, confirm-gated bot-thread resolve. Account-scoped; no AI.
|
|
144
144
|
await app.register(botTriageRoutes);
|
|
145
145
|
// Stripe billing seam (checkout redirect + webhook). Registered in both modes;
|
|
146
146
|
// inert until the STRIPE_* env vars are set (webhook 501s unconfigured).
|
|
@@ -3,10 +3,11 @@ import { setReviewThreadResolved } from '../github/mutations.js';
|
|
|
3
3
|
import { stampThreadResolved } from '../db/queries.js';
|
|
4
4
|
// Resolve a batch of already-eligible review threads on GitHub AND stamp them resolved
|
|
5
5
|
// locally. This is the ONE place the GitHub `resolveReviewThread` mutation is driven for
|
|
6
|
-
// bot-thread triage — shared verbatim by
|
|
7
|
-
// threads` route and the
|
|
6
|
+
// bot-thread triage — shared verbatim by the manual per-PR `POST /api/prs/:id/resolve-bot-
|
|
7
|
+
// threads` route and the scope-wide `POST /api/bot-threads/resolve`, so their behaviour can't
|
|
8
|
+
// drift. Both are strictly user-initiated + confirm-gated — there is no automatic/cron resolve.
|
|
8
9
|
//
|
|
9
|
-
// Callers own eligibility:
|
|
10
|
+
// Callers own eligibility: `getResolvableBotThreads` / `getResolvableBotThreadsForScope`
|
|
10
11
|
// return ONLY owned + automated-reviewer-originated + `likely_addressed` + unresolved threads
|
|
11
12
|
// (with a GitHub node id), so this helper never has to re-derive it. It NEVER merges — it only
|
|
12
13
|
// resolves. Sequential (not Promise.all) to stay gentle on the GraphQL rate limit (a bot
|