[JIRA] (JENKINS-56215) git submodule support

16 views
Skip to first unread message

tim.schlueter@amazone.de (JIRA)

unread,
Feb 20, 2019, 5:57:01 AM2/20/19
to jenkinsc...@googlegroups.com
Tim Schlüter created an issue
 
Jenkins / New Feature JENKINS-56215
git submodule support
Issue Type: New Feature New Feature
Assignee: Ulli Hafner
Components: warnings-ng-plugin
Created: 2019-02-20 10:56
Labels: git plugin
Priority: Minor Minor
Reporter: Tim Schlüter

At the moment warnings-ng doesn't support the git-feature submodule.

In the log the plugin promts the following error

Git blame errors:
no blame results for request <Module/UtilityLib/Source/UtilMath.c - [534]>.

Egit returns null for the request.

 

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

ullrich.hafner@gmail.com (JIRA)

unread,
Feb 20, 2019, 2:50:01 PM2/20/19
to jenkinsc...@googlegroups.com
Ulli Hafner assigned an issue to Unassigned
 

Which git plugin and git client plugin versions are you using?

Can you please check if it is possible to obtain a git blame from your Jenkins workspace using the git command line? I'm not sure if this is a problem in the jgit library or if such a workspace can't provide blames at all using the git command line.

Change By: Ulli Hafner
Labels: git plugin help-wanted
Assignee: Ulli Hafner

tim.schlueter@amazone.de (JIRA)

unread,
Feb 21, 2019, 4:27:02 AM2/21/19
to jenkinsc...@googlegroups.com
Tim Schlüter updated an issue
Change By: Tim Schlüter
Environment: git plugin - 3.9.3
git client plugin - 2.7.6

tim.schlueter@amazone.de (JIRA)

unread,
Feb 21, 2019, 4:33:02 AM2/21/19
to jenkinsc...@googlegroups.com
Tim Schlüter commented on New Feature JENKINS-56215
 
Re: git submodule support

 

$ git blame Module/UtilityLib/Source/UtilMath.c                      
fatal: no such path 'Module/UtilityLib/Source/UtilMath.c' in HEAD               
$ ls Module/UtilityLib/Source/UtilMath.c                               
Module/UtilityLib/Source/UtilMath.c  

 

ullrich.hafner@gmail.com (JIRA)

unread,
Feb 21, 2019, 7:31:01 AM2/21/19
to jenkinsc...@googlegroups.com
Ulli Hafner commented on New Feature JENKINS-56215
 
Re: git submodule support

I see. If this is not possible in git then it is not possible in my plugin. I don't see what I can do here

tim.schlueter@amazone.de (JIRA)

unread,
Feb 21, 2019, 8:48:02 AM2/21/19
to jenkinsc...@googlegroups.com
Tim Schlüter commented on New Feature JENKINS-56215
 
Re: git submodule support

Changing the directory would work

$ cd Module/UtilityLib/                                                                                                                                      
$ git blame Source/UtilMath.c                                                                                                                        
0372016e (userx 2015-08-24 15:43:28 +0200   1) /**@file**********************************************************************                                                                                                               
76b7d993 (usery 2015-10-13 12:05:32 +0200   2)                                                                                                              
889358ba (userx 2015-08-24 15:48:29 +0200   3)   Copyright(c) Alle Rechte sowie jede Verfuegungsbefugnis,                                                                                                                                   
...

 

ullrich.hafner@gmail.com (JIRA)

unread,
Feb 21, 2019, 9:28:01 AM2/21/19
to jenkinsc...@googlegroups.com
Ulli Hafner commented on New Feature JENKINS-56215
 
Re: git submodule support

Then it should be feasible somehow. GitBlamer needs to be adapted to detect the advanced feature Submodules from the git scm step and then somehow changes the processing of the files.

wrightsimong@gmail.com (JIRA)

unread,
Aug 2, 2019, 3:38:02 AM8/2/19
to jenkinsc...@googlegroups.com

raphael@hoeser.info (JIRA)

unread,
May 4, 2020, 3:14:02 AM5/4/20
to jenkinsc...@googlegroups.com
Raphael Höser commented on New Feature JENKINS-56215
 
Re: git submodule support

You're currently doing something like
"git blame <filepath>/<filename>".
If you change this behavior to
"cd <filepath> ; git blame <filename>"
this would always work for all files correctly.

(Also this would solve a problem if the warnings come from multiple repos, which are not submodules, but checked out seperately)

The only downside is the (in my opinion minnimal) performance hit for cding into each directory.

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

ullrich.hafner@gmail.com (JIRA)

unread,
May 4, 2020, 3:18:02 AM5/4/20
to jenkinsc...@googlegroups.com
Ulli Hafner commented on New Feature JENKINS-56215
 
Re: git submodule support

There is no filePath property available right now. Or how can I detect these modules?

ullrich.hafner@gmail.com (JIRA)

unread,
May 4, 2020, 3:19:03 AM5/4/20
to jenkinsc...@googlegroups.com
Ulli Hafner edited a comment on New Feature JENKINS-56215
 
Re: git submodule support
There is no {{filePath}} property available right now. Or how can should I detect these modules?

raphael@hoeser.info (JIRA)

unread,
May 4, 2020, 4:57:04 AM5/4/20
to jenkinsc...@googlegroups.com
Raphael Höser commented on New Feature JENKINS-56215
 
Re: git submodule support

If I understand it correctly you somehow have the filepath in any shape or form which you pass to the GitBlamer.
The Warnings-ng plugin shows this as "Folders" in the report. This information could be used.
A also created an issue which was marked as duplicate where I saw the problem on the git blamer and not the warnings-ng side, because they also can resolve this problem by splitting the filename and the path and doing what I described.

raphael@hoeser.info (JIRA)

unread,
May 4, 2020, 5:35:03 AM5/4/20
to jenkinsc...@googlegroups.com
 
Re: git submodule support

After digging around in the code from warnings-ng I can say that each issue in a report has a "getFolder()" method which returns the folder for the file of that issue.
In my opinion this should be solved at an git-forensics-plugin level or even better in jgit (git implementation used by git-forensics-plugin).
Sadly jgit is unrelated to this project and I didn't find an issue tracker for it.

ullrich.hafner@gmail.com (JIRA)

unread,
May 4, 2020, 6:12:03 AM5/4/20
to jenkinsc...@googlegroups.com
Ulli Hafner commented on New Feature JENKINS-56215
 
Re: git submodule support

jgit is the low level API to access Git, it makes no sense to touch that API.

In order to fix this issue only the Git Jenkins API (and the Git Forensics plugin) should be used.

ullrich.hafner@gmail.com (JIRA)

unread,
May 4, 2020, 6:12:04 AM5/4/20
to jenkinsc...@googlegroups.com
{{jgit}} is the low level API to access Git, it makes no sense to touch that API.

In order to fix this issue only the Git Jenkins API (and the Git Forensics plugin) should be used   (and the API of the warnings plugin) .
Reply all
Reply to author
Forward
0 new messages