Skip to content

Commit ad713f5

Browse files
canton-network-daDA Automation
andauthored
Update Splice from CCI (#419)
Signed-off-by: DA Automation <splice-maintainers@digitalasset.com> Co-authored-by: DA Automation <splice-maintainers@digitalasset.com>
1 parent d1fcffd commit ad713f5

File tree

169 files changed

+786
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+786
-159
lines changed

.github/workflows/cluster_tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
sha:
1010
type: string
1111
required: true
12+
splice_url:
13+
type: string
14+
required: false
1215

1316
outputs:
1417
result:
@@ -39,5 +42,5 @@ jobs:
3942
run: |
4043
set -euo pipefail
4144
result=$(curl -sSfL -H "Authorization: Bearer ${{ steps.auth.outputs.id_token }}" \
42-
"${{ secrets.CLUSTER_TEST_INVOKER_URL }}?workflow=${{ inputs.workflow }}&splice-git-ref=${{ inputs.sha }}")
45+
"${{ secrets.CLUSTER_TEST_INVOKER_URL }}?workflow=${{ inputs.workflow }}&splice-git-ref=${{ inputs.sha }}&splice-url=${{ inputs.splice_url }}")
4346
echo "result=$result" >> "$GITHUB_OUTPUT"

.github/workflows/post_merge.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/pr_cluster_test.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,60 @@ permissions:
1010

1111
jobs:
1212

13-
get_sha:
13+
get_head:
1414
runs-on: self-hosted-docker-tiny
1515
outputs:
16-
sha: ${{ steps.comment-branch.outputs.head_sha }}
16+
sha: ${{ steps.get_head.outputs.sha }}
17+
repo: ${{ steps.get_head.outputs.repo }}
1718
steps:
18-
- name: Get PR branch
19-
uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0
20-
id: comment-branch
19+
- name: Get head SHA & repo
20+
id: get_head
21+
run: |
22+
set -euo pipefail
23+
query='query pullRequestDetails { repository(name: \"${{ github.event.repository.name }}\", owner: \"${{ github.repository_owner }}\") { pullRequest(number: ${{ github.event.issue.number }}) { headRef { target { oid } } headRepository { sshUrl } } } }'
24+
result=$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -X POST -d " { \"query\": \"$query\" } " https://api.github.com/graphql)
25+
sha=$(echo "$result" | jq -r '.data.repository.pullRequest.headRef.target.oid')
26+
repo=$(echo "$result" | jq -r '.data.repository.pullRequest.headRepository.sshUrl')
27+
echo "sha=$sha" >> "$GITHUB_OUTPUT"
28+
echo "repo=$repo" >> "$GITHUB_OUTPUT"
2129
2230
trigger_cluster_test_basic:
2331
if: github.event.issue.pull_request && contains(github.event.comment.body, '/cluster_test')
24-
needs: get_sha
32+
needs: get_head
2533
uses: ./.github/workflows/cluster_tests.yml
2634
secrets: inherit
2735
with:
2836
workflow: cluster_test
29-
sha: ${{ needs.get_sha.outputs.sha }}
37+
sha: ${{ needs.get_head.outputs.sha }}
38+
splice_url: ${{ needs.get_head.outputs.repo }}
3039

3140
result:
3241
runs-on: self-hosted-docker-tiny
3342
needs:
3443
- trigger_cluster_test_basic
35-
- get_sha
44+
- get_head
3645
steps:
3746
- run: |
3847
number=$(echo '${{ needs.trigger_cluster_test_basic.outputs.result }}' | jq -r '.number')
39-
echo "Deploy scratchnet pipeline triggered for [PR as of ${{ needs.get_sha.outputs.sha }}](https://github.com/${{ github.repository }}/pull/${{ github.event.issue.number }}/files/${{ needs.get_sha.outputs.sha }}), please approve it in CircleCI: https://app.circleci.com/pipelines/github/DACH-NY/canton-network-internal/${number}"
48+
echo "Deploy scratchnet pipeline triggered for [Commit ${{ needs.get_head.outputs.sha }} in ${{ needs.get_head.outputs.repo }}](https://github.com/${{ github.repository }}/pull/${{ github.event.issue.number }}/files/${{ needs.get_head.outputs.sha }}), please approve it in CircleCI: https://app.circleci.com/pipelines/github/DACH-NY/canton-network-internal/${number}"
4049
4150
4251
trigger_cluster_test_hdm:
4352
if: github.event.issue.pull_request && contains(github.event.comment.body, '/hdm_test')
44-
needs: get_sha
53+
needs: get_head
4554
uses: ./.github/workflows/cluster_tests.yml
4655
secrets: inherit
4756
with:
4857
workflow: hdm_test
49-
sha: ${{ needs.get_sha.outputs.sha }}
58+
sha: ${{ needs.get_head.outputs.sha }}
59+
splice_url: ${{ needs.get_head.outputs.repo }}
5060

