Codespaces does not respect workspaceFolder option in devcontainer.json #11923
-
My org's repo is hosted in Azure Devops, and our github repo is a condespaces config plus some scripts to allow us to use codespaces against that repo. The way this works right now is that we create a destination directory for the repo in our Dockerfile, then clone the Azure Devops repo in a postCreate script. We would like the "start codespace" button to launch the codespace in that cloned repo's directory. At present, the codespace always launches against the shim repo's workspace ( We have workspaceMount and workspaceFolder set in our devcontainer.json Devcontainer.json {
"$schema": "https://raw.githubusercontent.com/microsoft/vscode/master/extensions/configuration-editing/schemas/devContainer.schema.json",
"name": "ADO in in github codespaces",
"build": {
"dockerfile": "./Dockerfile",
"args": {
"USERNAME": "vscode"
}
},
"remoteUser": "vscode",
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"workspaceMount": "/",
"workspaceFolder": "/workspaces/ado-repo",
"extensions": [],
"remoteEnv": {
"ADO_REPO_URL": "(omitted)",
"VM_REPO_PATH": "/workspaces/ado-repo",
"USER_NPMRC_PATH": "(omitted)",
"ADO_NPM_FEED": "(omitted)"
},
"postCreateCommand": "/bin/bash .codespaces/post-create.sh",
"postStartCommand": "/bin/bash .codespaces/post-start.sh",
"forwardPorts": [3000, 30001]
}
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
Internally, we use a repo forked from https://github.com/vsls-contrib/ado-in-codespaces to contribute to certain pieces of codespaces that live in ADO. I think taking a look at the devcontainer.json in this repo may be helpful! |
Beta Was this translation helpful? Give feedback.
-
Pada Sabtu, 05 Maret 2022, Max ***@***.***> menulis:
… We're using the same template as a base repo internally at Outlook. as far
as I can tell from that repo definition, the vscode workspace will still
boot in the shim repo, and the user has to manually execute the cddefault
alias to bring them to the checked-out ado repo.
(unless codespaces has some logic around reading $CODESPACE_DEFAULT_PATH
from the env that I'm missing)
—
Reply to this email directly, view it on GitHub
<#11923 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AX2RH347CS77R3ZJ576HIUTU6J2N5ANCNFSM5PCDLZMQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
null
|
Beta Was this translation helpful? Give feedback.
-
Confirmed still happening, minimal repro here forked from https://github.com/microsoft/vscode-dev-containers/. Works fine in local devcontainer ✅
Is ignored in Codespace ❌
Apparently was to be fixed in late 2020, so not sure if broken again or never working 🤔 Ref for myself as part of my quest to free up space on the prompt: microsoft/vscode-dev-containers#1196 (comment) |
Beta Was this translation helpful? Give feedback.
-
just hit the same issue. would be great to have a consistent workflow in codespaces and local |
Beta Was this translation helpful? Give feedback.
-
I encountered this issue with the following flow:
Committing the changes and creating a fresh codespace gave the correct folder. |
Beta Was this translation helpful? Give feedback.
just hit the same issue. would be great to have a consistent workflow in codespaces and local