diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000000..72232eabad81 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,73 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/configuration-reference +version: 2.1 + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs + +commands: + setup-bazel: + description: | + Setup the Bazel build system used for building Android projects + steps: + - run: + name: Add Bazel Apt repository + command: | + sudo apt install curl gnupg + curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg + sudo mv bazel.gpg /etc/apt/trusted.gpg.d/ + echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list + - run: + name: Install Bazel from Apt + command: sudo apt update && sudo apt install bazel + +jobs: + build: + # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. + # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job + docker: + # Specify the version you desire here + # See: https://circleci.com/developer/images/image/cimg/openjdk + - image: cimg/base:edge-20.04 + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/circleci-images/ + # - image: cimg/postgres:9.4 + + environment: + # Customize the JVM maximum heap limit + JVM_OPTS: -Xmx3200m + TERM: dumb + + # Add steps to the job + # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps + steps: + # Checkout the code as the first step. + - checkout + - setup-bazel + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "build.sbt" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: cat /dev/null | sbt test:compile + + - save_cache: + paths: + - ~/.m2 + key: v1-dependencies--{{ checksum "build.sbt" }} + + # run tests! + - run: cat /dev/null | sbt test:test + +# Orchestrate jobs using workflows +# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows +workflows: + sample: # This is the name of the workflow, feel free to change it to better match your workflow. + # Inside the workflow, you define the jobs you want to run. + jobs: + - build diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ebdd0a244865..2bf1d2bba0a6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,180 +1,180 @@ -# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 +# # Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. +# # SPDX-License-Identifier: Apache-2.0 -# Azure Pipelines file, see https://aka.ms/yaml +# # Azure Pipelines file, see https://aka.ms/yaml -# Enable builds on all branches -trigger: - # Build every commit as our release process relies on - # the release process being built alone. - batch: false - branches: - include: - - main - - main-2.x +# # Enable builds on all branches +# trigger: +# # Build every commit as our release process relies on +# # the release process being built alone. +# batch: false +# branches: +# include: +# - main +# - main-2.x -# Enable PR triggers that target the main branch -pr: none +# # Enable PR triggers that target the main branch +# pr: none -jobs: -- template: ci/build.yml - parameters: - test_mode: main -- template: ci/check-for-release-job.yml +# jobs: +# - template: ci/build.yml +# parameters: +# test_mode: main +# - template: ci/check-for-release-job.yml -- job: release - dependsOn: [ "check_for_release", "Linux", "macOS", "Windows" ] - condition: and(succeeded(), - eq(dependencies.check_for_release.outputs['out.is_release'], 'true'), - eq(dependencies.check_for_release.outputs['out.split_release_process'], 'false'), - eq(variables['Build.SourceBranchName'], 'main')) - pool: - name: 'ubuntu_20_04' - demands: assignment -equals default - variables: - release_sha: $[ dependencies.check_for_release.outputs['out.release_sha'] ] - release_tag: $[ dependencies.check_for_release.outputs['out.release_tag'] ] - trigger_sha: $[ dependencies.check_for_release.outputs['out.trigger_sha'] ] - steps: - - template: ci/report-start.yml - - checkout: self - persistCredentials: true - - bash: | - set -euo pipefail - git checkout $(release_sha) - name: checkout_release - - template: ci/bash-lib.yml - parameters: - var_name: bash-lib - - bash: | - set -euo pipefail - source $(bash-lib) - if git tag v$(release_tag) $(release_sha); then - git push origin v$(release_tag) - mkdir $(Build.StagingDirectory)/release-artifacts - else - setvar skip-github TRUE - fi - - task: DownloadPipelineArtifact@0 - inputs: - artifactName: linux-release - targetPath: $(Build.StagingDirectory)/release-artifacts - condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE'))) - - task: DownloadPipelineArtifact@0 - inputs: - artifactName: macos-release - targetPath: $(Build.StagingDirectory)/release-artifacts - condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE'))) - - task: DownloadPipelineArtifact@0 - inputs: - artifactName: windows-release - targetPath: $(Build.StagingDirectory)/release-artifacts - condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE'))) - - bash: | - set -euo pipefail - if [ -d sdk ]; then - cd sdk - fi - # Note: this gets dev-env from the release commit, not the trigger commit - eval "$(./dev-env/bin/dade-assist)" - KEY_FILE=$(mktemp) - GPG_DIR=$(mktemp -d) - cleanup() { - rm -rf $KEY_FILE $GPG_DIR - } - trap cleanup EXIT - echo "$GPG_KEY" | base64 -d > $KEY_FILE - gpg --homedir $GPG_DIR --no-tty --quiet --import $KEY_FILE - cd $(Build.StagingDirectory)/release-artifacts/github - sha256sum $(find . -type f | sort) > sha256sums - # Note: relies on our release artifacts not having spaces in their - # names. Creates a ${f}.asc with the signature for each $f. - for f in *; do - gpg --homedir $GPG_DIR -ab $f - done - cd ../artifactory - for f in *; do - gpg --homedir $GPG_DIR -ab $f - done - env: - GPG_KEY: $(gpg-code-signing) - - task: GitHubRelease@0 - inputs: - # I have no idea how dependent this is on the existence of my GitHub - # account or if this is just the name of the connection in Azure - # Pipelines. This is already mentioned in my transtiion document. - gitHubConnection: 'garyverhaegen-da' - repositoryName: '$(Build.Repository.Name)' - action: 'create' - target: '$(release_sha)' - tagSource: 'manual' - tag: 'v$(release_tag)' - assets: $(Build.StagingDirectory)/release-artifacts/github/* - assetUploadMode: 'replace' - title: '$(release_tag)' - addChangeLog: false - isPrerelease: true - releaseNotesSource: 'input' - releaseNotes: "This is a pre-release. Use at your own risk." - condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE'))) - - bash: | - set -euo pipefail - if [ -d sdk ]; then - cd sdk - fi - # Note: this gets dev-env from the release commit, not the trigger commit - eval "$(./dev-env/bin/dade-assist)" - ./ci/publish-artifactory.sh $(Build.StagingDirectory) $(release_tag) - env: - AUTH: $(ARTIFACTORY_USERNAME):$(ARTIFACTORY_PASSWORD) - condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE'))) - - bash: | - set -euo pipefail +# - job: release +# dependsOn: [ "check_for_release", "Linux", "macOS", "Windows" ] +# condition: and(succeeded(), +# eq(dependencies.check_for_release.outputs['out.is_release'], 'true'), +# eq(dependencies.check_for_release.outputs['out.split_release_process'], 'false'), +# eq(variables['Build.SourceBranchName'], 'main')) +# pool: +# name: 'ubuntu_20_04' +# demands: assignment -equals default +# variables: +# release_sha: $[ dependencies.check_for_release.outputs['out.release_sha'] ] +# release_tag: $[ dependencies.check_for_release.outputs['out.release_tag'] ] +# trigger_sha: $[ dependencies.check_for_release.outputs['out.trigger_sha'] ] +# steps: +# - template: ci/report-start.yml +# - checkout: self +# persistCredentials: true +# - bash: | +# set -euo pipefail +# git checkout $(release_sha) +# name: checkout_release +# - template: ci/bash-lib.yml +# parameters: +# var_name: bash-lib +# - bash: | +# set -euo pipefail +# source $(bash-lib) +# if git tag v$(release_tag) $(release_sha); then +# git push origin v$(release_tag) +# mkdir $(Build.StagingDirectory)/release-artifacts +# else +# setvar skip-github TRUE +# fi +# - task: DownloadPipelineArtifact@0 +# inputs: +# artifactName: linux-release +# targetPath: $(Build.StagingDirectory)/release-artifacts +# condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE'))) +# - task: DownloadPipelineArtifact@0 +# inputs: +# artifactName: macos-release +# targetPath: $(Build.StagingDirectory)/release-artifacts +# condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE'))) +# - task: DownloadPipelineArtifact@0 +# inputs: +# artifactName: windows-release +# targetPath: $(Build.StagingDirectory)/release-artifacts +# condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE'))) +# - bash: | +# set -euo pipefail +# if [ -d sdk ]; then +# cd sdk +# fi +# # Note: this gets dev-env from the release commit, not the trigger commit +# eval "$(./dev-env/bin/dade-assist)" +# KEY_FILE=$(mktemp) +# GPG_DIR=$(mktemp -d) +# cleanup() { +# rm -rf $KEY_FILE $GPG_DIR +# } +# trap cleanup EXIT +# echo "$GPG_KEY" | base64 -d > $KEY_FILE +# gpg --homedir $GPG_DIR --no-tty --quiet --import $KEY_FILE +# cd $(Build.StagingDirectory)/release-artifacts/github +# sha256sum $(find . -type f | sort) > sha256sums +# # Note: relies on our release artifacts not having spaces in their +# # names. Creates a ${f}.asc with the signature for each $f. +# for f in *; do +# gpg --homedir $GPG_DIR -ab $f +# done +# cd ../artifactory +# for f in *; do +# gpg --homedir $GPG_DIR -ab $f +# done +# env: +# GPG_KEY: $(gpg-code-signing) +# - task: GitHubRelease@0 +# inputs: +# # I have no idea how dependent this is on the existence of my GitHub +# # account or if this is just the name of the connection in Azure +# # Pipelines. This is already mentioned in my transtiion document. +# gitHubConnection: 'garyverhaegen-da' +# repositoryName: '$(Build.Repository.Name)' +# action: 'create' +# target: '$(release_sha)' +# tagSource: 'manual' +# tag: 'v$(release_tag)' +# assets: $(Build.StagingDirectory)/release-artifacts/github/* +# assetUploadMode: 'replace' +# title: '$(release_tag)' +# addChangeLog: false +# isPrerelease: true +# releaseNotesSource: 'input' +# releaseNotes: "This is a pre-release. Use at your own risk." +# condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE'))) +# - bash: | +# set -euo pipefail +# if [ -d sdk ]; then +# cd sdk +# fi +# # Note: this gets dev-env from the release commit, not the trigger commit +# eval "$(./dev-env/bin/dade-assist)" +# ./ci/publish-artifactory.sh $(Build.StagingDirectory) $(release_tag) +# env: +# AUTH: $(ARTIFACTORY_USERNAME):$(ARTIFACTORY_PASSWORD) +# condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE'))) +# - bash: | +# set -euo pipefail - if [ -d sdk ]; then - cd sdk - fi - # Note: this gets dev-env from the release commit, not the trigger commit - eval "$(./dev-env/bin/dade-assist)" - source $(bash-lib) +# if [ -d sdk ]; then +# cd sdk +# fi +# # Note: this gets dev-env from the release commit, not the trigger commit +# eval "$(./dev-env/bin/dade-assist)" +# source $(bash-lib) - cd $(Build.StagingDirectory)/release-artifacts/github - for f in *; do - gcs "$GCRED" cp "$f" "gs://daml-data/releases/$(release_tag)/github/$f" - done +# cd $(Build.StagingDirectory)/release-artifacts/github +# for f in *; do +# gcs "$GCRED" cp "$f" "gs://daml-data/releases/$(release_tag)/github/$f" +# done - cd $(Build.StagingDirectory)/release-artifacts/artifactory - for f in *; do - gcs "$GCRED" cp "$f" "gs://daml-data/releases/$(release_tag)/artifactory/$f" - done - name: backup_to_gcs - env: - GCRED: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT) - condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE'))) - - bash: | - set -euo pipefail - source $(bash-lib) - if [ -d sdk ]; then - cd sdk - fi - # Note: this gets dev-env from the release commit, not the trigger commit - eval "$(./dev-env/bin/dade-assist)" - msg=$(git log -n1 --format=%b HEAD | head -1) - # Keep this line in sync with RELEASE_PR_NOTIF in ci/cron/wednesday.yml - if [ "$msg" = "This PR has been created by a script, which is not very smart" ]; then - pr_handler="<@$(next_in_rotation_slack)>" - else - pr_handler="" - fi - curl -XPOST \ - -i \ - -H 'Content-Type: application/json' \ - --data "{\"text\":\"${pr_handler} Release \`$(release_tag)\` is ready for testing. See . (, , )\"}" \ - $(Slack.team-daml) - - template: ci/tell-slack-failed.yml - parameters: - trigger_sha: '$(trigger_sha)' - - template: ci/report-end.yml +# cd $(Build.StagingDirectory)/release-artifacts/artifactory +# for f in *; do +# gcs "$GCRED" cp "$f" "gs://daml-data/releases/$(release_tag)/artifactory/$f" +# done +# name: backup_to_gcs +# env: +# GCRED: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT) +# condition: and(succeeded(), not(eq(variables['skip-github'], 'TRUE'))) +# - bash: | +# set -euo pipefail +# source $(bash-lib) +# if [ -d sdk ]; then +# cd sdk +# fi +# # Note: this gets dev-env from the release commit, not the trigger commit +# eval "$(./dev-env/bin/dade-assist)" +# msg=$(git log -n1 --format=%b HEAD | head -1) +# # Keep this line in sync with RELEASE_PR_NOTIF in ci/cron/wednesday.yml +# if [ "$msg" = "This PR has been created by a script, which is not very smart" ]; then +# pr_handler="<@$(next_in_rotation_slack)>" +# else +# pr_handler="" +# fi +# curl -XPOST \ +# -i \ +# -H 'Content-Type: application/json' \ +# --data "{\"text\":\"${pr_handler} Release \`$(release_tag)\` is ready for testing. See . (, , )\"}" \ +# $(Slack.team-daml) +# - template: ci/tell-slack-failed.yml +# parameters: +# trigger_sha: '$(trigger_sha)' +# - template: ci/report-end.yml -- template: ci/split-release-job.yml -- template: ci/refresh-get-daml-com.yml +# - template: ci/split-release-job.yml +# - template: ci/refresh-get-daml-com.yml diff --git a/ci/prs.yml b/ci/prs.yml index 0b7b3578681e..3f2d649d87e4 100644 --- a/ci/prs.yml +++ b/ci/prs.yml @@ -1,154 +1,154 @@ # Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -trigger: none - -pr: - autoCancel: true # cancel previous builds on push - branches: - include: - - main - - main-2.x - - release/* - -jobs: -- template: build.yml - parameters: - test_mode: pr -- template: check-for-release-job.yml - - -- job: check_standard_change_label - dependsOn: - - check_for_release - condition: and(eq(variables['Build.Reason'], 'PullRequest'), - eq(dependencies.check_for_release.outputs['out.is_release'], 'true')) - pool: - name: 'ubuntu_20_04' - demands: assignment -equals default - steps: - - checkout: self - - bash: | - set -euo pipefail - - curl https://api.github.com/repos/digital-asset/daml/pulls/$PR -s | jq -r '.labels[].name' | grep -q '^Standard-Change$' - env: - PR: $(System.PullRequest.PullRequestNumber) - -# required for collect_build_data -- job: release - condition: false - -- job: notify_release_pr - condition: and(not(canceled()), - or(startsWith(variables['Build.SourceBranchName'], 'auto-release-pr-'), - startsWith(variables['System.PullRequest.SourceBranch'], 'auto-release-pr-')), - eq(dependencies.check_for_release.outputs['out.is_release'], 'true')) - dependsOn: - - git_sha - - collect_build_data - - check_for_release - - platform_independence_test - pool: - name: 'ubuntu_20_04' - demands: assignment -equals default - variables: - branch_sha: $[ dependencies.git_sha.outputs['out.branch'] ] - status: $[ dependencies.collect_build_data.result ] - is_release: $[ dependencies.check_for_release.outputs['out.is_release'] ] - steps: - - checkout: self - persistCredentials: true - - template: bash-lib.yml - parameters: - var_name: bash-lib - - bash: | - set -euo pipefail - - source $(bash-lib) - - AUTH="$(get_gh_auth_header)" - PR=$(curl -H "$AUTH" \ - -H "Accept: application/vnd.github.groot-preview+json" \ - -s -f \ - "https://api.github.com/repos/digital-asset/daml/commits/$(git rev-parse HEAD)/pulls" \ - | jq '.[0].number' \ - || echo "") - # Note: if we somehow fail to resolve the PR number from the GitHub - # API, there is still value in getting the notification on Slack, as - # we do have the build number and from there we can click through to - # the PR. Hence the `|| echo ""`. - PR_HANDLER=$(next_in_rotation_slack) - - case "$(status)" in - Succeeded*) - msg="has succeeded! Next step is to approve & merge. This is probably a good time to start your Windows testing machine." - ;; - Failed*) - msg="has failed. Please investigate." - ;; - *) - # Should not be reached, but who knows? - msg="has completed with status $(status). See for what to do next." - ;; - esac - tell_slack "<@${PR_HANDLER}> for release PR $msg" - -- job: notify_user - # No Slack tokens on forks - condition: and(not(canceled()), - eq(variables['System.PullRequest.IsFork'], 'False')) - dependsOn: - - git_sha - - collect_build_data - - check_for_release - pool: - name: 'ubuntu_20_04' - demands: assignment -equals default - variables: - pr.num: $[ variables['System.PullRequest.PullRequestNumber'] ] - branch_sha: $[ dependencies.git_sha.outputs['out.branch'] ] - build_status: $[ dependencies.collect_build_data.result ] - steps: - - template: bash-lib.yml - parameters: - var_name: bash-lib - - bash: | - set -euo pipefail - source $(bash-lib) - - user=$(user_slack_handle $(branch_sha)) - if [ "$user" != "" ]; then - tell_slack "<@${user}> for has completed with status $(build_status)." \ - "$(Slack.team-daml-ci)" - fi - if [ "$(git log -n1 --format="%(trailers:key=tell-slack,valueonly)" HEAD)" = "canton" ]; then - if [ "$(build_status)" = "Failed" ]; then - tell_slack " for has completed with status $(build_status)." \ - "$(Slack.team-canton-notifications)" - fi - fi - -- job: self_service_compat_test - pool: - name: 'ubuntu_20_04' - demands: assignment -equals default - condition: eq(variables['Build.Reason'], 'PullRequest') - steps: - - checkout: self - - template: bash-lib.yml - parameters: - var_name: bash-lib - - bash: | - set -euo pipefail - cd sdk - eval "$(./dev-env/bin/dade-assist)" - source $(bash-lib) - COMMIT=$(git rev-parse HEAD^2) - REQUEST=$(git log -n1 --format="%(trailers:key=run-full-compat,valueonly)" $COMMIT) - if [ $REQUEST == true ]; then - # Unfortunately recovering the actual branch name is tricky - trigger_azure $AZURE_TOKEN digital-asset.daml-daily-compat --commit-id $COMMIT --branch not-main - fi - env: - AZURE_TOKEN: $(System.AccessToken) +#trigger: none +# +#pr: +# autoCancel: true # cancel previous builds on push +# branches: +# include: +# - main +# - main-2.x +# - release/* +# +#jobs: +#- template: build.yml +# parameters: +# test_mode: pr +#- template: check-for-release-job.yml +# +# +#- job: check_standard_change_label +# dependsOn: +# - check_for_release +# condition: and(eq(variables['Build.Reason'], 'PullRequest'), +# eq(dependencies.check_for_release.outputs['out.is_release'], 'true')) +# pool: +# name: 'ubuntu_20_04' +# demands: assignment -equals default +# steps: +# - checkout: self +# - bash: | +# set -euo pipefail +# +# curl https://api.github.com/repos/digital-asset/daml/pulls/$PR -s | jq -r '.labels[].name' | grep -q '^Standard-Change$' +# env: +# PR: $(System.PullRequest.PullRequestNumber) +# +## required for collect_build_data +#- job: release +# condition: false +# +#- job: notify_release_pr +# condition: and(not(canceled()), +# or(startsWith(variables['Build.SourceBranchName'], 'auto-release-pr-'), +# startsWith(variables['System.PullRequest.SourceBranch'], 'auto-release-pr-')), +# eq(dependencies.check_for_release.outputs['out.is_release'], 'true')) +# dependsOn: +# - git_sha +# - collect_build_data +# - check_for_release +# - platform_independence_test +# pool: +# name: 'ubuntu_20_04' +# demands: assignment -equals default +# variables: +# branch_sha: $[ dependencies.git_sha.outputs['out.branch'] ] +# status: $[ dependencies.collect_build_data.result ] +# is_release: $[ dependencies.check_for_release.outputs['out.is_release'] ] +# steps: +# - checkout: self +# persistCredentials: true +# - template: bash-lib.yml +# parameters: +# var_name: bash-lib +# - bash: | +# set -euo pipefail +# +# source $(bash-lib) +# +# AUTH="$(get_gh_auth_header)" +# PR=$(curl -H "$AUTH" \ +# -H "Accept: application/vnd.github.groot-preview+json" \ +# -s -f \ +# "https://api.github.com/repos/digital-asset/daml/commits/$(git rev-parse HEAD)/pulls" \ +# | jq '.[0].number' \ +# || echo "") +# # Note: if we somehow fail to resolve the PR number from the GitHub +# # API, there is still value in getting the notification on Slack, as +# # we do have the build number and from there we can click through to +# # the PR. Hence the `|| echo ""`. +# PR_HANDLER=$(next_in_rotation_slack) +# +# case "$(status)" in +# Succeeded*) +# msg="has succeeded! Next step is to approve & merge. This is probably a good time to start your Windows testing machine." +# ;; +# Failed*) +# msg="has failed. Please investigate." +# ;; +# *) +# # Should not be reached, but who knows? +# msg="has completed with status $(status). See for what to do next." +# ;; +# esac +# tell_slack "<@${PR_HANDLER}> for release PR $msg" +# +#- job: notify_user +# # No Slack tokens on forks +# condition: and(not(canceled()), +# eq(variables['System.PullRequest.IsFork'], 'False')) +# dependsOn: +# - git_sha +# - collect_build_data +# - check_for_release +# pool: +# name: 'ubuntu_20_04' +# demands: assignment -equals default +# variables: +# pr.num: $[ variables['System.PullRequest.PullRequestNumber'] ] +# branch_sha: $[ dependencies.git_sha.outputs['out.branch'] ] +# build_status: $[ dependencies.collect_build_data.result ] +# steps: +# - template: bash-lib.yml +# parameters: +# var_name: bash-lib +# - bash: | +# set -euo pipefail +# source $(bash-lib) +# +# user=$(user_slack_handle $(branch_sha)) +# if [ "$user" != "" ]; then +# tell_slack "<@${user}> for has completed with status $(build_status)." \ +# "$(Slack.team-daml-ci)" +# fi +# if [ "$(git log -n1 --format="%(trailers:key=tell-slack,valueonly)" HEAD)" = "canton" ]; then +# if [ "$(build_status)" = "Failed" ]; then +# tell_slack " for has completed with status $(build_status)." \ +# "$(Slack.team-canton-notifications)" +# fi +# fi +# +#- job: self_service_compat_test +# pool: +# name: 'ubuntu_20_04' +# demands: assignment -equals default +# condition: eq(variables['Build.Reason'], 'PullRequest') +# steps: +# - checkout: self +# - template: bash-lib.yml +# parameters: +# var_name: bash-lib +# - bash: | +# set -euo pipefail +# cd sdk +# eval "$(./dev-env/bin/dade-assist)" +# source $(bash-lib) +# COMMIT=$(git rev-parse HEAD^2) +# REQUEST=$(git log -n1 --format="%(trailers:key=run-full-compat,valueonly)" $COMMIT) +# if [ $REQUEST == true ]; then +# # Unfortunately recovering the actual branch name is tricky +# trigger_azure $AZURE_TOKEN digital-asset.daml-daily-compat --commit-id $COMMIT --branch not-main +# fi +# env: +# AZURE_TOKEN: $(System.AccessToken)