Skip to content

Commit 77089ed

Browse files
committed
.
[ci] Signed-off-by: Moritz Kiefer <[email protected]>
1 parent 70475b5 commit 77089ed

File tree

6 files changed

+79
-3
lines changed

6 files changed

+79
-3
lines changed

.github/workflows/build.scala_test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ on:
5050
type: string
5151
required: false
5252
default: ""
53+
daml_base_version:
54+
type: string
55+
required: true
5356

5457
jobs:
5558

@@ -130,3 +133,4 @@ jobs:
130133
failure_notifications_invoker_sa: ${{ secrets.FAILURE_NOTIFICATIONS_INVOKER_SA }}
131134
failure_notifications_invoker_url: ${{ secrets.FAILURE_NOTIFICATIONS_INVOKER_URL }}
132135
failure_notifications_slack_channel: ${{ secrets.FAILURE_NOTIFICATIONS_SLACK_CHANNEL }}
136+
daml_base_version: ${{ inputs.daml_base_version }}

.github/workflows/build.scala_test_with_cometbft.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
type: string
1919
required: false
2020
default: ""
21+
daml_base_version:
22+
type: string
23+
required: true
2124

2225
jobs:
2326

@@ -117,3 +120,4 @@ jobs:
117120
failure_notifications_invoker_sa: ${{ secrets.FAILURE_NOTIFICATIONS_INVOKER_SA }}
118121
failure_notifications_invoker_url: ${{ secrets.FAILURE_NOTIFICATIONS_INVOKER_URL }}
119122
failure_notifications_slack_channel: ${{ secrets.FAILURE_NOTIFICATIONS_SLACK_CHANNEL }}
123+
daml_base_version: ${{ inputs.daml_base_version }}

.github/workflows/build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,18 @@ on:
1010
daml_base_version:
1111
type: string
1212
required: false
13-
default: "0.3.21"
13+
default: ""
14+
workflow_dispatch:
15+
inputs:
16+
commit_sha:
17+
description: 'The commit SHA to use for the build'
18+
required: false
19+
default: ''
20+
type: string
21+
daml_base_version:
22+
type: string
23+
required: false
24+
default: ""
1425

1526
permissions:
1627
id-token: write # Required for GCP Workload Identity for failure notifications
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Integration tests against mainnet Daml version
2+
on:
3+
pull_request:
4+
types: [ opened, synchronize, reopened ]
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
permissions:
11+
id-token: write # Required for GCP Workload Identity for failure notifications
12+
contents: read
13+
pull-requests: read # Required for the static tests
14+
issues: read # Required for the static tests
15+
actions: write # To cancel itself if not opted in
16+
17+
jobs:
18+
get_mainnet_version:
19+
runs-on: self-hosted-docker-tiny
20+
outputs:
21+
version: ${{ steps.get_mainnet_version.outputs.version }}
22+
steps:
23+
- name: Get MainNet version
24+
id: get_mainnet_version
25+
run: |
26+
set -eou pipefail
27+
version="$(curl -sSL --fail-with-body https://docs.global.canton.network.sync.global/info | jq -r '.sv.version')"
28+
echo "MainNet version is $version"
29+
echo "version=$version" >> "$GITHUB_OUTPUT"
30+
31+
build:
32+
needs: get_mainnet_version
33+
uses: ./.github/workflows/build.yml
34+
with:
35+
daml_base_version: ${{ needs.get_mainnet_version.outputs.version }}
36+
secrets: inherit

DEVELOPMENT.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,26 @@ To edit the files in a particular Daml project, for example, `/apps/wallet/daml`
369369
*Tip:* if `damlBuild` fails with weird errors, then that might be due to stale `damlBuild` outputs.
370370
Try forcing a clean rebuild by cleaning via SBT, e.g., `apps-common/clean` and similar for the dependent project.
371371

372+
## Daml Version Guards in Integration Tests
373+
374+
Our backends need to handle the case where we compile against Daml
375+
version X+1 but the vote to switch to those models is not yet done and
376+
only Daml version X can be used. This is done by checking the active
377+
version endpoints in triggers, UIs and similar. However, those checks
378+
can be easily forgotten and the normal integration tests do not catch
379+
that as they run against the latest version.
380+
381+
To catch this, we periodically run all integration tests against the
382+
latest Daml version that was shipped to mainnet. This means tests that
383+
do actually depend on the newer versions won't work. Default to making
384+
tests backwards compatible where possible. Where this is not possible
385+
or does not make sense (e.g. because you're testing functionality that
386+
did not have an equivalent before), tag the test with a scalatest tag
387+
corresponding to the version of the Daml package that introduced the
388+
functionality, e.g.,
389+
`org.lfdecentralizedtrust.splice.util.scalatesttags.SpliceAmuelt_0_1_9`. This
390+
ensures the test will be excluded if we are running against earlier
391+
Daml versions.
372392

373393
# Troubleshooting
374394

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/SpliceTests.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ import org.lfdecentralizedtrust.splice.auth.AuthUtil
4040
import org.lfdecentralizedtrust.splice.config.{AuthTokenSourceConfig, SpliceConfig}
4141
import org.lfdecentralizedtrust.splice.console.*
4242
import org.lfdecentralizedtrust.splice.environment.{
43+
DarResources,
4344
RetryProvider,
4445
SpliceEnvironment,
4546
SpliceEnvironmentFactory,
4647
}
47-
import org.lfdecentralizedtrust.splice.integration.EnvironmentDefinition
48+
import org.lfdecentralizedtrust.splice.integration.{EnvironmentDefinition, InitialPackageVersions}
4849
import org.lfdecentralizedtrust.splice.integration.plugins.{
4950
ResetDecentralizedNamespace,
5051
ResetSequencerSynchronizerStateThreshold,
@@ -573,7 +574,7 @@ object SpliceTests extends LazyLogging {
573574
}
574575

575576
protected def splitwellDarPath =
576-
"daml/dars/splitwell-InitialPackageVersions.initialPackageVersion(DarResources.splitwell).dar"
577+
s"daml/dars/splitwell-${InitialPackageVersions.initialPackageVersion(DarResources.splitwell)}.dar"
577578
}
578579

579580
object BracketSynchronous {

0 commit comments

Comments
 (0)