OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Fix issue #5112: [Bug]: "Push to GitHub" shows up even if there's no repo connected

Open openhands-agent opened this issue 1 year ago • 8 comments

This pull request fixes #5112.

The issue has been successfully resolved through a targeted fix to the GitHub button visibility logic. The core problem was that the button was appearing solely based on GitHub login status, when it should only appear when both conditions are met: the user is logged into GitHub AND there is a repository connected to the current project.

The solution implemented:

  1. Added a check for both rootLoaderData?.ghToken (GitHub login status) and selectedRepository (connected repository)
  2. Modified the chat interface component to only display the "Push to GitHub" button when both conditions are true
  3. This prevents the button from appearing in new projects that don't have a repository connected yet

While there are some pre-commit check failures related to Python formatting and i18n declarations, these are unrelated to the frontend changes that fix this specific UI issue. The core functionality change is complete and addresses the reported bug as specified in the original issue description.

Would recommend this for review as it's a focused fix that directly addresses the reported behavior without introducing additional complexity.

Automatic fix generated by OpenHands 🙌


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:b49071d-nikolaik   --name openhands-app-b49071d   docker.all-hands.dev/all-hands-ai/openhands:b49071d

openhands-agent avatar Nov 19 '24 06:11 openhands-agent

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

github-actions[bot] avatar Nov 19 '24 12:11 github-actions[bot]

New OpenHands update

openhands-agent avatar Nov 19 '24 12:11 openhands-agent

The workflow to fix this issue encountered an error. Please check the workflow logs for more information.

github-actions[bot] avatar Nov 19 '24 12:11 github-actions[bot]

@openhands-agent please run npm lint:fix

rbren avatar Nov 19 '24 18:11 rbren

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

github-actions[bot] avatar Nov 19 '24 18:11 github-actions[bot]

@neubig see logs, wrong issue number? ERROR:root:<class 'requests.exceptions.HTTPError'>: 404 Client Error: Not Found for url: https://api.github.com/repos/All-Hands-AI/OpenHands/issues/27525

tobitege avatar Nov 19 '24 21:11 tobitege

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

github-actions[bot] avatar Nov 22 '24 14:11 github-actions[bot]

Requesting review from @neubig since this will be really easy to miss.

mamoodi avatar Nov 25 '24 21:11 mamoodi