diff --git a/.github/renovate.json b/.github/renovate.json index 3bfef8356f..5afa859d07 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,5 +1,15 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["github>matrix-org/renovate-config-element-web"], - "postUpdateOptions": ["pnpmDedupe"] + "postUpdateOptions": ["pnpmDedupe"], + "customManagers": [ + { + "customType": "regex", + "datasourceTemplate": "docker", + "versioningTemplate": "loose", + "description": "Update testcontainers docker digests", + "managerFilePatterns": ["**/testcontainers/*.ts"], + "matchStrings": ["\\s+\"(?[^@]+):(?[^@]+)@(?sha256:[a-f0-9]+)\""] + } + ] } diff --git a/.github/workflows/playwright-image-updates.yaml b/.github/workflows/playwright-image-updates.yaml deleted file mode 100644 index d0cd242884..0000000000 --- a/.github/workflows/playwright-image-updates.yaml +++ /dev/null @@ -1,57 +0,0 @@ -name: Update Playwright docker images -on: - workflow_dispatch: {} - schedule: - - cron: "0 6 * * *" # Every day at 6am UTC -permissions: {} -jobs: - update: - runs-on: ubuntu-24.04 - permissions: - pull-requests: write - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - - - name: Update synapse image - run: | - docker pull "$IMAGE" - INSPECT=$(docker inspect --format='{{index .RepoDigests 0}}' "$IMAGE") - DIGEST=${INSPECT#*@} - sed -i "s/const TAG.*/const TAG = \"develop@$DIGEST\";/" playwright/testcontainers/synapse.ts - env: - IMAGE: ghcr.io/element-hq/synapse:develop - - - name: Update MAS image - run: | - docker pull "$IMAGE" - INSPECT=$(docker inspect --format='{{index .RepoDigests 0}}' "$IMAGE") - DIGEST=${INSPECT#*@} - sed -i "s/const TAG.*/const TAG = \"main@$DIGEST\";/" playwright/testcontainers/mas.ts - env: - IMAGE: ghcr.io/element-hq/matrix-authentication-service:main - - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8 - with: - token: ${{ secrets.ELEMENT_BOT_TOKEN }} - branch: actions/playwright-image-updates - delete-branch: true - title: Playwright Docker image updates - labels: | - T-Task - - - name: Enable automerge - run: gh pr merge --merge --auto "$PR_NUMBER" - if: steps.cpr.outputs.pull-request-operation == 'created' - env: - GH_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} - - - name: Enable autoapprove - run: | - gh pr review --approve "$PR_NUMBER" - if: steps.cpr.outputs.pull-request-operation == 'created' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} diff --git a/playwright/testcontainers/mas.ts b/playwright/testcontainers/mas.ts index 51460f6bdf..5459feef26 100644 --- a/playwright/testcontainers/mas.ts +++ b/playwright/testcontainers/mas.ts @@ -10,7 +10,8 @@ import { type StartedPostgreSqlContainer, } from "@element-hq/element-web-playwright-common/lib/testcontainers/index.js"; -const TAG = "main@sha256:79cefba4e15ccfa850fb2dc410313b793a93c79c6852081dd0b39c0051d4a403"; +const DOCKER_IMAGE = + "ghcr.io/element-hq/matrix-authentication-service:main@sha256:79cefba4e15ccfa850fb2dc410313b793a93c79c6852081dd0b39c0051d4a403"; /** * MatrixAuthenticationServiceContainer which freezes the docker digest to @@ -19,6 +20,6 @@ const TAG = "main@sha256:79cefba4e15ccfa850fb2dc410313b793a93c79c6852081dd0b39c0 */ export class MatrixAuthenticationServiceContainer extends BaseMatrixAuthenticationServiceContainer { public constructor(db: StartedPostgreSqlContainer) { - super(db, `ghcr.io/element-hq/matrix-authentication-service:${TAG}`); + super(db, DOCKER_IMAGE); } } diff --git a/playwright/testcontainers/synapse.ts b/playwright/testcontainers/synapse.ts index 32ac67479a..6d427d9ecd 100644 --- a/playwright/testcontainers/synapse.ts +++ b/playwright/testcontainers/synapse.ts @@ -7,7 +7,8 @@ Please see LICENSE files in the repository root for full details. import { SynapseContainer as BaseSynapseContainer } from "@element-hq/element-web-playwright-common/lib/testcontainers/index.js"; -const TAG = "develop@sha256:9e515689caf849b9c66bee33465c1dcd2b46adac2b781db0e98a9571d32c89a2"; +const DOCKER_IMAGE = + "ghcr.io/element-hq/synapse:develop@sha256:9e515689caf849b9c66bee33465c1dcd2b46adac2b781db0e98a9571d32c89a2"; /** * SynapseContainer which freezes the docker digest to stabilise tests, @@ -15,6 +16,6 @@ const TAG = "develop@sha256:9e515689caf849b9c66bee33465c1dcd2b46adac2b781db0e98a */ export class SynapseContainer extends BaseSynapseContainer { public constructor() { - super(`ghcr.io/element-hq/synapse:${TAG}`); + super(DOCKER_IMAGE); } }