Skip to content

Add feature to automatically checkout pull request source branch #11

@Philipp0205

Description

@Philipp0205

Summary

Provide a one-click action to automatically checkout the branch associated with a pull request, allowing users to test code locally and use full IDE features.

User Story

As a developer reviewing a pull request, I want to quickly checkout the PR's source branch, so that I can run tests, debug code, and use IDE features like code navigation and refactoring.

Proposed Solution

  • Add "Checkout Branch" action in pull request view
  • Fetch remote branch if not present locally
  • Switch to the branch using JGit/EGit APIs
  • Handle uncommitted changes (stash, prompt, or warn)
  • Show confirmation with branch name
  • Update Eclipse workspace to reflect checked-out code

Acceptance Criteria

  • "Checkout Branch" button/action available in PR detail view
  • Action fetches remote branch if not available locally
  • Switches active branch to PR source branch
  • Handles uncommitted local changes gracefully
  • Shows confirmation dialog with branch information
  • Works for both GitHub and Bitbucket repositories
  • Integrates with EGit branch switching UI patterns
  • Updates Eclipse workspace and package explorer

Technical Considerations

  • Use EGit's BranchOperationUI for branch checkout
  • Fetch branch using JGit FetchCommand if not present
  • Parse PR metadata to determine source branch name and remote
  • Handle detached HEAD state for forked repository PRs
  • Respect EGit preferences for stashing uncommitted changes
  • Consider integration with EGit's "Switch To" branch dialog
  • Handle authentication for private repositories

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions