Opened 11 months ago
Last modified 4 months ago
#62807 new enhancement
Protect `env:start` command against connection issues
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Build/Test Tools | Keywords: | has-patch needs-testing |
| Focuses: | Cc: |
Description
[59231] moved the composer update command from the test:php script to env:start to prevent the command from running every time unit tests are run.
ticket:57189#comment:22 from @flixos90 mentions a situation where packagist.org was experiencing some down time and caused the env:start command to fail. The reason for this can be hard to decipher and it's easy to assume that you are experiencing a Docker issue.
Ideally the composer update command catches errors and displays a more informative notice to the user. "There was a failure running composer update." with some guidance to fix the issue.
See #57189.
Change History (3)
This ticket was mentioned in PR #9360 on WordPress/wordpress-develop by @iamadisingh.
4 months ago
#2
- Keywords has-patch added; needs-patch removed
This PR improves the developer experience for npm run env:start by providing clear, actionable error messages if composer update fails.
Trac ticket: https://core.trac.wordpress.org/ticket/62807
Currently, the composer update command is run as part of the
env:startnpm script inpackage.jsonTo provide a clearer, actionable error message, we could move the
composer updatelogic into the JS startup scriptstart.js. This would allow us to run Composer using Node's spawnSync, check the exit code, and print a custom message if it fails (something like "There was a failure running composer update. This is often caused by network issues or Packagist.org downtime. Please check your internet connection and try again.").