-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more flexibility into devfile project source - checkout branch, commit ID etc #12775
Comments
I would make 'branch' available first/top priority. Not sure in which usecases the other parameters would be useful. |
to make it simpler, i would choose the second option (not using another attribute field) |
place where this is happened in Theia side https://github.com/eclipse/che-theia/blob/master/plugins/factory-plugin/src/workspace-projects-manager.ts |
I've updated the description with the agreed upon scope. |
Thanks @metlos, |
The use case I guess is that it is a general purpose tool to start with the repo at a specific state for e.g. debugging a bugfix. In Che 6, the
|
IMHO, |
@mshaposhnik , @skabashnyuk any comments about the above? |
I was looking at https://git-scm.com/docs/git-checkout
And have one idea in mind. What if instead of projects:
- name: petclinic
source:
type: git
location: 'git@github.com:spring-projects/spring-petclinic.git'
checkout: existedbranch projects:
- name: petclinic
source:
type: git
location: 'git@github.com:spring-projects/spring-petclinic.git'
checkout: -b newbranch projects:
- name: petclinic
source:
type: git
location: 'git@github.com:spring-projects/spring-petclinic.git'
checkout: 234a34 projects:
- name: petclinic
source:
type: git
location: 'git@github.com:spring-projects/spring-petclinic.git'
checkout: -b mybranch --track origin/master @sunix @mshaposhnik @metlos @l0rd @vinokurig @sleshchenko wdyt? |
@skabashnyuk I prefer |
@skabashnyuk because it covers 99% of our |
I agree with @sunix that On the other hand I am not sure if we're not trying to conflate two different things - namely the cloning of sources and setting the clone to a specific state. WRT to cloning I'd maybe prefer some of the possibilities of the actual projects:
- name: petclinic
source:
type: git
location: ...
clone:
branch: v2
depth: 1
full: false
checkout: 556df33 but in either case I'd postpone such things, along with @skabashnyuk's |
Ok. Let's define branch behavior. |
I'm not sure about create if branch doesn't exist. Maybe we could instead just checkout the default branch and inform the user about the fact? That seems a little bit less "magic" to me and gives the user more control over the situation. |
And what about the naming and format? projects:
- name: petclinic
source:
type: git
location: ...
clone:
branch: v2 or projects:
- name: petclinic
source:
type: git
location: ...
branch: v2 or even projects:
- name: petclinic
source:
type: git
location: ...
checkout: v2 I'm personally leaning more towards the third actually. For now if user would supply a commitId to the |
I would go to the simplest and closest to what we have option 2: - name: che-theia
source:
type: git
location: 'https://github.com/eclipse/che-theia.git'
branch: che-1234-wip |
KO for |
|
IMHO, "checkout", unlike "check out", is a noun (e.g. "please go to the checkout", or "the checkout papers are at the reception"), so yes, we're giving information. It is on the same level of confusion as "branch". When you say "git branch" you're talking about an action, whereas in our case you're giving information. Welcome to the wonderful world of ambiguities of non-declined languages ;) The reason why I am trying to avoid So if we in the future want to support specifying a tag or commit id, we would have to go ahead and actually change all of Theia impl, devfile schema and server side impl to add the new attribute. And I do think that for example checking out tags or commits is of great value - e.g. take a look at how the code looked like at the release time (usually a tag) or flows like "give me an IDE for the repo in the state I'm currently looking at on github".
not sure what you're referring to here. |
That said, I'm willing to look for a different name than These came to my mind:
|
I don't understand why you want to use
|
|
|
A short recap of a conversation we had:
The implementation is going to implement this using So to resolve this for good, I propose the following alternative ways forward (vote for one using an emoji on this comment):
|
I have edited the first option because wit
|
I'm closing this because the feature is ready in devfile as designed. There is a pending PR in che-theia to add the full support for this in the IDE: eclipse-che/che-theia#144. Currently che-theia only supports the |
Description
Factories have a variety of options to contol projects sources more precisely:
branch
,startPoint
,commitId
,fetch
,branchMerge
,keepDir
In this issue, we want to add support for
branch
andcommitId
into the devfile as new fields:or
respectively.
The text was updated successfully, but these errors were encountered: