opensafely-core / research-template-docker

This provides the devcontainer Docker image used by repos created from the OpenSAFELY research template.
Other
0 stars 0 forks source link

Missing Git dropdown and tab from RStudio #48

Closed iaindillingham closed 4 weeks ago

iaindillingham commented 1 month ago

RStudio users find it convenient to work with Git using RStudio's version control interface, as described in the "Version Control" page of the RStudio documentation. It is enabled by default in all OpenSAFELY Codespaces, but the expected visual elements -- the Git/Version control dropdown and the Git/Version Control tab -- don't appear.

The "Troubleshooting" section of the previously mentioned page suggests this is because the rstudio user doesn't own the working directory. ls -l . within the working directory tells us that it is owned by the rstudio user, but also by the root group. Possibly, the working directory needs to be owned by both the rstudio user and the rstudio group? That said, git status doesn't report the expected error.

Thanks, @milanwiedemann, for the feedback.


When I mentioned this to @lucyb, she asked about preferred interfaces to Git. Although we use git on the "How to add GitHub Codespaces to your project" page of the OpenSAFELY documentation, this is more because git provides canonical command names that can be translated into the user's preferred interface, and less because we think git is the preferred interface. So, I think it's reasonable that we support RStudio's version control interface, just as we support VS Code's Source Control interface, without describing either in the documentation.

Jongmassey commented 1 month ago

from RStudio version control docs

You should also become familiar with using RStudio Projects (which are required for version control features to be enabled).

In a Codespace I had running on the research-template repo I didn't have the git button in RStudio. However, when I went through the "New Project" dialogue in RStudio to add an RStudio project to the existing workspace directory, the Git button appeared and the various git dialogues seem to work fine:

image

Jongmassey commented 1 month ago

@milanwiedemann has suggested to me that we consider adding the RProject file to the template so this works out of the box for everyone. Apparently the desktop version of RStudio adds this file automatically whenever you open a workspace folder.

lucyb commented 1 month ago

A number of researchers already have an .Rproj file in their projects (see search). Equally this will just be noise to those researchers not using RStudio. Would it be possible to point people to some existing documentation that shows them how to create an R project file instead (and why they might want to do that)?

iaindillingham commented 1 month ago

There have been a couple of things like this recently: too large to ignore, but too small to document (for good reasons). Possibly the "Getting started" section needs a "Troubleshooting" page?

I don't imagine for a moment that anyone will search for this page; they will ask tech support for help. However, tech support can link to this page when they respond.

Jongmassey commented 1 month ago

Equally this will just be noise to those researchers not using RStudio

I share this concern. Interestingly, I found that when I used codespaces last, when I opened RStudio it did indeed create an RProj file automatically...

lucyb commented 1 month ago

Possibly the "Getting started" section needs a "Troubleshooting" page?

Good idea! I think this will also have the side effect of us documenting some of the smaller problems we come across, which will help us understand whether or not we want to fix them, or if there's a wider problem that needs tackling.

lucyb commented 4 weeks ago

We'll add this to a troubleshooting page rather than trying to fix it.