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.
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
Allow using
${remoteUser}
inside of features #525base: main
Are you sure you want to change the base?
Allow using
${remoteUser}
inside of features #525Changes from all commits
c47cb27
6bdccac
cf32d27
1afe943
92ca28c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
updated.remoteUser
could use other variables like${localEnv:DEV_CONTAINER_USER}
, would that work correctly? E.g.:Maybe there needs to be a second pass for substituting
${remoteUser}
which can get its value from the devcontainer.json?Another case to consider is when the
remoteUser
is set in the base image's metadata (e.g.,mcr.microsoft.com/devcontainers/base:bullseye
), in that caseupdated.remoteUser
would beundefined
.What if the
remoteUser
is not set, but the dev container will run with the container user? Should${remoteUser}
be replaced with the container user? We also do that for the_REMOTE_USER
variable.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.
There's a lot of tests here that could help assert the behavior when
remoteUser
is set on as image metadata: https://github.com/devcontainers/cli/blob/main/src/test/imageMetadata.test.ts(If you're curious what metadata is attached to an image, this is how I generally take a peek at it on the fly:)
That's a good point that I did not think of, perhaps it should align with those variable (info here https://containers.dev/implementors/features/#user-env-var)
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.
Hello @chrmarti, hello @joshspicer,
I understood the assignment. Configuration options can come from many different sources. Relying on the devcontainer.json to contain them is not the proper way to go.
Usually I'm pretty good at reading foreign code and getting the gist of it. At least enough to be able to provide smaller bugfixes and features. This project here... doesn't work very well with my brain. I'm having a hard time following along the different workflows without seeing the red string showing a common structure. Most likely the lack of experience on my side, I'm more ops than dev.
I'll give it another shot next weekend, unless one of you already knows where to use the screwdriver. Feel free to do whatever needs to be done, I definitely won't complain.