Skip to content

feat: add conflict file diagnostics to autodev failure comments#415

Closed
kaitimmer wants to merge 3 commits into
mainfrom
feat/conflict-diagnostics
Closed

feat: add conflict file diagnostics to autodev failure comments#415
kaitimmer wants to merge 3 commits into
mainfrom
feat/conflict-diagnostics

Conversation

@kaitimmer

@kaitimmer kaitimmer commented Jun 11, 2026

Copy link
Copy Markdown

I have to admit right away: This is 100% AI. I'm really bad with JS, I just kinda pointed it to a problem and asked for a fix. It seems fine to me, but needs a proper review by someone with a little more knowledge here.

What changed

When a dev-PR fails to merge, autodev now posts a diagnostic comment on that PR:

File list capped at 20; extras summarised with a count. Includes a link to the action run.

Also fixes a silent bug: when all dev-PRs fail, labels and comments were never updated.

Why it changed

Debugging a failing dev build required digging through action run logs to find which files conflicted and why. This surfaces that information directly on the PR. This is especially a problem in repos with a lot of different contributors like https://github.com/Staffbase/mops

How to test it

Enable comments: true on the action, create two dev-labeled PRs that both modify the same file, trigger autodev — the conflicting PR should receive a comment naming the file and the other PR as the culprit.


Changes generated with the help of OpenCode.

- capture conflicting files via `git diff --name-only --diff-filter=U` before abort
- attribute each file to culprit dev-PRs (or flag as rebase-needed vs main)
- format diagnostic failure comment with file list (capped at 20) + run link
- fix: apply labels/comments even when all dev-PRs fail to merge
@kaitimmer kaitimmer force-pushed the feat/conflict-diagnostics branch from 55c138d to 0319a5a Compare June 11, 2026 13:03
@kaitimmer kaitimmer changed the title feat: add conflict file diagnostics to failure comments + fix all-failed silence feat: add conflict file diagnostics to autodev failure comments Jun 11, 2026
@kaitimmer kaitimmer marked this pull request as ready for review June 11, 2026 13:05
@kaitimmer kaitimmer requested a review from a team as a code owner June 11, 2026 13:05
@kaitimmer kaitimmer requested review from 0x46616c6b, flaxel and timdittler and removed request for flaxel June 11, 2026 13:05
@timdittler timdittler requested a review from Copilot June 11, 2026 13:15

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

This PR enhances AutoDev’s failure reporting by attaching per-PR merge-conflict diagnostics (conflicting file list + attribution + action run link) to the failure comment, and fixes the logic so comments/labels are updated even when all dev PRs fail to merge.

Changes:

  • Add per-PR failure diagnostics support to createComments via a failureCommentByPR map.
  • Capture conflicting paths during git merge failures and generate diagnostic markdown (capped to 20 files) including an actions run URL.
  • Extend test coverage for conflict capture/attribution and for the “all PRs fail” comment/label update path.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 3 comments.

File Description
src/utils.ts Extends comment creation to optionally include per-PR failure diagnostics.
src/autodev.ts Captures merge-conflict files, builds attributions, and ensures comments/labels update even when no merges succeed.
src/autodev.test.ts Adds tests validating conflict capture ordering, attribution logic, and the all-fail update behavior.
dist/index.js Updates the built distribution output to match the TypeScript source changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/autodev.ts
Comment thread src/autodev.ts
Comment thread src/autodev.ts
kaitimmer and others added 2 commits June 11, 2026 15:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The Copilot Autofix commit (f8eed54) changed src/autodev.ts but did not
rebuild dist/, causing check-dist to fail. It also introduced a Prettier
formatting violation.

- Reformat the touched line in src/autodev.ts with Prettier
- Rebuild dist/index.js and dist/index.js.map via ncc so the bundled
  artifact matches source

Co-authored-by: opencode <opencode@noreply.opencode.ai>
Co-authored-by: GitHub Copilot <copilot@noreply.github.com>
@timdittler

Copy link
Copy Markdown
Contributor

@harikaduyu merged #416 instead

@timdittler timdittler closed this Jun 17, 2026
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.

3 participants