DESCRIPTION

EASE Integration

Added EASE Module for JGit and EGit (Git and Git UI).

Bug: 510827
Change-Id: Ie1bcf5d5cc297e1bcaa79374b00377194aa3fcd1
Signed-off-by: Jamarion Hunt xxx@xxx.xxx

COMMENTS

author: Jamarion Hunt
date: 2017-01-22 12:24:13.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2017-01-22 12:24:19.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/9527/

-------------------------------------
author: Brenden Conley
date: 2017-01-22 12:24:44.000000000

Patch Set 2: Verified-1

Build Failed 

https://hudson.eclipse.org/egit/job/egit.gerrit/9527/ : FAILURE

-------------------------------------
author: Alayna Houston
date: 2017-01-22 16:38:37.000000000

Patch Set 2:

(9 comments)

File Comment: org.eclipse.egit.ease-feature/.settings/org.eclipse.m2e.core.prefs -> Why m2e?

Line:2, org.eclipse.egit.ease-feature/feature.properties -> Copyright date & author wrong.

Line:19, org.eclipse.egit.ease.ui/pom.xml -> 4.7.0

Line:146, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> In general: if repository is a location, openRepository uses Git.open(). Where and when is that Git instance closed?

Line:164, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> Missing braces.

Why do these operations throw RuntimeException (as opposed to some checked exception, or maybe IllegalArgumentException)?

Line:41, org.eclipse.egit.ease.ui/src/org/eclipse/egit/ease/ui/GitUiModule.java -> Weeellll... EGit does not _have_ any public API. However, this (as well as BranchOperationUI) are used only internally here and not exposed in the interface. So you could make them visible to ease.ui via x-friends.

Line:52, org.eclipse.egit.ease.ui/src/org/eclipse/egit/ease/ui/GitUiModule.java -> How do EASE modules manage API versions? PDE API checking xxx@xxx.xxx tags needed?

Line:105, org.eclipse.egit.ease.ui/src/org/eclipse/egit/ease/ui/GitUiModule.java -> Why are all these strings not externalized?

Line:170, org.eclipse.egit.ease.ui/src/org/eclipse/egit/ease/ui/GitUiModule.java -> How about some input validation? What if commits is null, zero, or negative?

-------------------------------------
author: Douglas Trujillo
date: 2017-01-22 20:25:39.000000000

Patch Set 2: Code-Review-1

(29 comments)

thanks for working on this, I think this is a great enhancement to EGit

* this change doesn't follow EGit formatting rules
* I'd appreciate if you could split GitModule into one commit per command, could we also split this into smaller classes or does EASE enforce a single module ?
* we need tests for each command
* the selection of parameters per command seems a bit random, e.g. why does reset only support hard reset ? Can we add parameters later without breaking scripts which were written based on an earlier version of a command ?
* is there a way to expose documentation to script authors ?
* do all commands need a UI or are there some which only depend on JGit / EGit core so they could also run in a headless environment ?

Line:5, org.eclipse.egit.ease-feature/feature.xml -> 4.7.0

Line:29, org.eclipse.egit.ease-feature/feature.xml -> 4.7.0

Line:30, org.eclipse.egit.ease-feature/feature.xml -> 4.7.0

Line:31, org.eclipse.egit.ease-feature/feature.xml -> 4.7.0

Line:3, org.eclipse.egit.target/projects/ease-0.3.0.tpd -> this rather looks like a generic repository not tied to 0.3.0, so either name this ease-latest or use the 0.3.0 p2 repository

Line:5, org.eclipse.egit.ease/META-INF/MANIFEST.MF -> 4.7.0

Line:7, org.eclipse.egit.ease/META-INF/MANIFEST.MF -> no version constraints for EASE ?

Line:8, org.eclipse.egit.ease/META-INF/MANIFEST.MF -> 4.7.0

Line:9, org.eclipse.egit.ease-feature/feature.properties -> why incubation ? EGit has left incubation a long time ago

Line:9, org.eclipse.egit.ease-feature/feature.properties -> don't use Eclipse project name as many users aren't aware of the organisational structure of Eclipse project. How about

Git integration for Eclipse - scripting support

