concourse / semver-resource

automated semantic version bumping
Apache License 2.0
97 stars 105 forks source link

add pull before push #134

Closed yuzs2 closed 2 years ago

yuzs2 commented 2 years ago

add a "git pull -r" before git push to ensure the push is done on the latest repo.

yuzs2 commented 2 years ago

We added a "git pull" before "git push" in driver/git.go, this is to ensure every push happens when the local repo is synced with the remote repo. Doing this we could avoid possible bugs.

All tests passed locally: all tests passed! Removing intermediate container f1b9b08b7dde ---> 02c00f6ac274 Successfully built 02c00f6ac274 Successfully tagged semver-resource:latest

yuzs2 commented 2 years ago

all checks passed, the sign-off is not missing

evanchaoli commented 2 years ago

After the second look at the code, I think this PR is not needed. It already has a retry logic:

https://github.com/concourse/semver-resource/blob/d498338b21e68134fc8744d6025f8dc8a0cf326b/driver/git.go#L58

This PR is trying to resolve #124 , but I just realize the bug should be at:

https://github.com/concourse/semver-resource/blob/d498338b21e68134fc8744d6025f8dc8a0cf326b/driver/git.go#L75

As err is local inside the loop, it cannot be returned.

evanchaoli commented 2 years ago

@yuzs2 Could you please just close this PR?

yuzs2 commented 2 years ago

Yes, I'm closing it since it's no need. Thanks for the review.