Skip to content

Add provider-neutral list_pull_requests and extend conflict resolver to GitLab/ADO#320

Merged
daniel-lxs merged 3 commits into
developfrom
feat/source-control-list-pull-requests
Jul 14, 2026
Merged

Add provider-neutral list_pull_requests and extend conflict resolver to GitLab/ADO#320
daniel-lxs merged 3 commits into
developfrom
feat/source-control-list-pull-requests

Conversation

@daniel-lxs

Copy link
Copy Markdown
Member

What

First PR of the shared "list pull requests" primitive workstream — the single missing piece behind four GitHub-only automations (identified while explaining why manager-stats is GitHub-only).

  • list_pull_requests read action in the provider-neutral source-control layer, implemented for all five providers with per-provider realities surfaced honestly: GitLab/ADO filter server-side and carry conflict signals (has_conflicts / mergeStatus); Gitea page-walks with caps; Bitbucket cursor-walks with no mergeable signal; GitHub list payloads carry no mergeable (warning points to get_pull_request). Truncation always warns. Exposed via the MCP handler + worker tool and as repository-scoped dispatchers for automations.
  • Conflict resolver extended to GitLab and Azure DevOps. GitHub path byte-identical. Neutral path: list-level conflict signal first, single-PR detail fallback per labeled candidate, GitHub-only idle-commit guard skipped with documented equivalent semantics, launches stamped with the real provider (payload kind unchanged — fields are generic, ~6 consumers untouched). The resolution skill checks out non-GitHub PRs via plain git fetch/checkout instead of gh.
  • Registry: conflict_resolver declares ['github','gitlab','ado'] — the automations-page capability badge (Show automation destinations and provider capabilities on the automations page #319) renders this automatically.

Known caveat (deliberate)

ADO label fields in list payloads are unverified against a live instance; the schema tolerates their absence with a warning. If ADO omits them, the ADO conflict scan finds no labeled candidates (inert, not broken) — the fix is a per-PR labels fetch, kept out of this PR rather than shipped unverified.

Next in workstream

PR B: per-provider pullRequestFacts sync → unlocks both auditors. PR C: review-activity analytics → unlocks manager-stats.

Testing

  • 7 new reads tests (per-provider payloads, pagination truncation, mergeable mapping), 3 new conflict-scan tests
  • Full green: sdk (486), types (545), worker (1320), api (887), cloud-agents workflows (219), web automations (57); lint/types/knip clean

🤖 Generated with Claude Code

@roomote-roomote

roomote-roomote Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

No new code issues found. See task

  • packages/db/src/lib/github-branch-activity.ts:168 The branch-work fallback is now provider-scoped, so same-named GitHub and GitLab/ADO branches no longer block one another.
  • packages/sdk/src/server/automations/conflict-scan.ts:480 One combined outcome is now recorded after both scans, preserving prior scan failures.

Reviewed aa78c4c

daniel-lxs and others added 3 commits July 14, 2026 10:59
…to GitLab/ADO

New list_pull_requests read action across all five source-control
providers (server-filtered where the API allows, page-walked with caps
and truncation warnings elsewhere; mergeable mapped from GitLab
has_conflicts and ADO mergeStatus, null with a warning on GitHub
lists, Gitea passthrough, Bitbucket unsupported), exposed through the
manage-source-control handler and worker tool alongside repository-
scoped dispatchers for automation use.

First consumer: the conflict resolver now scans GitLab and Azure
DevOps repositories. The GitHub scan path stays byte-identical; the
neutral path trusts list-level conflict signals and falls back to
single-PR reads, skips the GitHub-only idle-commit guard with
documented semantics, and launches with the real provider on the
payload/surface/linkage. The resolution skill checks out non-GitHub
PRs with plain git fetch/checkout instead of gh.

Gitea/Bitbucket stay unsupported for conflict detection (async and
absent mergeable signals respectively). ADO list-payload labels are
schema-tolerant but unverified live; if absent, the ADO scan is inert
until a per-PR labels fetch follow-up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- findActiveGitHubBranchWork's payload repo/branch fallback now scopes
  by source-control provider (legacy payloads without the field still
  count as github), so an active GitHub run can no longer suppress an
  unrelated GitLab/ADO conflict-resolution launch.
- conflict-scan records exactly one combined automation outcome after
  both scan sections; a GitHub failure is preserved in lastError even
  when the provider-neutral pass succeeds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The capability-badge test merged in #319 expected conflict_resolver to
read "GitHub only"; it now declares GitHub, GitLab, and Azure DevOps.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@daniel-lxs
daniel-lxs force-pushed the feat/source-control-list-pull-requests branch from 322e9e7 to aa78c4c Compare July 14, 2026 16:00
@daniel-lxs
daniel-lxs merged commit fa7d69e into develop Jul 14, 2026
17 checks passed
@daniel-lxs
daniel-lxs deleted the feat/source-control-list-pull-requests branch July 14, 2026 16:03
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.

1 participant