Rework /workspace organization on gitpod (project in own top-level directory)

Created on 2 May 2024, 6 months ago
Updated 15 September 2024, about 1 month ago

Problem/Motivation

I find the organization of the /workspace/drupalpod directory on a Drupalpod-created Gitpod instance to be confusing. vscode actually checks out the drupalpod project (which is irrelevant to users of this tool) in /workspace, then puts the actual repository in play in /workspace/drupalpod/repos/

gitpod /workspace/drupalpod (main) $ tree -L 2 /workspace/drupalpod/
/workspace/drupalpod/
├── Drupal Core Development Composer Project.md
├── LICENSE
├── README.md
├── repos
│   └── drupal

So to get any work done, people have to go find where the code is.

Steps to reproduce

Open any project and `cd /workspace/drupalpod`

Proposed resolution

A gitpod repo can have many things in /workspace, so make the various repositories peers, and use the actual repository as the default one opened by vscode.

$ tree -L 1 /workspace
/workspace
|-- drupal
|-- drupalpod
`-- some_module

Then open vscode with the "drupal" folder.

Note that some fiddling has to be done with modules. They'll have to be either mounted into the ddev-webserver with an extra docker-compose.mounts.yaml or will have to be copied into the drupal folder. One of the techniques for doing this is in https://stackoverflow.com/questions/57426306/ddev-mount-additional-folde...

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Component

Code

Created by

🇺🇸United States rfay Palisade, CO, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rfay
  • 🇺🇸United States shaal Boca Raton, FL

    Thank you, @rfay.

    The original idea (and perhaps it was confusing, but I was trying to add context) was that most developers are probably familiar with a "normal" modern Drupal setup, where Drupal is installed under `/web` or `/docroot`, and dependencies are managed by Composer.

    Currently, it's not possible to manage Drupal core with Composer; only a "drupal/recommended-project" can be managed.

    Because of that, the "website" being set up by DrupalPod is under `/workspace/DrupalPod`.

    Under that directory, users should expect a "normal" modern installation, where contributed modules are under `/web/modules/contrib`, and the core is under `/web/core`.

    When users choose to work on Drupal core issues, the git repository of Drupal core itself is directly available in `/web/core`. When working on a contributed module, the git repository of that module is directly available at `/web/modules/contrib/my_module`.

    This allows the Drupal installation to use the updates the user is making in the current installation.

    The git repositories are symlinked from `/repos/drupal` or `/repos/my_module`.

    The DrupalPod setup itself is 'hidden' under `.gitpod/`, and the ddev setup is 'hidden' under `.ddev/`.

    In summary, the DrupalPod installation is supposed to provide a familiar Drupal website setup, where all directories are well-known.

    I'd love to hear your thoughts.

  • 🇺🇸United States rfay Palisade, CO, USA

    I helped quite a few people with this confusion at the Mentored Contribution. They opened drupalpod and ended up in the drupalpod git repo (which is irrelevant to them) and didn't know what to do next. They were fine when I got them into repos/ but not fine before that.

  • 🇺🇸United States shaal Boca Raton, FL

    What if after initial setup we delete `/workspace/drupalpod/.git` directory? Would that make it simpler for people?
    We can also open VSCode welcome screen with clear instructions on project structure, and how to find where is the git they should push code to.

    I'm open for ideas as I would like to make it simpler and easier for everyone.

  • 🇺🇸United States rfay Palisade, CO, USA

    Deleting the drupalpod/.git would be a step forward, but they still wouldn't know what to do next.

    People don't read anything as you know, but adding more instructions is still OK.

    Is there a way to change the default directory? That would also solve it, if we put them in the repos/* directory to start.

  • 🇺🇸United States rfay Palisade, CO, USA

    @shaal and I rehashed this again on a call the other day. IMO this is really important. This has already been done for DDEV PRs and ddev-gitpod-launcher.

Production build 0.71.5 2024