Skip to content

Preview merge conflicts summary before attempting merge #451

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 4 commits into from
Jun 20, 2025

Conversation

tbantle22
Copy link
Collaborator

@tbantle22 tbantle22 commented May 21, 2025

Pull requests will now show if there are conflicts before attempting a merge:
Screenshot 2025-06-20 at 8 07 41 AM

And you can view the conflicted rows for a table:
Screenshot 2025-06-20 at 8 14 01 AM

Requires dolt >=1.55.0

@tbantle22 tbantle22 marked this pull request as ready for review June 20, 2025 14:55
@tbantle22 tbantle22 requested a review from Copilot June 20, 2025 15:39
Copy link
Contributor

@Copilot Copilot AI left a comment

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 adds support for previewing merge conflict summaries and detailed row conflicts before performing a merge operation.

  • Introduces a new ConflictsTable React component and associated styles for displaying base/ours/theirs rows per column.
  • Adds breadcrumb support and routing for a “Pull Conflicts” page.
  • Extends the GraphQL schema, resolvers, and query factories to fetch conflict summaries and row‐level conflict data.

Reviewed Changes

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

Show a summary per file
File Description
web/renderer/components/pageComponents/DatabasePage/ForPullConflicts/ConflictsTable/index.tsx New React component rendering conflict tables
web/renderer/components/pageComponents/DatabasePage/ForPullConflicts/ConflictsTable/index.module.css Styles for the ConflictsTable
web/renderer/components/breadcrumbs/types.ts Added DBPullConflicts enum value
web/renderer/components/breadcrumbs/breadcrumbDetails.tsx Registered new breadcrumb trail entries
web/renderer/components/breadcrumbs/PullConflictBreadcrumbs.tsx New breadcrumb wrapper component
web/package.json Bumped sharp dependency
graphql-server/src/utils/commonTypes.ts Added shared PullArgs for pull operations
graphql-server/src/rows/row.model.ts Renamed key parameter to colName in getCellValue
graphql-server/src/rowDiffs/rowDiff.model.ts Updated import reference for Column
graphql-server/src/resolvers.ts Included PullConflictsResolver
graphql-server/src/queryFactory/mysql/index.ts Stubbed getPullConflicts* methods
graphql-server/src/queryFactory/index.ts Declared new getPullConflicts* interfaces
graphql-server/src/queryFactory/doltgres/queries.ts Added SQL queries for merge conflicts summary and rows
graphql-server/src/queryFactory/doltgres/index.ts Implemented getPullConflicts* methods
graphql-server/src/queryFactory/dolt/queries.ts Added SQL queries for merge conflicts summary and rows
graphql-server/src/queryFactory/dolt/index.ts Implemented getPullConflicts* methods
graphql-server/src/pulls/pull.resolver.ts Switched to shared PullArgs
graphql-server/src/pullConflicts/pullConflict.resolver.ts New resolver for conflict summaries and row conflicts
graphql-server/src/pullConflicts/pullConflict.model.ts Object types and mappers for conflict data
graphql-server/schema.gql Extended schema with conflict types and queries
Comments suppressed due to low confidence (3)

graphql-server/src/queryFactory/mysql/index.ts:322

  • [nitpick] The error message in getPullRowConflicts still reads get pull conflicts summary, which may be confusing. Update it to something like get pull row conflicts to match the method's purpose.
    throw notDoltError("get pull conflicts summary");

web/renderer/components/pageComponents/DatabasePage/ForPullConflicts/ConflictsTable/index.tsx:11

  • [nitpick] Consider adding unit tests for the ConflictsTable component to verify that it correctly highlights conflicted cells and gracefully handles cases where ours or theirs data is undefined.
export default function ConflictsTable(props: Props) {

graphql-server/src/queryFactory/doltgres/queries.ts:99

  • There's a typo in the SQL query: a period instead of a comma between $2::text and $3::text. Replace . with , to correct the parameter list.
export const mergeConflictsQuery = `SELECT * FROM DOLT_PREVIEW_MERGE_CONFLICTS($1::text, $2::text. $3::text)`;

@tbantle22 tbantle22 merged commit 9482f30 into main Jun 20, 2025
2 checks passed
@tbantle22 tbantle22 deleted the taylor/conflicts branch June 20, 2025 16:00
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