CI configuration to accommodate several FE islands

What does this MR do and why?

The MR introduces the shared CI configuration to accommodate several FE islands without the need to manually update the config with every new FE island.

TL;DR; of the changes

  • scripts/validate_fe_islands_ci.rb script to validate the FE islands CI configuration
  • scripts/update_fe_islands_ci.rb script to automatically update the FE islands CI configuration
  • a new validate-fe-islands-ci "predictive" job that runs validation in CI
  • a new validate-fe-islands-ci command to run validation in pre-commit hook of lefthook
  • extensive documentation on the FE islands structure (inline in the scripts and in ee/frontend_islands/README.md), CI config, important jobs (in CI), and scripts (in package.json)
Detailed explanation

Most of the configuration is universal and doesn't need to be run on each particular island except for two jobs currently:

  • test-fe-islands - unit tests
  • eslint:fe-islands - eslint analysis

To compliment the shared config and support these two cases still without the need for manual updates, the MR introduces two new scripts.

scripts/validate_fe_islands_ci.rb.

This script validates the existing CI configuration against the actual islands in ee/frontend_islands/apps. The validation passes only if:

  • all the folder in apps/ have valid package.json
  • all the package.json files in the islands define test and lint jobs

scripts/update_fe_islands_ci.rb

This script automatically updates the CI configuration (still keeping it explicit, no magic or abstractions) if there are apps with valid configuration (runs the previous validation step under the hood) so that the two jobs mentioned above would run parallel streams for each FE island.

Why validate if update runs validation as well?

Great question. The answer is in two other things this MR introduces:

  • a new validate-fe-islands-ci CI job that does run validation only as a quickly-failing job to fail early if the CI config for the FE islands isn't correct based on the validate_fe_islands_ci.rb's output.
  • we run validation for the FE islands in pre-commit hook in lefthook to fail as early as possible to avoid unnecessary CI runs

Typical workflow

Here's the typical lifecycle stages of a new FE island and the corresponding validation output at those points:

State Validation output
Empty folder in app/ Screenshot_2025-11-06_at_09.11.15
Folder with empty or invalid package.json Screenshot_2025-11-05_at_11.49.17
Valid package.json but missing both lint and test scripts Screenshot_2025-11-06_at_09.13.12
Valid package.json but missing just the test script Screenshot_2025-11-06_at_09.14.27
Valid package.json but missing just the lint script Screenshot_2025-11-06_at_09.14.59
Valid package.json with both scripts, but the app isn't in the CI config jobs Screenshot_2025-11-06_at_09.15.32
Running ruby scripts/update_fe_islands_ci.rb as suggested Screenshot_2025-11-06_at_09.17.12
Re-running the validation script after updating the CI config Screenshot_2025-11-06_at_09.19.23

References

How to set up and validate locally

  • Try following the workflow as depicted in the screenshots above to confirm the behavior
  • If you have lefthook enabled locally, try comitting an "invalid" app (either empty package.json, or no script(s), etc.). Ensure lefthook runs the validation command and doesn't allow to commit
  • Testing in CI is a bit more challenging, but you can observe the new job running on this MR (shouldn't fail)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #578506

Edited by Denys Mishunov

Merge request reports

Loading