Skip to content

Add metrics for completing/aborting a merge after conflicts#5810

Merged
outofambit merged 28 commits intomasterfrom
did-you-merge-it
Oct 16, 2018
Merged

Add metrics for completing/aborting a merge after conflicts#5810
outofambit merged 28 commits intomasterfrom
did-you-merge-it

Conversation

@iAmWillShepherd
Copy link
Contributor

@iAmWillShepherd iAmWillShepherd commented Oct 4, 2018

⚠️ This PR has associated work: #5394 (comment) ⚠️

Fixes #5394

How to test

  1. Create a repo and produce some conflicts
  2. Open that repo in Desktop (you should be notified that conflicts exist
  3. Note the values of mergeAbortedAfterConflictsCount and mergeSuccessAfterConflictsCount from the database as n and m respectfully.

Abort

  1. Open terminal and execute git merge --abort
  2. Check the database: mergeAbortedAfterConflictsCount should be n + 1

Complete

  1. Fix the conflicts
  2. Make a commit
  3. Check the database: mergeSuccessAfterConflictsCount should be m + 1

@iAmWillShepherd iAmWillShepherd added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Oct 4, 2018
@outofambit outofambit self-requested a review October 8, 2018 16:52
@outofambit outofambit added this to the 1.4.3 milestone Oct 8, 2018
Copy link
Contributor

@outofambit outofambit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for taking this the last mile, @iAmWillShepherd! a few blocking requests.

how can we easily test that this works?

const repoState = this.repositoryStateCache.get(repository)

// check if we're in a conflicted state
if (repoState.conflictState === null) {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@outofambit outofambit modified the milestones: 1.4.2, 1.4.3 Oct 9, 2018
@outofambit outofambit self-assigned this Oct 9, 2018
mergedWithLoadingHintCount: 0,
mergedWithCleanMergeHintCount: 0,
mergedWithConflictWarningHintCount: 0,
mergeSuccesfulAfterConflicts: 0,

This comment was marked as spam.

@outofambit outofambit modified the milestone: 1.4.3 Oct 10, 2018
outofambit
outofambit previously approved these changes Oct 11, 2018
Copy link
Contributor

@outofambit outofambit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested this out locally and i think we're good 👍

@shiftkey shiftkey self-assigned this Oct 14, 2018
Copy link
Member

@shiftkey shiftkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case this gets merged before #5810 is clarified I've added some further feedback and assigned myself to it.

switch (command) {
case 'pull':
dispatcher.recordMergeConflictFromPull()
dispatcher.mergeConflictDetected()

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

const repoState = this.repositoryStateCache.get(repository)

// check if we're in a conflicted state
if (repoState.conflictState === null) {

This comment was marked as spam.

@kenia-borges

This comment was marked as spam.

@iAmWillShepherd
Copy link
Contributor Author

🍏

@shiftkey shiftkey mentioned this pull request Oct 16, 2018
@iAmWillShepherd
Copy link
Contributor Author

🍏

Copy link
Member

@shiftkey shiftkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of suggestions

const currentBranchName = status.currentBranch

// no current branch means something happened so bail
if (currentBranchName === undefined) {

This comment was marked as spam.

file.status === AppFileStatus.Resolved
)

// we are still in a conflict, so bail

This comment was marked as spam.

return
}

// no more conflicts!

This comment was marked as spam.

@iAmWillShepherd
Copy link
Contributor Author

💯

@outofambit outofambit requested a review from shiftkey October 16, 2018 20:08
Copy link
Member

@shiftkey shiftkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion to cleanup, but I'll let @outofambit merge this at their leisure so we can wrap this up 🎉

return
}

const repository = selection.repository

This comment was marked as spam.

@outofambit
Copy link
Contributor

outofambit commented Oct 16, 2018

thanks @shiftkey! 🚀 going to merge this after tests pass so we can include this in the beta ✨

return
}

const repository = selection.repository

This comment was marked as spam.

@outofambit outofambit merged commit b8a7bc2 into master Oct 16, 2018
@outofambit outofambit deleted the did-you-merge-it branch October 16, 2018 22:50
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chinagourmet888

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants