Use Renovate to bump testcontainers digests (#32532)

* Use Renovate to bump testcontainers digests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2026-02-17 11:45:13 +00:00 committed by GitHub
parent 33af62965a
commit b933d16e5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 62 deletions

12
.github/renovate.json vendored
View File

@ -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+\"(?<depName>[^@]+):(?<currentValue>[^@]+)@(?<currentDigest>sha256:[a-f0-9]+)\""]
}
]
}

View File

@ -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 }}

View File

@ -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);
}
}

View File

@ -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);
}
}