Repository navigation
fix(ci): build and restore the Playwright golden fixture on MySQL - #36404
shrabantipaul-collate merged 6 commits into
Conversation
The MySQL release-branch Playwright run goes through the shared reusable workflow, but the golden-fixture builder, validator and fast-environment launcher only knew the PostgreSQL + OpenSearch stack. Every MySQL fixture rebuild failed with `No such object: openmetadata_postgresql`, and because the fixture cache key ignored the database, a MySQL run could restore a PostgreSQL fixture and silently test PostgreSQL instead. - playwright_fixture_profile.sh maps each database to its compose stack, containers, data paths and server/Airflow settings (PostgreSQL with OpenSearch, MySQL with Elasticsearch). - The fixture manifest (v3) records the database and generic databaseImage/searchImage digests; the validator and launcher reject a fixture seeded on a different database. - docker-compose-playwright-fast-mysql.yml restores MySQL and Elasticsearch from the snapshot. - The golden-fixture cache key includes the database.
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
…/openmetadata-actions-failing-fix # Conflicts: # .github/scripts/tests/test_playwright_cache_assets.py
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
… the fixture decisions The pull step read the manifest through process substitution, whose exit status is lost, so a tar or jq failure skipped the pull silently. Assign the manifest and require both images instead. Add decision records for the per-database golden-fixture contract and for pulling fast-mode images outside the 5m startup budget.
Code Review ✅ Approved 2 closed / 2 findings🟡 Medium risk · Adding MySQL/Elasticsearch fixture creation and restoration changes CI database setup; profile or image mismatches could fail shards or test against an unintended stack. Fixes the MySQL Playwright golden-fixture pipeline by adding a database-specific fixture profile, MySQL and Elasticsearch stack support, a database-scoped cache key, and a separate 15m image-pull step outside the 5m restore budget. Resolved the missing decision-record findings for the per-database fixture contract and the new image-pull budget. No open issues found. ✅ 2 closed✅ Quality: Per-database golden-fixture contract has no decision record
✅ Quality: New 15m image-pull budget outside the 5m restore has no record
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Describe your changes:
Fixes the failing
MySQL Playwright E2E (release branch)run: every 2.1 dispatch dies inprepare-playwright-fixturewithError: No such object: openmetadata_postgresql(e.g. run 40636905856).Since #31628 the MySQL run goes through
playwright-e2e-reusable.yml, but the golden-fixture pipeline it uses (#30310) only knew PostgreSQL + OpenSearch: the builder snapshotsopenmetadata_postgresql/openmetadata_opensearch, the validator requires./postgres/PG_VERSION, and the shard launcher startsdocker-compose-postgres.ymlwith the PostgreSQL JDBC driver andSEARCH_TYPE=opensearch. The MySQL stack (docker/development/docker-compose.yml) runs MySQL + Elasticsearch, so the snapshot step fails.A second, silent problem: the golden-fixture cache key did not include the database. Whenever a PostgreSQL fixture with the same fingerprint was cached, a "MySQL" run restored it and actually tested PostgreSQL + OpenSearch.
Type of change:
High-level design:
.github/scripts/playwright_fixture_profile.sh(new, sourced) maps a database to its stack: compose file, fast compose override, service/container names, data paths, base image Dockerfile, layout markers, server JDBC settings, Airflow DB scheme andSEARCH_TYPE.postgresql→ PostgreSQL + OpenSearch,mysql→ MySQL + Elasticsearch.load_playwright_fixture_profile_from_manifestreads the fixture's database and rejects a fixture seeded on another engine whenPLAYWRIGHT_DATABASEis set.database,databaseImage,searchImage(replacingpostgresImage/opensearchImage); the archive uses genericdatabase/andsearch/directories. The database image is the digest of theFROMimage of the stack's Dockerfile (postgres:15/mysql:8.0), as before for PostgreSQL.docker/development/docker-compose-playwright-fast-mysql.yml(new) restores MySQL (keeps--sort_buffer_size=10M, drops binlog/flush durability for the disposable clone) and Elasticsearch (2 GiB heap) from the/dev/shmsnapshot. The PostgreSQL override uses the same genericPW_DATABASE_*/PW_SEARCH_*variables.PW_COMPOSE_FILE,PW_FAST_COMPOSE_FILE,PW_DATABASE_SERVICE,PW_SEARCH_SERVICEfor cleanup and diagnostics.playwright-e2e-reusable.yml): top-levelPLAYWRIGHT_DATABASE: ${{ inputs.database }}, golden-fixture cache keyplaywright-golden-fixture-v2-${{ inputs.database }}-…, shard diagnostics read the launcher's exports (with PostgreSQL fallbacks for release branches whose launcher predates them). Comment inpopulate-playwright-caches.ymlupdated accordingly.pull_playwright_fixture_images.sh(moved out of the launcher) now also runs as its own step insetup-openmetadata-test-environmentwith a 15m timeout, reading the image digests from the fixture manifest. On the first MySQL run, 4/34 shards were killed by the 5m restoretimeoutwhile pullingdocker.elastic.co/elasticsearch:9.3.0(4–5 min with ~40 shards pulling at once); the same budget previously killed a PostgreSQL shard on an OpenSearch pull (run 34826046448). The launcher calls the same script, so its pulls are cache hits.docker-compose.yml, the new override,docker/mysql/, the profile helper) join the fixture inputs.Rollout: the manifest version, fixture key and fingerprint all change, so the first run of each pipeline rebuilds its fixture once. Release branches need a backport — a dispatch with
branch: 2.1checks out 2.1's scripts; I'll open the 2.1 backport after this merges.Alternatives rejected: seeding every MySQL shard from scratch (restructures the PR-gating shard job and slows every shard); restoring the pre-#31628 standalone MySQL workflow (re-introduces the drift #31628 removed).
Tests:
Use cases covered
Unit tests
.github/scripts/tests/test_playwright_cache_assets.py:test_fixture_profile_matches_the_seeded_and_fast_compose_stacks[postgresql|mysql]— profile container names / data paths / images agree with both compose stacks (fails on the original bug: a wrong container name for MySQL).test_fixture_validator_accepts_a_fixture_seeded_on_the_requested_database[mysql|postgresql]— runsvalidate_playwright_fixture.shon a real.tar.zstfixture.test_fixture_validator_rejects_a_fixture_seeded_on_another_databasetest_fixture_validator_requires_the_search_layout_of_the_fixture_databasetest_golden_fixture_cache_is_scoped_by_databasetest_playwright_startup_diagnostics.pyfor the renamed stop-script variables.python -m pytest .github/scripts/tests/→ 335 passed, 5 failed. The 5 failures are pre-existing and fail identically on a cleanorigin/maincheckout (test_unavailable_first_attempt_evidence_never_becomes_a_pass[False],test_basic_project_excludes_dedicated_state_specs,test_search_impact_mapping_includes_ingestion_project_for_schema_search,test_summary_reconciles_results_and_evaluates_performance_independently,test_retry_policy_is_one_everywhere_during_the_flake_week).bash -non all changed scripts;docker compose configon the merged MySQL and PostgreSQL fast stacks (bind mounts replace base volumes, base healthchecks inherited, pinned image used with--no-build).Backend integration tests
Ingestion integration tests
Playwright (UI) tests
full_suite=true):82516d8: MySQL golden fixture built ✅; 30/34 shards (incl. Airflow-on-MySQL ingestion lanes) passed; 4 killed by the 5m restore timeout while pulling the Elasticsearch image → fixed ind08b91b/9a81c13.9a81c13(PR head): success, 34/34 shards. Environment setup per shard: min 76s, median 95s, max 309s (the max would have exceeded the old 5m pull+startup budget).Manual testing performed
create_playwright_fixture.sh→docker inspect openmetadata_postgresqlon the MySQL stack.docker compose -f docker/development/docker-compose.yml -f docker/development/docker-compose-playwright-fast-mysql.yml configwith fixture env vars and checked image, command, volumes, healthchecks.mysql-nightly-e2e.ymlon this branch twice (links above).tar --zstd --occurrence=1 -xOf <fixture> ./fixture-manifest.json | jqunder GNU tar 1.35 (Ubuntu 24.04, as on runners).UI screen recording:
Not applicable — CI-only change.
Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>— test/CI fix, no issue (skip-pr-checks).My PR is linked to a GitHub issue via
Fixes #<issue-number>above. — test/CI fix, see above.I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: not applicable.
For a UI feature or feature task: not applicable.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: reviewed
f989c7d,82516d8,d08b91bagainstREVIEW.md— no 🔴 (9a81c13applies the last nit,--occurrence=1). Nits fixed: release-branch diagnostics fallbacks, shared manifest→profile check (now covered by the validator tests), stale cache-key comment. Answered: per-database fixture fingerprint not split — MySQL-only compose edits are rare (~2 in 90 days) and a split would thread the database through every--kind fixturecall site.Decision check: no durable cross-component decision; the fixture manifest is produced and consumed only by these scripts.
I have added a test that covers the exact scenario we are fixing.
🤖 Generated with Claude Code
The PR appears safe to merge, with a non-blocking improvement to report fixture-read errors in the image-pull step.
Findings
Summary
Adds MySQL and Elasticsearch support to the shared Playwright fixture pipeline.
Acknowledged choices from
shrabantipaul-collate: release branches need a separate backport; database-specific fingerprints are intentionally deferred because MySQL-only changes are rare and splitting them would affect every fixture-key caller; the manifest remains an internal script contract.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Requested database] --> B[Shared fixture profile] B --> C[Seed matching database and search stack] C --> D[Archive data and version 3 manifest] D --> E[Cache under database-specific key] E --> F[Reject a different database] F --> G[Pull recorded images] G --> H[Restore data and start matching services] H --> I[Start server and optional Airflow]Reviews (1) · Last reviewed commit: "fix(ci): stop reading the fixture once i..." · Reviewed by Greptile