5161
result_hdm:
5262
runs-on: self-hosted-docker-tiny
5363
needs:
5464
- trigger_cluster_test_hdm
55-
- get_sha
65+
- get_head
5666
steps:
5767
- run: |
5868
number=$(echo '${{ needs.trigger_cluster_test_hdm.outputs.result }}' | jq -r '.number')
59-
echo "Deploy scratchnet HDM pipeline triggered for [PR as of ${{ needs.get_sha.outputs.sha }}](https://github.com/${{ github.repository }}/pull/${{ github.event.issue.number }}/files/${{ needs.get_sha.outputs.sha }}), please approve it in CircleCI: https://app.circleci.com/pipelines/github/DACH-NY/canton-network-internal/${number}"
69+
echo "Deploy scratchnet HDM pipeline triggered for [Commit ${{ needs.get_head.outputs.sha }} in ${{ needs.get_head.outputs.repo }}](https://github.com/${{ github.repository }}/pull/${{ github.event.issue.number }}/files/${{ needs.get_head.outputs.sha }}), please approve it in CircleCI: https://app.circleci.com/pipelines/github/DACH-NY/canton-network-internal/${number}"

LATEST_RELEASE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.21
1+
0.4.0

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.0
1+
0.4.1

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import com.digitalasset.canton.topology.admin.grpc.TopologyStoreId.Authorized
2828
import com.digitalasset.canton.topology.store.TimeQuery.HeadState
2929
import monocle.macros.syntax.lens.*
3030
import org.lfdecentralizedtrust.splice.console.ParticipantClientReference
31+
import com.digitalasset.canton.config.NonNegativeFiniteDuration
3132

