Conversation
Replace the general `isEnvUp()` function with service-specific container status checks using Docker API. This provides more precise control over environment validation by checking the `php` and `database` containers individually.
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the development environment status checks for SQL import and sync commands to be more specific and accurate. Instead of checking if the entire environment is up, it now verifies that only the required containers (PHP and database) are running before proceeding with operations.
- Replaces broad
isEnvUpchecks with specific container status validation - Introduces a new
isContainerRunningutility function for granular container status checking - Updates import statements to remove unused functions and add new utilities
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/lib/dev-environment/dev-environment-lando.ts | Adds new isContainerRunning function to check individual container status via Docker API |
| src/commands/dev-env-import-sql.ts | Replaces isEnvUp with specific PHP and database container checks using the new utility function |
rinatkhaziev
approved these changes
Aug 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This pull request refactors the code to check if the development environment is running before importing SQL data. Instead of checking if the whole environment is up, it now specifically checks if both the
phpanddatabasecontainers are running. Additionally, it introduces a new utility function to check the running status of individual containers and updates imports accordingly.Improvements to environment status checks:
isEnvUpcheck with explicit checks for thephpanddatabasecontainers using the newisContainerRunningfunction inDevEnvImportSQLCommand. This ensures a more accurate validation of required services before proceeding.New utility function:
isContainerRunningtodev-environment-lando.ts, which checks if a specific container for a given environment is running by querying Docker directly.Code cleanup and import updates:
dev-env-import-sql.tsanddev-environment-lando.tsto remove unused functions and add the new utility where needed. [1] [2]Changelog Description
Changed
vip dev-env import sqlandvip dev-env sync sqlcommands now verify that the PHP and Database containers are running, rather than checking the status of the entire environment.Pull request checklist
New release checklist
Steps to Test
Without this patch, synchronization will fail with the "Environment needs to be started first" message. With this patch, it will succeed.