Skip to content

Support running tests with an older initial package version set #1014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Jun 12, 2025

Conversation

moritzkiefer-da
Copy link
Contributor

to catch missing Daml version guards

fixes #452

[ci]

Pull Request Checklist

Cluster Testing

  • If a cluster test is required, comment /cluster_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.
  • If a hard-migration test is required (from the latest release), comment /hdm_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.

PR Guidelines

  • Include any change that might be observable by our partners or affect their deployment in the release notes.
  • Specify fixed issues with Fixes #n, and mention issues worked on using #n
  • Include a screenshot for frontend-related PRs - see README or use your favorite screenshot tool

Merge Guidelines

  • Make the git commit message look sensible when squash-merging on GitHub (most likely: just copy your PR description).

@moritzkiefer-da moritzkiefer-da force-pushed the cocreature/daml-version-checks branch 7 times, most recently from 3b9e4eb to 35e20bd Compare June 6, 2025 12:32
to catch missing Daml version guards

fixes #452

[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da force-pushed the cocreature/daml-version-checks branch from 35e20bd to 33320a1 Compare June 6, 2025 13:04
.
Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da force-pushed the cocreature/daml-version-checks branch from b2062dc to 99c18cd Compare June 10, 2025 08:08
.
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da force-pushed the cocreature/daml-version-checks branch from 99c18cd to 33b8806 Compare June 10, 2025 08:19
.
Signed-off-by: Moritz Kiefer <[email protected]>
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da force-pushed the cocreature/daml-version-checks branch from abcd3b4 to 05e4b5d Compare June 10, 2025 10:50
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
.
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
.
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
.
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
.
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da force-pushed the cocreature/daml-version-checks branch 2 times, most recently from c860011 to a0d6d98 Compare June 10, 2025 14:09
.
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da force-pushed the cocreature/daml-version-checks branch from a0d6d98 to 25b195f Compare June 10, 2025 14:13
.
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da force-pushed the cocreature/daml-version-checks branch from 918cbda to cf888cd Compare June 11, 2025 11:00
.
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da force-pushed the cocreature/daml-version-checks branch from cf888cd to 77089ed Compare June 11, 2025 11:06
.
Signed-off-by: Moritz Kiefer <[email protected]>
@@ -133,6 +136,35 @@ runs:
with:
cache_version: 4

- name: Set Daml package versions
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not as precise as we probably should be: It relies on the version shipped to mainnet, not the versions vetted on mainnet. The latter is a bit of a mess since we also need a splitwell version which is not in the packageConfig, definitely solvable but annoying. So for now I'd suggest we keep it as is and open a separate issue for making the version we test against it more precise. This still gives us a two week compatibility window at a minimum which is much better than what we had so far.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.decentralizedSynchronizer
.activeSynchronizer
val domainFeesConfig = defaultSynchronizerFeesConfig
defaultAmuletConfig(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was just buggy, this used the default config instead of the existing one.

nextSynchronizerId = nextSynchronizerId,
val existingAmuletConfig = AmuletConfigSchedule(amuletRules)
.getConfigAsOf(env.environment.clock.now)
val existingTransferConfig = existingAmuletConfig.transferConfig
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was just buggy, this used the default config instead of the existing one.

@@ -193,7 +193,7 @@ object ParticipantAdminCommands {
if (dar.description.isEmpty)
PathUtils.getFilenameWithoutExtension(Path.of(filename))
else dar.description
_ = logger.info(s"Sending upload doar for ${descriptionOrFilename}")(
_ = logger.info(s"Sending upload dar for ${descriptionOrFilename}")(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doar

.
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da force-pushed the cocreature/daml-version-checks branch from a57e800 to e9eeaaf Compare June 11, 2025 11:32
"Sender accepts payment request",
senderWallet.acceptAppPaymentRequest(request.contractId),
)(
"Splitwell completes payment",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this actually mattered in the end but it makes debugging easier at least to synchronize on this

[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da force-pushed the cocreature/daml-version-checks branch from 2ff0d50 to 331aad0 Compare June 11, 2025 12:12
@moritzkiefer-da
Copy link
Contributor Author

I had a green build on this and only changed the from triggering on the PR to triggering periodically in the last commit 0a13a13

@moritzkiefer-da moritzkiefer-da requested a review from nicu-da June 11, 2025 13:13
@moritzkiefer-da moritzkiefer-da marked this pull request as ready for review June 11, 2025 13:13
@moritzkiefer-da
Copy link
Contributor Author

@nicu-da @isegall-da could I get a review on this please

Copy link
Contributor

@nicu-da nicu-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice! Thank you!

@@ -83,6 +83,9 @@ inputs:
failure_notifications_slack_channel:
description: "Slack channel for failure notifications (for failure notifications)"
required: true
daml_base_version:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can we add a description as to what is this used? Makes easier compared to having to read the action

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

val participantHttpApiPort =
validator.participantClient.config.ledgerApi.port.unwrap + 1000
val sv1 = environment.svs.local.find(_.name == "sv1").value
val amuletVersion = inside(sv1.config.onboarding) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: any reason why we don't read the current vetted version from the topology state?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this a bit easier to debug. I had quite a few cases where a prior test messed up the vetting state by vetting too much but the next one ran with an older initial package config change or something like that. This isn't gonna fix it but at least it makes it easier to figure out what is going wrong™

@@ -42,6 +42,7 @@ import java.time.Instant
import java.time.temporal.ChronoUnit
import scala.jdk.CollectionConverters.*

@org.lfdecentralizedtrust.splice.util.scalatesttags.NoDamlCompatibilityCheck
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I LOVE IT!

Can we adda readme on how to add new tags and when to use them? (can be done later in a different PR)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you see the readme I added?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In DEVELOPMENT.md or something else that I'm missing?
I'm seeing there instructions to tag a test if it doesn't work with this setup but I don't see anything about how are tags used, when to add a new type of tag and how to make the test run aware of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extended

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment as to what it does?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added


import org.scalatest.Tag

object Tags {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment for each tag as to why they exist and when they're used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
Copy link

@meiersi-da meiersi-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work! Thank you @moritzkiefer-da .

[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da enabled auto-merge (squash) June 12, 2025 08:43
@moritzkiefer-da moritzkiefer-da merged commit 12e9b25 into main Jun 12, 2025
60 checks passed
@moritzkiefer-da moritzkiefer-da deleted the cocreature/daml-version-checks branch June 12, 2025 09:16
@isegall-da
Copy link
Contributor

@nicu-da @isegall-da could I get a review on this please

Argh, why did I not get notified of the original review request?? 😠

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve our testing to catch missing Daml version guards
5 participants