Skip to content

[Feat] Notify task threads when pull requests conflict - #1615

Merged
mrubens merged 3 commits into
developfrom
feature/pr-conflict-notifications-3a6bfn2nxy1b1
Aug 25, 2026
Merged

[Feat] Notify task threads when pull requests conflict#1615
mrubens merged 3 commits into
developfrom
feature/pr-conflict-notifications-3a6bfn2nxy1b1

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

​Opened on behalf of @mrubens. Follow up by mentioning @roomote-roomote or in the web UI.

What changed

  • Listen for tracked pull-request mergeability invalidations from base-branch pushes and relevant pull-request webhooks (including ready_for_review, so conflicts accrued while a PR was a draft surface at the transition). Queueing is best-effort and honors the repo skip list, so it can never fail the webhook's pre-existing handlers.
  • Delay checks for 45 seconds, collapse repeated branch pushes, fetch every eligible PR in one aliased GitHub GraphQL request (tolerating partially failed batches), and retry UNKNOWN results only once. Jobs carry a branch or PR scope and resolve the tracked rows at run time, so checks enqueued before the tracked row lands are still picked up.
  • Persist clean/conflicting transitions and generation-scoped notification claims so Slack, Teams, Telegram, Discord, and Fast-parent conversations receive one conflict notice per transition, sharing the existing PR-review route resolution and provider post-input builder.

Why this change was made

Roomote-created pull requests can become unmergeable after either their base or head moves, but GitHub does not emit a dedicated conflict webhook. This adds a rate-limit-conscious webhook path without enabling the existing opt-in conflict resolver or scanning unrelated repository pull requests.

Impact

Originating chat threads (Slack, Teams, Telegram, Discord) now receive a linked merge-conflict notice when a Roomote-created open pull request transitions into a conflicting state, and Fast-parent conversations are informed directly. A later clean observation re-arms the notification, while durable claims prevent overlapping webhook jobs from double-posting.

@roomote-community

roomote-community Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

No code issues found. See task

  • Base-branch pushes cannot re-arm a previously notified conflict (apps/api/src/handlers/github/queuePullRequestMergeabilityCheck.ts:33).

Reviewed 885b011

Comment thread apps/api/src/handlers/github/queuePullRequestMergeabilityCheck.ts Outdated
- Route conflict notifications to Teams and Telegram threads through the
  shared provider adapter (previously silently dropped but marked
  notified), reusing one route-to-post-input builder for both jobs and
  matching the active-installation filter on Slack lookups.
- Tolerate partial GraphQL responses so one unresolvable PR number no
  longer aborts mergeability recording for the whole batch.
- Make webhook-side queueing best-effort and run the push-path check
  concurrently, so a Redis/DB blip cannot drop the pre-existing push
  conflict check or PR open/reopen/synchronize handling.
- Honor isRepoSkipped on both mergeability queue paths.
- Queue a mergeability check on ready_for_review so conflicts accrued
  while a PR was a draft surface at the transition.
- Carry a branch/PR scope in the job payload instead of frozen row ids,
  so opened webhooks that race the tracked-row insert still get checked.
- Cap the dedup TTL at the job delay so pushes landing after promotion
  enqueue a fresh check instead of being silently deduplicated.
- Share one conflict message builder across chat and Fast-parent paths,
  skip redundant base-ref writes, and drop the webhook-time list on the
  PR path.
@mrubens
mrubens marked this pull request as ready for review August 25, 2026 03:42
@mrubens
mrubens merged commit cca119b into develop Aug 25, 2026
17 checks passed
@mrubens
mrubens deleted the feature/pr-conflict-notifications-3a6bfn2nxy1b1 branch August 25, 2026 03:42
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