gitpod-io / gitpod-io/gitpod

Set project root based on workspace context folder

Open
#6,900 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

editor: jetbrains meta: never-stale team: IDE type: feature request
Dominant language
TypeScript
Stars
13.8k
Forks
1.4k
Avg merge
17h 58m
Merged PRs (30d)
5

Description

When you open a workspace with a folder in the context URL like this one:

https://gitpod.io/#https://github.com/gitpod-io/gitpod/tree/main/components/ide/jetbrains/backend-plugin

We currently start the IDE with /workspace/gitpod as project root that has the folder components/ide/jetbrains/backend-plugin unfolded in the tree view. It would be even more useful when we change this behavior to open this folder as project root in the editor instead.

This would be a good step towards better support for projects inside mono-repos, especially when there are different languages in one repo. E.g. this would allow to better index a project in the JetBrains IDE.

(internal discussions)

Note: This issue is not about handling .gitpod.yml files in subfolders and should be handled in a separate issue.


Technically, we could check if

echo $GITPOD_WORKSPACE_CONTEXT | jq -r .isFile

is false and if this is the case set

echo "$GITPOD_REPO_ROOT/$(echo $GITPOD_WORKSPACE_CONTEXT | jq -r .path)"

as project root for the editor. Maybe there is even a more elegant way to do this, e.g using supervisor API resp. gp info instead of env vars (see also https://github.com/gitpod-io/gitpod/issues/6803#issuecomment-978913823).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace the JetBrains backend plugin's editor startup path and how it reads GITPOD_WORKSPACE_CONTEXT and GITPOD_REPO_ROOT. Check the context path and isFile values, then verify that a folder context opens as the editor project root while file contexts and .gitpod.yml handling remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
desktop, developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.