From 7845408fa21f254ab728ae2f80b8ce9cc743ee17 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Mon, 19 Aug 2024 10:02:37 +0100 Subject: [PATCH 01/59] run auto formating script with github action --- .github/workflows/autoformat.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/autoformat.yml diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml new file mode 100644 index 000000000..88736931c --- /dev/null +++ b/.github/workflows/autoformat.yml @@ -0,0 +1,12 @@ +# Runs auto-formatting script on push to any branch except main +name: "Run auto formatting" + +on: push + +jobs: + autoformat: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + id: autoformat + - run: bash ./builds/run_formatting.sh From bd370010c8b5fec24f22de89eb49882ddbca00b7 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Mon, 19 Aug 2024 10:13:05 +0100 Subject: [PATCH 02/59] login to ecr --- builds/run_sbt_task_in_docker.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 896c811dd..6402cd123 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -47,6 +47,8 @@ else HOST_COURSIER_CACHE=~/$LINUX_COURSIER_CACHE fi +aws ecr get-login-password | docker login --username AWS --password-stdin $ECR_REGISTRY + docker run --tty --rm \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ From c8e13770a427e3c6bafd6049bec5d4979908328b Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 20 Aug 2024 15:30:48 +0100 Subject: [PATCH 03/59] assume ecr read role --- .github/workflows/autoformat.yml | 13 ++++++++++++- builds/run_sbt_task_in_docker.sh | 2 -- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 88736931c..82188fb31 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -1,12 +1,23 @@ # Runs auto-formatting script on push to any branch except main name: "Run auto formatting" +permissions: + id-token: write + contents: read + on: push jobs: autoformat: + name: autoformat runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - id: autoformat + - uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: eu-west-1 + role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} + - uses: aws-actions/amazon-ecr-login@v2 + env: + AWS_REGION: eu-west-1 - run: bash ./builds/run_formatting.sh diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 6402cd123..896c811dd 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -47,8 +47,6 @@ else HOST_COURSIER_CACHE=~/$LINUX_COURSIER_CACHE fi -aws ecr get-login-password | docker login --username AWS --password-stdin $ECR_REGISTRY - docker run --tty --rm \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ From db988e6d833609dcd1cdad99f9f84d7804f48c3b Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 20 Aug 2024 15:56:40 +0100 Subject: [PATCH 04/59] try with configure-aws-credentials@main --- .github/workflows/autoformat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 82188fb31..e6e9363f6 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: aws-actions/configure-aws-credentials@v4 + - uses: aws-actions/configure-aws-credentials@main with: aws-region: eu-west-1 role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} From 82de8b5a0c5d29cb930f04435a353a97eaaad7a3 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 20 Aug 2024 15:57:48 +0100 Subject: [PATCH 05/59] add with audience --- .github/workflows/autoformat.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index e6e9363f6..7218a29ae 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -16,6 +16,7 @@ jobs: - uses: aws-actions/configure-aws-credentials@main with: aws-region: eu-west-1 + audience: sts.amazonaws.com role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} - uses: aws-actions/amazon-ecr-login@v2 env: From 4ab66028d8b8c67c36937c31df6433d99305f17e Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 20 Aug 2024 16:05:13 +0100 Subject: [PATCH 06/59] debug credentials --- .github/workflows/autoformat.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 7218a29ae..514dfaabb 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -12,11 +12,13 @@ jobs: name: autoformat runs-on: ubuntu-latest steps: + - name: Debug AWS Credentials + run: | + echo "GHA ROLE ARN: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }}" - uses: actions/checkout@v4 - uses: aws-actions/configure-aws-credentials@main with: aws-region: eu-west-1 - audience: sts.amazonaws.com role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} - uses: aws-actions/amazon-ecr-login@v2 env: From fcd018ac68594944a57b08d9928965b6d2a2c02f Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 20 Aug 2024 16:20:08 +0100 Subject: [PATCH 07/59] mmmkay --- .github/workflows/autoformat.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 514dfaabb..759b376bc 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -12,13 +12,11 @@ jobs: name: autoformat runs-on: ubuntu-latest steps: - - name: Debug AWS Credentials - run: | - echo "GHA ROLE ARN: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }}" - uses: actions/checkout@v4 - - uses: aws-actions/configure-aws-credentials@main + - uses: aws-actions/configure-aws-credentials@v4 with: aws-region: eu-west-1 + audience: sts.amazonaws.com role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} - uses: aws-actions/amazon-ecr-login@v2 env: From 7bf6f827b6af0d472b2392111aa5b3c9e638da9e Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 20 Aug 2024 16:26:25 +0100 Subject: [PATCH 08/59] master --- .github/workflows/autoformat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 759b376bc..6b99a580d 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: aws-actions/configure-aws-credentials@v4 + - uses: aws-actions/configure-aws-credentials@master with: aws-region: eu-west-1 audience: sts.amazonaws.com From 74cfa0437543849f611758ba6b2db34444d9ca89 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 20 Aug 2024 17:02:18 +0100 Subject: [PATCH 09/59] this works in wc.org --- .github/workflows/autoformat.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 6b99a580d..91eed0887 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -1,4 +1,4 @@ -# Runs auto-formatting script on push to any branch except main +# Runs auto-formatting script on push to any branch name: "Run auto formatting" permissions: @@ -13,10 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: aws-actions/configure-aws-credentials@master + - uses: aws-actions/configure-aws-credentials@v4 with: aws-region: eu-west-1 - audience: sts.amazonaws.com role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} - uses: aws-actions/amazon-ecr-login@v2 env: From f8b352da6d85d49e8c715ec6392177d033e7ad82 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 21 Aug 2024 09:22:17 +0100 Subject: [PATCH 10/59] do we have a secret --- .github/workflows/autoformat.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 91eed0887..cfcd7cc50 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -12,6 +12,9 @@ jobs: name: autoformat runs-on: ubuntu-latest steps: + - name: Debug AWS Credentials + run: | + echo "GHA ROLE ARN: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }}" - uses: actions/checkout@v4 - uses: aws-actions/configure-aws-credentials@v4 with: From d3941f3a57c50990326de9db2b80c7ae2078b9bd Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 21 Aug 2024 09:27:26 +0100 Subject: [PATCH 11/59] remove --- .github/workflows/autoformat.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index cfcd7cc50..91eed0887 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -12,9 +12,6 @@ jobs: name: autoformat runs-on: ubuntu-latest steps: - - name: Debug AWS Credentials - run: | - echo "GHA ROLE ARN: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }}" - uses: actions/checkout@v4 - uses: aws-actions/configure-aws-credentials@v4 with: From 88aa6e3bed19136b1d733e9b78dd5985ad8391bf Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 22 Aug 2024 11:38:51 +0100 Subject: [PATCH 12/59] ecr-login in us-east-1 --- .github/workflows/autoformat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 91eed0887..77af700ec 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -19,5 +19,5 @@ jobs: role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} - uses: aws-actions/amazon-ecr-login@v2 env: - AWS_REGION: eu-west-1 + AWS_REGION: us-east-1 - run: bash ./builds/run_formatting.sh From a65096900eb273a03085f7e0b7c0af16c5e47883 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 22 Aug 2024 11:46:38 +0100 Subject: [PATCH 13/59] with region rather than env --- .github/workflows/autoformat.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 77af700ec..868578b34 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -18,6 +18,6 @@ jobs: aws-region: eu-west-1 role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} - uses: aws-actions/amazon-ecr-login@v2 - env: - AWS_REGION: us-east-1 + with: + aws-region: us-east-1 - run: bash ./builds/run_formatting.sh From 28b09f8aea69ce903d294efa86c966d915ffa3bc Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 22 Aug 2024 11:48:35 +0100 Subject: [PATCH 14/59] both in us-east-1? --- .github/workflows/autoformat.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 868578b34..4eaa6d492 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -15,9 +15,9 @@ jobs: - uses: actions/checkout@v4 - uses: aws-actions/configure-aws-credentials@v4 with: - aws-region: eu-west-1 + aws-region: us-east-1 role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} - uses: aws-actions/amazon-ecr-login@v2 - with: - aws-region: us-east-1 + env: + AWS_REGION: us-east-1 - run: bash ./builds/run_formatting.sh From e0a13c76b6ccfe1a937f162c66418578deca9ee9 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 22 Aug 2024 13:11:26 +0100 Subject: [PATCH 15/59] remove region entirely from amazon-ecr-login --- .github/workflows/autoformat.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 4eaa6d492..f2ee49796 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -15,9 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: aws-actions/configure-aws-credentials@v4 with: - aws-region: us-east-1 + aws-region: eu-west-1 role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} - uses: aws-actions/amazon-ecr-login@v2 - env: - AWS_REGION: us-east-1 - run: bash ./builds/run_formatting.sh From 19384359326b3e0529cd4fd6dfe0683f1f1c08ea Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 22 Aug 2024 13:12:50 +0100 Subject: [PATCH 16/59] do we even need to log in to ecr? --- .github/workflows/autoformat.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index f2ee49796..4ac46f424 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -17,5 +17,4 @@ jobs: with: aws-region: eu-west-1 role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} - - uses: aws-actions/amazon-ecr-login@v2 - run: bash ./builds/run_formatting.sh From b3960f61e98e6954e3b7c6f0b9ab2709c80bee75 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 27 Aug 2024 12:02:14 +0100 Subject: [PATCH 17/59] maybe, just maybe, log in to ecr --- .github/workflows/autoformat.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 4ac46f424..f2ee49796 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -17,4 +17,5 @@ jobs: with: aws-region: eu-west-1 role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} + - uses: aws-actions/amazon-ecr-login@v2 - run: bash ./builds/run_formatting.sh From a704b2ad838bf9cdcc671e77d2711538a478ec50 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 27 Aug 2024 13:48:16 +0100 Subject: [PATCH 18/59] need S3 access for scala releases --- .github/workflows/autoformat.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index f2ee49796..5c50b761f 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -13,9 +13,20 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: aws-actions/configure-aws-credentials@v4 + - name: Configure AWS credentials for ECR + uses: aws-actions/configure-aws-credentials@v4 with: aws-region: eu-west-1 role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} - - uses: aws-actions/amazon-ecr-login@v2 - - run: bash ./builds/run_formatting.sh + + - name: Log in to private ECR + uses: aws-actions/amazon-ecr-login@v2 + + - name: Configure AWS credentials for S3 + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: eu-west-1 + role-to-assume: ${{ secrets.S3_SCALA_RELEASES_READ_ROLE_ARN }} + + - name: Run formatting + run: bash ./builds/run_formatting.sh From f03398c7e83d12ff23682f097a042895ebcda90e Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 27 Aug 2024 13:54:29 +0100 Subject: [PATCH 19/59] try to pass creds down --- .github/workflows/autoformat.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 5c50b761f..263ababe6 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -23,6 +23,7 @@ jobs: uses: aws-actions/amazon-ecr-login@v2 - name: Configure AWS credentials for S3 + id: s3_creds uses: aws-actions/configure-aws-credentials@v4 with: aws-region: eu-west-1 @@ -30,3 +31,7 @@ jobs: - name: Run formatting run: bash ./builds/run_formatting.sh + with: + aws-region: eu-west-1 + aws-access-key-id: ${{ steps.s3_creds.outputs.aws-access-key-id }} + aws-secret-access-key: ${{ steps.s3_creds.outputs.aws-secret-access-key }} From c3b612e07cfa077a6336227b5a5e430e710c68a2 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 27 Aug 2024 14:25:19 +0100 Subject: [PATCH 20/59] with new S3 read role --- .github/workflows/autoformat.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 263ababe6..434b902a8 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -12,7 +12,9 @@ jobs: name: autoformat runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Check out project + uses: actions/checkout@v4 + - name: Configure AWS credentials for ECR uses: aws-actions/configure-aws-credentials@v4 with: @@ -23,15 +25,10 @@ jobs: uses: aws-actions/amazon-ecr-login@v2 - name: Configure AWS credentials for S3 - id: s3_creds uses: aws-actions/configure-aws-credentials@v4 with: aws-region: eu-west-1 - role-to-assume: ${{ secrets.S3_SCALA_RELEASES_READ_ROLE_ARN }} + role-to-assume: ${{ secrets.GHA_PLATFORM_S3_SCALA_LIBS_READ_ROLE_ARN }} - name: Run formatting run: bash ./builds/run_formatting.sh - with: - aws-region: eu-west-1 - aws-access-key-id: ${{ steps.s3_creds.outputs.aws-access-key-id }} - aws-secret-access-key: ${{ steps.s3_creds.outputs.aws-secret-access-key }} From 9920e9c3680678bdcdf66346042bfc1411b1bfdb Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 27 Aug 2024 15:28:11 +0100 Subject: [PATCH 21/59] output credentials --- .github/workflows/autoformat.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 434b902a8..11571ab87 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -25,10 +25,16 @@ jobs: uses: aws-actions/amazon-ecr-login@v2 - name: Configure AWS credentials for S3 + id: s3_credentials uses: aws-actions/configure-aws-credentials@v4 with: aws-region: eu-west-1 role-to-assume: ${{ secrets.GHA_PLATFORM_S3_SCALA_LIBS_READ_ROLE_ARN }} + output-credentials: true - name: Run formatting run: bash ./builds/run_formatting.sh + env: + AWS_ACCESS_KEY_ID: ${{ steps.s3_credentials.outputs.aws-access-key-id }} + AWS_SECRET_ACCESS_KEY: ${{ steps.s3_credentials.outputs.aws-secret-access-key }} + From 0d38a85446d4c97ed791dd786475560f487be71c Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 27 Aug 2024 15:58:12 +0100 Subject: [PATCH 22/59] output credentials with other role --- .github/workflows/autoformat.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 11571ab87..7fb00ed67 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -29,12 +29,12 @@ jobs: uses: aws-actions/configure-aws-credentials@v4 with: aws-region: eu-west-1 - role-to-assume: ${{ secrets.GHA_PLATFORM_S3_SCALA_LIBS_READ_ROLE_ARN }} + role-to-assume: ${{ secrets.S3_SCALA_RELEASES_READ_ROLE_ARN }} output-credentials: true - name: Run formatting run: bash ./builds/run_formatting.sh env: AWS_ACCESS_KEY_ID: ${{ steps.s3_credentials.outputs.aws-access-key-id }} - AWS_SECRET_ACCESS_KEY: ${{ steps.s3_credentials.outputs.aws-secret-access-key }} + AWS_SECRET_KEY: ${{ steps.s3_credentials.outputs.aws-secret-access-key }} From aad6546b2dc93014cdbedaaaf15a35dae8bf8f73 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 27 Aug 2024 16:01:42 +0100 Subject: [PATCH 23/59] try that --- builds/run_formatting.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builds/run_formatting.sh b/builds/run_formatting.sh index 12ee62c2d..1233d69d5 100755 --- a/builds/run_formatting.sh +++ b/builds/run_formatting.sh @@ -12,7 +12,7 @@ docker run --tty --rm \ --workdir /repo \ "public.ecr.aws/hashicorp/terraform:light" fmt -recursive -./builds/run_sbt_task_in_docker.sh "scalafmt" +./builds/run_sbt_task_in_docker.sh "scalafmt" AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_KEY=$AWS_SECRET_KEY # Undo any formatting changes to the source_model code copied from # the pipeline repo. Ideally I'd have scalafmt ignore them, but I From b735f76256eff110a275436e5e34fce9b18f7f0f Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Tue, 27 Aug 2024 16:40:16 +0100 Subject: [PATCH 24/59] configure set role --- .github/workflows/autoformat.yml | 9 +++------ builds/run_formatting.sh | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 7fb00ed67..6fc828f99 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -30,11 +30,8 @@ jobs: with: aws-region: eu-west-1 role-to-assume: ${{ secrets.S3_SCALA_RELEASES_READ_ROLE_ARN }} - output-credentials: true - name: Run formatting - run: bash ./builds/run_formatting.sh - env: - AWS_ACCESS_KEY_ID: ${{ steps.s3_credentials.outputs.aws-access-key-id }} - AWS_SECRET_KEY: ${{ steps.s3_credentials.outputs.aws-secret-access-key }} - + run: | + aws configure set role_arn "${{ secrets.S3_SCALA_RELEASES_READ_ROLE_ARN }}" + bash ./builds/run_formatting.sh diff --git a/builds/run_formatting.sh b/builds/run_formatting.sh index 1233d69d5..12ee62c2d 100755 --- a/builds/run_formatting.sh +++ b/builds/run_formatting.sh @@ -12,7 +12,7 @@ docker run --tty --rm \ --workdir /repo \ "public.ecr.aws/hashicorp/terraform:light" fmt -recursive -./builds/run_sbt_task_in_docker.sh "scalafmt" AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_KEY=$AWS_SECRET_KEY +./builds/run_sbt_task_in_docker.sh "scalafmt" # Undo any formatting changes to the source_model code copied from # the pipeline repo. Ideally I'd have scalafmt ignore them, but I From 5e4705148cc943700b4073387d1c08be38b1e676 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 09:23:01 +0100 Subject: [PATCH 25/59] use new scala formatting role --- .github/workflows/autoformat.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 6fc828f99..ede83e56b 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -15,23 +15,15 @@ jobs: - name: Check out project uses: actions/checkout@v4 - - name: Configure AWS credentials for ECR + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: aws-region: eu-west-1 - role-to-assume: ${{ secrets.GHA_PLATFORM_ECR_READ_ROLE_ARN }} + role-to-assume: ${{ secrets.GHA_SCALA_FORMATTING_ROLE_ARN }} - name: Log in to private ECR uses: aws-actions/amazon-ecr-login@v2 - - name: Configure AWS credentials for S3 - id: s3_credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-region: eu-west-1 - role-to-assume: ${{ secrets.S3_SCALA_RELEASES_READ_ROLE_ARN }} - - name: Run formatting - run: | - aws configure set role_arn "${{ secrets.S3_SCALA_RELEASES_READ_ROLE_ARN }}" - bash ./builds/run_formatting.sh + run: bash ./builds/run_formatting.sh + From 358c1acc7406ab56df7bcf546669817dabc255cb Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 09:40:24 +0100 Subject: [PATCH 26/59] output credentials and pass as env variables --- .github/workflows/autoformat.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index ede83e56b..5578fbbe6 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -16,14 +16,21 @@ jobs: uses: actions/checkout@v4 - name: Configure AWS credentials + id: aws_credentials uses: aws-actions/configure-aws-credentials@v4 with: aws-region: eu-west-1 role-to-assume: ${{ secrets.GHA_SCALA_FORMATTING_ROLE_ARN }} + output-credentials: true - name: Log in to private ECR uses: aws-actions/amazon-ecr-login@v2 - name: Run formatting run: bash ./builds/run_formatting.sh + env: + aws-region: eu-west-1 + aws-access-key-id: ${{ steps.aws_credentials.outputs.aws-access-key-id }} + aws-secret-access-key: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} + From 092787517492738d3e24be6108a49da34df4b033 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 09:45:51 +0100 Subject: [PATCH 27/59] is it case-sensitive? --- .github/workflows/autoformat.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 5578fbbe6..fa5366624 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -30,7 +30,7 @@ jobs: run: bash ./builds/run_formatting.sh env: aws-region: eu-west-1 - aws-access-key-id: ${{ steps.aws_credentials.outputs.aws-access-key-id }} - aws-secret-access-key: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} + AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} + AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} From 861bbba1ea54159e0bd3979bf05b40ab8496243c Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 10:09:42 +0100 Subject: [PATCH 28/59] pass env var everywhere --- .github/workflows/autoformat.yml | 2 +- builds/run_formatting.sh | 2 +- builds/run_sbt_task_in_docker.sh | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index fa5366624..abebed898 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -27,7 +27,7 @@ jobs: uses: aws-actions/amazon-ecr-login@v2 - name: Run formatting - run: bash ./builds/run_formatting.sh + run: bash ./builds/run_formatting.sh AWS_ACCESS_KEY_ID=${{ steps.aws_credentials.outputs.aws-access-key-id }} AWS_SECRET_KEY=${{ steps.aws_credentials.outputs.aws-secret-access-key }} env: aws-region: eu-west-1 AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} diff --git a/builds/run_formatting.sh b/builds/run_formatting.sh index 12ee62c2d..1233d69d5 100755 --- a/builds/run_formatting.sh +++ b/builds/run_formatting.sh @@ -12,7 +12,7 @@ docker run --tty --rm \ --workdir /repo \ "public.ecr.aws/hashicorp/terraform:light" fmt -recursive -./builds/run_sbt_task_in_docker.sh "scalafmt" +./builds/run_sbt_task_in_docker.sh "scalafmt" AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_KEY=$AWS_SECRET_KEY # Undo any formatting changes to the source_model code copied from # the pipeline repo. Ideally I'd have scalafmt ignore them, but I diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 896c811dd..0559ff316 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -56,4 +56,6 @@ docker run --tty --rm \ --net host \ --volume "$ROOT:$ROOT" \ --workdir "$ROOT" \ + -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ + -e AWS_SECRET_KEY=$AWS_SECRET_KEY \ "$ECR_REGISTRY/wellcome/sbt_wrapper" "$@" From 357ce4a11d723ea4af20b877dbf8af7dba229887 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 10:12:36 +0100 Subject: [PATCH 29/59] adding session token --- .github/workflows/autoformat.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index abebed898..15b484274 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -32,5 +32,6 @@ jobs: aws-region: eu-west-1 AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} + aws-session-token: ${{ steps.aws_credentials.outputs.aws-session-token }} From dd6640cc89cee1d4c68a39b1924fe69addfcf7e8 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 10:16:03 +0100 Subject: [PATCH 30/59] passing session token on to the scripts --- .github/workflows/autoformat.yml | 2 +- builds/run_formatting.sh | 2 +- builds/run_sbt_task_in_docker.sh | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 15b484274..a366a30a9 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -27,7 +27,7 @@ jobs: uses: aws-actions/amazon-ecr-login@v2 - name: Run formatting - run: bash ./builds/run_formatting.sh AWS_ACCESS_KEY_ID=${{ steps.aws_credentials.outputs.aws-access-key-id }} AWS_SECRET_KEY=${{ steps.aws_credentials.outputs.aws-secret-access-key }} + run: bash ./builds/run_formatting.sh AWS_ACCESS_KEY_ID=${{ steps.aws_credentials.outputs.aws-access-key-id }} AWS_SECRET_KEY=${{ steps.aws_credentials.outputs.aws-secret-access-key }} aws-session-token=${{ steps.aws_credentials.outputs.aws-session-token }} env: aws-region: eu-west-1 AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} diff --git a/builds/run_formatting.sh b/builds/run_formatting.sh index 1233d69d5..41260ab5d 100755 --- a/builds/run_formatting.sh +++ b/builds/run_formatting.sh @@ -12,7 +12,7 @@ docker run --tty --rm \ --workdir /repo \ "public.ecr.aws/hashicorp/terraform:light" fmt -recursive -./builds/run_sbt_task_in_docker.sh "scalafmt" AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_KEY=$AWS_SECRET_KEY +./builds/run_sbt_task_in_docker.sh "scalafmt" AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_KEY=$AWS_SECRET_KEY aws-session-token=$aws-session-token # Undo any formatting changes to the source_model code copied from # the pipeline repo. Ideally I'd have scalafmt ignore them, but I diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 0559ff316..86e9c6bec 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -58,4 +58,5 @@ docker run --tty --rm \ --workdir "$ROOT" \ -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ -e AWS_SECRET_KEY=$AWS_SECRET_KEY \ + -e aws-session-token=$aws-session-token \ "$ECR_REGISTRY/wellcome/sbt_wrapper" "$@" From 78f1f90b3da9e8fc7a94b8cffea9a3b6bdd2fca3 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 10:20:33 +0100 Subject: [PATCH 31/59] case-sensitive? --- .github/workflows/autoformat.yml | 4 ++-- builds/run_formatting.sh | 2 +- builds/run_sbt_task_in_docker.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index a366a30a9..62bb95f32 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -27,11 +27,11 @@ jobs: uses: aws-actions/amazon-ecr-login@v2 - name: Run formatting - run: bash ./builds/run_formatting.sh AWS_ACCESS_KEY_ID=${{ steps.aws_credentials.outputs.aws-access-key-id }} AWS_SECRET_KEY=${{ steps.aws_credentials.outputs.aws-secret-access-key }} aws-session-token=${{ steps.aws_credentials.outputs.aws-session-token }} + run: bash ./builds/run_formatting.sh AWS_ACCESS_KEY_ID=${{ steps.aws_credentials.outputs.aws-access-key-id }} AWS_SECRET_KEY=${{ steps.aws_credentials.outputs.aws-secret-access-key }} AWS_SESSION_TOKEN=${{ steps.aws_credentials.outputs.aws-session-token }} env: aws-region: eu-west-1 AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} - aws-session-token: ${{ steps.aws_credentials.outputs.aws-session-token }} + AWS_SESSION_TOKEN: ${{ steps.aws_credentials.outputs.aws-session-token }} diff --git a/builds/run_formatting.sh b/builds/run_formatting.sh index 41260ab5d..6292ea3d3 100755 --- a/builds/run_formatting.sh +++ b/builds/run_formatting.sh @@ -12,7 +12,7 @@ docker run --tty --rm \ --workdir /repo \ "public.ecr.aws/hashicorp/terraform:light" fmt -recursive -./builds/run_sbt_task_in_docker.sh "scalafmt" AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_KEY=$AWS_SECRET_KEY aws-session-token=$aws-session-token +./builds/run_sbt_task_in_docker.sh "scalafmt" AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_KEY=$AWS_SECRET_KEY AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN # Undo any formatting changes to the source_model code copied from # the pipeline repo. Ideally I'd have scalafmt ignore them, but I diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 86e9c6bec..04b637f5c 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -58,5 +58,5 @@ docker run --tty --rm \ --workdir "$ROOT" \ -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ -e AWS_SECRET_KEY=$AWS_SECRET_KEY \ - -e aws-session-token=$aws-session-token \ + -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \ "$ECR_REGISTRY/wellcome/sbt_wrapper" "$@" From 732ab96be1d1957cf719cd1315f566f7aab209f1 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 10:50:01 +0100 Subject: [PATCH 32/59] scalafmt doesnt seem to like these args --- builds/run_formatting.sh | 2 +- builds/run_sbt_task_in_docker.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/builds/run_formatting.sh b/builds/run_formatting.sh index 6292ea3d3..12ee62c2d 100755 --- a/builds/run_formatting.sh +++ b/builds/run_formatting.sh @@ -12,7 +12,7 @@ docker run --tty --rm \ --workdir /repo \ "public.ecr.aws/hashicorp/terraform:light" fmt -recursive -./builds/run_sbt_task_in_docker.sh "scalafmt" AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_KEY=$AWS_SECRET_KEY AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN +./builds/run_sbt_task_in_docker.sh "scalafmt" # Undo any formatting changes to the source_model code copied from # the pipeline repo. Ideally I'd have scalafmt ignore them, but I diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 04b637f5c..21784f271 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -48,6 +48,9 @@ else fi docker run --tty --rm \ + -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ + -e AWS_SECRET_KEY=$AWS_SECRET_KEY \ + -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ --volume "$HOST_COURSIER_CACHE:/root/$LINUX_COURSIER_CACHE" \ @@ -56,7 +59,4 @@ docker run --tty --rm \ --net host \ --volume "$ROOT:$ROOT" \ --workdir "$ROOT" \ - -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ - -e AWS_SECRET_KEY=$AWS_SECRET_KEY \ - -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \ "$ECR_REGISTRY/wellcome/sbt_wrapper" "$@" From a9db406c36f9684433d558b2316b005aca9b9430 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 10:56:02 +0100 Subject: [PATCH 33/59] is this needed --- .github/workflows/autoformat.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 62bb95f32..4e178b632 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -28,10 +28,10 @@ jobs: - name: Run formatting run: bash ./builds/run_formatting.sh AWS_ACCESS_KEY_ID=${{ steps.aws_credentials.outputs.aws-access-key-id }} AWS_SECRET_KEY=${{ steps.aws_credentials.outputs.aws-secret-access-key }} AWS_SESSION_TOKEN=${{ steps.aws_credentials.outputs.aws-session-token }} - env: - aws-region: eu-west-1 - AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} - AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} - AWS_SESSION_TOKEN: ${{ steps.aws_credentials.outputs.aws-session-token }} +# env: +# aws-region: eu-west-1 +# AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} +# AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} +# AWS_SESSION_TOKEN: ${{ steps.aws_credentials.outputs.aws-session-token }} From 7296755c0fc0f97dfac057500ee3535f7b94c8e9 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 10:58:20 +0100 Subject: [PATCH 34/59] is this needed-2 --- .github/workflows/autoformat.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 4e178b632..1e75fc8ac 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -27,11 +27,11 @@ jobs: uses: aws-actions/amazon-ecr-login@v2 - name: Run formatting - run: bash ./builds/run_formatting.sh AWS_ACCESS_KEY_ID=${{ steps.aws_credentials.outputs.aws-access-key-id }} AWS_SECRET_KEY=${{ steps.aws_credentials.outputs.aws-secret-access-key }} AWS_SESSION_TOKEN=${{ steps.aws_credentials.outputs.aws-session-token }} -# env: -# aws-region: eu-west-1 -# AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} -# AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} -# AWS_SESSION_TOKEN: ${{ steps.aws_credentials.outputs.aws-session-token }} + run: bash ./builds/run_formatting.sh + env: + aws-region: eu-west-1 + AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} + AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} + AWS_SESSION_TOKEN: ${{ steps.aws_credentials.outputs.aws-session-token }} From c5f0eec8b412ad33e6371913f1a2a70cdd6c8dcc Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 11:00:24 +0100 Subject: [PATCH 35/59] is this needed-3 --- .github/workflows/autoformat.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 1e75fc8ac..ba7637e43 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -29,7 +29,6 @@ jobs: - name: Run formatting run: bash ./builds/run_formatting.sh env: - aws-region: eu-west-1 AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} AWS_SESSION_TOKEN: ${{ steps.aws_credentials.outputs.aws-session-token }} From ac8df1a8536977e64f0503d48ffb553f4a9a2b0b Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 12:04:15 +0100 Subject: [PATCH 36/59] adding commit changes step --- .github/workflows/autoformat.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index ba7637e43..7b2fcfad5 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -33,4 +33,10 @@ jobs: AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} AWS_SESSION_TOKEN: ${{ steps.aws_credentials.outputs.aws-session-token }} + - name: Commit formatting changes + run: | + git config user.name "Buildkite on behalf of Wellcome Collection" + git config user.email "wellcomedigitalplatform@wellcome.ac.uk" + git commit -am "Apply auto-formatting rules" + git push From 57571364a0985d5a6ad3875316276f3751fe84d6 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 12:19:16 +0100 Subject: [PATCH 37/59] check diff before commit and push --- .github/workflows/autoformat.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 7b2fcfad5..f925c3b1b 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -33,7 +33,15 @@ jobs: AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} AWS_SESSION_TOKEN: ${{ steps.aws_credentials.outputs.aws-session-token }} - - name: Commit formatting changes + - name: Check for formatting changes + id: check_formatting_changes + run: | + if [[ -n $(git status --porcelain) ]]; then + echo "changes=true" >> "$GITHUB_OUTPUT"; + fi + + - name: Commit and push formatting changes + if: steps.check_formatting_changes.outputs.changes == 'true' run: | git config user.name "Buildkite on behalf of Wellcome Collection" git config user.email "wellcomedigitalplatform@wellcome.ac.uk" From b716054a196c898ef48451b3a4e8554e521d28f7 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 13:40:05 +0100 Subject: [PATCH 38/59] do we need the env var in docker run --- builds/run_sbt_task_in_docker.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 21784f271..896c811dd 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -48,9 +48,6 @@ else fi docker run --tty --rm \ - -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ - -e AWS_SECRET_KEY=$AWS_SECRET_KEY \ - -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ --volume "$HOST_COURSIER_CACHE:/root/$LINUX_COURSIER_CACHE" \ From c7d3d76ebe567e0a641896eda2d0f97b51f2146d Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 13:43:23 +0100 Subject: [PATCH 39/59] yes we do --- .github/workflows/autoformat.yml | 16 ++++++++-------- builds/run_sbt_task_in_docker.sh | 3 +++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index f925c3b1b..c35ad02e2 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -32,16 +32,16 @@ jobs: AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} AWS_SESSION_TOKEN: ${{ steps.aws_credentials.outputs.aws-session-token }} - - - name: Check for formatting changes - id: check_formatting_changes - run: | - if [[ -n $(git status --porcelain) ]]; then - echo "changes=true" >> "$GITHUB_OUTPUT"; - fi +# +# - name: Check for formatting changes +# id: check_formatting_changes +# run: | +# if [[ -n $(git status --porcelain) ]]; then +# echo "changes=true" >> "$GITHUB_OUTPUT"; +# fi - name: Commit and push formatting changes - if: steps.check_formatting_changes.outputs.changes == 'true' + if: [[ -n $(git status --porcelain) ]] run: | git config user.name "Buildkite on behalf of Wellcome Collection" git config user.email "wellcomedigitalplatform@wellcome.ac.uk" diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 896c811dd..21784f271 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -48,6 +48,9 @@ else fi docker run --tty --rm \ + -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ + -e AWS_SECRET_KEY=$AWS_SECRET_KEY \ + -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ --volume "$HOST_COURSIER_CACHE:/root/$LINUX_COURSIER_CACHE" \ From a70f89610fe971d74568e530a230ad82ba3e860b Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 13:45:47 +0100 Subject: [PATCH 40/59] just checking --- .github/workflows/autoformat.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index c35ad02e2..4a2b197d5 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -41,7 +41,6 @@ jobs: # fi - name: Commit and push formatting changes - if: [[ -n $(git status --porcelain) ]] run: | git config user.name "Buildkite on behalf of Wellcome Collection" git config user.email "wellcomedigitalplatform@wellcome.ac.uk" From 01198265a527ae57a345d26556884ad30a41689a Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 13:48:16 +0100 Subject: [PATCH 41/59] really need to check diff --- .github/workflows/autoformat.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 4a2b197d5..f925c3b1b 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -32,15 +32,16 @@ jobs: AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} AWS_SESSION_TOKEN: ${{ steps.aws_credentials.outputs.aws-session-token }} -# -# - name: Check for formatting changes -# id: check_formatting_changes -# run: | -# if [[ -n $(git status --porcelain) ]]; then -# echo "changes=true" >> "$GITHUB_OUTPUT"; -# fi + + - name: Check for formatting changes + id: check_formatting_changes + run: | + if [[ -n $(git status --porcelain) ]]; then + echo "changes=true" >> "$GITHUB_OUTPUT"; + fi - name: Commit and push formatting changes + if: steps.check_formatting_changes.outputs.changes == 'true' run: | git config user.name "Buildkite on behalf of Wellcome Collection" git config user.email "wellcomedigitalplatform@wellcome.ac.uk" From 8bef06ab3502a44b4c4c932b6ae3b62fe6cdf659 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 15:11:36 +0100 Subject: [PATCH 42/59] bad formatting to see if formatter works --- .../scala/weco/api/items/services/SierraItemUpdater.scala | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/items/src/main/scala/weco/api/items/services/SierraItemUpdater.scala b/items/src/main/scala/weco/api/items/services/SierraItemUpdater.scala index bb16a2050..42c011f2c 100644 --- a/items/src/main/scala/weco/api/items/services/SierraItemUpdater.scala +++ b/items/src/main/scala/weco/api/items/services/SierraItemUpdater.scala @@ -212,9 +212,5 @@ class SierraItemUpdater( } private def parseISOStringToLocalDate(isoString: String): LocalDate = - LocalDate.parse( - isoString, - DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX") - ) - + LocalDate.parse(isoString, DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX")) } From 4d9c7900f8401bb5432a20bf3da6e6c9dd4dc25e Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 15:15:22 +0100 Subject: [PATCH 43/59] permission to write contents --- .github/workflows/autoformat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index f925c3b1b..4e5d454ab 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -3,7 +3,7 @@ name: "Run auto formatting" permissions: id-token: write - contents: read + contents: write on: push From 800e4a4d84887db29c530dd203c12903f902cf37 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 15:42:51 +0100 Subject: [PATCH 44/59] what if --- .github/workflows/autoformat.yml | 7 ++----- builds/run_sbt_task_in_docker.sh | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 4e5d454ab..08cc8d7e5 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -28,10 +28,7 @@ jobs: - name: Run formatting run: bash ./builds/run_formatting.sh - env: - AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} - AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} - AWS_SESSION_TOKEN: ${{ steps.aws_credentials.outputs.aws-session-token }} +# - name: Check for formatting changes id: check_formatting_changes @@ -43,7 +40,7 @@ jobs: - name: Commit and push formatting changes if: steps.check_formatting_changes.outputs.changes == 'true' run: | - git config user.name "Buildkite on behalf of Wellcome Collection" + git config user.name "GithubAction on behalf of Wellcome Collection" git config user.email "wellcomedigitalplatform@wellcome.ac.uk" git commit -am "Apply auto-formatting rules" git push diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 21784f271..f3ecb2ee0 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -48,9 +48,9 @@ else fi docker run --tty --rm \ - -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ - -e AWS_SECRET_KEY=$AWS_SECRET_KEY \ - -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \ +# -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ +# -e AWS_SECRET_KEY=$AWS_SECRET_KEY \ +# -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ --volume "$HOST_COURSIER_CACHE:/root/$LINUX_COURSIER_CACHE" \ From 3203e38fce15cbc7f06bfe8ec0b679d9dc51211f Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 15:45:09 +0100 Subject: [PATCH 45/59] fix docker run --- builds/run_sbt_task_in_docker.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index f3ecb2ee0..896c811dd 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -48,9 +48,6 @@ else fi docker run --tty --rm \ -# -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ -# -e AWS_SECRET_KEY=$AWS_SECRET_KEY \ -# -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ --volume "$HOST_COURSIER_CACHE:/root/$LINUX_COURSIER_CACHE" \ From ce8bde1f992cd28e324e14117dab2fe6081d72d2 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Wed, 28 Aug 2024 15:54:22 +0100 Subject: [PATCH 46/59] we do need these env variables --- .github/workflows/autoformat.yml | 5 ++++- builds/run_sbt_task_in_docker.sh | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 08cc8d7e5..06647574b 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -28,7 +28,10 @@ jobs: - name: Run formatting run: bash ./builds/run_formatting.sh -# + env: + AWS_ACCESS_KEY_ID: ${{ steps.aws_credentials.outputs.aws-access-key-id }} + AWS_SECRET_KEY: ${{ steps.aws_credentials.outputs.aws-secret-access-key }} + AWS_SESSION_TOKEN: ${{ steps.aws_credentials.outputs.aws-session-token }} - name: Check for formatting changes id: check_formatting_changes diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 896c811dd..21784f271 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -48,6 +48,9 @@ else fi docker run --tty --rm \ + -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ + -e AWS_SECRET_KEY=$AWS_SECRET_KEY \ + -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ --volume "$HOST_COURSIER_CACHE:/root/$LINUX_COURSIER_CACHE" \ From b1f86c9576bed120af7e85b2165933eec953c1df Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 29 Aug 2024 09:31:49 +0100 Subject: [PATCH 47/59] set default for aws credentials vars --- builds/run_sbt_task_in_docker.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 21784f271..0f737e255 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -48,9 +48,9 @@ else fi docker run --tty --rm \ - -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ - -e AWS_SECRET_KEY=$AWS_SECRET_KEY \ - -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \ + -e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-}" \ + -e AWS_SECRET_KEY="${$AWS_SECRET_KEY:-}" \ + -e AWS_SESSION_TOKEN="${$AWS_SESSION_TOKEN:-}" \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ --volume "$HOST_COURSIER_CACHE:/root/$LINUX_COURSIER_CACHE" \ From ef7c87c1262db5372aef03c647a31d0ed783a159 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 29 Aug 2024 09:37:00 +0100 Subject: [PATCH 48/59] actually set default for aws credentials vars --- builds/run_sbt_task_in_docker.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 0f737e255..90d5e55ac 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -48,9 +48,9 @@ else fi docker run --tty --rm \ - -e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-}" \ - -e AWS_SECRET_KEY="${$AWS_SECRET_KEY:-}" \ - -e AWS_SESSION_TOKEN="${$AWS_SESSION_TOKEN:-}" \ + -e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-null}" \ + -e AWS_SECRET_KEY="${$AWS_SECRET_KEY:-null}" \ + -e AWS_SESSION_TOKEN="${$AWS_SESSION_TOKEN:-null}" \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ --volume "$HOST_COURSIER_CACHE:/root/$LINUX_COURSIER_CACHE" \ From 3047719f72aa82aaa92b10461e78b426d914f313 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 29 Aug 2024 09:39:35 +0100 Subject: [PATCH 49/59] bad substitution --- builds/run_sbt_task_in_docker.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 90d5e55ac..eb94be436 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -48,9 +48,9 @@ else fi docker run --tty --rm \ - -e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-null}" \ - -e AWS_SECRET_KEY="${$AWS_SECRET_KEY:-null}" \ - -e AWS_SESSION_TOKEN="${$AWS_SESSION_TOKEN:-null}" \ + -e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-""}" \ + -e AWS_SECRET_KEY="${$AWS_SECRET_KEY:-"null"}" \ + -e AWS_SESSION_TOKEN="${$AWS_SESSION_TOKEN:-""}" \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ --volume "$HOST_COURSIER_CACHE:/root/$LINUX_COURSIER_CACHE" \ From 0b327e4ceb9e3df53aa50c7f90e08d6d0c87cba3 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 29 Aug 2024 09:40:44 +0100 Subject: [PATCH 50/59] come on now --- builds/run_sbt_task_in_docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index eb94be436..da8a2ab14 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -49,7 +49,7 @@ fi docker run --tty --rm \ -e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-""}" \ - -e AWS_SECRET_KEY="${$AWS_SECRET_KEY:-"null"}" \ + -e AWS_SECRET_KEY="${$AWS_SECRET_KEY:-""}" \ -e AWS_SESSION_TOKEN="${$AWS_SESSION_TOKEN:-""}" \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ From 3c731ab841cea65757f0a030761c9a5e35d7002f Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 29 Aug 2024 09:43:02 +0100 Subject: [PATCH 51/59] yea ok --- builds/run_sbt_task_in_docker.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index da8a2ab14..5fddb83ca 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -48,9 +48,9 @@ else fi docker run --tty --rm \ - -e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-""}" \ - -e AWS_SECRET_KEY="${$AWS_SECRET_KEY:-""}" \ - -e AWS_SESSION_TOKEN="${$AWS_SESSION_TOKEN:-""}" \ + -e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-null}" \ + -e AWS_SECRET_KEY="${AWS_SECRET_KEY:-null}" \ + -e AWS_SESSION_TOKEN="${AWS_SESSION_TOKEN:-null}" \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ --volume "$HOST_COURSIER_CACHE:/root/$LINUX_COURSIER_CACHE" \ From ee297e30806aa6e44b6e1f7f35d88548b71c967e Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 29 Aug 2024 10:36:09 +0100 Subject: [PATCH 52/59] no default --- builds/run_sbt_task_in_docker.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/run_sbt_task_in_docker.sh b/builds/run_sbt_task_in_docker.sh index 5fddb83ca..b644ed087 100755 --- a/builds/run_sbt_task_in_docker.sh +++ b/builds/run_sbt_task_in_docker.sh @@ -48,9 +48,9 @@ else fi docker run --tty --rm \ - -e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-null}" \ - -e AWS_SECRET_KEY="${AWS_SECRET_KEY:-null}" \ - -e AWS_SESSION_TOKEN="${AWS_SESSION_TOKEN:-null}" \ + -e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-}" \ + -e AWS_SECRET_KEY="${AWS_SECRET_KEY:-}" \ + -e AWS_SESSION_TOKEN="${AWS_SESSION_TOKEN:-}" \ --volume ~/.sbt:/root/.sbt \ --volume ~/.ivy2:/root/.ivy2 \ --volume "$HOST_COURSIER_CACHE:/root/$LINUX_COURSIER_CACHE" \ From 2e413d403e42e5dd465027da6bcfd89c81f9524b Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 29 Aug 2024 11:34:19 +0100 Subject: [PATCH 53/59] use reusable workflow and remove formatting steps from the buildkite pipeline --- .buildkite/pipeline.yml | 5 +- .../scripts/push_autoformatting_changes.sh | 49 ------------------- .github/workflows/autoformat.yml | 46 ++--------------- 3 files changed, 5 insertions(+), 95 deletions(-) delete mode 100755 .buildkite/scripts/push_autoformatting_changes.sh diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d08107401..597b63685 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,8 +1,5 @@ steps: - - command: | - ./builds/run_formatting.sh - .buildkite/scripts/push_autoformatting_changes.sh - ./builds/run_linting.sh + - command: ./builds/run_linting.sh label: "autoformat" agents: queue: "scala" diff --git a/.buildkite/scripts/push_autoformatting_changes.sh b/.buildkite/scripts/push_autoformatting_changes.sh deleted file mode 100755 index ffdc33533..000000000 --- a/.buildkite/scripts/push_autoformatting_changes.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash -<> "$GITHUB_OUTPUT"; - fi - - - name: Commit and push formatting changes - if: steps.check_formatting_changes.outputs.changes == 'true' - run: | - git config user.name "GithubAction on behalf of Wellcome Collection" - git config user.email "wellcomedigitalplatform@wellcome.ac.uk" - git commit -am "Apply auto-formatting rules" - git push - + uses: wellcomecollection/.github/.github/workflows/autoformat.yml@make-reformatting-workflow-reusable From 05b70450048679a207b25389b4cbddebd9a0b338 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 29 Aug 2024 11:38:18 +0100 Subject: [PATCH 54/59] correct file name --- .github/workflows/autoformat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 1a59c394f..859b24ab2 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -9,4 +9,4 @@ permissions: jobs: autoformat: - uses: wellcomecollection/.github/.github/workflows/autoformat.yml@make-reformatting-workflow-reusable + uses: wellcomecollection/.github/.github/workflows/scala_formatting.yml@make-reformatting-workflow-reusable From ea03d5b516e5a3331d89e4fe6993cb77d108b710 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 29 Aug 2024 11:51:22 +0100 Subject: [PATCH 55/59] inherit secrets from called workflow --- .github/workflows/autoformat.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 859b24ab2..d6fb3916f 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -10,3 +10,4 @@ permissions: jobs: autoformat: uses: wellcomecollection/.github/.github/workflows/scala_formatting.yml@make-reformatting-workflow-reusable + secrets: inherit From 9f8dfdd8145249b41eab8254e19695caccdff2c8 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 29 Aug 2024 14:09:59 +0100 Subject: [PATCH 56/59] rename linting step --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 597b63685..df36974f5 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,6 +1,6 @@ steps: - command: ./builds/run_linting.sh - label: "autoformat" + label: "linting" agents: queue: "scala" From b6481f2dc280ec0416052b2beb6a5bfaef79e788 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 29 Aug 2024 15:35:09 +0100 Subject: [PATCH 57/59] mess up formatting on purpose --- .../scala/weco/api/items/services/SierraItemUpdater.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/items/src/main/scala/weco/api/items/services/SierraItemUpdater.scala b/items/src/main/scala/weco/api/items/services/SierraItemUpdater.scala index 42c011f2c..cccf3faa3 100644 --- a/items/src/main/scala/weco/api/items/services/SierraItemUpdater.scala +++ b/items/src/main/scala/weco/api/items/services/SierraItemUpdater.scala @@ -194,9 +194,7 @@ class SierraItemUpdater( def updateItems(items: Seq[DisplayItem]): Future[Seq[DisplayItem]] = { val staleItemIds = items .filter(item => item.isStale) - .map( - item => SierraItemIdentifier.fromSourceIdentifier(item.identifiers.head) - ) + .map(item => SierraItemIdentifier.fromSourceIdentifier(item.identifiers.head)) staleItemIds.size match { case 0 => Future.successful(items) From fb5f8faeab8b03f1651d1e2e0d67df0b185eebc6 Mon Sep 17 00:00:00 2001 From: Agnes Garoux Date: Thu, 29 Aug 2024 17:24:17 +0100 Subject: [PATCH 58/59] use workflow on main branch --- .github/workflows/autoformat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index d6fb3916f..8b7366d9e 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -9,5 +9,5 @@ permissions: jobs: autoformat: - uses: wellcomecollection/.github/.github/workflows/scala_formatting.yml@make-reformatting-workflow-reusable + uses: wellcomecollection/.github/.github/workflows/scala_formatting.yml@main secrets: inherit From 8e6485d0dbeb64aa54b727d0d7a362cd68e7b728 Mon Sep 17 00:00:00 2001 From: Github on behalf of Wellcome Collection Date: Thu, 29 Aug 2024 16:26:27 +0000 Subject: [PATCH 59/59] Apply auto-formatting rules --- .../scala/weco/api/items/services/SierraItemUpdater.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/items/src/main/scala/weco/api/items/services/SierraItemUpdater.scala b/items/src/main/scala/weco/api/items/services/SierraItemUpdater.scala index cccf3faa3..fdddbbf45 100644 --- a/items/src/main/scala/weco/api/items/services/SierraItemUpdater.scala +++ b/items/src/main/scala/weco/api/items/services/SierraItemUpdater.scala @@ -194,7 +194,8 @@ class SierraItemUpdater( def updateItems(items: Seq[DisplayItem]): Future[Seq[DisplayItem]] = { val staleItemIds = items .filter(item => item.isStale) - .map(item => SierraItemIdentifier.fromSourceIdentifier(item.identifiers.head)) + .map(item => + SierraItemIdentifier.fromSourceIdentifier(item.identifiers.head)) staleItemIds.size match { case 0 => Future.successful(items) @@ -210,5 +211,7 @@ class SierraItemUpdater( } private def parseISOStringToLocalDate(isoString: String): LocalDate = - LocalDate.parse(isoString, DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX")) + LocalDate.parse( + isoString, + DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX")) }