-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Fix issue #5448: When using the GitHub resolver on a PR, automatically pipe in failure info #5449
base: main
Are you sure you want to change the base?
Conversation
…y pipe in failure info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@openhands-agent the python linting GitHub workflow is failing. Please check the workflow file and make sure that linking passes.
I'm still working on validating this, which is bringing out a bunch of little issues. No need to review yet. |
Correction and update on the validation test for this PR: I apologize for the confusion in my previous comment. After further investigation and fixes, here are the corrected results:
After applying these changes, the test results now correctly show:
This update ensures that the OpenHands resolver accurately reports PR status issues without duplication, further improving its functionality in addressing the original issue (#5448). The changes made to resolve the issue:
These modifications have successfully resolved the issue of duplicate lint failures being reported in the PR status, ensuring that the implementation correctly addresses the original requirements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but need a second review.
Actually, I tried to run this locally, and got the following error. We should see if we can reproduce this and fix.
|
1. Add pr_status section to basic-followup.jinja template 2. Add unit tests to verify PR status in prompts
Update test assertions to match new behavior where 'This PR has no merge conflicts' is only included when there's already some status information.
1. Add check to avoid duplicate CI check entries 2. Remove separate linting section since it's redundant with CI check information 3. Update tests to match new behavior
OK, I've confirmed this is working, I get the below prompt when linting is failing: The current code is an attempt at fixing one or more issues. The code is not satisfactory and follow up feedback have been provided to address this.
The feedback may be addressed to specific code files. In this case the file locations will be provided.
Please update the code based on the feedback for the repository in /workspace.
An environment has been set up for you to start working. You may assume all necessary tools are installed.
# Issues addressed
[
"It would nice to be able to sort the retrieved PRs. Add an option to retrieve the sorted PRs by various characteristics."
]
# PR Status
The following CI checks have failed:
- lint: No description provided
Please examine the GitHub workflow files, reproduce the problem locally, and fix and test it locally.
Please run the failing checks locally to fix the issues.
Note: Detailed information about the failed checks is not available. Please check the GitHub Actions tab for more information.
# Review comments
None
# Review threads
None
# Review thread files
None
# PR Thread Comments
IMPORTANT: You should ONLY interact with the environment provided to you AND NEVER ASK FOR HUMAN HELP.
You SHOULD INCLUDE PROPER INDENTATION in your edit commands.
When you think you have fixed the issue through code changes, please finish the interaction. |
import logging | ||
import traceback | ||
from openhands.resolver.issue_definitions import PRHandler | ||
from openhands.core.config import LLMConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the inclusion of this file intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing not, but this file is great! I wonder if we could convert it into an integration test 🤔
|
||
# Print raw API response for debugging | ||
print(f'Raw API response for PR #{pull_number}:') | ||
print(json.dumps(response_json, indent=2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't need these prints anymore
|
||
print(f'Processed PR status for PR #{pull_number}:') | ||
print(f'has_conflicts: {has_conflicts}') | ||
print(f'failed_checks: {failed_checks}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too, I suppose?
openhands/resolver/github_issue.py
Outdated
thread_ids: Optional[list[str]] = None | ||
head_branch: Optional[str] = None | ||
has_merge_conflicts: Optional[bool] = None | ||
failed_checks: Optional[list[dict[str, Optional[str]]]] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@openhands-agent In this PR, look at the diff for the file github_issue.py.
IMPORTANT: we use python 3.10+ and so we use | None, instead of the old Optional. Please make sure that this file does that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Openhands fix success summary
Unable to verify the implementation of the requested changes because the actual code changes in github_issue.py are not provided. While the AI agent claims to have updated the type hints to use Python 3.10+ style (| None instead of Optional), removed the Optional import, and fixed nested type hints, we need to see the actual code diff to confirm these changes were made correctly.
@@ -296,6 +296,129 @@ def __init__(self, owner: str, repo: str, token: str, llm_config: LLMConfig): | |||
super().__init__(owner, repo, token, llm_config) | |||
self.download_url = 'https://api.github.com/repos/{}/{}/pulls' | |||
|
|||
def __get_pr_status( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really intentional to use a double underscore here?
…, automatically pipe in failure info
Overview: The changes cannot be verified because:
To properly assess the resolution, we would need to see:
Recommendation: |
This PR addresses the issue reported in the comment #5449 (comment)
Changes made:
get_instruction
method inPRHandler
class to include a message when there are no merge conflicts and all CI checks have passed.test_get_instruction_without_pr_status
test case to check for the new message.Please review the changes and let me know if any further modifications are needed.
To run this PR locally, use the following command: