-
Notifications
You must be signed in to change notification settings - Fork 35
Update PR review workflows to use extensions plugin #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
99bb0fc
Update PR review workflows to use extensions plugin
openhands-agent 8aa4dce
Address review feedback
openhands-agent d487ec2
Remove reusable workflow, use full workflow directly
openhands-agent b0af14f
Address review feedback: accept trace file path as argument
openhands-agent 3874c31
Address review feedback: add comments and require logs
openhands-agent f27dd68
Use symlinks for workflow templates in plugins directory
openhands-agent 9fc9989
Fix README: use correct URLs for workflow files
openhands-agent 5e74fcc
Replace symlinks with copies + add sync test
openhands-agent 9692b23
Merge workflow sync check into validation workflow
openhands-agent 297d61e
Replace validation checks with proper tests workflow
openhands-agent 8129b96
Add PYTHONPATH for tests to find skills module
openhands-agent 4ddbdc9
Add requests to test dependencies
openhands-agent 87ba88a
Use uv for tests workflow
openhands-agent fe609a7
Fix workflow sync test to only check known copy locations
openhands-agent 08e135c
Auto-discover all plugins/*/workflows directories
openhands-agent 694ffef
Add pyproject.toml with test dependencies
openhands-agent 39ade09
Fix PR review action: use uv run --with for dependencies
openhands-agent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| --- | ||
| name: PR Review Evaluation | ||
|
|
||
| # This workflow evaluates how well PR review comments were addressed. | ||
| # It runs when a PR is closed to assess review effectiveness. | ||
| # | ||
| # Security note: pull_request_target is safe here because: | ||
| # 1. Only triggers on PR close (not on code changes) | ||
| # 2. Does not checkout PR code - only downloads artifacts from trusted workflow runs | ||
| # 3. Runs evaluation scripts from the extensions repo, not from the PR | ||
|
neubig marked this conversation as resolved.
|
||
|
|
||
| on: | ||
| pull_request_target: | ||
|
neubig marked this conversation as resolved.
|
||
| types: [closed] | ||
|
neubig marked this conversation as resolved.
|
||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| evaluate: | ||
| runs-on: ubuntu-24.04 | ||
| env: | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| REPO_NAME: ${{ github.repository }} | ||
| PR_MERGED: ${{ github.event.pull_request.merged }} | ||
|
|
||
| steps: | ||
| - name: Download review trace artifact | ||
| id: download-trace | ||
| uses: dawidd6/action-download-artifact@v6 | ||
| continue-on-error: true | ||
| with: | ||
| workflow: pr-review-by-openhands.yml | ||
| name: pr-review-trace-${{ github.event.pull_request.number }} | ||
| path: trace-info | ||
| search_artifacts: true | ||
| if_no_artifact_found: warn | ||
|
|
||
| - name: Check if trace file exists | ||
| id: check-trace | ||
| run: | | ||
| if [ -f "trace-info/laminar_trace_info.json" ]; then | ||
| echo "trace_exists=true" >> $GITHUB_OUTPUT | ||
| echo "Found trace file for PR #$PR_NUMBER" | ||
| else | ||
| echo "trace_exists=false" >> $GITHUB_OUTPUT | ||
| echo "No trace file found for PR #$PR_NUMBER - skipping evaluation" | ||
| fi | ||
|
|
||
| # Always checkout main branch for security - cannot test script changes in PRs | ||
| - name: Checkout extensions repository | ||
| if: steps.check-trace.outputs.trace_exists == 'true' | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| repository: OpenHands/extensions | ||
| path: extensions | ||
|
neubig marked this conversation as resolved.
|
||
|
|
||
| - name: Set up Python | ||
| if: steps.check-trace.outputs.trace_exists == 'true' | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install dependencies | ||
| if: steps.check-trace.outputs.trace_exists == 'true' | ||
|
neubig marked this conversation as resolved.
|
||
| run: pip install lmnr | ||
|
|
||
| - name: Run evaluation | ||
| if: steps.check-trace.outputs.trace_exists == 'true' | ||
| env: | ||
| # Script expects LMNR_PROJECT_API_KEY; org secret is named LMNR_SKILLS_API_KEY | ||
| LMNR_PROJECT_API_KEY: ${{ secrets.LMNR_SKILLS_API_KEY }} | ||
|
neubig marked this conversation as resolved.
|
||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| python extensions/plugins/pr-review/scripts/evaluate_review.py \ | ||
| --trace-file trace-info/laminar_trace_info.json | ||
|
|
||
| - name: Upload evaluation logs | ||
| uses: actions/upload-artifact@v5 | ||
| if: always() && steps.check-trace.outputs.trace_exists == 'true' | ||
| with: | ||
| name: pr-review-evaluation-${{ github.event.pull_request.number }} | ||
| path: '*.log' | ||
| retention-days: 30 | ||
|
neubig marked this conversation as resolved.
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ["*"] | ||
| push: | ||
| branches: ["main", "master"] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| enable-cache: true | ||
| python-version: "3.12" | ||
|
|
||
| - name: Run tests | ||
| run: uv run --group test pytest tests/ | ||
| env: | ||
| PYTHONPATH: ${{ github.workspace }} |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.