mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 22:02:59 -07:00
62670cc822
This PR implements several bot-related improvements and verifies workflow permissions as requested by maintainers. ### Changes: 1. **Fix Metric Cap (BT-01):** Refactored `open_issues.ts` and `open_prs.ts` to use GitHub's GraphQL API. This bypasses the 1000-item limit of the standard list command, ensuring accurate metrics for repositories with large numbers of open items. 2. **Initialize Pulse Reflexes (BT-02):** Created the `tools/gemini-cli-bot/reflexes/scripts` directory and added a README. This prepares the infrastructure for high-frequency reflexive automation. 3. **Workflow Verification (BT-05):** This PR and the accompanying comment on #24353 serve as confirmation that the GitHub App integration and workflow "write" permissions are correctly configured. ### Impact: - Accurate tracking of repository backlog. - Foundation for faster automated triage. - Confirmed operational status of the bot.
25 lines
689 B
TypeScript
25 lines
689 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2026 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { execSync } from 'node:child_process';
|
|
import { GITHUB_OWNER, GITHUB_REPO } from '../types.js';
|
|
|
|
try {
|
|
const query = `query { repository(owner: "${GITHUB_OWNER}", name: "${GITHUB_REPO}") { issues(states: OPEN) { totalCount } } }`;
|
|
const count = execSync(
|
|
`gh api graphql -f query='${query}'`,
|
|
{
|
|
encoding: 'utf-8',
|
|
},
|
|
).trim();
|
|
const parsed = JSON.parse(count);
|
|
const totalCount = parsed?.data?.repository?.issues?.totalCount ?? 0;
|
|
console.log(`open_issues,${totalCount}`);
|
|
} catch {
|
|
// Fallback if gh fails or no issues found
|
|
console.log('open_issues,0');
|
|
}
|