Skip to content

Commit 7ae02af

Browse files
author
Shaurya Singh
committed
Cleanup: Remove debug instrumentation after successful fix verification
1 parent 94d4d91 commit 7ae02af

File tree

9 files changed

+5
-37
lines changed

9 files changed

+5
-37
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33

44

5+

nixpacks.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ cmd = 'npm start'
1212

1313

1414

15+

src/auth/ownership.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ export async function resolveRepoId(
1515
userId: string,
1616
repoId: string
1717
): Promise<string | null> {
18-
// #region agent log
19-
fetch('http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'ownership.ts:resolveRepoId',message:'Resolving repoId',data:{userId,repoId,isValidUUID:isValidUUID(repoId)},timestamp:Date.now(),sessionId:'debug-session',hypothesisId:'C'})}).catch(()=>{});
20-
// #endregion
21-
2218
let result;
2319
if (isValidUUID(repoId)) {
2420
// Look up by database ID (UUID)
@@ -34,10 +30,6 @@ export async function resolveRepoId(
3430
);
3531
}
3632

37-
// #region agent log
38-
fetch('http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'ownership.ts:resolveRepoId',message:'Resolve result',data:{found:result.rows.length > 0,resolvedId:result.rows[0]?.id || null,lookupType:isValidUUID(repoId)?'uuid':'github_id'},timestamp:Date.now(),sessionId:'debug-session',hypothesisId:'C'})}).catch(()=>{});
39-
// #endregion
40-
4133
return result.rows.length > 0 ? result.rows[0].id : null;
4234
}
4335

src/db/migrations/002_add_installation_id.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ COMMENT ON COLUMN github_accounts.installation_id IS 'GitHub App installation ID
1818

1919

2020

21+

src/github/app-client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@ export async function getUserOctokit(userId: string, db: any): Promise<any> {
7474

7575

7676

77+

src/routes/github-app.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ export default async function githubAppRoutes(fastify: FastifyInstance) {
140140
const req = request as AuthenticatedRequest;
141141
const { available } = request.query as { available?: string };
142142

143-
// #region agent log
144-
fetch('http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'github-app.ts:GET /github/repos',message:'Endpoint called',data:{userId:req.userId,available},timestamp:Date.now(),sessionId:'debug-session',hypothesisId:'A'})}).catch(()=>{});
145-
// #endregion
146-
147143
try {
148144
// Get user's Octokit instance
149145
const octokit = await getUserOctokit(req.userId, db);
@@ -158,11 +154,6 @@ export default async function githubAppRoutes(fastify: FastifyInstance) {
158154
// If available=true, return all GitHub repos (for onboarding/selection)
159155
if (available === 'true') {
160156
const githubRepos = await fetchUserRepos(octokit as any);
161-
162-
// #region agent log
163-
fetch('http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'github-app.ts:GET /github/repos',message:'Returning available GitHub repos',data:{count:githubRepos.length},timestamp:Date.now(),sessionId:'debug-session',hypothesisId:'A'})}).catch(()=>{});
164-
// #endregion
165-
166157
return reply.send({ repos: githubRepos });
167158
}
168159

@@ -174,10 +165,6 @@ export default async function githubAppRoutes(fastify: FastifyInstance) {
174165
[req.userId]
175166
);
176167

177-
// #region agent log
178-
fetch('http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'github-app.ts:GET /github/repos',message:'Database repos fetched',data:{count:dbResult.rows.length,repos:dbResult.rows.map((r:any)=>({id:r.id,github_repo_id:r.github_repo_id,full_name:r.full_name}))},timestamp:Date.now(),sessionId:'debug-session',hypothesisId:'A'})}).catch(()=>{});
179-
// #endregion
180-
181168
// If user has connected repos, return them (with database UUIDs)
182169
if (dbResult.rows.length > 0) {
183170
const repos = dbResult.rows.map((row: any) => ({
@@ -191,18 +178,10 @@ export default async function githubAppRoutes(fastify: FastifyInstance) {
191178
last_analyzed_at: row.last_analyzed_at,
192179
}));
193180

194-
// #region agent log
195-
fetch('http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'github-app.ts:GET /github/repos',message:'Returning database repos',data:{repoIds:repos.map((r:any)=>r.id)},timestamp:Date.now(),sessionId:'debug-session',hypothesisId:'A'})}).catch(()=>{});
196-
// #endregion
197-
198181
return reply.send({ repos });
199182
}
200183

201184
// No connected repos - return error to trigger redirect to onboarding
202-
// #region agent log
203-
fetch('http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'github-app.ts:GET /github/repos',message:'No connected repos found',data:{userId:req.userId},timestamp:Date.now(),sessionId:'debug-session',hypothesisId:'B'})}).catch(()=>{});
204-
// #endregion
205-
206185
return reply.status(404).send({
207186
error: 'No repositories connected',
208187
message: 'No repositories connected. Please connect repositories first.',

src/routes/outputs.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ export default async function outputsRoutes(fastify: FastifyInstance) {
1313
const req = request as AuthenticatedRequest;
1414
const { repoId } = request.params as { repoId: string };
1515

16-
// #region agent log
17-
fetch('http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'outputs.ts:GET /repos/:repoId/outputs/latest',message:'Route called',data:{repoId,userId:req.userId,isValidUUID:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(repoId)},timestamp:Date.now(),sessionId:'debug-session',hypothesisId:'C'})}).catch(()=>{});
18-
// #endregion
19-
2016
// Resolve repoId to database UUID (handles both UUID and GitHub ID)
2117
const resolvedRepoId = await resolveRepoId(req.userId, repoId);
2218

src/routes/repos.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ export default async function reposRoutes(fastify: FastifyInstance) {
9898
const req = request as AuthenticatedRequest;
9999
const { repoId } = request.params as { repoId: string };
100100

101-
// #region agent log
102-
fetch('http://127.0.0.1:7242/ingest/8d3b0573-4207-40dd-b592-63e02b65dcc5',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({location:'repos.ts:GET /repos/:repoId',message:'Route called',data:{repoId,userId:req.userId,isValidUUID:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(repoId)},timestamp:Date.now(),sessionId:'debug-session',hypothesisId:'C'})}).catch(()=>{});
103-
// #endregion
104-
105101
// Resolve repoId to database UUID (handles both UUID and GitHub ID)
106102
const resolvedRepoId = await resolveRepoId(req.userId, repoId);
107103

src/routes/webhooks.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,4 @@ async function handleRelease(payload: any) {
168168

169169

170170

171+

0 commit comments

Comments
 (0)