Skip to content
This repository has been archived by the owner on Sep 2, 2019. It is now read-only.

Add the ability to use local source instead of cloning the repository #26

Closed
wants to merge 2 commits into from

Conversation

sunix
Copy link
Contributor

@sunix sunix commented Jun 3, 2019

Support the --alias option:

che:theia init --alias https://github.com/eclipse/che-theia=/projects/theia/che/che-theia

will replace source folder designed by https://github.com/eclipse/che-theia in https://github.com/eclipse/che-theia/blob/master/che-theia-init-sources.yml.
If the folder /projects/theia/che/che-theia is not empty, it won't clone the folder again and use it as it is.

The goal is to be able to skip clonning if the sources are already present.

https://github.com/eclipse/che-theia/issues/208

@sunix sunix requested review from benoitf and evidolob June 3, 2019 13:53
@codecov
Copy link

codecov bot commented Jun 3, 2019

Codecov Report

Merging #26 into master will decrease coverage by 0.31%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #26      +/-   ##
==========================================
- Coverage   98.53%   98.22%   -0.32%     
==========================================
  Files          17       17              
  Lines         547      562      +15     
  Branches       60       64       +4     
==========================================
+ Hits          539      552      +13     
- Misses          8       10       +2
Impacted Files Coverage Δ
src/init-sources.ts 98.55% <88.88%> (-1.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f64b20...cca886a. Read the comment docs.

@slemeur
Copy link

slemeur commented Jun 3, 2019

That would work for someone that is using Che locally - which is not the primary use case. How would that work with a remote Che? If not, that should be highlighted

@sunix
Copy link
Contributor Author

sunix commented Jun 4, 2019

@slemeur it is not about running che locally or not, it is about using sources that may be already present in the file system (in the case of a docker build of che-theia, dockerfile is in the same repo than extensions and plugins ... but we still clone it from git even if we could just do a copy)
This PR would avoid the contributor having to make too much manual changes (push his extension or plugin changes, change che-theia-init-sources.yaml) to test the docker build and test the che-theia image.

src/init-sources.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@benoitf benoitf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving again

@benoitf
Copy link
Contributor

benoitf commented Jul 18, 2019

@sunix the codecov is failing as it's reducing code coverage

…. Introducing alias for change the source location from the command line

Signed-off-by: Sun Tan <[email protected]>
@@ -271,8 +266,14 @@ export class InitSources {
* @param extension the extension to clone
*/
async clone(extension: ISource): Promise<void> {
const repository = new Repository(extension.source);
extension.clonedDir = await repository.clone(this.cheTheiaFolder, repository.getRepositoryName(), extension.checkoutTo);
if (fs.existsSync(extension.source)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await fs.pathExists(extension.source)

?

@benoitf
Copy link
Contributor

benoitf commented Jul 29, 2019

@benoitf benoitf closed this Jul 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants