Automattic / vip-cli

The VIP-CLI
https://docs.wpvip.com/vip-cli/
MIT License
58 stars 17 forks source link

fix(dev-env): verify the container is running before URL scan #2061

Closed sjinks closed 3 weeks ago

sjinks commented 1 month ago

Description

In #1896, we removed the 404 code from the list of "unhealthy" codes. However, that introduced a bug: if Traefik cannot find a container matching the host, it returns a 404 response. Because of that, all environments are shown as "UP."

In this PR, we ensure service containers are running before starting a URL scan.

Pull request checklist

New release checklist

Steps to Test

  1. Create two environments.
  2. Start one of them
  3. Run vip dev-env list or vip dev-env info -s slug_of_not_running_env: even if the environment is not running, it will be shown as "UP."
  4. Apply the patch and ensure the problem hs gone away.
github-actions[bot] commented 1 month ago

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

rinatkhaziev commented 3 weeks ago

tested, works.