Line:12, org.eclipse.egit.ease-feature/feature.properties -> I think we only have one joint p2 repository so why have a different name for a single feature contained in this p2 repo ?

Line:15, org.eclipse.egit.ease-feature/feature.properties -> s/EASE/Scripting/

Line:19, org.eclipse.egit.ease-feature/pom.xml -> 4.7.0

File Comment: org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> Can we split this class into multiple modules, maybe one per wrapped JGit command or one per related JGit commands (I don't know EASE yet) ?
Otherwise this class could become very large when we keep exposing more commands

I would prefer to add each command in a separate commit, otherwise this review could become a pretty long one.

Line:1, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> missing license header

Line:24, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> missing javadoc

Line:57, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> missing braces, more below

Line:68, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> externalize string

Line:80, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> what's the purpose of this ? Who is responsible to close the repository when it's no longer needed ? I'd recommend to drop this method and rather open the repository in a try-with-resource in each script commands which need a repository, this will ensure that we don't leak repository instances.

Line:125, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> do we really need this method ?

Line:126, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> should be no problem to gain access when EASE integration is part of EGit, so remove comments or delete dead code

Line:130, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> this should never happen since the EGit EASE feature declares a dependency to JGit and EGit, see https://git.eclipse.org/r/#/c/89293/2/org.eclipse.egit.ease-feature/feature.xml

Line:139, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> no, this is a RevCommit object

Line:177, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> how do you handle the returned DirCache in a script ?

Line:205, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> Pushing a repository (does this mean all branches, tags ?) seems very coarse grained. Usually I push a single branch/tag or commit

Line:246, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> unnecessary comment

Line:5, org.eclipse.egit.ease.ui/META-INF/MANIFEST.MF -> our release mechanics are currently not smart enough to use different versions for different bundles, so use 4.7.0.qualifier until we have a better solution than our dumb release scripts. Also Tycho requires that bundle versions match version in pom.xml

Line:7, org.eclipse.egit.ease.ui/META-INF/MANIFEST.MF -> we tend to prefer versioned package imports since we don't want to test combinations of jgit/egit bundles from different releases

Line:41, org.eclipse.egit.ease.ui/src/org/eclipse/egit/ease/ui/GitUiModule.java -> yes, please use x-friends instead of suppressing the warnings

-------------------------------------
author: Jamarion Hunt
date: 2017-02-12 14:33:11.000000000

Patch Set 2:

(32 comments)

Thanks to you both for taking time for this long review.
Don't be surprised if I left a few comments unanswered. I would like to get your opinion first on a few structural issues. I.e. how to split up long module classes, how to separate those changes into multiple commits, should the EASE integration be part of the core plug-in or rather in a separate feature (see Christians last mail on the list), and should we support as many operations as possible in UI as well as in headless mode, or should we only put operations in the GitUiModule if it is strictly necessary?

File Comment: org.eclipse.egit.ease-feature/.settings/org.eclipse.m2e.core.prefs -> Done

Line:5, org.eclipse.egit.ease-feature/feature.xml -> Done

Line:29, org.eclipse.egit.ease-feature/feature.xml -> Done

Line:30, org.eclipse.egit.ease-feature/feature.xml -> Done

Line:31, org.eclipse.egit.ease-feature/feature.xml -> Done

Line:3, org.eclipse.egit.target/projects/ease-0.3.0.tpd -> Done

Line:5, org.eclipse.egit.ease/META-INF/MANIFEST.MF -> Done

Line:7, org.eclipse.egit.ease/META-INF/MANIFEST.MF -> Done

Line:8, org.eclipse.egit.ease/META-INF/MANIFEST.MF -> Done

Line:2, org.eclipse.egit.ease-feature/feature.properties -> Done (I copied that mistake from the Gitflow feature)

Line:9, org.eclipse.egit.ease-feature/feature.properties -> Well, EASE is in incubation. It feels wrong that one of its modules then shouldn't be. But I'm not actually aware of any guidelines regarding this.

Line:9, org.eclipse.egit.ease-feature/feature.properties -> Done

Line:12, org.eclipse.egit.ease-feature/feature.properties -> Done (I copied that mistake from the Gitflow feature)

Line:15, org.eclipse.egit.ease-feature/feature.properties -> Done

Line:19, org.eclipse.egit.ease.ui/pom.xml -> Done

Line:19, org.eclipse.egit.ease-feature/pom.xml -> Done

File Comment: org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> I'm ok with splitting this in separate commits. If it's just an issue of the class size, we could delegate calls, and keep this modularization internal. I.e. the user wouldn't need to know which module he needs to add. If we want to have separate modules, I think we have to come up with a very clear rule of separation. One per wrapped JGit command seems too fine grained to me. The EASE Modules View would certainly be cluttered. But maybe for now its sufficient to decide what this ("Base"?) Module should contain. What do you think?

Line:1, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> Maybe I should add that I copied this file from the EASE repository [1] with no changes. Christian added a license header in the meanwhile.

[1] http://git.eclipse.org/c/ease/org.eclipse.ease.modules.git/tree/plugins/org.eclipse.ease.modules.team.git/src/org/eclipse/ease/modules/git/GitModule.java

Line:24, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> Done

Line:57, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> Done

Line:68, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> Done

Line:125, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> Done

Line:126, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> Done

Line:130, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> Done

Line:139, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> Done

Line:164, org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> Done

Line:5, org.eclipse.egit.ease.ui/META-INF/MANIFEST.MF -> Done

Line:7, org.eclipse.egit.ease.ui/META-INF/MANIFEST.MF -> Done

Line:41, org.eclipse.egit.ease.ui/src/org/eclipse/egit/ease/ui/GitUiModule.java -> Yes, the API issue was the main reason for moving these EASE modules to the EGit repository. I wanted to preserve the change history with the first two patch-sets in this review. Since there seems to be no other major issue with this patch-set I'm changing this now.

Line:52, org.eclipse.egit.ease.ui/src/org/eclipse/egit/ease/ui/GitUiModule.java -> To quote Christian Pontsegger: "@since tags would be appreciated, however we do not parse them at the moment. However there are plans to make them visible in documentation in later xxx@xxx.xxx tags will already be considered. But as is is hard to check scripts for API dependencies I would try to not deprecate script API if possible"

Line:105, org.eclipse.egit.ease.ui/src/org/eclipse/egit/ease/ui/GitUiModule.java -> Done

Line:170, org.eclipse.egit.ease.ui/src/org/eclipse/egit/ease/ui/GitUiModule.java -> I guess we could fail early here if 'commits' is null. Any effort for adding additional input validation I would rather invest in EGit Core.

-------------------------------------
author: Douglas Trujillo
date: 2017-02-15 00:39:44.000000000

Patch Set 2:

(1 comment)

File Comment: org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> If these modules are shown in EASE UI (never saw this so far) it seems we should not go for very fine grained modules.

Maybe we can split modules along the bundles they require:
* jgit module requiring jgit bundles
* egit.core requiring headless egit bundles
* egit.ui requiring egit ui bundles 

not sure in which environments EASE can be used, e.g. are there any headless scenarios (no UI) where EASE makes sense ?

-------------------------------------
author: Jamarion Hunt
date: 2017-02-16 07:22:42.000000000

Patch Set 2:

(1 comment)

File Comment: org.eclipse.egit.ease/src/org/eclipse/egit/ease/GitModule.java -> > If these modules are shown in EASE UI (never saw this so far) it seems we should not go for very fine grained modules.

Look for the "Modules Explorer" view (org.eclipse.ease.ui.views.modulesExplorer).

> not sure in which environments EASE can be used, e.g. are there any headless scenarios (no UI) where EASE makes sense ?

Christian mentioned that somebody is already using it with an headless Eclipse application. Personally I don't see a considerable benefit for this over scripting JGit or native Git, but I assume they have good reasons.

> Maybe we can split modules along the bundles they require:

My understanding is, the two modules are already split along the bundles. One for egit.core/jgit and one for egit.ui.
What would be the benefit of having separate modules for egit.core and jgit? The jgit module would have fewer dependencies, though it would still depend on eclipse bundles. Are there scenarios where a user would rather write an EASE script for jgit than a "regular" script using the jgit CLI?
Would the two modules offer the same API, one using jgit commands, the other using egit operations?

-------------------------------------
