Skip to content

Simplify BitBucket merge mode: auto-detect from VCS provider config #709

@acreeger

Description

@acreeger

Problem

Currently, BitBucket users must configure both versionControl.provider: 'bitbucket' and mergeBehavior.mode: 'bitbucket-pr' separately. This creates a confusing UX where the VCS provider and merge behavior are decoupled even though they're logically linked.

Additionally, bitbucket-pr being a separate merge mode creates code complexity:

  • Every conditional that checks merge modes must enumerate github-pr, github-draft-pr, AND bitbucket-pr
  • Adding new VCS providers means adding more mode strings
  • The finish.ts command has three near-duplicate PR workflow paths

Desired Behavior

Setting versionControl.provider: 'bitbucket' should be sufficient. The merge behavior should auto-detect:

  • If VCS is bitbucket and mode is github-pr or github-draft-pr → warn and use bitbucket-pr (or a generic pr mode)
  • Ideally, merge modes would be local, pr, draft-pr and the system routes to the correct VCS provider automatically
  • BitBucket doesn't support draft PRs natively, so draft-pr with BitBucket would either error clearly or fall back to regular PR with a note

Scope

This is a larger refactoring that would:

  1. Introduce generic merge modes (local, pr, draft-pr) that are VCS-agnostic
  2. Route PR operations through VersionControlProvider interface for all providers (including GitHub)
  3. Unify the three PR workflow paths in finish.ts into one
  4. Deprecate provider-specific mode strings (github-pr, github-draft-pr, bitbucket-pr) with backward compatibility

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bitbucketBitBucket VCS integrationtech-debtTechnical debt that should be addressed

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions