MCPcopy Create free account
hub / github.com/ReviewStage/stage-cli / resolveRunScopeKey

Function resolveRunScopeKey

packages/cli/src/routes/comments.ts:211–227  ·  view source on GitHub ↗
(db: StageDb, runId: string | undefined)

Source from the content-addressed store, hash-verified

209}
210
211function resolveRunScopeKey(db: StageDb, runId: string | undefined): string | null {
212 if (!runId) return null;
213 const [run] = db
214 .select({
215 scopeKind: chapterRun.scopeKind,
216 workingTreeRef: chapterRun.workingTreeRef,
217 baseSha: chapterRun.baseSha,
218 headSha: chapterRun.headSha,
219 mergeBaseSha: chapterRun.mergeBaseSha,
220 })
221 .from(chapterRun)
222 .where(eq(chapterRun.id, runId))
223 .limit(1)
224 .all();
225 if (!run) return null;
226 return deriveScopeKey(run);
227}
228
229function listThreads(db: StageDb, scopeKey: string): CommentThreadDto[] {
230 const threads = db

Callers 1

commentRoutesFunction · 0.85

Calls 1

deriveScopeKeyFunction · 0.85

Tested by

no test coverage detected