|
| 1 | +--- |
| 2 | +name: QA Changes Evaluation [experimental] |
| 3 | + |
| 4 | +# This workflow evaluates how well QA validation performed. |
| 5 | +# It runs when a PR is closed to assess QA effectiveness. |
| 6 | +# |
| 7 | +# Security note: pull_request_target is safe here because this workflow |
| 8 | +# never checks out or executes PR code. It only: |
| 9 | +# 1. Downloads artifacts produced by a trusted workflow run |
| 10 | +# 2. Runs evaluation scripts from the extensions repo (main/pinned branch) |
| 11 | + |
| 12 | +on: |
| 13 | + pull_request_target: |
| 14 | + types: [closed] |
| 15 | + |
| 16 | +permissions: |
| 17 | + contents: read |
| 18 | + pull-requests: read |
| 19 | + |
| 20 | +jobs: |
| 21 | + evaluate: |
| 22 | + runs-on: ubuntu-24.04 |
| 23 | + env: |
| 24 | + PR_NUMBER: ${{ github.event.pull_request.number }} |
| 25 | + REPO_NAME: ${{ github.repository }} |
| 26 | + PR_MERGED: ${{ github.event.pull_request.merged }} |
| 27 | + |
| 28 | + steps: |
| 29 | + - name: Download QA trace artifact |
| 30 | + id: download-trace |
| 31 | + uses: dawidd6/action-download-artifact@v19 |
| 32 | + continue-on-error: true |
| 33 | + with: |
| 34 | + workflow: qa-changes-by-openhands.yml |
| 35 | + name: qa-changes-trace-${{ github.event.pull_request.number }} |
| 36 | + path: trace-info |
| 37 | + search_artifacts: true |
| 38 | + if_no_artifact_found: warn |
| 39 | + |
| 40 | + - name: Check if trace file exists |
| 41 | + id: check-trace |
| 42 | + run: | |
| 43 | + if [ -f "trace-info/laminar_trace_info.json" ]; then |
| 44 | + echo "trace_exists=true" >> $GITHUB_OUTPUT |
| 45 | + echo "Found trace file for PR #$PR_NUMBER" |
| 46 | + else |
| 47 | + echo "trace_exists=false" >> $GITHUB_OUTPUT |
| 48 | + echo "No trace file found for PR #$PR_NUMBER - skipping evaluation" |
| 49 | + fi |
| 50 | +
|
| 51 | + # EXPERIMENTAL: pinned to feature branch while qa-changes plugin is in development. |
| 52 | + # Switch to @main (and remove ref:) once the plugin is merged. |
| 53 | + - name: Checkout extensions repository |
| 54 | + if: steps.check-trace.outputs.trace_exists == 'true' |
| 55 | + uses: actions/checkout@v6 |
| 56 | + with: |
| 57 | + repository: OpenHands/extensions |
| 58 | + ref: feat/qa-changes-plugin |
| 59 | + path: extensions |
| 60 | + |
| 61 | + - name: Set up Python |
| 62 | + if: steps.check-trace.outputs.trace_exists == 'true' |
| 63 | + uses: actions/setup-python@v6 |
| 64 | + with: |
| 65 | + python-version: '3.12' |
| 66 | + |
| 67 | + - name: Install dependencies |
| 68 | + if: steps.check-trace.outputs.trace_exists == 'true' |
| 69 | + run: pip install lmnr |
| 70 | + |
| 71 | + - name: Run evaluation |
| 72 | + if: steps.check-trace.outputs.trace_exists == 'true' |
| 73 | + env: |
| 74 | + # Script expects LMNR_PROJECT_API_KEY; org secret is named LMNR_SKILLS_API_KEY |
| 75 | + LMNR_PROJECT_API_KEY: ${{ secrets.LMNR_SKILLS_API_KEY }} |
| 76 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 77 | + run: | |
| 78 | + python extensions/plugins/qa-changes/scripts/evaluate_qa_changes.py \ |
| 79 | + --trace-file trace-info/laminar_trace_info.json |
| 80 | +
|
| 81 | + - name: Upload evaluation logs |
| 82 | + uses: actions/upload-artifact@v7 |
| 83 | + if: always() && steps.check-trace.outputs.trace_exists == 'true' |
| 84 | + with: |
| 85 | + name: qa-changes-evaluation-${{ github.event.pull_request.number }} |
| 86 | + path: '*.log' |
| 87 | + retention-days: 30 |
0 commit comments