From 394ce8366ac766cd8f2e2bc675a06d2da63d4027 Mon Sep 17 00:00:00 2001 From: Dmitri Dolguikh Date: Fri, 23 Apr 2021 13:40:06 -0700 Subject: [PATCH 1/3] automator.sh now creates tickets in istio/istio on failed merges Signed-off-by: Dmitri Dolguikh --- tools/automator/automator.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/automator/automator.sh b/tools/automator/automator.sh index fdc0037d781..26a8fdc780c 100755 --- a/tools/automator/automator.sh +++ b/tools/automator/automator.sh @@ -257,7 +257,14 @@ merge() { git -c "user.name=$user" -c "user.email=$email" merge --no-ff -m "$title" --log upstream/"$merge_branch" local code=$? if [ "$code" -ne 0 ]; then - print_error "$(git status)" 1 + echo "$token" | gh auth login --with-token + local issue_exists=$(gh issue list -S "Automatic merge of $merge_branch into $branch failed." -R "istio/isio" | wc -l) + if [ $issue_exists -eq 0 ]; then + gh issue create -b "Automatic merge of $merge_branch into $branch failed. @istio/wg-networking-maintainers" -t "Automatic merge of upstream envoy release branch failed" -l "area/networking/envoy" -R "istio/istio" + print_error "Conflicts detected, manual merge is required. An issue in istio/istio has been created." 0 + else + print_error "Conflicts detected, manual merge is required. An issue in istio/istio already exists." 0 + fi else if [[ "$(git show --shortstat)" =~ $title ]]; then git show --shortstat From 2db2d67a3a8d35975d23227ef46f8d285f2d2872 Mon Sep 17 00:00:00 2001 From: Dmitri Dolguikh Date: Fri, 23 Apr 2021 13:59:27 -0700 Subject: [PATCH 2/3] Responded to feedback Signed-off-by: Dmitri Dolguikh --- tools/automator/automator.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/automator/automator.sh b/tools/automator/automator.sh index 26a8fdc780c..e7879b3e32c 100755 --- a/tools/automator/automator.sh +++ b/tools/automator/automator.sh @@ -258,8 +258,10 @@ merge() { local code=$? if [ "$code" -ne 0 ]; then echo "$token" | gh auth login --with-token - local issue_exists=$(gh issue list -S "Automatic merge of $merge_branch into $branch failed." -R "istio/isio" | wc -l) - if [ $issue_exists -eq 0 ]; then + export GITHUB_TOKEN="$token" + local issue_exists + issue_exists=$(gh issue list -S "Automatic merge of $merge_branch into $branch failed." -R "istio/isio" | wc -l) + if [ "$issue_exists" -eq 0 ]; then gh issue create -b "Automatic merge of $merge_branch into $branch failed. @istio/wg-networking-maintainers" -t "Automatic merge of upstream envoy release branch failed" -l "area/networking/envoy" -R "istio/istio" print_error "Conflicts detected, manual merge is required. An issue in istio/istio has been created." 0 else From 9660ffa9207f01514ea9a595327211cd497bf9f0 Mon Sep 17 00:00:00 2001 From: Dmitri Dolguikh Date: Fri, 23 Apr 2021 14:00:50 -0700 Subject: [PATCH 3/3] Actually removed gh login auth Signed-off-by: Dmitri Dolguikh --- tools/automator/automator.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/automator/automator.sh b/tools/automator/automator.sh index e7879b3e32c..109e35335b4 100755 --- a/tools/automator/automator.sh +++ b/tools/automator/automator.sh @@ -257,7 +257,6 @@ merge() { git -c "user.name=$user" -c "user.email=$email" merge --no-ff -m "$title" --log upstream/"$merge_branch" local code=$? if [ "$code" -ne 0 ]; then - echo "$token" | gh auth login --with-token export GITHUB_TOKEN="$token" local issue_exists issue_exists=$(gh issue list -S "Automatic merge of $merge_branch into $branch failed." -R "istio/isio" | wc -l)