feat: add conflict file diagnostics to autodev failure comments#415
Closed
kaitimmer wants to merge 3 commits into
Closed
feat: add conflict file diagnostics to autodev failure comments#415kaitimmer wants to merge 3 commits into
kaitimmer wants to merge 3 commits into
Conversation
- 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
55c138d to
0319a5a
Compare
There was a problem hiding this comment.
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
createCommentsvia afailureCommentByPRmap. - Capture conflicting paths during
git mergefailures 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.
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>
9 tasks
Contributor
|
@harikaduyu merged #416 instead |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
path/to/file.yaml— also modified by ⬆️ Bump @typescript-eslint/parser from 5.31.0 to 5.32.0 #123path/to/file.yaml— conflicts withmain, rebase neededFile 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: trueon 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.