-
Notifications
You must be signed in to change notification settings - Fork 4
Detect and display PR merge conflicts #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Returns priority 1 (High) since conflicts block PR merging. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Conflicts are treated as high-priority blockers that prevent merging. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Detects merge conflicts by checking if MergeableState is "DIRTY" (GitHub's mergeStateStatus value for conflicts). Creates a FeedbackItem with: - Type: FeedbackTypeConflict - Priority 1 (High) since conflicts block merging - Actionable: true Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests cover: - processConflicts returns FeedbackItem when MergeableState is "DIRTY" - processConflicts returns empty slice for CLEAN, BLOCKED, UNSTABLE, and empty states - getPriorityForType returns priority 1 for FeedbackTypeConflict Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add mergeable_state column to works table via migration - Update SQLC queries to include the new column - Add MergeableState field to db.Work and progress.WorkProgress - Update feedback processor to extract and store MergeableState from GitHub API - Add merge status display in TUI PR Status section with color-coded icons: - CLEAN: ✓ Ready to merge (green) - DIRTY: ⚠ Has conflicts (red) - BLOCKED: ⏸ Blocked by checks (yellow) - BEHIND: ↓ Behind main (dim) - DRAFT: 📝 Draft PR (dim) - UNSTABLE: ⚠ CI unstable (yellow) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
newhook
commented
Jan 27, 2026
newhook
commented
Jan 27, 2026
Replace hardcoded "DIRTY" string with db.MergeableStateDirty constant in processConflicts for consistency with other mergeable state checks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace string literals with db.MergeableStateClean, db.MergeableStateDirty, db.MergeableStateBlocked, and db.MergeableStateUnstable constants in TestProcessConflicts for consistency with the rest of the codebase. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
Adds automatic detection and display of merge conflicts in PRs:
FeedbackTypeConflictto categorize merge conflict feedbackmergeStateStatusis "DIRTY" and creates actionable feedback itemsmergeable_statein the works database tableChanges
Core Conflict Detection
FeedbackTypeConflictconstant (internal/github/feedback.go)processConflicts()method that checks forMergeableState == "DIRTY"and creates feedback items with priority 1 (High)GetBeadType()to map conflict feedback to "bug" type for high-priority handlinggetPriorityForType()to return priority 1 for conflicts (blocks merging)Database & Schema
mergeable_statecolumn toworkstable via migration003_mergeable_state.sqlMergeableStatefield toWorkstruct andWorkProgressTUI Display
WorkSummaryPanelFeedback Status Tracking
ExtractStatusFromPRStatus()to include mergeable stateUpdatePRStatusIfChanged()to detect and log mergeable state changesMergeableStatetoPRStatusInfostructIssues Resolved
Testing
processConflicts()covering all merge states (DIRTY, CLEAN, BLOCKED, UNSTABLE, empty)getPriorityForType()with conflict typeFiles Changed
internal/github/feedback.go- New feedback type constantinternal/feedback/processor.go- Conflict processing and priority handlinginternal/feedback/processor_test.go- Unit testsinternal/feedback/integration.go- Bead type mappinginternal/feedback/status.go- PR status extraction and change detectioninternal/db/db.go- Mergeable state constantsinternal/db/schema.sql- Schema updateinternal/db/migrations/003_mergeable_state.sql- Migrationinternal/db/work.go- Work struct and update functioninternal/db/sqlc/- Regenerated SQLC codeinternal/progress/- Progress types and fetchinginternal/tui/tui_panel_work_summary.go- TUI displaysql/queries/works.sql- Updated SQL queries🤖 Generated with Claude Code