-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Bugfix: Don't try to open a pullrequest when not needed #436
Conversation
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Well for some reason the github action doesn't find the branch "main" |
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
This reverts commit 658034b.
I successfully tested this PR with jenkins-infra/kubernetes-management#1879 |
The error also appears on my machine (macOS 12.1, MBP 16" Intel, go1.17.5): $ gh pr checkout 436
$ make test-short
go test ./... -short
# ...
time="2022-01-02T09:27:53+01:00" level=error msg="reference \"main\" - reference not found"
time="2022-01-02T09:27:53+01:00" level=error msg="reference \"main\" - reference not found"
time="2022-01-02T09:27:53+01:00" level=error msg="reference \"main\" - reference not found"
--- FAIL: TestIsSimilarBranch (0.00s)
main_test.go:54:
Error Trace: main_test.go:54
Error: Not equal:
expected: *errors.errorString(&errors.errorString{s:"reference not found"})
actual : <nil>(<nil>)
Test: TestIsSimilarBranch
main_test.go:55: [0] Expected error '<nil>' but got 'reference not found'
main_test.go:54:
Error Trace: main_test.go:54
Error: Not equal:
expected: *errors.errorString(&errors.errorString{s:"reference not found"})
actual : <nil>(<nil>)
Test: TestIsSimilarBranch
main_test.go:55: [1] Expected error '<nil>' but got 'reference not found'
main_test.go:61:
Error Trace: main_test.go:61
Error: Not equal:
expected: false
actual : true
Test: TestIsSimilarBranch
main_test.go:62: [1] Expected result 'true' but got 'false'
FAIL
FAIL github.com/updatecli/updatecli/pkg/plugins/git/generic 7.026s
#... => I'm trying to debug it since it appears locally. |
The fix is working for me on both the asciidoctor/docker-asciidoctor and jenkins-infra/* repositories on my manual tests ✅ . Many thanks for this huge work to start 2022 🍾 |
Co-authored-by: Damien Duportal <damien.duportal@gmail.com>
This reverts commit bf6067c.
Signed-off-by: Olblak <me@olblak.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Signed-off-by: Olblak me@olblak.com
Don't try to open a pullrequest when not needed
Fix #431
Add a function to test if the latest commits of two branches are similar. The intend of this approach is to only try to create a pullrequest when two branch content mismatch
Test
To test this pull request, you can run the following commands:
cp pkg/plugins/git/generic go test
Additional Information
Tradeoff
Potential improvement
I am planning to also look at a way to test if two git tags are similar