spec
spec copied to clipboard
Clarify working directory for lifecycle script execution
The documentation or the initializeCommand says:
A command string or list of command arguments to run on the host machine before the container is created.
This is insufficient since it does not say anything about the working directory when the command is run.
This is a general problem with the reference documentation, every time something is run (on the host or in the container) the script writer needs to know the working directory.
PS. The same page uses "(list of) command arguments to run" but I cannot see that "command arguments" is defined anywhere, and it is not standard POSIX terminology. I find the term confusing since the immediate question then is "which command will get those 'command arguments' as its arguments?"
Hi 👋
This is insufficient since it does not say anything about the working directory when the command is run.
The document does mention "⚠️ The command is run wherever the source code is located on the host. For cloud services, this is in the cloud." which already answers your question about the working directory.
Let us know which bit of information is confusing to you, happy to enhance the docs. Thanks!
Thank you for looking at this.
I initially interpreted your quoted text in the same way as you, i.e. that the text you quoted tries to say something about the working directory. However, typically "the source code is located" in many different directories, and "in the cloud" is irrelevant for file structure, so I concluded that the text you quoted actually tries to emphasize that the code is not run in the dev container.
So, even if your interpretation is correct, the documentation is unclear and imprecise regarding working directory, and the descriptions of the other lifecycle scripts also need information about working directory (and their descriptions do no have any text that could be misunderstood as talking about working directory).
Thanks for explaining. Looping in @bamurtaugh for doc enhancements.
Thanks for looping me in @samruddhikhandale, and thanks for the discussion @PerMildner! Your feedback on how to clarify our documentation is really valuable.
However, typically "the source code is located" in many different directories
It's helpful to hear this is how the docs may be interpreted. Our intention is to state that the relevant directory is where your devcontainer.json in source code is located. While your project may have many folders/directories within it, the devcontainer.json will be based in one specific directory.
If you have a moment, it'd be fantastic if you could start a PR where you've identified our documentation could be clearer. That way we know we'd be addressing the spot(s) that are most confusing. We'd be more than happy to iterate with you on it too.
Please let us know if you have other questions/feedback, thanks!