Skip to content

Don't show update-pr-from-base-branch when there are conflicts - #5768

Merged
fregante merged 7 commits into
mainfrom
no-duplicate-update-pr
Jul 16, 2022
Merged

fregante merged 7 commits into
mainfrom
no-duplicate-update-pr

Conversation

@fregante

@fregante fregante commented Jul 3, 2022 •

Copy link
Copy Markdown
Member

Comment on lines +63 to +66
mergeable
viewerCanEditFiles
canBeRebased
mergeStateStatus

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I may be misunderstanding these 2 new fields, but they seem to always match.

  • Either it's conflicting, cannot be rebased and dirty
  • or mergeable, can be rebased and clean

Screen Shot 10

Screen Shot 9

Comment on lines +55 to +59
// TODO: Find how to determine whether the branch needs to be updated via v4
api.v3(`compare/${base}...${head}`),

if (status === 'diverged') {
// Some fields are just for testing
api.v4(`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@fregante fregante changed the title Don't duplicate native update-pr-from-base-branch Don't show update-pr-from-base-branch when there are conflicts Jul 12, 2022
@fregante
fregante marked this pull request as ready for review July 12, 2022 13:07
@fregante
fregante merged commit 0741fc9 into main Jul 16, 2022
@fregante
fregante deleted the no-duplicate-update-pr branch July 16, 2022 04:04
@fregante fregante added the bug label Jul 20, 2022
import {getConversationNumber} from '.';

interface PullRequestInfo {
// TODO: Probably can be used for #3863 and #4679

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure what you mean by this comment

const getBaseReference = onetime(async (): Promise<string> => {
const {repository} = await api.v4(`
repository() {
pullRequest(number: ${getConversationNumber()!}) {
baseRefOid
}
}
`);
return repository.pullRequest.baseRefOid;
});

We are already using it

fregante added a commit that referenced this pull request May 20, 2023
@fregante fregante mentioned this pull request May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

update-pr-from-base-branch sometimes duplicates native functionality

2 participants