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

Fix "Push and create PR" button sending wrong query #7565

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rbren
Copy link
Collaborator

@rbren rbren commented Mar 27, 2025

Description

This PR fixes an issue where the "Push and create PR" button was sending the wrong query. The button was supposed to send a query to create a pull request with a meaningful branch name, but it was sending the query associated with "Push to Branch" instead.

Changes

  • Updated the ActionSuggestions component to ensure each button sends the correct query
  • Made the code more explicit by directly using the string values instead of relying on the value parameter
  • Fixed linting issues by removing unused parameters and formatting the code properly
  • Refactored the code to reduce duplication by:
    • Creating a ButtonConfig interface to define button configurations
    • Extracting button configurations into constants
    • Adding a helper function to handle button clicks consistently
    • Improving code maintainability and readability

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:aa5473a-nikolaik   --name openhands-app-aa5473a   docker.all-hands.dev/all-hands-ai/openhands:aa5473a

@rbren
Copy link
Collaborator Author

rbren commented Apr 7, 2025

@OpenHands rebase

Copy link

openhands-ai bot commented Apr 7, 2025

I'm on it! @rbren can track my progress at all-hands.dev

@rbren rbren force-pushed the fix-push-create-pr-button-query branch from 1878265 to aa5473a Compare April 7, 2025 15:56
Copy link

openhands-ai bot commented Apr 7, 2025

I successfully rebased the branch fix-push-create-pr-button-query onto the latest main branch as requested in PR #7565.

Here's a summary of what I did:

  1. Identified that the branch needed to be rebased onto the latest main branch
  2. Stashed a minor file permission change to .openhands/setup.sh before rebasing
  3. Performed the rebase, which resulted in a merge conflict in frontend/src/components/features/chat/action-suggestions.tsx
  4. Resolved the conflict by carefully merging the two versions:
    • Preserved the GitLab support from the main branch (using different terminology for GitLab vs GitHub)
    • Kept the code refactoring from our branch that reduced duplication using ButtonConfig objects
    • Combined both approaches to maintain all functionality while keeping the code clean
  5. Successfully completed the rebase
  6. Applied the stashed changes
  7. Force-pushed the rebased branch to update PR Fix "Push and create PR" button sending wrong query #7565

The rebase was successful, and the PR is now up-to-date with the latest main branch while preserving all the intended changes from the feature branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants