Skip to content

Download E2E WordPress dependencies once and share them with all shards - #4089

Closed
vahidkay-meta wants to merge 3 commits into
mainfrom
ci/e2e-download-dependencies-once
Closed

vahidkay-meta wants to merge 3 commits into
mainfrom
ci/e2e-download-dependencies-once

Conversation

@vahidkay-meta

Copy link
Copy Markdown
Contributor

Description

Each of the 12 E2E shards downloaded WordPress core, WooCommerce, Storefront, Twenty Twenty-Five, WPC Composite Products and WP-CLI on its own, about 60 external downloads per run. A single DNS hiccup on one runner failed that shard with misleading errors. On the 3.7.8 release PR (#4088), for example, downloads.wordpress.org did not resolve on two runners:

  • product-category failed in setup with Download failed. "A valid URL was not provided." WordPress's wp_http_validate_url() resolves the host with gethostbyname(), and when that fails WP_Http::request() reports this generic message.
  • variable-product-depth passed all tests, then failed the PHP log check on a wp_update_plugins() warning that WordPress could not reach WordPress.org.

The other shards in the same run installed the same packages fine, so the failures were transient and per runner.

This PR adds a prepare-dependencies job that:

  • resolves versions on api.wordpress.org and downloads every dependency in a single step: WordPress core and WooCommerce for both the supported and latest version sets, Storefront, Twenty Twenty-Five, WPC Composite Products, WP-CLI, and the marketplace Meta for WooCommerce build when use-marketplace-version is set
  • tries each download 3 times, 5 seconds apart, and fails with an explicit error naming the URL
  • checks every archive (tar -t / unzip -t) and the WP-CLI phar
  • uploads everything as the wp-dependencies artifact

The shards now need this job, so they are skipped when it fails instead of each failing mid-setup. They install from the artifact (wp theme install <zip>, wp plugin install <zip>) instead of the network. Version resolution is unchanged: the supported WooCommerce major.minor resolves to its newest patch release, and a full version such as 11.1.1 falls back to that exact version.

Twenty Twenty-Five is installed only when missing, because recent WordPress releases bundle it and installing a zip over an existing theme fails. This matches the previous behaviour, where wp theme install twentytwentyfive left the bundled copy in place.

Not in this PR: the test site still makes its own update-check requests to api.wordpress.org at runtime (the source of the wp_update_plugins() warning). Stopping those, for example with an mu-plugin that short-circuits pre_http_request for api.wordpress.org, would be a follow-up.

Type of change

  • Tweak (non-breaking change which fixes code modularity, linting or phpcs issues)

Checklist

  • I have commented my code, particularly in hard-to-understand areas, if any.
  • I have confirmed that my changes do not introduce any new PHPCS warnings or errors.
  • I have checked plugin debug logs that my changes do not introduce any new PHP warnings or FATAL errors.
  • I followed general Pull Request best practices. Meta employees to follow this wiki.
  • I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes.
  • I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.
  • I have updated or requested update to plugin documentations (if necessary). Meta employees to follow this wiki.

Changelog entry

Dev - Download E2E test dependencies once per run and share them with all shards.

Test Plan

  • Parsed the workflow YAML and ran bash -n on the new download script.
  • Ran the script's jq queries against the live WordPress.org API: WooCommerce latest 11.2.1 and supported 11.1.1 (exact-version fallback), Storefront 4.6.2, Twenty Twenty-Five 1.5, WPC Composite Products 8.0.3 all return download links. WordPress 7.1 and latest tarballs, the marketplace trunk zip and WP-CLI 2.10.0 return 200.
  • The E2E workflow on this PR runs the new job and all shards.

@meta-cla meta-cla Bot added the CLA Signed label Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

📦 Latest Plugin Build

Built at: 2026-11-06T15:14:07Z
Commit: 7429f6f
Size: 1.9M

Download: Click here to download the plugin

To download: Click the link above → Scroll to bottom → Download "facebook-for-woocommerce" artifact

@codecov-commenter

codecov-commenter commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@08164c9). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4089   +/-   ##
=======================================
  Coverage        ?   11.12%           
  Complexity      ?     6127           
=======================================
  Files           ?      235           
  Lines           ?    20778           
  Branches        ?        0           
=======================================
  Hits            ?     2311           
  Misses          ?    18467           
  Partials        ?        0           
Flag Coverage Δ
integration 11.12% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vahidkay-meta vahidkay-meta added the changelog: dev Developer-facing only change. label Nov 5, 2026
@vahidkay-meta
vahidkay-meta force-pushed the ci/e2e-download-dependencies-once branch from ab0dda3 to 36f79de Compare November 5, 2026 09:59
@meta-codesync

meta-codesync Bot commented Nov 6, 2026

Copy link
Copy Markdown

@vahidkay-meta has imported this pull request. If you are a Meta employee, you can view this in D130203198.

Every E2E shard downloaded WordPress core, WooCommerce, Storefront, Twenty
Twenty-Five, WPC Composite Products and WP-CLI on its own, about 60 external
downloads per run. A single DNS hiccup on one runner failed that shard with
misleading errors, such as WordPress's "A valid URL was not provided." when
downloads.wordpress.org did not resolve.

A new prepare-dependencies job resolves versions on api.wordpress.org and
downloads everything in one step, trying each download 3 times 5 seconds
apart, checks the archives and uploads them as an artifact. The shards need
that job, so they are skipped when it fails, and install from the artifact
instead of the network.
The events classic-theme project switches to twentythirteen, which
WordPress no longer bundles, so the test helper installed it from
WordPress.org mid-run. A failed connection there logged a themes_api()
warning that failed the PHP debug-log check. Download it in
prepare-dependencies and install it during setup like the other themes.
@vahidkay-meta
vahidkay-meta force-pushed the ci/e2e-download-dependencies-once branch 2 times, most recently from 431ae82 to 93cfa29 Compare November 6, 2026 15:11
Every shard ran `playwright install --with-deps`, downloading the browsers
from Playwright's CDN and about 80 MB of system packages from the Ubuntu
mirror. On PR 4085 the mirror was slow enough that the step hit its
15-minute timeout and the shard failed before any test ran.

- prepare-dependencies installs every browser the shards use once, with
  one retry. The browsers are saved to the Actions cache, keyed on the
  @playwright/test version from package-lock.json, and the shards restore
  them instead of downloading.
- The system packages that install fetched stay in apt's cache and ship in
  the wp-dependencies artifact, with the Xvfb and Opera helper packages.
  The shards seed apt's cache with them, so apt installs from disk and
  only fetches a package that has since moved to a newer version.
- Both jobs make apt retry dropped downloads and treat 30 seconds without
  data as a failure to retry, so one stalled package cannot hold a step
  until its timeout.
@meta-codesync meta-codesync Bot closed this in bd1faa2 Nov 10, 2026
@meta-codesync meta-codesync Bot added the Merged label Nov 10, 2026
@meta-codesync

meta-codesync Bot commented Nov 10, 2026

Copy link
Copy Markdown

@vahidkay-meta merged this pull request in bd1faa2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: dev Developer-facing only change. CLA Signed Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants