From 4f76c44d161e389d0040097d9a87229cca3c02bb Mon Sep 17 00:00:00 2001 From: Ashley Zhang <69987606+ashleyzhang01@users.noreply.github.com> Date: Tue, 30 Jun 2026 17:09:06 -0700 Subject: [PATCH 1/2] restrict re-enrich and re-analyze prs to non merged --- online/etl/db/repository.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/online/etl/db/repository.py b/online/etl/db/repository.py index 62b15b2..527640e 100644 --- a/online/etl/db/repository.py +++ b/online/etl/db/repository.py @@ -113,8 +113,9 @@ async def insert_pr( ) ) # New events arrived — reset to pending so PR gets - # re-enriched/assembled/analyzed with the updated timeline - if len(merged_events) > len(old_events): + # re-enriched/assembled/analyzed with the updated timeline. + # Skip reset for PRs already analyzed/labeled: post-merge events + if len(merged_events) > len(old_events) and existing.get("status") not in ("analyzed", "labeled"): await self.db.execute( *self.db._translate_params( "UPDATE prs SET status = 'pending', enrichment_step = NULL, " From 0d12e6970f29ca08aa8a2fea26297097ec7b36eb Mon Sep 17 00:00:00 2001 From: Ashley Zhang <69987606+ashleyzhang01@users.noreply.github.com> Date: Tue, 30 Jun 2026 17:21:23 -0700 Subject: [PATCH 2/2] fix label --- online/etl/db/repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/online/etl/db/repository.py b/online/etl/db/repository.py index 527640e..6f09fb2 100644 --- a/online/etl/db/repository.py +++ b/online/etl/db/repository.py @@ -327,7 +327,7 @@ async def get_analyzed_not_labeled( if sort_by == "sweep": if chatbot_id is not None: return await self.db.fetchall( - q.GET_ANALYZED_NOT_LABELED_SWEEP, (chatbot_id, limit) + q.GET_ANALYZED_NOT_LABELED_BY_ASSEMBLED, (chatbot_id, limit) ) return await self.db.fetchall( q.GET_ALL_ANALYZED_NOT_LABELED_SWEEP, (limit,)