[JIRA] (JENKINS-57326) Support jgit and jgitapache with Configuration as Code plugin

23 views
Skip to first unread message

mark.earl.waite@gmail.com (JIRA)

unread,
May 4, 2019, 9:06:02 AM5/4/19
to jenkinsc...@googlegroups.com
Mark Waite created an issue
 
Jenkins / Improvement JENKINS-57326
Support jgit and jgitapache with Configuration as Code plugin
Issue Type: Improvement Improvement
Assignee: Mark Waite
Attachments: screencapture-home-markwaite-net-jenkins-configureTools-2019-05-04-07_00_50.png
Components: git-plugin
Created: 2019-05-04 13:05
Environment: Jenkins 2.164.2
Configuration as code latest release
Git plugin 3.10.0
Labels: jcasc-compatibility
Priority: Minor Minor
Reporter: Mark Waite

When I export the configuration as code definition of my Jenkins server that has JGit configured as one of the git implementations, it includes lines like this:

tool:
  git:
    installations:
    - home: "git"
      name: "Default"
    - home: "jgit"
      name: "jgit"

When I load those lines into configuration as code, it attempts to create a command line implementation of jgit instead of creating the internal implementation of jgit. The result of reloading that configuration looks like this:

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

mark.earl.waite@gmail.com (JIRA)

unread,
May 4, 2019, 9:07:02 AM5/4/19
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Change By: Mark Waite
When I export the configuration as code definition of my Jenkins server that has JGit configured as one of the git implementations, it includes lines like this:

{noformat}

tool:
  git:
    installations:
    - home: "git"
      name: "Default"
    - home: "jgit"
      name: "jgit"
{noformat}


When I load those lines into configuration as code, it attempts to create a command line implementation of jgit instead of creating the internal implementation of jgit.  The result of reloading that configuration looks like this:

!screencapture-home-markwaite-net-jenkins-configureTools-2019-05-04-07_00_50.png|thumbnail!

mark.earl.waite@gmail.com (JIRA)

unread,
May 4, 2019, 9:08:03 AM5/4/19
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
Change By: Mark Waite
Assignee: Mark Waite

nicolas.deloof@gmail.com (JIRA)

unread,
May 15, 2019, 4:29:01 AM5/15/19
to jenkinsc...@googlegroups.com
Nicolas De Loof commented on Improvement JENKINS-57326
 
Re: Support jgit and jgitapache with Configuration as Code plugin

This is caused by `GitTool` not being abstract, so that JCasC can't guess there can be other implementation for this "API".

Maybe we can fix this on JCasC at the price of more complexity, or can just refactor git-client to make GitTool and actual API (interface|abstract class) by Jenkins architecture conventions.

nicolas.deloof@gmail.com (JIRA)

unread,
May 15, 2019, 6:26:02 AM5/15/19
to jenkinsc...@googlegroups.com
Nicolas De Loof edited a comment on Improvement JENKINS-57326
This is caused by `GitTool` not being abstract, so that JCasC can't guess there can be other implementation for this "API".

Maybe we can fix this on JCasC at the price of more complexity, or can just refactor git-client to make GitTool and actual API (interface|abstract class) by Jenkins architecture conventions.

mark.earl.waite@gmail.com (JIRA)

unread,
May 15, 2019, 7:11:01 AM5/15/19
to jenkinsc...@googlegroups.com

Since git client plugin 3.0 already includes the breaking change of a switch from JGit 4.5 to JGit 5.x (with the resulting API breaks inherent in that change), we can certainly consider additional breaking changes in git client 3.0.

How badly will compatibility be damaged for dependent plugins if GitTool becomes abstract?

Would it be better to create AbstractGitTool and leave GitTool as an implementation?

nicolas.deloof@gmail.com (JIRA)

unread,
May 15, 2019, 7:16:02 AM5/15/19
to jenkinsc...@googlegroups.com

JCasC do detect referenced type from other component relying on git-client, which use `GitTool`. afaik They never explicitely invoke constructor on it. So you can make this class abstract, and add an xstream alias so that existing configuration get loaded into some new `CLIGitTool` implementation. This is still a backward incompatible change but with limited impacts

nicolas.deloof@gmail.com (JIRA)

unread,
May 16, 2019, 11:11:03 AM5/16/19
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
May 21, 2019, 11:13:03 AM5/21/19
to jenkinsc...@googlegroups.com
Mark Waite started work on Improvement JENKINS-57326
 
Change By: Mark Waite
Status: Open In Progress

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 7, 2019, 10:17:02 PM7/7/19
to jenkinsc...@googlegroups.com
Mark Waite stopped work on Improvement JENKINS-57326
 
Change By: Mark Waite
Status: In Progress Open

mark.earl.waite@gmail.com (JIRA)

unread,
Sep 14, 2019, 10:15:03 PM9/14/19
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
Change By: Mark Waite
Assignee: Nicolas De Loof
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

rsandell@cloudbees.com (JIRA)

unread,
Oct 2, 2019, 6:43:02 AM10/2/19
to jenkinsc...@googlegroups.com

rsandell@cloudbees.com (JIRA)

unread,
Oct 2, 2019, 6:47:03 AM10/2/19
to jenkinsc...@googlegroups.com

rsandell@cloudbees.com (JIRA)

unread,
Oct 2, 2019, 6:47:03 AM10/2/19
to jenkinsc...@googlegroups.com
rsandell started work on Improvement JENKINS-57326
 
Change By: rsandell
Status: Open In Progress

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 6, 2019, 12:31:02 PM10/6/19
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 6, 2019, 12:31:03 PM10/6/19
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 7, 2019, 9:52:02 AM10/7/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages