From 149d53aeaeb5a74eec3efa3a896360454a1c8a0c Mon Sep 17 00:00:00 2001 From: Allain Magyar Date: Mon, 23 Oct 2023 20:05:40 -0300 Subject: [PATCH 1/2] ci: fix client generation Signed-off-by: Allain Magyar --- .github/workflows/release-clients.yml | 3 +++ prism-agent/client/generator/generate-clients.sh | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-clients.yml b/.github/workflows/release-clients.yml index a1c49fd0b5..ea7a8a3f7f 100644 --- a/.github/workflows/release-clients.yml +++ b/.github/workflows/release-clients.yml @@ -41,6 +41,9 @@ jobs: username: ${{ secrets.ATALA_GITHUB_ACTOR }} password: ${{ secrets.ATALA_GITHUB_TOKEN }} + - name: Setup yq - portable yaml processor + uses: mikefarah/yq@v4.34.2 + - name: Install generator dependencies working-directory: prism-agent/client/generator run: yarn install diff --git a/prism-agent/client/generator/generate-clients.sh b/prism-agent/client/generator/generate-clients.sh index 3c0aea1c1d..8c4795f265 100755 --- a/prism-agent/client/generator/generate-clients.sh +++ b/prism-agent/client/generator/generate-clients.sh @@ -1,13 +1,16 @@ #!/bin/bash set -e +# open api cli generator is not compatible with 3.1.0 +yq e -i '.openapi = "3.0.3"' ../../service/api/http/prism-agent-openapi-spec.yaml + # generate kotlin models yarn openapi-generator-cli generate \ -g kotlin \ -i ../../service/api/http/prism-agent-openapi-spec.yaml \ -o ../kotlin \ --ignore-file-override ../kotlin/.openapi-generator-ignore \ - --additional-properties=packageName=io.iohk.atala.prism,serializationLibrary=gson + --additional-properties=packageName=io.iohk.atala.prism,serializationLibrary=gson,enumPropertyNaming=UPPERCASE # generate typescript models yarn openapi-generator-cli generate \ From 8b7682cbb56dce77f123b0504e2f9565edd2643c Mon Sep 17 00:00:00 2001 From: Yurii Shynbuiev Date: Tue, 24 Oct 2023 16:32:27 +0700 Subject: [PATCH 2/2] fix(pollux): add asc ordering to the VerificationPolicy constraints ATL-6040 Signed-off-by: Yurii Shynbuiev --- .../iohk/atala/pollux/sql/model/db/VerificationPolicy.scala | 4 +++- .../pollux/sql/VerificationPolicySqlIntegrationSpec.scala | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pollux/lib/sql-doobie/src/main/scala/io/iohk/atala/pollux/sql/model/db/VerificationPolicy.scala b/pollux/lib/sql-doobie/src/main/scala/io/iohk/atala/pollux/sql/model/db/VerificationPolicy.scala index b64bd515b1..fbc8120a2c 100644 --- a/pollux/lib/sql-doobie/src/main/scala/io/iohk/atala/pollux/sql/model/db/VerificationPolicy.scala +++ b/pollux/lib/sql-doobie/src/main/scala/io/iohk/atala/pollux/sql/model/db/VerificationPolicy.scala @@ -75,7 +75,9 @@ object VerificationPolicySql extends DoobieContext.Postgres(SnakeCase) { def getVerificationPolicyConstrains(fk_ids: Seq[UUID]) = run( quote( - query[VerificationPolicyConstraint].filter(vpc => liftQuery(fk_ids).contains(vpc.fk_id)) + query[VerificationPolicyConstraint] + .filter(vpc => liftQuery(fk_ids).contains(vpc.fk_id)) + .sortBy(_.index)(Ord.asc) ) ) diff --git a/pollux/lib/sql-doobie/src/test/scala/io/iohk/atala/pollux/sql/VerificationPolicySqlIntegrationSpec.scala b/pollux/lib/sql-doobie/src/test/scala/io/iohk/atala/pollux/sql/VerificationPolicySqlIntegrationSpec.scala index fb75706797..665815dc2e 100644 --- a/pollux/lib/sql-doobie/src/test/scala/io/iohk/atala/pollux/sql/VerificationPolicySqlIntegrationSpec.scala +++ b/pollux/lib/sql-doobie/src/test/scala/io/iohk/atala/pollux/sql/VerificationPolicySqlIntegrationSpec.scala @@ -286,7 +286,7 @@ object VerificationPolicySqlIntegrationSpec extends ZIOSpecDefault, PostgresTest name <- name description <- description constraints <- Gen - .setOfBounded(min = 1, max = 10)(verificationPolicyConstraint) + .setOfBounded(min = 2, max = 10)(verificationPolicyConstraint) .map(_.toVector) } yield VerificationPolicy.make( name = name,