From e5b63cd84141a0b8c9cbf86dfb6b891cfbb3804d Mon Sep 17 00:00:00 2001 From: Adam Nichols Date: Thu, 7 Dec 2023 19:39:52 -0500 Subject: [PATCH 01/28] Rename suggested by Ivan --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index ead29c29d4f..3a051588047 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -113,7 +113,7 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac }.build val consumerPactBuilder: ConsumerPactBuilder = ConsumerPactBuilder - .consumer("cromwell-consumer") + .consumer("cromwell") val pactProvider: PactDslWithProvider = consumerPactBuilder .hasPactWith("drshub-provider") From 22ee9677eec756cf845f1edc81d6470a4ce7447b Mon Sep 17 00:00:00 2001 From: Adam Nichols Date: Thu, 7 Dec 2023 19:52:02 -0500 Subject: [PATCH 02/28] Interrogate --- .github/workflows/consumer_contract_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/consumer_contract_tests.yml b/.github/workflows/consumer_contract_tests.yml index 0970e45e863..197d3b52162 100644 --- a/.github/workflows/consumer_contract_tests.yml +++ b/.github/workflows/consumer_contract_tests.yml @@ -109,6 +109,7 @@ jobs: id: encode-pact run: | cd pact4s + ls -la NON_BREAKING_B64=$(cat target/pacts/cromwell-consumer-drshub-provider.json | base64 -w 0) echo "pact-b64=${NON_BREAKING_B64}" >> $GITHUB_OUTPUT From 3ee27fb298ab9292bd20a854c55c78d698407624 Mon Sep 17 00:00:00 2001 From: Adam Nichols Date: Thu, 7 Dec 2023 19:56:16 -0500 Subject: [PATCH 03/28] Test --- .github/workflows/consumer_contract_tests.yml | 3 ++- pact4s/README.md | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/consumer_contract_tests.yml b/.github/workflows/consumer_contract_tests.yml index 197d3b52162..4932b052008 100644 --- a/.github/workflows/consumer_contract_tests.yml +++ b/.github/workflows/consumer_contract_tests.yml @@ -110,7 +110,8 @@ jobs: run: | cd pact4s ls -la - NON_BREAKING_B64=$(cat target/pacts/cromwell-consumer-drshub-provider.json | base64 -w 0) + ls -la target/ + NON_BREAKING_B64=$(cat target/pacts/cromwell-drshub-provider.json | base64 -w 0) echo "pact-b64=${NON_BREAKING_B64}" >> $GITHUB_OUTPUT # Prevent untrusted sources from using PRs to publish contracts diff --git a/pact4s/README.md b/pact4s/README.md index d33447f7356..2d08d2301db 100644 --- a/pact4s/README.md +++ b/pact4s/README.md @@ -46,6 +46,5 @@ docker run --rm -v $PWD:/working \ ``` The generated contracts can be found in the `./target/pacts` folder -- `cromwell-consumer-drshub-provider.json` -- `cromwell-consumer-fake-provider.json` - +- `cromwell-drshub-provider.json` +- `cromwell-fake-provider.json` From fc3495804d1b9d6f43841899d92c8fbce415a27e Mon Sep 17 00:00:00 2001 From: Adam Nichols Date: Thu, 7 Dec 2023 22:50:31 -0500 Subject: [PATCH 04/28] Fix version? --- .github/workflows/consumer_contract_tests.yml | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/consumer_contract_tests.yml b/.github/workflows/consumer_contract_tests.yml index 4932b052008..d474c63a9e8 100644 --- a/.github/workflows/consumer_contract_tests.yml +++ b/.github/workflows/consumer_contract_tests.yml @@ -52,6 +52,24 @@ jobs: steps: - uses: actions/checkout@v3 + # Construct a version string like `87-9c6c439`. Copied from `chart_update_on_merge.yml`. + - name: Find Cromwell short SHA + run: | + set -e + cd cromwell + echo "CROMWELL_SHORT_SHA=`git rev-parse --short $GITHUB_SHA`" >> $GITHUB_ENV + - name: Find Cromwell release number + run: | + set -e + previous_version=$(curl -X GET https://api.github.com/repos/broadinstitute/cromwell/releases/latest | jq .tag_name | xargs) + if ! [[ "${previous_version}" =~ ^[0-9][0-9]+$ ]]; then + exit 1 + fi + echo "CROMWELL_NUMBER=$((previous_version + 1))" >> $GITHUB_ENV + - name: Save complete image ID + run: | + echo "CROMWELL_VERSION=`echo "$CROMWELL_NUMBER-$CROMWELL_SHORT_SHA"`" >> $GITHUB_ENV + - name: Extract branch id: extract-branch run: | @@ -72,7 +90,7 @@ jobs: echo "CURRENT_SHA=$GITHUB_SHA" >> $GITHUB_ENV echo "repo-branch=${GITHUB_REF/refs\/heads\//""}" >> $GITHUB_OUTPUT - echo "repo-version=${GITHUB_SHA}" >> $GITHUB_OUTPUT + echo "repo-version=${CROMWELL_VERSION}" >> $GITHUB_OUTPUT echo "fork=${FORK}" >> $GITHUB_OUTPUT - name: Is PR triggered by forked repo? @@ -88,7 +106,7 @@ jobs: echo "repo-version=${{ steps.extract-branch.outputs.repo-version }}" echo "fork=${{ steps.extract-branch.outputs.fork }}" - cromwell-consumer-contract-tests: + cromwell-contract-tests: runs-on: ubuntu-latest needs: [init-github-context] outputs: @@ -109,8 +127,6 @@ jobs: id: encode-pact run: | cd pact4s - ls -la - ls -la target/ NON_BREAKING_B64=$(cat target/pacts/cromwell-drshub-provider.json | base64 -w 0) echo "pact-b64=${NON_BREAKING_B64}" >> $GITHUB_OUTPUT @@ -119,7 +135,7 @@ jobs: publish-contracts: runs-on: ubuntu-latest if: ${{ needs.init-github-context.outputs.fork == 'false' || needs.init-github-context.outputs.fork == ''}} - needs: [init-github-context, cromwell-consumer-contract-tests] + needs: [init-github-context, cromwell-contract-tests] steps: - name: Dispatch to terra-github-workflows uses: broadinstitute/workflow-dispatch@v3 @@ -128,7 +144,7 @@ jobs: repo: broadinstitute/terra-github-workflows ref: refs/heads/main token: ${{ secrets.BROADBOT_GITHUB_TOKEN }} # github token for access to kick off a job in the private repo - inputs: '{ "pact-b64": "${{ needs.cromwell-consumer-contract-tests.outputs.pact-b64 }}", "repo-owner": "${{ github.repository_owner }}", "repo-name": "${{ github.event.repository.name }}", "repo-branch": "${{ needs.init-github-context.outputs.repo-branch }}" }' + inputs: '{ "pact-b64": "${{ needs.cromwell-contract-tests.outputs.pact-b64 }}", "repo-owner": "${{ github.repository_owner }}", "repo-name": "${{ github.event.repository.name }}", "repo-branch": "${{ needs.init-github-context.outputs.repo-branch }}" }' can-i-deploy: runs-on: ubuntu-latest @@ -142,4 +158,4 @@ jobs: repo: broadinstitute/terra-github-workflows ref: refs/heads/main token: ${{ secrets.BROADBOT_GITHUB_TOKEN }} # github token for access to kick off a job in the private repo - inputs: '{ "pacticipant": "cromwell-consumer", "version": "${{ needs.init-github-context.outputs.repo-version }}" }' + inputs: '{ "pacticipant": "cromwell", "version": "${{ needs.init-github-context.outputs.repo-version }}" }' From 722041c1d4f1d80acd044cd95d968a5519286eef Mon Sep 17 00:00:00 2001 From: Adam Nichols Date: Thu, 7 Dec 2023 22:52:18 -0500 Subject: [PATCH 05/28] Fix --- .github/workflows/consumer_contract_tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/consumer_contract_tests.yml b/.github/workflows/consumer_contract_tests.yml index d474c63a9e8..6b03387d297 100644 --- a/.github/workflows/consumer_contract_tests.yml +++ b/.github/workflows/consumer_contract_tests.yml @@ -56,7 +56,6 @@ jobs: - name: Find Cromwell short SHA run: | set -e - cd cromwell echo "CROMWELL_SHORT_SHA=`git rev-parse --short $GITHUB_SHA`" >> $GITHUB_ENV - name: Find Cromwell release number run: | From faf943c3d503924e5ea8074074fb8e60ac7cb249 Mon Sep 17 00:00:00 2001 From: Adam Nichols Date: Fri, 8 Dec 2023 12:31:46 -0500 Subject: [PATCH 06/28] Comment commit --- .github/workflows/consumer_contract_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/consumer_contract_tests.yml b/.github/workflows/consumer_contract_tests.yml index 6b03387d297..38f1ff3e1eb 100644 --- a/.github/workflows/consumer_contract_tests.yml +++ b/.github/workflows/consumer_contract_tests.yml @@ -52,7 +52,7 @@ jobs: steps: - uses: actions/checkout@v3 - # Construct a version string like `87-9c6c439`. Copied from `chart_update_on_merge.yml`. + # Construct a version string like `87-9c6c439`. Adapted from `chart_update_on_merge.yml`. - name: Find Cromwell short SHA run: | set -e From 4eee177a6bfab1869f5cebc71167227281545397 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 8 Dec 2023 12:48:35 -0500 Subject: [PATCH 07/28] Try noop change --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index 3a051588047..dd5bb334cd8 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -131,7 +131,7 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac "fileSize" -> filesize.toString, "timeCreated" -> timeCreated ), - uponReceiving = "Request to resolve drs url", + uponReceiving = "Request to resolve drs url noop", method = "POST", path = "/api/v4/drs/resolve", requestHeaders = Seq("Content-type" -> "application/json"), From 0c3f58b75b97d2c2e1481de09641880447817439 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 8 Dec 2023 13:06:53 -0500 Subject: [PATCH 08/28] Updated workflow-dispatch to v4.0.0 --- .github/workflows/consumer_contract_tests.yml | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/consumer_contract_tests.yml b/.github/workflows/consumer_contract_tests.yml index 38f1ff3e1eb..e7594b4d394 100644 --- a/.github/workflows/consumer_contract_tests.yml +++ b/.github/workflows/consumer_contract_tests.yml @@ -41,6 +41,10 @@ on: branches: - develop +env: + PUBLISH_CONTRACTS_RUN_NAME: 'publish-contracts-${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt }}' + CAN_I_DEPLOY_RUN_NAME: 'can-i-deploy-${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt }}' + jobs: init-github-context: runs-on: ubuntu-latest @@ -87,7 +91,7 @@ jobs: fi echo "CURRENT_BRANCH=${GITHUB_REF/refs\/heads\//""}" >> $GITHUB_ENV echo "CURRENT_SHA=$GITHUB_SHA" >> $GITHUB_ENV - + echo "repo-branch=${GITHUB_REF/refs\/heads\//""}" >> $GITHUB_OUTPUT echo "repo-version=${CROMWELL_VERSION}" >> $GITHUB_OUTPUT echo "fork=${FORK}" >> $GITHUB_OUTPUT @@ -137,13 +141,20 @@ jobs: needs: [init-github-context, cromwell-contract-tests] steps: - name: Dispatch to terra-github-workflows - uses: broadinstitute/workflow-dispatch@v3 + uses: broadinstitute/workflow-dispatch@v4.0.0 with: + run-name: "${{ env.PUBLISH_CONTRACTS_RUN_NAME }}" workflow: .github/workflows/publish-contracts.yaml repo: broadinstitute/terra-github-workflows ref: refs/heads/main token: ${{ secrets.BROADBOT_GITHUB_TOKEN }} # github token for access to kick off a job in the private repo - inputs: '{ "pact-b64": "${{ needs.cromwell-contract-tests.outputs.pact-b64 }}", "repo-owner": "${{ github.repository_owner }}", "repo-name": "${{ github.event.repository.name }}", "repo-branch": "${{ needs.init-github-context.outputs.repo-branch }}" }' + inputs: '{ + "run-name": "${{ env.PUBLISH_CONTRACTS_RUN_NAME }}", + "pact-b64": "${{ needs.cromwell-contract-tests.outputs.pact-b64 }}", + "repo-owner": "${{ github.repository_owner }}", + "repo-name": "${{ github.event.repository.name }}", + "repo-branch": "${{ needs.init-github-context.outputs.repo-branch }}" + }' can-i-deploy: runs-on: ubuntu-latest @@ -151,10 +162,15 @@ jobs: needs: [ init-github-context, publish-contracts ] steps: - name: Dispatch to terra-github-workflows - uses: broadinstitute/workflow-dispatch@v3 + uses: broadinstitute/workflow-dispatch@v4.0.0 with: + run-name: "${{ env.CAN_I_DEPLOY_RUN_NAME }}" workflow: .github/workflows/can-i-deploy.yaml repo: broadinstitute/terra-github-workflows ref: refs/heads/main token: ${{ secrets.BROADBOT_GITHUB_TOKEN }} # github token for access to kick off a job in the private repo - inputs: '{ "pacticipant": "cromwell", "version": "${{ needs.init-github-context.outputs.repo-version }}" }' + inputs: '{ + "run-name": "${{ env.CAN_I_DEPLOY_RUN_NAME }}", + "pacticipant": "cromwell", + "version": "${{ needs.init-github-context.outputs.repo-version }}" + }' From 1cc35cd40478bb0e905bac1df46a97db8183e66a Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 8 Dec 2023 22:41:53 -0500 Subject: [PATCH 09/28] Fix request header --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index dd5bb334cd8..33f94b8ff7a 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -131,13 +131,13 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac "fileSize" -> filesize.toString, "timeCreated" -> timeCreated ), - uponReceiving = "Request to resolve drs url noop", + uponReceiving = "Request to resolve drs url", method = "POST", path = "/api/v4/drs/resolve", - requestHeaders = Seq("Content-type" -> "application/json"), + requestHeaders = Seq("Accept" -> "application/json"), requestBody = resourceRequestDsl, status = 200, - responseHeaders = Seq(), + responseHeaders = Seq("Content-type" -> "application/json"), responsBody = resourceMetadataResponseDsl ) From 7e63e47005248faf5072a00a2b033904243aa807 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 8 Dec 2023 22:48:49 -0500 Subject: [PATCH 10/28] Fix headers --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index 33f94b8ff7a..34a5ce3e4ba 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -134,10 +134,10 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac uponReceiving = "Request to resolve drs url", method = "POST", path = "/api/v4/drs/resolve", - requestHeaders = Seq("Accept" -> "application/json"), + requestHeaders = Seq(), requestBody = resourceRequestDsl, status = 200, - responseHeaders = Seq("Content-type" -> "application/json"), + responseHeaders = Seq("Content-type" -> "application/json; charset=UTF-8"), responsBody = resourceMetadataResponseDsl ) From f2dbe9b62d07f8db3886d0db3330af8540832ed4 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 8 Dec 2023 23:09:01 -0500 Subject: [PATCH 11/28] Revert --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index 34a5ce3e4ba..c88a5f17ae1 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -134,10 +134,10 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac uponReceiving = "Request to resolve drs url", method = "POST", path = "/api/v4/drs/resolve", - requestHeaders = Seq(), + requestHeaders = Seq("Content-Type" -> "application/json; charset=utf-8"), requestBody = resourceRequestDsl, status = 200, - responseHeaders = Seq("Content-type" -> "application/json; charset=UTF-8"), + responseHeaders = Seq(), responsBody = resourceMetadataResponseDsl ) From a83cb5212d5bcf845da1a0c9e80cb86847d80c81 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 8 Dec 2023 23:16:38 -0500 Subject: [PATCH 12/28] revert --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index c88a5f17ae1..3a051588047 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -134,7 +134,7 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac uponReceiving = "Request to resolve drs url", method = "POST", path = "/api/v4/drs/resolve", - requestHeaders = Seq("Content-Type" -> "application/json; charset=utf-8"), + requestHeaders = Seq("Content-type" -> "application/json"), requestBody = resourceRequestDsl, status = 200, responseHeaders = Seq(), From 52a55b7b47fcf7ff792b94657f46babe2548fd6b Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 8 Dec 2023 23:46:18 -0500 Subject: [PATCH 13/28] testing --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index 3a051588047..104e32e7931 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -134,7 +134,7 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac uponReceiving = "Request to resolve drs url", method = "POST", path = "/api/v4/drs/resolve", - requestHeaders = Seq("Content-type" -> "application/json"), + requestHeaders = Seq("Content-Type" -> "application/json"), requestBody = resourceRequestDsl, status = 200, responseHeaders = Seq(), From 993cdcc9f3bf48d88348f61b558639f85ed5b225 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 9 Dec 2023 12:16:11 -0500 Subject: [PATCH 14/28] Update drshub naming --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index 104e32e7931..5fae4a4bfc5 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -116,7 +116,7 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac .consumer("cromwell") val pactProvider: PactDslWithProvider = consumerPactBuilder - .hasPactWith("drshub-provider") + .hasPactWith("drshub") var pactDslResponse: PactDslResponse = buildInteraction( pactProvider, From 43f63b506c49a0cc3c19fad9856bd8149bab5921 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 9 Dec 2023 12:25:55 -0500 Subject: [PATCH 15/28] Update drshub naming --- .github/workflows/consumer_contract_tests.yml | 2 +- pact4s/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/consumer_contract_tests.yml b/.github/workflows/consumer_contract_tests.yml index e7594b4d394..54446ae7ffc 100644 --- a/.github/workflows/consumer_contract_tests.yml +++ b/.github/workflows/consumer_contract_tests.yml @@ -130,7 +130,7 @@ jobs: id: encode-pact run: | cd pact4s - NON_BREAKING_B64=$(cat target/pacts/cromwell-drshub-provider.json | base64 -w 0) + NON_BREAKING_B64=$(cat target/pacts/cromwell-drshub.json | base64 -w 0) echo "pact-b64=${NON_BREAKING_B64}" >> $GITHUB_OUTPUT # Prevent untrusted sources from using PRs to publish contracts diff --git a/pact4s/README.md b/pact4s/README.md index 2d08d2301db..fd3245a877d 100644 --- a/pact4s/README.md +++ b/pact4s/README.md @@ -46,5 +46,5 @@ docker run --rm -v $PWD:/working \ ``` The generated contracts can be found in the `./target/pacts` folder -- `cromwell-drshub-provider.json` -- `cromwell-fake-provider.json` +- `cromwell-drshub.json` + From 8d452656f99121bf3610111691f87e7f1ea9e126 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 9 Dec 2023 12:37:01 -0500 Subject: [PATCH 16/28] Enabled drshub for contract tests --- .github/workflows/consumer_contract_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/consumer_contract_tests.yml b/.github/workflows/consumer_contract_tests.yml index 54446ae7ffc..34d82da10a3 100644 --- a/.github/workflows/consumer_contract_tests.yml +++ b/.github/workflows/consumer_contract_tests.yml @@ -29,7 +29,7 @@ name: Consumer contract tests # Consumer kicks off can-i-deploy on process to determine if changes can be promoted and used for deployment. # # NOTE: The publish-contracts workflow will use the latest commit of the branch that triggers this workflow to publish the unique consumer contract version to Pact Broker. - +# on: pull_request: paths-ignore: From dfb3214d0b9434555265d62122256e6876a7c7bd Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 9 Dec 2023 12:49:25 -0500 Subject: [PATCH 17/28] Test consumer --- .github/workflows/consumer_contract_tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/consumer_contract_tests.yml b/.github/workflows/consumer_contract_tests.yml index 34d82da10a3..35a5d39e0ec 100644 --- a/.github/workflows/consumer_contract_tests.yml +++ b/.github/workflows/consumer_contract_tests.yml @@ -29,7 +29,6 @@ name: Consumer contract tests # Consumer kicks off can-i-deploy on process to determine if changes can be promoted and used for deployment. # # NOTE: The publish-contracts workflow will use the latest commit of the branch that triggers this workflow to publish the unique consumer contract version to Pact Broker. -# on: pull_request: paths-ignore: From dce8166ef389c185d0772b0e147376deea5a1748 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 9 Dec 2023 15:04:34 -0500 Subject: [PATCH 18/28] test webhook --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index 5fae4a4bfc5..b83fda4eb85 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -131,7 +131,7 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac "fileSize" -> filesize.toString, "timeCreated" -> timeCreated ), - uponReceiving = "Request to resolve drs url", + uponReceiving = "Request to resolve drs url noop", method = "POST", path = "/api/v4/drs/resolve", requestHeaders = Seq("Content-Type" -> "application/json"), From d23c2d2b262013749ecebb7f8436da037ae560a8 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 9 Dec 2023 15:55:15 -0500 Subject: [PATCH 19/28] test webhook --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index b83fda4eb85..ea7c6a5d618 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -131,7 +131,7 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac "fileSize" -> filesize.toString, "timeCreated" -> timeCreated ), - uponReceiving = "Request to resolve drs url noop", + uponReceiving = "Request to resolve drs url noop 1", method = "POST", path = "/api/v4/drs/resolve", requestHeaders = Seq("Content-Type" -> "application/json"), From 743ba7b13f7427588617d118efc1e74b8d3146d5 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 9 Dec 2023 16:15:10 -0500 Subject: [PATCH 20/28] Use CROMWELL_VERSION to publish pacts for now. This needs to change to semver later. --- .github/workflows/consumer_contract_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/consumer_contract_tests.yml b/.github/workflows/consumer_contract_tests.yml index 35a5d39e0ec..79ef0e1777a 100644 --- a/.github/workflows/consumer_contract_tests.yml +++ b/.github/workflows/consumer_contract_tests.yml @@ -152,7 +152,8 @@ jobs: "pact-b64": "${{ needs.cromwell-contract-tests.outputs.pact-b64 }}", "repo-owner": "${{ github.repository_owner }}", "repo-name": "${{ github.event.repository.name }}", - "repo-branch": "${{ needs.init-github-context.outputs.repo-branch }}" + "repo-branch": "${{ needs.init-github-context.outputs.repo-branch }}", + "release-tag": "${{ needs.init-github-context.outputs.repo-version }}g" }' can-i-deploy: From 394105ffaa43fd86bb5fb6e7dc157bf8c1929080 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 9 Dec 2023 16:23:50 -0500 Subject: [PATCH 21/28] Force verification --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index ea7c6a5d618..ae177cb7c66 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -131,7 +131,7 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac "fileSize" -> filesize.toString, "timeCreated" -> timeCreated ), - uponReceiving = "Request to resolve drs url noop 1", + uponReceiving = "Request to resolve drs url noop 2", method = "POST", path = "/api/v4/drs/resolve", requestHeaders = Seq("Content-Type" -> "application/json"), From 2f6c291c75b4b84f2a9eda1fb8febe69dfb60062 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 9 Dec 2023 16:42:36 -0500 Subject: [PATCH 22/28] typo --- .github/workflows/consumer_contract_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/consumer_contract_tests.yml b/.github/workflows/consumer_contract_tests.yml index 79ef0e1777a..79f5517b41e 100644 --- a/.github/workflows/consumer_contract_tests.yml +++ b/.github/workflows/consumer_contract_tests.yml @@ -153,7 +153,7 @@ jobs: "repo-owner": "${{ github.repository_owner }}", "repo-name": "${{ github.event.repository.name }}", "repo-branch": "${{ needs.init-github-context.outputs.repo-branch }}", - "release-tag": "${{ needs.init-github-context.outputs.repo-version }}g" + "release-tag": "${{ needs.init-github-context.outputs.repo-version }}" }' can-i-deploy: From 4341eb09bbfe9e7ab1c7a934e39c1977918bd017 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 9 Dec 2023 16:51:43 -0500 Subject: [PATCH 23/28] Clean up --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index ae177cb7c66..5fae4a4bfc5 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -131,7 +131,7 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac "fileSize" -> filesize.toString, "timeCreated" -> timeCreated ), - uponReceiving = "Request to resolve drs url noop 2", + uponReceiving = "Request to resolve drs url", method = "POST", path = "/api/v4/drs/resolve", requestHeaders = Seq("Content-Type" -> "application/json"), From cf5129bbded40c11c6d90d7cd6087b0c42694f33 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sun, 10 Dec 2023 14:15:14 -0500 Subject: [PATCH 24/28] Bump pact4s from 0.9.0 -> 0.10.0 --- project/Dependencies.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 2bc4ec34f00..8e2391f052c 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -99,7 +99,7 @@ object Dependencies { private val mysqlV = "8.0.28" private val nettyV = "4.1.72.Final" private val owlApiV = "5.1.19" - private val pact4sV = "0.9.0" + private val pact4sV = "0.10.0" private val postgresV = "42.4.1" private val pprintV = "0.7.3" private val rdf4jV = "3.7.1" @@ -628,7 +628,7 @@ object Dependencies { "org.lz4" % "lz4-java" % lz4JavaV ) val scalaTest = "org.scalatest" %% "scalatest" % scalatestV - + val testDependencies: List[ModuleID] = List( "org.scalatest" %% "scalatest" % scalatestV, // Use mockito Java DSL directly instead of the numerous and often hard to keep updated Scala DSLs. From 61721ec7fafa93fb96a70af872ea021b4fd2f054 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sun, 10 Dec 2023 14:50:24 -0500 Subject: [PATCH 25/28] Try Content-type --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index 5fae4a4bfc5..1c969d71436 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -134,7 +134,7 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac uponReceiving = "Request to resolve drs url", method = "POST", path = "/api/v4/drs/resolve", - requestHeaders = Seq("Content-Type" -> "application/json"), + requestHeaders = Seq("Content-type" -> "application/json"), requestBody = resourceRequestDsl, status = 200, responseHeaders = Seq(), From d9b295ec91a6b87680b8de3c21d79db476a98eb9 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sun, 10 Dec 2023 15:00:29 -0500 Subject: [PATCH 26/28] Revert to Content-Type --- .github/workflows/consumer_contract_tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/consumer_contract_tests.yml b/.github/workflows/consumer_contract_tests.yml index 79f5517b41e..cce91ff3e2e 100644 --- a/.github/workflows/consumer_contract_tests.yml +++ b/.github/workflows/consumer_contract_tests.yml @@ -31,9 +31,13 @@ name: Consumer contract tests # NOTE: The publish-contracts workflow will use the latest commit of the branch that triggers this workflow to publish the unique consumer contract version to Pact Broker. on: pull_request: + branches: + - develop paths-ignore: - 'README.md' push: + branches: + - develop paths-ignore: - 'README.md' merge_group: From 01ec364e9595e0403c40885043c7d8d210787a3f Mon Sep 17 00:00:00 2001 From: Ivan Date: Sun, 10 Dec 2023 15:10:25 -0500 Subject: [PATCH 27/28] Revert to 0.9.0 --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 8e2391f052c..cdb0ccb412c 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -99,7 +99,7 @@ object Dependencies { private val mysqlV = "8.0.28" private val nettyV = "4.1.72.Final" private val owlApiV = "5.1.19" - private val pact4sV = "0.10.0" + private val pact4sV = "0.9.0" private val postgresV = "42.4.1" private val pprintV = "0.7.3" private val rdf4jV = "3.7.1" From 55e6b40a7165b46d3a9f96c543bfa56615b5c785 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sun, 10 Dec 2023 15:16:06 -0500 Subject: [PATCH 28/28] Content-type -> Content-Type --- .../dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala index 1c969d71436..5fae4a4bfc5 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/cromwell/consumer/DrsHubClientSpec.scala @@ -134,7 +134,7 @@ class DrsHubClientSpec extends AnyFlatSpec with Matchers with RequestResponsePac uponReceiving = "Request to resolve drs url", method = "POST", path = "/api/v4/drs/resolve", - requestHeaders = Seq("Content-type" -> "application/json"), + requestHeaders = Seq("Content-Type" -> "application/json"), requestBody = resourceRequestDsl, status = 200, responseHeaders = Seq(),