Set project root based on workspace context folder
Nobody has claimed this yet.
- 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:
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.
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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