self-service compat: set branch name to not main (#11902)

The "tell slack about failures" step is conditional on the branch name
being main; for whatever reason if we don't supply a branch name Azure
sets it to `main`, regardless of the fact that the commit is not in that
branch at all.

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Gary Verhaegen 2021-11-26 17:50:53 +01:00 committed by GitHub
parent 2f4aa4797e
commit 4e50060021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

View File

@ -217,5 +217,5 @@ jobs:
- bash: | - bash: |
set -euo pipefail set -euo pipefail
source $(bash-lib) source $(bash-lib)
trigger_azure $(System.AccessToken) --branch $(branch) PRs trigger_azure $(System.AccessToken) PRs --branch $(branch)
trigger_azure $(System.AccessToken) --branch $(branch) digital-asset.daml-daily-compat trigger_azure $(System.AccessToken) digital-asset.daml-daily-compat --branch $(branch)

View File

@ -160,18 +160,18 @@ steps:
} }
trigger_azure() ( trigger_azure() (
token=$1 token=$1
option=$2 shift
target=$3 build=$1
build=$4 shift
az extension add --name azure-devops az extension add --name azure-devops
trap 'az devops logout' EXIT trap 'az devops logout' EXIT
echo $token \ echo $token \
| az devops login --org "https://dev.azure.com/digitalasset" | az devops login --org "https://dev.azure.com/digitalasset"
az pipelines build queue \ az pipelines build queue \
$option $target \
--definition-name $build \ --definition-name $build \
--org "https://dev.azure.com/digitalasset" \ --org "https://dev.azure.com/digitalasset" \
--project daml --project daml \
$@
) )
END END

View File

@ -186,7 +186,8 @@ jobs:
COMMIT=$(git rev-parse HEAD^2) COMMIT=$(git rev-parse HEAD^2)
REQUEST=$(git log -n1 --format="%(trailers:key=run-full-compat,valueonly)" $COMMIT) REQUEST=$(git log -n1 --format="%(trailers:key=run-full-compat,valueonly)" $COMMIT)
if [ $REQUEST == true ]; then if [ $REQUEST == true ]; then
trigger_azure $AZURE_TOKEN --commit-id $COMMIT digital-asset.daml-daily-compat # Unfortunately recovering the actual branch name is tricky
trigger_azure $AZURE_TOKEN digital-asset.daml-daily-compat --commit-id $COMMIT --branch not-main
fi fi
env: env:
AZURE_TOKEN: $(System.AccessToken) AZURE_TOKEN: $(System.AccessToken)