Repository navigation
fix(ci): build and restore the Playwright golden fixture on MySQL #36404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
shrabantipaul-collate
merged 6 commits into
main
from
shrabantipaul-collate/openmetadata-actions-failing-fix
Oct 29, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f989c7d
fix(ci): seed and restore the Playwright golden fixture on MySQL
82516d8
fix(ci): share the fixture database check and keep release-branch dia…
d08b91b
fix(ci): pull fast-environment images before the 5m restore budget
9a81c13
fix(ci): stop reading the fixture once its manifest is found
c7e07e8
Merge remote-tracking branch 'origin/main' into shrabantipaul-collate…
1def28c
fix(ci): fail the image-pull step on an unreadable fixture and record…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright 2026 Collate | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # Sourced by the fixture builder, validator and fast-environment launcher so the | ||
| # database a fixture was seeded on (the `database` input of | ||
| # playwright-e2e-reusable.yml) is restored onto the same engine and search | ||
| # backend. The PostgreSQL stack pairs with OpenSearch, the MySQL stack with | ||
| # Elasticsearch, mirroring their docker/development compose files. | ||
| # ADR:2026-10-28-playwright-golden-fixtures-are-scoped-to-their-seed-database | ||
| load_playwright_fixture_profile() { | ||
| case "$1" in | ||
| postgresql) | ||
| PW_COMPOSE_FILE=docker/development/docker-compose-postgres.yml | ||
| PW_FAST_COMPOSE_FILE=docker/development/docker-compose-playwright-fast.yml | ||
| PW_DATABASE_SERVICE=postgresql | ||
| PW_DATABASE_CONTAINER=openmetadata_postgresql | ||
| PW_DATABASE_DATA_PATH=/var/lib/postgresql/data | ||
| PW_DATABASE_DOCKERFILE=docker/postgresql/Dockerfile_postgres | ||
| PW_DATABASE_MARKER=./database/PG_VERSION | ||
| PW_DB_DRIVER_CLASS=org.postgresql.Driver | ||
| PW_DB_SCHEME=postgresql | ||
| PW_DB_PORT=5432 | ||
| PW_AIRFLOW_DB_SCHEME=postgresql+psycopg2 | ||
| PW_SEARCH_SERVICE=opensearch | ||
| PW_SEARCH_CONTAINER=openmetadata_opensearch | ||
| PW_SEARCH_DATA_PATH=/usr/share/opensearch/data | ||
| PW_SEARCH_MARKER=./search/nodes/ | ||
| PW_SEARCH_TYPE=opensearch | ||
| ;; | ||
| mysql) | ||
| PW_COMPOSE_FILE=docker/development/docker-compose.yml | ||
| PW_FAST_COMPOSE_FILE=docker/development/docker-compose-playwright-fast-mysql.yml | ||
| PW_DATABASE_SERVICE=mysql | ||
| PW_DATABASE_CONTAINER=openmetadata_mysql | ||
| PW_DATABASE_DATA_PATH=/var/lib/mysql | ||
| PW_DATABASE_DOCKERFILE=docker/mysql/Dockerfile_mysql | ||
| PW_DATABASE_MARKER=./database/mysql.ibd | ||
| PW_DB_DRIVER_CLASS=com.mysql.cj.jdbc.Driver | ||
| PW_DB_SCHEME=mysql | ||
| PW_DB_PORT=3306 | ||
| PW_AIRFLOW_DB_SCHEME=mysql+mysqldb | ||
| PW_SEARCH_SERVICE=elasticsearch | ||
| PW_SEARCH_CONTAINER=openmetadata_elasticsearch | ||
| PW_SEARCH_DATA_PATH=/usr/share/elasticsearch/data | ||
| # Elasticsearch 8+ dropped the nodes/<n>/ level that OpenSearch still uses. | ||
| PW_SEARCH_MARKER=./search/indices/ | ||
| PW_SEARCH_TYPE=elasticsearch | ||
| ;; | ||
| *) | ||
| echo "Unsupported Playwright fixture database: ${1:-<empty>}" >&2 | ||
| return 1 | ||
| ;; | ||
| esac | ||
| } | ||
|
|
||
| # Loads the profile of the database a fixture manifest was seeded on, refusing | ||
| # a fixture from another engine when the workflow pins PLAYWRIGHT_DATABASE. | ||
| load_playwright_fixture_profile_from_manifest() { | ||
| PW_FIXTURE_DATABASE=$(jq -r '.database // empty' "$1") | ||
| if [[ -n "${PLAYWRIGHT_DATABASE:-}" && "$PW_FIXTURE_DATABASE" != "$PLAYWRIGHT_DATABASE" ]]; then | ||
| echo "The Playwright fixture was seeded on '${PW_FIXTURE_DATABASE:-unknown}', not '$PLAYWRIGHT_DATABASE'" >&2 | ||
| return 1 | ||
| fi | ||
| load_playwright_fixture_profile "$PW_FIXTURE_DATABASE" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright 2026 Collate | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| if [[ $# -lt 1 ]]; then | ||
| echo "Usage: $0 <image>..." >&2 | ||
| exit 2 | ||
| fi | ||
|
|
||
| # Pre-pull the compose images with retries so a transient Docker Hub blip does | ||
| # not fail the shard on the very first step. Docker Hub's auth endpoint is | ||
| # unreliable enough that a single request per image regularly times out (see | ||
| # run 30730142750 where chromium-14/19/20 all failed on | ||
| # `Get "https://auth.docker.io/token?..."` with no test having run). Separating | ||
| # the pull from `docker compose up` also gives a clearer error when pulls | ||
| # actually fail — no orphan containers, exit before the health-wait loop. | ||
| pull_image_with_retry() { | ||
| local image=$1 | ||
| if docker image inspect "$image" >/dev/null 2>&1; then | ||
| return 0 # already cached from a previous invocation on the same runner | ||
| fi | ||
| local delay=10 | ||
| local attempt | ||
| for attempt in 1 2 3; do | ||
| if docker pull --quiet "$image"; then | ||
| return 0 | ||
| fi | ||
| if [[ $attempt -eq 3 ]]; then | ||
| echo "docker pull failed for $image after 3 attempts" >&2 | ||
| return 1 | ||
| fi | ||
| echo "docker pull $image failed on attempt $attempt; retrying in ${delay}s" >&2 | ||
| sleep "$delay" | ||
| delay=$(( delay * 2 )) | ||
| done | ||
| } | ||
|
|
||
| # Pulled together rather than one after the other: import-export-02 on run | ||
| # 34826046448 spent 22s on postgres and 3m44s on opensearch back to back. | ||
| # `wait` is checked per job so a failed pull still stops the script with its | ||
| # own message instead of being swallowed. | ||
| pull_pids=() | ||
| for image in "$@"; do | ||
| pull_image_with_retry "$image" & | ||
| pull_pids+=("$!") | ||
| done | ||
|
|
||
| pull_failed=0 | ||
| for pid in "${pull_pids[@]}"; do | ||
| wait "$pid" || pull_failed=1 | ||
| done | ||
| exit "$pull_failed" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.