fix(bench): sample symbols in embedding benchmark to prevent CI timeouts #2520
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Codegraph Impact Analysis | |
| on: [pull_request] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| concurrency: | |
| group: codegraph-impact-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| impact: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| for attempt in 1 2 3; do | |
| npm install && break | |
| if [ "$attempt" -lt 3 ]; then | |
| echo "::warning::npm install attempt $attempt failed, retrying in 15s..." | |
| sleep 15 | |
| else | |
| echo "::error::npm install failed after 3 attempts" | |
| exit 1 | |
| fi | |
| done | |
| - uses: actions/cache@v5 | |
| with: | |
| path: .codegraph/ | |
| key: codegraph-${{ hashFiles('src/**', 'package.json') }} | |
| restore-keys: codegraph- | |
| - name: Build graph | |
| run: node dist/cli.js build || (rm -rf .codegraph && node dist/cli.js build --no-incremental) | |
| - name: Run impact analysis | |
| run: node dist/cli.js diff-impact origin/${{ github.base_ref }} --json -T > impact.json | |
| - name: Comment on PR | |
| if: success() | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const impact = JSON.parse(fs.readFileSync('impact.json', 'utf-8')); | |
| if (!impact.summary || (impact.summary.functionsChanged === 0 && impact.summary.callersAffected === 0)) { | |
| console.log('No impact data to report.'); | |
| return; | |
| } | |
| const body = `## Codegraph Impact Analysis\n\n` + | |
| `**${impact.summary.functionsChanged} functions changed** → ` + | |
| `**${impact.summary.callersAffected} callers affected** across ` + | |
| `**${impact.summary.filesAffected} files**\n\n` + | |
| (impact.affectedFunctions || []).slice(0, 20).map(f => | |
| `- \`${f.name}\` in \`${f.file}:${f.line}\` (${f.transitiveCallers} transitive callers)` | |
| ).join('\n'); | |
| // Update existing comment or create new one | |
| const comments = await github.paginate(github.rest.issues.listComments, { | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const existing = comments.find(c => c.body.startsWith('## Codegraph Impact Analysis')); | |
| if (existing) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existing.id, | |
| body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body, | |
| }); | |
| } |