From 5328faff2fcc41424e68e817e8a745d0e4e3c11e Mon Sep 17 00:00:00 2001 From: "gemini-cli[bot]" Date: Thu, 30 Apr 2026 23:48:16 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Gemini=20Bot=20Productivity=20Op?= =?UTF-8?q?timizations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metrics/scripts/backlog_health.ts | 40 +++++++------------ 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/tools/gemini-cli-bot/metrics/scripts/backlog_health.ts b/tools/gemini-cli-bot/metrics/scripts/backlog_health.ts index f7abcc9c4f..67db146530 100644 --- a/tools/gemini-cli-bot/metrics/scripts/backlog_health.ts +++ b/tools/gemini-cli-bot/metrics/scripts/backlog_health.ts @@ -8,35 +8,25 @@ import { GITHUB_OWNER, GITHUB_REPO } from '../types.js'; import { execSync } from 'node:child_process'; try { - const query = ` - query($owner: String!, $repo: String!, $cursor: String) { - repository(owner: $owner, name: $repo) { - pullRequests(states: OPEN, first: 100, orderBy: {field: CREATED_AT, direction: ASC}, after: $cursor) { - totalCount - nodes { - createdAt - } - pageInfo { - hasNextPage - endCursor - } - } - issues(states: OPEN, first: 100, orderBy: {field: CREATED_AT, direction: ASC}, after: $cursor) { - totalCount - nodes { - createdAt - } - pageInfo { - hasNextPage - endCursor + const fetchNodes = async (type: 'pullRequests' | 'issues') => { + const query = ` + query($owner: String!, $repo: String!, $cursor: String) { + repository(owner: $owner, name: $repo) { + ${type}(states: OPEN, first: 100, orderBy: {field: CREATED_AT, direction: ASC}, after: $cursor) { + totalCount + nodes { + createdAt + } + pageInfo { + hasNextPage + endCursor + } } } } - } - `; + `; - const fetchNodes = async (type: 'pullRequests' | 'issues') => { - let allNodes: { createdAt: string }[] = []; + const allNodes: { createdAt: string }[] = []; let cursor: string | null = null; let totalCount = 0;