CI Pipeline

Linter fails

If the pipeline fails due to linter errors, you most certainly have committed code that does not adhere to the coding standards. Just run the following commands locally in the root of the project to run the linter and commit the changes:

yarn run prettier --write ./
composer run lint:fix

End-to-End test fails

If the end-to-end tests fail, there are multiple reasons why this could happen. See the documentation on playwright tests for guidance on how to troubleshoot.

The most common reasons are:

  1. The test environment server is busy or slow. This can cause the tests to fail due to timeouts. In this case, you can try running the tests again.

  2. Changes in the latest database dump. The most recent database dumps of the production database contains data that leads to test failures. Common examples are renamed products or categories, text elements that were changed or out-of-stock products. While the tests should be able to handle these cases, sometimes the tests need to be updated to reflect the changes in the database.

  3. The test environment is not in a clean state. This can happen if the database is not reset before running the tests. In this case, you can try resetting the database and running the tests again.

  4. Problems with the elementor css cache. The elementor css cache can sometimes fail to be generated correctly, causing the tests to fail. Flushing the elementor css cache in the WordPress admin panel of the affected test environment usually fixes this issue.

  5. Weird edge cases. Sometimes the tests fail due to weird edge cases that are hard to reproduce. In this case, you can try running the tests again to see if the issue persists.

Composer validation fails

As part of the CI pipeline, we validate the composer.json and composer.lock files. In some cases, the composer.lock file is not up to date with the composer.json file. This can happen when a new package is added to the composer.json file but the composer.lock file is not updated. The GitHub action will fail with an error message similar to the following:

# Lock file errors
./composer.json is valid but your composer.lock has some errors
- The lock file is not up to date with the latest changes in composer.json, it is recommended that you run `composer update` or `composer update <package name>`.

To fix this issue, run the following command to update the composer.lock file:

composer update --lock

[!TIP] You could also run composer update as the error message suggests, but this will update all packages to the latest version (Which is probably not what you want, as version bumps should be done in a separate PR).

Renew Local SSL Certificate

  1. Make sure local VENV is running in project folder

  2. Run

valet secure
  1. Confirm with local admin password