Issue Triage #12
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
| # Issue Triage Bot | |
| # | |
| # TRIGGERS: | |
| # issues.opened/reopened → classify, label, and respond to every new issue | |
| # issue_comment.created → when user provides debug log on a needs-debug-log issue, | |
| # run deeper analysis then auto-confirm the bug in code | |
| # workflow_dispatch → manually re-run triage or analyze_log on any issue | |
| # | |
| # Pipeline stages (automatic): | |
| # Stage 1 — triage-new-issue : classify, label, request debug log if needed | |
| # Stage 2 — analyze-debug-log : analyse debug log / screenshots (initial hypotheses) | |
| # Stage 3 — auto-confirm-bug : read actual source files and confirm/deny the bug | |
| # | |
| # After confirmation, the fix pipeline is triggered manually: | |
| # Comment "@claude-bot fix this" on any issue to invoke issue_fixer.py | |
| # Comment "@claude-bot confirm" to re-run the confirmation step manually | |
| name: Issue Triage | |
| on: | |
| issues: | |
| types: [opened, reopened] | |
| issue_comment: | |
| types: [created] | |
| workflow_dispatch: | |
| inputs: | |
| issue_number: | |
| description: "Issue number to re-triage" | |
| required: true | |
| type: number | |
| mode: | |
| description: "Mode: triage (classify) or analyze_log (analyse debug data)" | |
| required: true | |
| default: triage | |
| type: choice | |
| options: | |
| - triage | |
| - analyze_log | |
| jobs: | |
| # --------------------------------------------------------------------------- | |
| # Triage new issues automatically (also handles manual workflow_dispatch) | |
| # --------------------------------------------------------------------------- | |
| triage-new-issue: | |
| name: Triage New Issue | |
| if: | | |
| github.event_name == 'issues' || | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'triage') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.CLAUDE_REVIEWER_APP_ID }} | |
| private-key: ${{ secrets.CLAUDE_REVIEWER_PRIVATE_KEY }} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install anthropic PyGithub | |
| - env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| ISSUE_NUMBER: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.issue_number || github.event.issue.number }} | |
| REPO_FULL_NAME: ${{ github.repository }} | |
| GITHUB_RUN_ID: ${{ github.run_id }} | |
| GITHUB_SERVER_URL: ${{ github.server_url }} | |
| TRIAGE_MODE: triage | |
| run: python scripts/issue_triage.py | |
| # --------------------------------------------------------------------------- | |
| # Analyze debug log when user provides one on a waiting issue | |
| # --------------------------------------------------------------------------- | |
| analyze-debug-log: | |
| name: Analyze Debug Log | |
| if: | | |
| ( | |
| github.event_name == 'issue_comment' && | |
| github.event.issue.pull_request == null && | |
| github.event.issue.state == 'open' && | |
| github.actor != 'bess-manager-claude-bot[bot]' && | |
| contains(toJson(github.event.issue.labels), 'needs-debug-log') | |
| ) || | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'analyze_log') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.CLAUDE_REVIEWER_APP_ID }} | |
| private-key: ${{ secrets.CLAUDE_REVIEWER_PRIVATE_KEY }} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install anthropic PyGithub | |
| - env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| ISSUE_NUMBER: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.issue_number || github.event.issue.number }} | |
| COMMENT_BODY: ${{ github.event.comment.body }} | |
| REPO_FULL_NAME: ${{ github.repository }} | |
| GITHUB_RUN_ID: ${{ github.run_id }} | |
| GITHUB_SERVER_URL: ${{ github.server_url }} | |
| TRIAGE_MODE: analyze_log | |
| run: python scripts/issue_triage.py | |
| # --------------------------------------------------------------------------- | |
| # Auto-confirm bug after debug log analysis completes | |
| # --------------------------------------------------------------------------- | |
| auto-confirm-bug: | |
| name: Auto-Confirm Bug | |
| needs: analyze-debug-log | |
| if: | | |
| needs.analyze-debug-log.result == 'success' && | |
| ( | |
| ( | |
| github.event_name == 'issue_comment' && | |
| github.event.issue.pull_request == null && | |
| github.event.issue.state == 'open' && | |
| github.actor != 'bess-manager-claude-bot[bot]' && | |
| contains(toJson(github.event.issue.labels), 'needs-debug-log') | |
| ) || | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'analyze_log') | |
| ) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.CLAUDE_REVIEWER_APP_ID }} | |
| private-key: ${{ secrets.CLAUDE_REVIEWER_PRIVATE_KEY }} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install anthropic PyGithub | |
| - env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| ISSUE_NUMBER: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.issue_number || github.event.issue.number }} | |
| REPO_FULL_NAME: ${{ github.repository }} | |
| GITHUB_RUN_ID: ${{ github.run_id }} | |
| GITHUB_SERVER_URL: ${{ github.server_url }} | |
| run: python scripts/issue_confirmer.py |