Writing a new thread because Issues with Code Road extension, collated posts is locked.
I have spent two days mentoring a friend through the beginning of the Relational Databases Certification in Chinese. Much time was spent configuring the local environment for the CodeRoad based workshops. I would like to report the problems I met and how I worked around them.
First prick in the process is a mistranslation: “Local Setup” should be “本地设置” rather than “局域设置”. (We had to resort to Local Setup because GitHub Codespaces is too slow to be usable. We were using GitHub proxy sites for cloning the repo and accessing the URL to tutorial.json of the workshops hosted on GitHub. I also had to patch the Dockerfile to use Chinese apt mirrors as well as the tutorial.json files to use proxied GitHub URLs.)
I chose to install VSCode, WSL2 and Docker Desktop. After running Dev Containers: Rebuild and Reopen in Container, we found the first launch of CodeRoad: Start can fail with “command not found”. We closed the window and relaunched the workspace in the same container, and CodeRoad: Start succeeded in opening the CodeRoad panel.
We finished the first workshop, Build a Boilerplate, without putting the CODEROAD_WEBHOOK_TOKEN in the Dockerfile. I sent the necessary webhook request with curl to record the progress.
We decided to put CODEROAD_WEBHOOK_TOKEN in the Dockerfile and rebuild the container before the second workshop. We were surprised to find that CodeRoad: Start opened back to the first workshop. The New workspace button asked for a path but could not create new workspace. I tried to mkdir in the terminal but there got Permission denied. I rebuilt the container again without cache. CodeRoad: Start still opens back to the first workshop.
I went digging in the source code of CodeRoad. It uses context.workspaceState to store the Tutorial and Position states. Issues with Code Road extension, collated posts - #29 by f.labarca.mercado inspired me to look into the user profile directory (specifically %APPDATA%/Code/User/workspaceStorage), and among the hash-named subdirectories I found out that the CodeRoad workspace would always write to one of them when closed, updating its Modified Time. The storage was in the host OS, so rebuilding the container did not touch it at all. But apparently rebuilding the container does not create a new workspace, but reuses the old workspace, so the old tutorial kept coming back.
I removed the subdirectory under workspaceStorage for the CodeRoad workspace, and relaunched it. CodeRoad: Start then opened to the homepage with the “Start New Tutorial” button.
I hope that CodeRoad at least gain a command for reseting to the homepage. I hope it gains more commands for moving between steps of the tutorial.
Chinese: 如果你用 VSCode 和 WSL2 和 Docker Desktop 运行 CodeRoad:
如果你发现运行 CodeRoad: Start 无法启动 CodeRoad ,关掉 VSCode 窗口再打开到 CodeRoad 的容器里再试一次。
如果你发现无法新建 Workspace,重建容器也卡在老的教程里的时候,用文件管理器到 %APPDATA%/Code/User/workspaceStorage 这个路径里(可以直接复制粘贴到路径栏中按回车),打开 VSCode 到你的 CodeRoad 窗口,再关掉,应该可以看到上述路径的文件夹中有一个子文件夹的最近改动时间变成了刚才关掉窗口的时间,删掉那个子文件夹,再打开 VSCode 回到 CodeRoad 窗口,应该就可以看到“开始新教程”按钮了。