From 60a5156400ba07c69a6be2307e7c18048c465495 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 13 Feb 2023 08:20:00 +0000 Subject: [PATCH] automation: remove bump snapshots (#2250) (#2253) (cherry picked from commit c0976970f2317dd79a9056ea1ee2044b72485713) Co-authored-by: Victor Martinez --- .ci/bump-stack-version.sh | 42 ----------------------------- .github/workflows/bump-golang.yml | 2 +- .github/workflows/opentelemetry.yml | 1 + .mergify.yml | 31 --------------------- 4 files changed, 2 insertions(+), 74 deletions(-) delete mode 100755 .ci/bump-stack-version.sh diff --git a/.ci/bump-stack-version.sh b/.ci/bump-stack-version.sh deleted file mode 100755 index 8d7fdc594b0..00000000000 --- a/.ci/bump-stack-version.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# -# Given the stack version this script will bump the version. -# -# This script is executed by the automation we are putting in place -# and it requires the git add/commit commands. -# -# Parameters: -# $1 -> the version to be bumped. Mandatory. -# $2 -> whether to create a branch where to commit the changes to. -# this is required when reusing an existing Pull Request. -# Optional. Default true. -# -set -euo pipefail -MSG="parameter missing." -VERSION=${1:?$MSG} -CREATE_BRANCH=${2:-true} - -OS=$(uname -s| tr '[:upper:]' '[:lower:]') - -if [ "${OS}" == "darwin" ] ; then - SED="sed -i .bck" -else - SED="sed -i" -fi - -echo "Update stack with version ${VERSION}" -${SED} -E -e "s#(image: docker\.elastic\.co/.*):[0-9]+\.[0-9]+\.[0-9]+(-[a-f0-9]{8})?#\1:${VERSION}#g" testing/environments/snapshot.yml - -echo "Commit changes" -if [ "$CREATE_BRANCH" = "true" ]; then - base=$(git rev-parse --abbrev-ref HEAD | sed 's#/#-#g') - git checkout -b "update-stack-version-$(date "+%Y%m%d%H%M%S")-${base}" -else - echo "Branch creation disabled." -fi - -git add testing/environments/snapshot.yml -git diff --staged --quiet || git commit -m "[Automation] Update elastic stack version to ${VERSION} for testing" -git --no-pager log -1 - -echo "You can now push and create a Pull Request" diff --git a/.github/workflows/bump-golang.yml b/.github/workflows/bump-golang.yml index f0169aac5b3..6964db0db0f 100644 --- a/.github/workflows/bump-golang.yml +++ b/.github/workflows/bump-golang.yml @@ -1,5 +1,5 @@ --- -name: Bump golang version +name: bump-golang on: workflow_dispatch: diff --git a/.github/workflows/opentelemetry.yml b/.github/workflows/opentelemetry.yml index 9b5afa45962..e1878da5fc9 100644 --- a/.github/workflows/opentelemetry.yml +++ b/.github/workflows/opentelemetry.yml @@ -4,6 +4,7 @@ name: OpenTelemetry Export Trace on: workflow_run: workflows: + - bump-golang - golangci-lint - Elastic Agent workflow using Snyk - macos diff --git a/.mergify.yml b/.mergify.yml index 50ba909e2ba..4f779688c44 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -54,37 +54,6 @@ pull_request_rules: message: | This pull request has been automatically closed by Mergify. There are some other up-to-date pull requests. - - name: automatic approval for automated pull requests with bump updates - conditions: - - author=apmmachine - - check-success=fleet-ci/pr-merge - - label=automation - - files~=^testing/environments/snapshot.*\.yml$ - actions: - review: - type: APPROVE - message: Automatically approving mergify - - name: automatic squash and merge with success checks and the files matching the regex ^testing/environments/snapshot* are modified. - conditions: - - check-success=fleet-ci/pr-merge - - label=automation - - files~=^testing/environments/snapshot.*\.yml$ - - "#approved-reviews-by>=1" - actions: - queue: - method: squash - name: default - - name: delete upstream branch after merging changes on testing/environments/snapshot* or it's closed - conditions: - - or: - - merged - - closed - - and: - - label=automation - - head~=^update-stack-version - - files~=^testing/environments/snapshot.*\.yml$ - actions: - delete_head_branch: - name: delete upstream branch after merging changes on .go-version or it's closed conditions: - or: