|
| 1 | +name: Classify All Workflow Errors |
| 2 | + |
| 3 | +# Trigger after specific workflows complete |
| 4 | +on: |
| 5 | + workflow_run: |
| 6 | + workflows: |
| 7 | + - "CI Test Suite" |
| 8 | + - "Copyright Checks" |
| 9 | + - "Container Validation (Dynamo)" |
| 10 | + - "Pre Merge" |
| 11 | + - "Nightly CI Pipeline" |
| 12 | + - "Post-Merge CI Pipeline" |
| 13 | + - "NVIDIA Test Lab Validation" |
| 14 | + types: [completed] |
| 15 | + |
| 16 | +permissions: |
| 17 | + actions: read |
| 18 | + checks: write |
| 19 | + contents: read |
| 20 | + pull-requests: write |
| 21 | + |
| 22 | +jobs: |
| 23 | + classify-errors: |
| 24 | + name: Classify Workflow Errors |
| 25 | + runs-on: ubuntu-latest |
| 26 | + # Only run if the triggering workflow failed |
| 27 | + if: ${{ github.event.workflow_run.conclusion == 'failure' }} |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: Checkout code |
| 31 | + uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + ref: ${{ github.event.workflow_run.head_branch }} |
| 34 | + |
| 35 | + - name: Set up Python |
| 36 | + uses: actions/setup-python@v5 |
| 37 | + with: |
| 38 | + python-version: '3.11' |
| 39 | + |
| 40 | + - name: Install dependencies |
| 41 | + run: | |
| 42 | + python3 -m venv /tmp/error-classification-venv |
| 43 | + . /tmp/error-classification-venv/bin/activate |
| 44 | + pip install -r opensearch_upload/requirements.txt |
| 45 | +
|
| 46 | + - name: Classify All Workflow Errors |
| 47 | + env: |
| 48 | + # NVIDIA API Configuration (Claude via NVIDIA inference API) |
| 49 | + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
| 50 | + API_FORMAT: "openai" |
| 51 | + API_BASE_URL: "https://inference-api.nvidia.com/v1" |
| 52 | + ANTHROPIC_MODEL: "aws/anthropic/claude-opus-4-5" |
| 53 | + |
| 54 | + # Feature flags |
| 55 | + ENABLE_ERROR_CLASSIFICATION: "true" |
| 56 | + ENABLE_GITHUB_ANNOTATIONS: "true" |
| 57 | + ENABLE_PR_COMMENTS: "true" |
| 58 | + |
| 59 | + # GitHub context |
| 60 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + |
| 62 | + # OpenSearch (optional) |
| 63 | + ERROR_CLASSIFICATION_INDEX: ${{ secrets.ERROR_CLASSIFICATION_INDEX }} |
| 64 | + OPENSEARCH_URL: ${{ secrets.OPENSEARCH_URL }} |
| 65 | + OPENSEARCH_USERNAME: ${{ secrets.OPENSEARCH_USERNAME }} |
| 66 | + OPENSEARCH_PASSWORD: ${{ secrets.OPENSEARCH_PASSWORD }} |
| 67 | + |
| 68 | + # Performance tuning |
| 69 | + MAX_PARALLEL_JOBS: "5" |
| 70 | + run: | |
| 71 | + . /tmp/error-classification-venv/bin/activate |
| 72 | + python3 .github/workflows/classify_workflow_errors.py || echo "⚠️ Classification failed but continuing" |
| 73 | +
|
| 74 | + - name: Upload Classification Results (if available) |
| 75 | + if: always() |
| 76 | + uses: actions/upload-artifact@v4 |
| 77 | + with: |
| 78 | + name: error-classification-results |
| 79 | + path: | |
| 80 | + /tmp/error-classification-*.json |
| 81 | + retention-days: 7 |
| 82 | + if-no-files-found: ignore |
0 commit comments