Skip to content
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

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

Merged
merged 7 commits into from
Jul 16, 2022

Conversation

fregante
Copy link
Member

@fregante fregante commented Jul 3, 2022

Comment on lines 63 to 66
mergeable
viewerCanEditFiles
canBeRebased
mergeStateStatus
Copy link
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
Member Author

Choose a reason for hiding this comment

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

Ideally we'd just use v4, but I still don't see any fields for this. https://twitter.com/fregante/status/1543557018576830464

@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
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