From a43731fc32fedab44c34b3318b5fba63fd1dbcff Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 3 May 2021 16:09:10 -0400 Subject: [PATCH 1/2] ci: allow cherry-picking a manual backport to other release branches If an automatic backport fails to more than one release branch we need to crate a PR to backport it. So far we've had to create a backport PR for each target release branch. With this change, we may be able to create only a single PR, and then run the backport automation to cherry-pick it into other release branches. The idea is that if a change introduced in version n-1 caused a conflict, and there are no other changes, then the backport automation should be able to use the same commit for version n-2 and n-3. --- .circleci/config.yml | 1 + .circleci/scripts/cherry-picker.sh | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b30b26114..e4425b248e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1000,3 +1000,4 @@ workflows: branches: only: - master + - /release\/\d+\.\d+\.x$/ diff --git a/.circleci/scripts/cherry-picker.sh b/.circleci/scripts/cherry-picker.sh index ac08a2acc2..6961e996e5 100755 --- a/.circleci/scripts/cherry-picker.sh +++ b/.circleci/scripts/cherry-picker.sh @@ -157,11 +157,12 @@ if echo "$resp" | jq -e '.items[].labels[] | select(.name | contains("docs-cherr fi fi +git config --local user.email "github-team-consul-core@hashicorp.com" +git config --local user.name "hc-github-team-consul-core" + backport_failures=0 # loop through all labels on the PR for label in $labels; do - git config --local user.email "github-team-consul-core@hashicorp.com" - git config --local user.name "hc-github-team-consul-core" status "checking label: $label" # if the label matches docs-cherrypick, it will attempt to cherry-pick to stable-website if [[ $label =~ docs-cherrypick ]]; then From 6858a8caf50be006b4b8caccbd5360801d3bcb4d Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 6 May 2021 12:26:10 -0400 Subject: [PATCH 2/2] ci: add a verify CI job to ensure CI checks are run (#10179) This workflow will be added as a branch protection rule in github. --- .circleci/config.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e4425b248e..b74fae665b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -850,8 +850,21 @@ jobs: "https://circleci.com/api/v1.1/project/github/hashicorp/consul-enterprise/tree/${CIRCLE_BRANCH}" | jq -r '.build_url' - run: *notify-slack-failure + # The noop job is a used as a very fast job in the verify-ci workflow because every workflow + # requires at least one job. It does nothing. + noop: + docker: + - image: docker.mirror.hashicorp.services/alpine:latest + steps: + - run: 'echo ok' + workflows: version: 2 + # verify-ci is a no-op workflow that must run on every PR. It is used in a + # branch protection rule to detect when CI workflows are not running. + verify-ci: + jobs: [noop] + go-tests: jobs: - check-vendor: &filter-ignore-non-go-branches