From dd443b030d1f68dfcb7b168451368fae1ee4ed96 Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Tue, 13 Aug 2024 10:58:48 +0100 Subject: [PATCH] fix(commit_check)_: use proper base branch (#5700) --- _assets/ci/Jenkinsfile.tests | 20 ++++++++++++-------- _assets/scripts/commit_check.sh | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/_assets/ci/Jenkinsfile.tests b/_assets/ci/Jenkinsfile.tests index 0e31652ce..774d6787f 100644 --- a/_assets/ci/Jenkinsfile.tests +++ b/_assets/ci/Jenkinsfile.tests @@ -52,14 +52,15 @@ pipeline { } environment { - PLATFORM = 'tests' - DB_CONT = "status-go-test-db-${env.EXECUTOR_NUMBER.toInteger() + 1}" - DB_PORT = "${5432 + env.EXECUTOR_NUMBER.toInteger()}" - TMPDIR = "${WORKSPACE_TMP}" - GOPATH = "${WORKSPACE_TMP}/go" - GOCACHE = "${WORKSPACE_TMP}/gocache" - PATH = "${PATH}:${GOPATH}/bin" - REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go" + PLATFORM = 'tests' + DB_CONT = "status-go-test-db-${env.EXECUTOR_NUMBER.toInteger() + 1}" + DB_PORT = "${5432 + env.EXECUTOR_NUMBER.toInteger()}" + TMPDIR = "${WORKSPACE_TMP}" + GOPATH = "${WORKSPACE_TMP}/go" + GOCACHE = "${WORKSPACE_TMP}/gocache" + PATH = "${PATH}:${GOPATH}/bin" + REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go" + BASE_BRANCH = "${env.CHANGE_TARGET}" /* Hack-fix for params not being set in env on first job run. */ UNIT_TEST_FAILFAST = "${params.UNIT_TEST_FAILFAST}" @@ -94,6 +95,9 @@ pipeline { } stage('Commit') { + environment { + BASE_BRANCH = "${env.BASE_BRANCH}" + } when { // https://github.com/status-im/status-go/issues/4993#issuecomment-2022685544 expression { !isTestNightlyJob() } } diff --git a/_assets/scripts/commit_check.sh b/_assets/scripts/commit_check.sh index bb828918f..a70f695ec 100755 --- a/_assets/scripts/commit_check.sh +++ b/_assets/scripts/commit_check.sh @@ -3,7 +3,7 @@ set -euo pipefail parse_commits() { - start_commit=${1:-origin/develop} + start_commit=${1:-origin/${BASE_BRANCH}} end_commit=${2:-HEAD} is_breaking_change=false @@ -27,4 +27,4 @@ parse_commits() { echo "$is_breaking_change" } -parse_commits +parse_commits "$@"