fix(yq): migrate fully to yq v4 syntax#96
Open
sbaerlocher wants to merge 1 commit intowhatwedo:masterfrom
Open
fix(yq): migrate fully to yq v4 syntax#96sbaerlocher wants to merge 1 commit intowhatwedo:masterfrom
sbaerlocher wants to merge 1 commit intowhatwedo:masterfrom
Conversation
s4mpl3d
reviewed
Sep 9, 2025
Member
s4mpl3d
left a comment
There was a problem hiding this comment.
@sbaerlocher there are some conflicts. Please also pin the yq image version
| _checkProject | ||
| _loadProjectDotdde | ||
| local service=$(docker run --rm -v $(pwd):/workdir mikefarah/yq:3 yq r --printMode p docker-compose.yml 'services.*' | head -n1 | sed 's/.*\.//') | ||
| local service=$(_yq eval '.services | keys | .[]' docker-compose.yml | head -n1 | sed 's/.*\.//') |
Member
There was a problem hiding this comment.
| head -n1 | sed 's/.*\.//' we can do this with yq too
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.
Overview
DDE internally uses two different Docker versions of yq – one being the latest (latest) and the other an older version 3. This creates unnecessary complications, especially when all images are removed locally and, upon re-downloading with DDE, two different images have to be fetched.
To resolve this issue, the method for parsing the docker-compose file has been updated to use yq v4 syntax, eliminating the dependency on a specific yq v3 Docker image.
Changes
Migration to yq v4:
The complex docker run command that used the mikefarah/yq:3 image has been replaced with the
_yq evalfunction. This change ensures compatibility with yq v4 and removes the need to download the specific yq v3 Docker image.Adjustment of the yq Query:
The query has been modified from:
services.* | head -n1 | sed 's/.*\.//'to:
.services | keys | .[0]This update accurately extracts the first service name from the docker-compose.yml file.
Shell Scripts Update:
In the file
commands/project/shell/root.sh, the query was slightly modified to:.services | keys | .[] | head -n1 | sed 's/.*\.//'This correction ensures that the intended functionality is maintained.
Affected Files:
The changes were applied in the following files:
commands/project/exec.shcommands/project/exec/root.shcommands/project/fix-permissions.shcommands/project/shell.shcommands/project/shell/root.shImpact
Functionality:
The extraction of the first service name from the docker-compose.yml file now relies on the updated yq v4 syntax using the
_yq evalfunction.Simplification:
By removing the dependency on the yq v3 Docker image, the system is simplified, and the need to download multiple images is eliminated.
Compatibility:
These changes ensure full compatibility with yq v4 while maintaining the expected behavior.