Add ability to configure git tool, repository browser, and additional behaviours for literate/multi-branch projects. #350

Merged
merged 4 commits into from Jun 25, 2016

Projects

None yet

9 participants

@wadahiro
wadahiro commented Sep 8, 2015

This can be useful for some jobs for multi-branch projects (such as literate plugin and multi-branch project plugin).

@MarkEWaite

@jglick and @ndeloof I need your help to evaluate this pull request. I'm not a credible reviewer of a proposal to extend the git plugin to assist with workflow.

@ndeloof
Member
ndeloof commented Sep 8, 2015

@wadahiro can you prepare a PR on literate/multi-branch to demonstrate use of this ?
It's not clear to me how this is supposed to be used. Not opposed to a merge, but seems unnecessary from first overview

@wadahiro wadahiro changed the title from Added options to GitSCMSource for setting GitTool, RepositoryBrowser, and Additional Behaviours. to Add ability to configure git tool, repository browser, and additional behaviours for iterate/multi-branch projects. Sep 8, 2015
@wadahiro
wadahiro commented Sep 8, 2015

@ndeloof I changed this PR description. How about this?

@jenkinsadmin
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@ndeloof
Member
ndeloof commented Sep 8, 2015

@wadahiro the description is fine, this is not what I was asking for. Changes looks good, but why they are needed to is not clear to me, so a sample usage from another plugin would help.

@wadahiro
wadahiro commented Sep 8, 2015

@ndeloof
I am sorry for not explaining sufficiently.

why they are needed to is not clear to me,

Some plugins configure git configurations via scm-api (the implementation is GitSCMSource). As far as I know, Literate plugin and Multi-branch project plugin use this scm-api. Because of GitSCMSource doesn't support more detailed settings such as 'Additional Behaviors' currently, we cannot use useful options such as 'Shallow clone'.

so a sample usage from another plugin would help.

In Multi-branch project plugin, it includes 'descriptor.configPage' of SCMSource simply in the config jelly. So if GitSCMSource supports more options, it can be generate more options automatically.

@ndeloof
Member
ndeloof commented Sep 8, 2015

got it

LGTM

@wadahiro
wadahiro commented Oct 7, 2015

@ndeloof When will this PR be merged? Has there been any issue with this PR itself? Please let me know if there are any problems.

@ndeloof
Member
ndeloof commented Oct 7, 2015

I'm not maintaining this plugin anymore

@wadahiro
wadahiro commented Oct 7, 2015

@MarkEWaite Could you evaluate this pull request? Please let me know if there are any problems.

@KostyaSha KostyaSha and 1 other commented on an outdated diff Oct 7, 2015
src/main/java/jenkins/plugins/git/GitSCMSource.java
@DataBoundConstructor
- public GitSCMSource(String id, String remote, String credentialsId, String includes, String excludes, boolean ignoreOnPushNotifications) {
+ public GitSCMSource(String id, String remote, String credentialsId, String includes, String excludes,
+ boolean ignoreOnPushNotifications, GitRepositoryBrowser browser, String gitTool,
@KostyaSha
KostyaSha Oct 7, 2015 Member

Use @DataBoundSetters ?

@wadahiro
wadahiro Oct 8, 2015

@KostyaSha Thanks. I'll fix to use @DataBoundSetter against three new args(browser, gitTool, extensions).

@MarkEWaite

I hope to evaluate this pull request (code review and interactive test) within the next week. Thanks for your patience.

@jason-womack

@MarkEWaite What is the status of this PR?

@MarkEWaite

It will likely be many weeks before this pull request is evaluated. My optimism in October has been tempered by a very heavy schedule at work.

Since there are now conflicts between this pull request and the master branch, the original author could resolve the conflicts with a merge from the master branch. That would help speed the process a little

@bgianfo
bgianfo commented Feb 15, 2016

@wadahiro Any hope of syncing this up to master?

@MarkEWaite

Yes, there's hope. The merge conflict is trivial enough that I can resolve it myself. I doubt it will be on the master today, but it may be on the master within the next 1-2 weeks.

@bgianfo
bgianfo commented Feb 27, 2016

Anything I can do to help?

@MarkEWaite

Sure @bgianfo , you can help by building a copy of this pull request and deploying it. Test it in various ways to confirm that it does not break existing use models, then post your results with the pull request. I'm much more comfortable when others can say that they've used a pull request successfully.

wadahiro added some commits Sep 2, 2015
@wadahiro wadahiro Added options to GitSCMSource for setting GitTool, RepositoryBrowser,
and Additional Behaviours. This can be useful for some jobs for
multi-branch projects (such as literate plugin and multi-branch project
plugin).
cb3d137
@wadahiro wadahiro Modify to use @DataBoundSetter for new parameters. a55c66c
@wadahiro wadahiro Added null checking. a18c96e
@wadahiro wadahiro Fix tests. fda4f12
@wadahiro

@MarkEWaite I resolved the merge conflict.
I have been using this patched version with Multi-branch project plugin for six months in the several projects, but there was no problem.

@MarkEWaite
MarkEWaite commented Apr 19, 2016 edited

@wadahiro thanks for resolving the merge conflicts. I'm glad to hear that it has been working well for you. It will be several weeks (at least) before I can evaluate this.

I'm traveling on business this week and won't have much time for Jenkins work while I'm traveling.

I will start the automated evaluation in my environment later today so that I can at least report if the automated tests were successful in the multi-platform / multi-version automated test environment.

@MarkEWaite MarkEWaite changed the title from Add ability to configure git tool, repository browser, and additional behaviours for iterate/multi-branch projects. to Add ability to configure git tool, repository browser, and additional behaviours for literate/multi-branch projects. Apr 19, 2016
@wadahiro
wadahiro commented Jun 8, 2016

@MarkEWaite Any updates?

@MarkEWaite MarkEWaite merged commit 38a3b04 into jenkinsci:master Jun 25, 2016

1 check passed

Jenkins This pull request looks good
Details
@wadahiro

@MarkEWaite Thanks!! ๐Ÿ˜„

@oleg-nenashev
Member

This change breaks the binary compatibility and causes issues like JENKINS-36419. All abstract methods need to be reworked

@oleg-nenashev
Member

Working on the fix, but such interface is going to be a headache. Seems I'll have to just move some methods upstairs and break the compatibility for setters

@oleg-nenashev
Member

@wadahiro Do you use this functionality anywhere?

@oleg-nenashev oleg-nenashev commented on the diff Jul 4, 2016
src/main/java/jenkins/plugins/git/GitSCMSource.java
+ public String getGitTool() {
+ return gitTool;
+ }
+
+ @Override
+ @DataBoundSetter
+ public void setGitTool(String gitTool) {
+ this.gitTool = gitTool;
+ }
+
+ @Override
+ public List<GitSCMExtension> getExtensions() {
+ if (extensions == null) {
+ extensions = new ArrayList<GitSCMExtension>();
+ }
+ return extensions;
@oleg-nenashev
oleg-nenashev Jul 4, 2016 edited Member

This method exposes internal implementation. FindBugs should not have accepted it. CC @MarkEWaite (is it still disabled?)

@MarkEWaite
MarkEWaite Jul 4, 2016

Yes, it is still disabled. I'll check it more rigorously in the future. Sorry about that!

@wadahiro
wadahiro commented Jul 5, 2016

@oleg-nenashev @MarkEWaite I apologize for the breaking change. ๐Ÿ™‡ I shouldn't have add abstract methods into AbstractGitSCMSource class. Thank you for your great works!

@jglick
Member
jglick commented Jul 12, 2016

Does this not purport to fix JENKINS-31924?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment