fix(desktop): respect repository merge settings in PR merge menus

AB
2mo ago
+593-57

Design

Both pull request merge menus use the same pure merge-method selection logic and the same capability mapping.

  • @superset/shared/github-merge-methods owns the supported method set, REST-to-canonical capability normalization, and explicit-disabled check.
  • The renderer uses that capability check while filtering methods and keeps the viewer default first when it is enabled.
  • v2 reads repository capabilities through github.getRepo; v1 reads the equivalent fields through gh repo view, resolving fork worktrees to their upstream repository.
  • Both merge mutations reject a method only when GitHub explicitly reports it as disabled. Missing, incomplete, or failed settings lookups remain fail-open, preserving the existing merge behavior.
  • No database schema changes are required.

Validation

  • Shared capability tests: 2 passing
  • Merge menu tests: 4 passing
  • v1 merge router tests: 3 passing
  • GitHub router integration tests: 10 passing
  • Existing v1 merge utility tests: 3 passing
  • Biome lint and format checks: passing
  • Shared and host-service typechecks: passing
  • Desktop typecheck remains blocked by the workspace's missing @sentry/electron/main and @sentry/electron/renderer modules.

Closes #6185

Summary by CodeRabbit

  • New Features

    • Pull request merge menus now reflect the repository’s enabled merge methods.
    • The viewer’s preferred merge method is prioritized when available.
    • Merge method labels and selections are consistent across pull request interfaces.
    • Unavailable repository settings fall back to standard merge options.
  • Bug Fixes

    • Disabled merge methods are no longer displayed or accepted for merging.
  • Tests

    • Added coverage for repository-specific methods, defaults, fallbacks, and disabled options.