3233
import scala.jdk.CollectionConverters.*
3334
import java.time.Instant
@@ -75,6 +76,14 @@ class AppUpgradeIntegrationTest
7576
// Makes the test a bit faster and easier to debug. See #11488
7677
ConfigTransforms.useDecentralizedSynchronizerSplitwell()(config)
7778
)
79+
.addConfigTransform((_, conf) =>
80+
ConfigTransforms.updateAllValidatorAppConfigs_(c =>
81+
// Reduce the cache TTL so package upgrades are picked up quickly.
82+
c.copy(scanClient =
83+
c.scanClient.setAmuletRulesCacheTimeToLive(NonNegativeFiniteDuration.ofSeconds(1))
84+
)
85+
)(conf)
86+
)
7887
.addConfigTransform((_, config) => {
7988
config
8089
.focus(_.validatorApps)
@@ -362,7 +371,7 @@ class AppUpgradeIntegrationTest
362371

363372
actAndCheck(
364373
"Bob taps after upgrade",
365-
eventually() {
374+
eventuallySucceeds() {
366375
bobWalletClient.tap(20)
367376
},
368377
)(

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/BFTManualStartIntegrationTest.scala renamed to apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/BftManualStartIntegrationTest.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import org.lfdecentralizedtrust.splice.integration.EnvironmentDefinition
77
import org.lfdecentralizedtrust.splice.integration.tests.SpliceTests.IntegrationTest
88
import org.lfdecentralizedtrust.splice.scan.config.BftSequencerConfig
99

10-
// TODO(#19679) consider renaming to BftManualStartIntegrationTest
11-
class BFTManualStartIntegrationTest extends IntegrationTest {
10+
class BftManualStartIntegrationTest extends IntegrationTest {
1211

1312
override def environmentDefinition: SpliceEnvironmentDefinition = {
1413
EnvironmentDefinition

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,7 @@ class SvFrontendIntegrationTest
372372

373373
val (_, (createdVoteRequestAction, createdVoteRequestRequester)) = actAndCheck(
374374
"sv1 operator can create a new vote request", {
375-
val dropDownAction = new Select(webDriver.findElement(By.id("display-actions")))
376-
dropDownAction.selectByValue(action)
375+
changeAction(action)
377376

378377
fillUpForm(webDriver)
379378

@@ -672,8 +671,7 @@ class SvFrontendIntegrationTest
672671

673672
actAndCheck(
674673
"sv1 operator can create a new vote request", {
675-
val dropDownAction = new Select(webDriver.findElement(By.id("display-actions")))
676-
dropDownAction.selectByValue("SRARC_GrantFeaturedAppRight")
674+
changeAction("SRARC_GrantFeaturedAppRight")
677675

678676
inside(find(id("set-application-provider"))) { case Some(element) =>
679677
element.underlying.sendKeys(requestProviderParty)
@@ -728,8 +726,7 @@ class SvFrontendIntegrationTest
728726
"sv1 operator can create a new vote request to revoke the featured app right", {
729727
go to s"http://localhost:$sv1UIPort/votes"
730728

731-
val dropDownAction = new Select(webDriver.findElement(By.id("display-actions")))
732-
dropDownAction.selectByValue("SRARC_RevokeFeaturedAppRight")
729+
changeAction("SRARC_RevokeFeaturedAppRight")
733730

734731
inside(find(id("set-application-rightcid"))) { case Some(element) =>
735732
element.underlying.sendKeys(rightCid)
@@ -775,9 +772,7 @@ class SvFrontendIntegrationTest
775772
// The `eventually` guards against `StaleElementReferenceException`s
776773
// eventually() must contain clickVoteRequestSubmitButtonOnceEnabled() to retry the whole process
777774
eventually() {
778-
find(id("display-actions")) should not be empty
779-
val dropDownAction = new Select(webDriver.findElement(By.id("display-actions")))
780-
dropDownAction.selectByValue("SRARC_SetConfig")
775+
changeAction("SRARC_SetConfig")
781776

782777
inside(find(id("checkbox-set-effective-at-threshold"))) { case Some(element) =>
783778
element.underlying.click()
@@ -1127,6 +1122,17 @@ class SvFrontendIntegrationTest
11271122
}
11281123
}
11291124

1125+
def changeAction(actionName: String)(implicit webDriver: WebDriverType) = {
1126+
find(id("display-actions")) should not be empty
1127+
val dropDownAction = new Select(webDriver.findElement(By.id("display-actions")))
1128+
dropDownAction.selectByValue(actionName)
1129+
1130+
if (actionName != "SRARC_OffboardSv") {
1131+
val proceedButton = webDriver.findElement(By.id("action-change-dialog-proceed"))
1132+
proceedButton.click()
1133+
}
1134+
}
1135+
11301136
def getVoteRequestsInProgressSize()(implicit webDriver: WebDriverType) = {
11311137
val tbodyInProgress = find(id("sv-voting-in-progress-table-body"))
11321138
tbodyInProgress

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ abstract class ValidatorPreflightIntegrationTestBase
211211
// we can't test a specific amulet price as the amulet price on a live network can change
212212
val rateR =
213213
raw"""^\s*(\d+(?:\.\d+)?)\s*${amuletNameAcronym}/USD\s*$$""".r
214-
inside(transaction.rate) { case rateR(rate) =>
214+
inside(transaction.rate.value) { case rateR(rate) =>
215215
BigDecimal(rate) should be > BigDecimal(0)
216216
transaction.usdAmount should beWithin(
217217
transaction.ccAmount / BigDecimal(rate) - smallAmount,

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/util/WalletFrontendTestUtil.scala

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ trait WalletFrontendTestUtil extends WalletTestUtil { self: FrontendTestCommon =
135135
.text,
136136
unit = "USD",
137137
),
138-
rate = transactionRow.childElement(className("tx-amount-rate")).text,
138+
rate = transactionRow.findChildElement(className("tx-amount-rate")).map(_.text),
139139
appRewardsUsed = parseAmountText(
140140
transactionRow
141141
.childElement(className("tx-row-cell-rewards"))
@@ -207,9 +207,15 @@ trait WalletFrontendTestUtil extends WalletTestUtil { self: FrontendTestCommon =
207207
expectedAmountUSD._1,
208208
expectedAmountUSD._2,
209209
)
210-
transaction.rate should matchText(
211-
s"${BigDecimal(1) / amuletPrice} ${spliceInstanceNames.amuletNameAcronym}/USD"
212-
)
210+
211+
transaction.rate match {
212+
case Some(rate) =>
213+
rate should matchText(
214+
s"${BigDecimal(1) / amuletPrice} ${spliceInstanceNames.amuletNameAcronym}/USD"
215+
)
216+
// Rate text should be missing iff the price is zero
217+
case None => amuletPrice shouldBe BigDecimal(0)
218+
}
213219
}
214220

215221
protected def createTransferOffer(
@@ -314,7 +320,7 @@ object WalletFrontendTestUtil {
314320
partyDescription: Option[String],
315321
ccAmount: BigDecimal,
316322
usdAmount: BigDecimal,
317-
rate: String,
323+
rate: Option[String],
318324
appRewardsUsed: BigDecimal,
319325
validatorRewardsUsed: BigDecimal,
320326
svRewardsUsed: BigDecimal,

0 commit comments

Comments
 (0)