-
Notifications
You must be signed in to change notification settings - Fork 360
cli issue - Valid devcontainer.metadata can corrupt compose override file #904 #928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli issue - Valid devcontainer.metadata can corrupt compose override file #904 #928
Conversation
chrmarti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Could you add a test? Does a single devcontainer.json with a docker-compose.yml reproduce the issue?
In order to reproduce this issue I built a base devcontainer image manually with a devcontainer.json having the environment properties in containerEnv tag. Please find the files for the same in my GitHub repo location https://github.com/Kaniska244/cli/tree/dev/Mathi/RosConsole/src/test/configs/original-container/.devcontainer Then the second part is to use the previously built base image in the docker compose yaml and start the devcontainer and this is when the the environment properties in the docker compose file are being overridden with different values already set in the base image and the issue occurs. PFB the files in the following location. I will need to check further if we can add an automated test scenario for this using the test framework. |
|
@Kaniska244 I can reproduce it with a single devcontainer.json. That should also simplify the automated test: {
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"containerEnv": {
"ROSCONSOLE_FORMAT": "[$${severity}] [$${walltime:%Y-%m-%d %H:%M:%S}] [$${node}]: $${message}"
}
}And: version: '3.8'
services:
app:
image: mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm
volumes:
- ../..:/workspaces:cached
command: sleep infinity |
Hi @chrmarti, Thanks a lot for the guidance. I will try this and use this approach in writing the test script. I will keep you posted. |
…rties and the updated test script for the fix.
|
Hi @chrmarti , I have modified existing test script to add test for this fix and I have executed the same. Also modified the fix to escape newline and dollar in the environment properties. Would you kindly review the changes. With Regards, |
chrmarti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks! @eljog Could you review again?
ddoyle2017
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good 👍 @eljog
Ref: #904
Description
Changelog
src/spec-node/dockerCompose.tsfile's Line number 560, wrapped the key value pairs in double quotes so they be considered single entity, rather the : separating them into two entities earlier as discussed in the issue atROSCONSOLE_FORMAT: "[$${severity}] [$${walltime:%Y-%m-%d %H:%M:%S}] [$${node}]: $${message}"Checklist