Skip to content

Add an auto-merge indicator to the PR badge - #153

Merged
0101 merged 1 commit into
mainfrom
auto-merge-indicator
Jul 28, 2026
Merged

Add an auto-merge indicator to the PR badge#153
0101 merged 1 commit into
mainfrom
auto-merge-indicator

Conversation

@0101

@0101 0101 commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Problem

When a PR has GitHub auto-merge (or Azure DevOps auto-complete) set, it will merge itself as soon as the remaining checks and policies pass. Treemon showed no sign of this, so a worktree with a fully hands-off PR looked identical to one still waiting on a human to press merge.

Changes

  • AutoMergeEnabled: bool added to PrInfo in src/Shared/Types.fs
  • Parsed from data already present in the existing PR-list responses, so no extra provider calls:
    • GitHub: auto_merge in /pulls (object → true, null/absent → false)
    • AzDo: autoCompleteSetBy in az repos pr list (identity → true, null/absent → false)
  • Both providers keep the field populated after the PR merges, so parsing forces false for merged PRs — the flag is only meaningful while the PR is open. MergedPrStore fallbacks are likewise always false, and the fact is not persisted.
  • Dashboard renders a mauve check-in-circle glyph on the PR badge (autoMergeIcon in CardViews.fs). The existing .conflict-icon CSS was generalized to a shared .pr-icon class with conflict / auto-merge colour modifiers.
  • tm status gains a matching auto-merge flag alongside draft / merged / conflicts.
  • Demo fixture exercises the new state; spec section added to docs/spec/worktree-monitor.md.

Tests

dotnet test src/Tests/Tests.fsproj --filter "Category=Fast"1710 passed, 0 failed (5m 27s).

New coverage: GitHub and AzDo fixture parsing (set, null, absent, and merged-PR cases), CLI flag rendering, dashboard badge markup, and MergedPrStore fallback.

Copilot AI review requested due to automatic review settings July 28, 2026 15:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds provider-aware auto-merge status to PR data and surfaces it in the dashboard and CLI.

Changes:

  • Parses GitHub auto-merge and Azure DevOps auto-complete state.
  • Displays an auto-merge icon and CLI status flag.
  • Adds provider, persistence, CLI, and dashboard coverage.
Show a summary per file
File Description
src/Shared/Types.fs Adds auto-merge state to PrInfo.
src/Server/PrStatus.fs Parses Azure DevOps auto-complete state.
src/Server/GithubPrStatus.fs Parses GitHub auto-merge state.
src/Server/MergedPrStore.fs Defaults restored merged PRs to no auto-merge.
src/Server/DemoFixture.fs Demonstrates the indicator.
src/Client/CardViews.fs Renders the auto-merge icon.
src/Client/index.html Adds shared PR icon styling.
src/Cli/Program.fs Adds the auto-merge flag.
src/Tests/AzDoFixtureTests.fs Tests Azure DevOps parsing.
src/Tests/GithubFixtureTests.fs Tests GitHub parsing.
src/Tests/CliTests.fs Tests CLI formatting.
src/Tests/DashboardTests.fs Tests dashboard rendering.
src/Tests/MergedPrStoreTests.fs Tests fallback behavior.
src/Tests/PrFilteringTests.fs Updates PR fixtures.
src/Tests/SchedulerTests.fs Updates scheduler test data.
src/Tests/fixtures/worktrees.json Adds serialized fixture values.
src/Tests/fixtures/github/pr-list.json Adds enabled GitHub data.
src/Tests/fixtures/github/pr-list-with-closed.json Adds null and merged GitHub cases.
src/Tests/fixtures/azdo/pr-list.json Adds Azure DevOps cases.
docs/spec/worktree-monitor.md Documents the indicator and persistence behavior.

Review details

  • Files reviewed: 20/20 changed files
  • Comments generated: 0
  • Review effort level: Medium

@0101
0101 force-pushed the auto-merge-indicator branch from 36d8e3e to 0542017 Compare July 28, 2026 15:57
Adds AutoMergeEnabled to PrInfo, parsed from data already present in the
existing PR-list responses (GitHub auto_merge, AzDo autoCompleteSetBy), so no
extra provider calls. Both providers keep the field populated after a merge, so
parsing forces it false for merged PRs.

The dashboard renders a mauve check-in-circle glyph on the PR badge, and
`tm status` gains a matching auto-merge flag.

Copilot-Session: 19824f14-1931-440b-824f-7359cd257981
@0101
0101 force-pushed the auto-merge-indicator branch from 0542017 to 1228009 Compare July 28, 2026 16:09
@0101
0101 merged commit fa140bb into main Jul 28, 2026
1 check passed
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