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

Remove "state": "OPEN" to fix updating of titles #931

Merged
merged 1 commit into from
Oct 18, 2022

Conversation

timja
Copy link
Contributor

@timja timja commented Oct 17, 2022

Fixes #866

Test

To test this pull request, you can run the following commands:

gh repo clone timja/updatecli-test
cd updatecli-test
updatecli apply

echo 'abcd=1' > my-file.properties
updatecli apply

Additional Information

Tradeoff

None that I can think of this seems like it was unnecessary, other code handles creating a new pull request if no open ones exist

#866 (comment)

Potential improvement

I've raised a ticket with GitHub to get clarification

@timja timja mentioned this pull request Oct 17, 2022
1 task
Copy link
Member

@lemeurherve lemeurherve left a comment

Choose a reason for hiding this comment

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

Thanks!

@olblak
Copy link
Member

olblak commented Oct 17, 2022

Thanks for the PR

I don't think a closed pull request would get opened any more is that okay?
Otherwise we could run the mutation twice, once with state and once with title and body.

In the past, we found it annoying that if someone accidentally close a PR, it doesn't get reopened by Updatecli. This led us to miss some update as the branch would kept being updated but we wouldn't notice it. So I would prefer doing the mutation twice

@olblak olblak added this to the 0.37.0 milestone Oct 17, 2022
@olblak olblak added the bug Something isn't working label Oct 17, 2022
@timja
Copy link
Contributor Author

timja commented Oct 17, 2022

Testing out the current code, it seems to create a new pull request rather than updating the existing branch, it's not finding it. Trying to see why but seems my current worry wasn't an issue?

(e.g. timja/updatecli-test#7)

@timja
Copy link
Contributor Author

timja commented Oct 17, 2022

This isn't finding closed PRs:

func (p *PullRequest) getRemotePullRequest() error {

So it opens a new PR (with the same branch), and all works how you would expect

@timja
Copy link
Contributor Author

timja commented Oct 17, 2022

because of this (hardcoded search for state open):

} `graphql:"pullRequests(baseRefName: $baseRefName, headRefName: $headRefName, last: 1, states: [OPEN])"`

Ok all seems fine and understood, cc @olblak

@olblak
Copy link
Member

olblak commented Oct 18, 2022

Ok all seems fine and understood, cc @olblak

Is this PR ready to be merged?
I'll trust your testing, as I don't have the time atm

@olblak
Copy link
Member

olblak commented Oct 18, 2022

I had a look to the previous PR I did on this topic to refresh my head and your PR seems great.
If you are, I am ready to merge this one

@timja
Copy link
Contributor Author

timja commented Oct 18, 2022

Is this PR ready to be merged?

Yes I've tested many different methods and it's ready.

GitHub support is raising the issue to the engineering team.

@olblak olblak merged commit 11c56f1 into updatecli:main Oct 18, 2022
@olblak olblak removed this from the 0.37.0 milestone Oct 18, 2022
@timja timja deleted the fix-update-title branch October 18, 2022 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pullrequest-github
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic PR title isn't updated
3 participants