Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [che-dev] Mounting of project sources - recap

+1 for your plan Lukas

On Wed, Jan 23, 2019 at 2:01 PM Lukas Krejci <lkrejci@xxxxxxxxxx> wrote:
Hi all,

thanks for all the input on the issue of mounting the project sources. I
am very glad some important issues were raised that maybe change the
scope of the change but are very important to solve right.

Let me recap the problems we identified during the discussion:

1) LS requires a file to be represented using the same URI across all
plugin containers - that's because it can require changes to files that
are identified using an URI containing the path of the file.

2) Go's peculiar conventions require checking out code of the projects
into a sub-directory structure, not directly under some root (e.g.
/projects).

I've briefly looked at Gitpod and their solution seems quite simple:

a) they allow "checkoutLocation" - a relative path to /projects as a
target dir of the checkout

b) they are able to figure out the checkoutLocation automagically if not
explicitly configured in their .gitpod.yml file (an equivalent of our
devfile).

https://docs.gitpod.io/45_Config_Go.html

Given all the information above, I'd like to split the task of "Use of
the property mountProjectSources" to a couple of steps:

1) Be able to use "mountSources" bool attribute in che-plugin.yaml file
and disallow mounting projects using the volumes approach.

2) Define the "sourceRoot" (i.e. /projects) in devfile and propagate its
value to the tool containers as an env variable (CHE_SOURCE_ROOT) if
they have mountSources=true. Note that this is actually not needed but
is "nice" for the user. Things would also work with for example
autogenerated name stored in DB or something.

3) Define "checkoutPath" in the devfile to specify a subdir of
CHE_SOURCE_ROOT where the sources should be actually checked out (maybe
also forward this as an env var to the tool containers).

4) Implement auto-detection of "checkoutPath" based on the contents of
the project.

Steps 1) to 3) are fairly easy to do in my largely uninformed humble
opinion, although step 3 probably requires changes in GWT IDE and Theia
factory extension, while step 4) will require more work.

WDYT?

Lukas
_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/che-dev

Back to the top