Skip to content
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

Better error handling after Create draft PR or push branch workflow #117

Closed
neubig opened this issue Sep 28, 2024 · 2 comments · Fixed by #118
Closed

Better error handling after Create draft PR or push branch workflow #117

neubig opened this issue Sep 28, 2024 · 2 comments · Fixed by #118
Labels
fix-me Try to automatically fix the issue with OpenHands

Comments

@neubig
Copy link
Contributor

neubig commented Sep 28, 2024

Currently in the Create draft PR or push branch workflow, even if the workflow fails due to permission issues, etc., a comment is sometimes posted that the branch or PR was completed successfully.

- name: Create draft PR or push branch
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
GITHUB_USERNAME: ${{ secrets.PAT_USERNAME }}
LLM_MODEL: ${{ secrets.LLM_MODEL }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
run: |
if [ "${{ steps.check_result.outputs.RESOLUTION_SUCCESS }}" == "true" ]; then
python -m openhands_resolver.send_pull_request \
--issue-number ${{ github.event.issue.number }} \
--pr-type draft | tee pr_result.txt && \
grep "draft created" pr_result.txt | sed 's/.*\///g' > pr_number.txt
else
python -m openhands_resolver.send_pull_request \
--issue-number ${{ github.event.issue.number }} \
--pr-type branch \
--send-on-failure | tee branch_result.txt && \
grep "branch created" branch_result.txt | sed 's/.*\///g; s/.expand=1//g' > branch_name.txt
fi

We should check that the workflow actually succeeded by making sure that there is a non-empty value in prNumber or branchName, and if the workflow failed, write a message to that effect.

This is about github workflows, so we don't need python tests for it.

@neubig neubig added the fix-me Try to automatically fix the issue with OpenHands label Sep 28, 2024
Copy link

OpenHands started fixing the issue! You can monitor the progress here.

Copy link

A potential fix has been generated and a draft PR #118 has been created. Please review the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix-me Try to automatically fix the issue with OpenHands
Projects
None yet
1 participant