Configuration settings aren't enforced in Codespaces devcontainer configuration
I'm building a devcontainer that includes this extension so that my students can have their code automatically pushed to their repository. I have configured the devcontainer.json to include the extention, this works, and apply specific settings to enable the auto save and ignore any problems in the code, this part doesn't work. Below is the full configuration file where you can see I'm using the gitdoc.commitValidationLevel and gitdoc.enabled settings. When I check the settings of a coding environment in Codespaces that is using this devcontainer I can see the extension but the settings aren't set. If I manually change the settings then I see the extension behave how I would like it to.
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {
},
"customizations": {
"vscode": {
"extensions": [
"ritwickdey.LiveServer",
"esbenp.prettier-vscode",
"vsls-contrib.gitdoc"
],
"settings":{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"gitdoc.commitValidationLevel": "none",
"gitdoc.enabled": true
}
}
}
}
You can see the full repo at https://github.com/bnolan001/CodespacesWebTemplate
Also, totally unrelated, do you have anywhere someone could contribute money to the project?
Hmm interesting! I was able to repro this exact issue. Oddly enough, if I delete the settings.json file and reload, then everything works as expected. And it also seems to work if I simply delete the setting in settings.json file to enable GitDoc. So it almost seems like there's an issue with GitDoc being configured to be enabled in both the VS Code settings file and the devcontainer 🤔
Would you be able try that and see if it repros for you as well? And I'll take a look and see what might be going on.
Yep, I opened Codespaces, deleted the settings.json file in the .vscode folder, reloaded the Codespaces page and editing a file. It then automatically commit/push the changes back to the repo. I'll try deleting the .vscode folder and the settings.json file in the folder to see if that resolves the issue.
Tried creating a project that didn't have a .vscode folder as well as one with the folder and an empty file called empty.txt in it. Thought maybe one of those might get the environment to work with the GitDoc extension but in both instances the auto save configuration defined in the devcontainer.json file didn't get applied to the actual extension settings.
I'm no longer able to repro this, so it may have been resolved by a bug in Codespaces/the devcontainer CLI. That said, I'm going to close it for now, but please re-open it if you're still hitting it. Thanks!