-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 #5179: [frontend]: Push to Github button should only push branch, but not creating a PR #5181
Conversation
…ranch, but not creating a PR
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 you should do npm run lint:fix
to fix frontend linting.
…ld only push branch, but not creating a PR
New OpenHands update |
The workflow to fix this issue encountered an error. Please check the workflow logs for more information. |
The workflow to fix this issue encountered an error. Please check the workflow logs for more information. |
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.
Could we get a screenshot of the resulting design? I'm a little bit worried about the design becoming noisy.
@neubig edited the PR description to include a screenshot |
Thanks! @rbren , wdyt about this design? For me personally I think it might be nice if we could put the buttons side-by-side to save screen space? |
@openhands-agent Can you put these two button side to side? |
…ld only push branch, but not creating a PR
New OpenHands update |
The workflow to fix this issue encountered an error. Please check the workflow logs for more information. |
@openhands-agent please display the "Push to Github" and "Push & Create PR" button side-by-side |
…ld only push branch, but not creating a PR
New OpenHands update |
The workflow to fix this issue encountered an error. Please check the workflow logs for more information. |
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 now!
suggestion={{ | ||
label: "Push to GitHub", | ||
value: | ||
"Please push the changes to a remote branch on GitHub, but do NOT create a pull request.", |
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.
Can we update the microagent instructions to send the user a compare link?
e.g.
If the user asks you to push your changes, but not create a PR, send them a message with a link to compare the files on the remote branch against the main branch.
]; | ||
renderChatInterface(messages); | ||
|
||
const pushButton = screen.getByRole("button", { name: "Push to GitHub" }); |
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.
Let's name this Push to Branch
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.
done
renderChatInterface(messages); | ||
|
||
const pushButton = screen.getByRole("button", { name: "Push to GitHub" }); | ||
const prButton = screen.getByRole("button", { name: "Push & Create PR" }); |
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 think once the Push & Create PR
button has been clicked once, we should only show one button after that. The agent (and user) will get v confused if you push and create PR, and then click "push to branch", since the PR is already opened.
Once you click "Push & Create PR" we should just have one button that says "Push changes to PR"
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.
done the most recent commit
@openhands-agent Can you review the comments above and work on it? |
@xingyaoww Hah, sorry, I have the assumption that it will read all comments too, but it doesn't automatically receive them: #5236 |
…ld only push branch, but not creating a PR
New OpenHands update |
The workflow to fix this issue encountered an error. Please check the workflow logs for more information. |
… creation * Rename 'Push to GitHub' button to 'Push to Branch' * Add state to track PR creation * Show only 'Push changes to PR' button after PR is created * Update tests to reflect new behavior
This pull request fixes #5179.
The PR has successfully resolved the original issue by implementing the requested split functionality for GitHub interactions. Specifically:
The original single "Push to GitHub" button that automatically created PRs has been separated into two distinct buttons:
The implementation includes proper test coverage to verify:
The changes maintain backward compatibility while adding the requested granular control over GitHub operations.
This solution directly addresses the original problem by preventing unintended PR creation while still maintaining the ability to create PRs when desired. The clear separation of concerns through distinct buttons provides a better user experience aligned with the requested solution.
A reviewer can verify that:
Automatic fix generated by OpenHands 🙌
It looks something like this:Before click push to PR:
Once Push to PR is clicked
To run this PR locally, use the following command: