[JIRA] (JENKINS-15128) Renaming job doesn't work with Git

232 views
Skip to first unread message

fcamblor@java.net (JIRA)

unread,
Sep 12, 2012, 3:18:49 AM9/12/12
to jenkinsc...@googlegroups.com
Issue Type: Bug Bug
Assignee: Frédéric Camblor
Components: scm-sync-configuration
Created: 12/Sep/12 7:17 AM
Description:

This is due to SCM-694 which has been fixed.

Once released, we should align on v1.9 to fix current issue

Project: Jenkins
Priority: Major Major
Reporter: Frédéric Camblor
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

scm_issue_link@java.net (JIRA)

unread,
Sep 12, 2012, 3:48:49 AM9/12/12
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Frédéric Camblor
Path:
src/test/java/hudson/plugins/scm_sync_configuration/repository/HudsonExtensionsGitTest.java
http://jenkins-ci.org/commit/scm-sync-configuration-plugin/b4ea03118051348882ded4467fd79c3fb4724cbf
Log:
Ignoring shouldJobRenameBeCorrectlyImpactedOnSCM in HudsonExtensionsGitTest due to JENKINS-15128

fcamblor@java.net (JIRA)

unread,
Oct 30, 2012, 5:54:42 PM10/30/12
to jenkinsc...@googlegroups.com

SCM-694 improvement should be available in 1.8.1

fcamblor@java.net (JIRA)

unread,
Oct 30, 2012, 5:56:42 PM10/30/12
to jenkinsc...@googlegroups.com
 
Frédéric Camblor edited a comment on Bug JENKINS-15128

SCM-694 improvement should be available in Maven SCM 1.8.1

fcamblor@java.net (JIRA)

unread,
Nov 24, 2012, 10:22:41 AM11/24/12
to jenkinsc...@googlegroups.com

fcamblor@java.net (JIRA)

unread,
Nov 28, 2012, 3:18:42 AM11/28/12
to jenkinsc...@googlegroups.com
Change By: Frédéric Camblor (28/Nov/12 8:17 AM)
Description: This is due to [SCM-694|http://jira.codehaus.org/browse/SCM-694] which has been fixed.


Once released, we should align on v1.9 to fix current issue


Note that both svn and git renames have been deactivated in 0.0.6.1 because of this issue.

fcamblor@java.net (JIRA)

unread,
Nov 28, 2012, 3:22:41 AM11/28/12
to jenkinsc...@googlegroups.com
Change By: Frédéric Camblor (28/Nov/12 8:20 AM)
Priority: Major Critical

pukhalsky@bpc.ru (JIRA)

unread,
Nov 28, 2012, 3:39:41 AM11/28/12
to jenkinsc...@googlegroups.com

I don't understand. The MSCM1.8.1 is out there for almost one month, but the restriction isn't yet lifted. Or we wait for 1.9 (i don't know what ”align” means in that case)?

pukhalsky@bpc.ru (JIRA)

unread,
Nov 28, 2012, 3:41:41 AM11/28/12
to jenkinsc...@googlegroups.com
 
Yury Pukhalsky edited a comment on Bug JENKINS-15128

I don't understand. The MSCM1.8.1 is out there for almost one month, but the restriction isn't yet lifted. Or we wait for 1.9 (i don't know what “align” means in that case)?

This message is automatically generated by JIRA.

fcamblor@java.net (JIRA)

unread,
Nov 28, 2012, 4:17:41 AM11/28/12
to jenkinsc...@googlegroups.com

If you're not happy about how fast things are done, don't hesitate to contribute... plugin is opensource.

fcamblor@java.net (JIRA)

unread,
Nov 28, 2012, 4:19:41 AM11/28/12
to jenkinsc...@googlegroups.com
 
Frédéric Camblor edited a comment on Bug JENKINS-15128

If you're not happy about how fast things are done, don't hesitate to contribute... plugin is opensource.

Maven scm api is a dependency of scm-sync-config plugin.
The latest thing to do since 1.8.1 is released, is to align scm-sync-plugin on this version, test if no regression is implied, and release.

pukhalsky@bpc.ru (JIRA)

unread,
Nov 28, 2012, 4:25:41 AM11/28/12
to jenkinsc...@googlegroups.com

No, no problem at all with how fast the things are done! At least you do it. Other problems i've reported are being ignored altogether But well, «À cheval donné on ne regarde pas la denture» =

I just need to evaluate the time until it's fixed. For example, if it takes one year, i will revert back to our self-written system to store SCM config in SVN. If it takes one month, i'll tell people to stop renaming for a while.

pukhalsky@bpc.ru (JIRA)

unread,
Nov 28, 2012, 4:27:41 AM11/28/12
to jenkinsc...@googlegroups.com
 
Yury Pukhalsky edited a comment on Bug JENKINS-15128

No, no problem at all with how fast the things are done! At least you do it. Other problems i've reported are being ignored altogether But well, «À cheval donné on ne regarde pas la denture» =

I just need to evaluate the time until it's fixed. For example, if it takes one year, i will revert back to our self-written system to store Jenkins config in SVN. If it takes one month, i'll tell people to stop renaming for a while.

fcamblor@java.net (JIRA)

unread,
Nov 28, 2012, 10:07:41 AM11/28/12
to jenkinsc...@googlegroups.com

I won't have time to work on scm-sync-config 'til mid-december.

But after, this issue (and more generally, every critical/blocking issues) is in my short list

sschuberth@gmail.com (JIRA)

unread,
Jan 15, 2013, 5:02:55 AM1/15/13
to jenkinsc...@googlegroups.com

It wouldn't be so bad if renaming of jobs would just not work with the Git backend. But what I'm seeing is that in case of renaming a job all files below jobs/<new_job_name> including all builds and the complete workspace get committed to the Git repository that is supposed to just hold the changes to configuration files. As a result, the Git repository size has grow to over 7 GiB for our project. Given this, I'd say this is a blocker.

fcamblor@java.net (JIRA)

unread,
Jan 17, 2013, 3:30:54 AM1/17/13
to jenkinsc...@googlegroups.com

If this is really the case, I completely agree with you...

Changed priority to blocker in order to spot this in my next release sprint.

Change By: Frédéric Camblor (17/Jan/13 8:30 AM)
Priority: Critical Blocker

fcamblor@java.net (JIRA)

unread,
Jan 17, 2013, 3:32:53 AM1/17/13
to jenkinsc...@googlegroups.com
 
Frédéric Camblor edited a comment on Bug JENKINS-15128

If this is really the case, I completely agree with you...

Changed priority to blocker in order to spot this in my next release sprint backlog

pukhalsky@bpc.ru (JIRA)

unread,
Jan 28, 2013, 4:12:53 AM1/28/13
to jenkinsc...@googlegroups.com

I don't know how clear is the implication — as it's not stated explicitly — but deleting job doesn't work either.
The priority's a blocker already, so nowhere to augment…

scm_issue_link@java.net (JIRA)

unread,
Mar 7, 2013, 4:57:53 AM3/7/13
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Frédéric Camblor
Path:
pom.xml
src/main/resources/META-INF/plexus/components.xml
src/test/java/hudson/plugins/scm_sync_configuration/repository/HudsonExtensionsGitTest.java
http://jenkins-ci.org/commit/scm-sync-configuration-plugin/6281daf4184fddcaf74b073af56fc8de0f42b8a3
Log:
AL on maven-scm-provider-gitexe 1.8.1 (thus maven-scm-manager-plexus 1.8.1) => fixing JENKINS-15128 (handling job rename with git)

scm_issue_link@java.net (JIRA)

unread,
Mar 7, 2013, 4:57:53 AM3/7/13
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Frédéric Camblor
Path:
src/main/java/hudson/plugins/scm_sync_configuration/scms/customproviders/git/gitexe/ScmSyncGitExeScmProvider.java
src/main/resources/META-INF/plexus/components.xml
http://jenkins-ci.org/commit/scm-sync-configuration-plugin/f7660046a918b6cc456a6408fe0428efeedf9276
Log:
JENKINS-15128: Fix job rename with Git by providing a custom GitExeScmProvider allowing to explicitely set "origin" as remote branch during push (in order to update local reference to avoid problem during subsequent call)

fcamblor@java.net (JIRA)

unread,
Mar 7, 2013, 5:05:53 AM3/7/13
to jenkinsc...@googlegroups.com

Note this issue is not yet fixed, had to push my current local state due to https://github.com/jenkinsci/scm-sync-configuration-plugin/pull/14

azatoth@gmail.com (JIRA)

unread,
Jun 17, 2013, 4:29:58 PM6/17/13
to jenkinsc...@googlegroups.com

Is there any progress on this issue? have been some months now since last progress update.

fcamblor@java.net (JIRA)

unread,
Jun 18, 2013, 3:58:58 AM6/18/13
to jenkinsc...@googlegroups.com

As I said in the PR 14, this is not this simple

The last time I looked at it, I was stuck on some svn/git differences in behaviour (having to rely on a generic layer for SCM manipulations is not always obvious).
This makes me wondering if current issue is "fixable" given the current state of the project.

It might be handled if I was dropping the use of scm API (that is to say, reimplement only my needed commands) and use jenkins' own credential api (see JENKINS-18129)

sschuberth@gmail.com (JIRA)

unread,
Jun 18, 2013, 4:04:58 AM6/18/13
to jenkinsc...@googlegroups.com

Would extending the upstream Jenkins SCM API to your needs then be an option? That at least sounds to be less work than using the credentials API yourself, and other plugin developers would benefit from your work, too.

fcamblor@java.net (JIRA)

unread,
Jun 18, 2013, 8:31:58 AM6/18/13
to jenkinsc...@googlegroups.com

In the scm-sync-config plugin, there are 2 SCM API used (and bridged) nowadays :

  • Jenkins SCM API : used mainly for authentication
  • Maven SCM API : used mainly to provide an abstraction over "standard" scm commands

Problem with SCM API are :

  • I don't know them very well (don't think it is well documented either)
  • I don't think it is as rich (in terms of abstractions) as the Maven SCM API (I don't think, for instance, that there is a generic method allowing to "commit" things on the repository ... since jenkins doesn't need to commit anything generally .. it only uses scm to checkout source files).

On the SCM API side, problem is not with lack of generic layered methods, but differences in behaviour in these ones.

For instance, update() with svn will do an `svn update` (thus, working copy will be up to date, and ready for subsequent modifications). A svn delete will then be taken into account directly.
Whereas update() with a git impl will only do a `git fetch` (working copy not up-to-date (only origin references are updated)), thus we will need either a 'rebase' or 'merge' to include changes to push them on the upstream remote. These methods don't exist because they are too DVCS-oriented (and couldn't be implemented in non-DVCS scms).

Moreover, changing things in SCM API takes time because adding a generic method needs every scm implementation to provide their impl for this new generic method

This is the reason why I think the better solution will be to implement our own generic impl for plugin needs only

jenkins@ericlong.com (JIRA)

unread,
Jan 3, 2014, 11:52:37 AM1/3/14
to jenkinsc...@googlegroups.com
Eric Long commented on Bug JENKINS-15128

Does anyone have an idea for a work around? I am still unable to check in new changes to git using the plugin.

Some things I have tried and failed:
*manually committing the changes from the checkoutConfiguration folder
*deleting the checkoutConfiguration folder
*deleting the scm-sync-configuration.fail.log
*changing the git repo location and putting it back
*manually adding the folder to git so that the plug in could allow the commit including the deletion of the folder
*the steps found here: JENKINS-19229 comment
*manually deleting the checkoutConfiguration/jobs/rcx-datamodel folder

This is the error I receive:

Jan 02, 2014 1:53:15 PM hudson.plugins.scm_sync_configuration.SCMManipulator deleteHierarchy
SEVERE: [deleteHierarchy] Problem during remove : The git command failed.
Jan 02, 2014 1:53:15 PM hudson.plugins.scm_sync_configuration.SCMManipulator
FINE: Deleting SCM hierarchy [/var/lib/jenkins/scm-sync-configuration/checkoutConfiguration/jobs/rcx-datamodel] from SCM ...
Jan 02, 2014 1:53:15 PM hudson.plugins.scm_sync_configuration.ScmSyncConfigurationBusiness
FINEST: Processing commit : Commit hudson.plugins.scm_sync_configuration.model.Commit@2f023ff1 : 
  Author : John Doe
  Comment : Job [rcx-domainmodel] hierarchy renamed from [jobs/rcx-datamodel] to [jobs/rcx-domainmodel] by John Doe
  Changeset : 
    A jobs/rcx-test-data-framework/config.xml
    A config.xml
    A jobs/rcx-domainmodel/
    D jobs/rcx-datamodel/

The problem appears to be with the rcx-datamodel job that is deleted. The Git master has already deleted the folder.

What is odd is that the rcx-datamodel job is already missing from the /var/lib/jenkins folder in Jenkins and is missing in the git repo.

Is there a good way to start the scm-sync-configuration over from scratch without deleting the git repo?

fcamblor@java.net (JIRA)

unread,
Jan 10, 2014, 5:13:39 AM1/10/14
to jenkinsc...@googlegroups.com

Hi,

Workaround for job renames is :

  • Stop Jenkins
  • Manually `git mv` directories in the checkoutConfiguration/ directory, commit change, then push the commit to your repository
  • Restart Jenkins

In last resort, you can switch in the global config page : Git SCM => No SCM + save => Git SCM + save
This will result in :

  • Resetting checkoutConfiguration/ content (changing scm resets the directory)
  • Performing a new "initial sync" with the repository, that is to say :
    • Clone repo into checkoutConfiguration
    • Add folders located into your JENKINS_HOME/ and not present into checkoutConfiguration/ to the repo

Initial sync has a drawback : if you have checkoutConfiguration/foo and JENKINS_HOME/foo doesn't exist, foo won't be removed from your repository (I prefer not to remove such files due to "reload files from repo" feature)

jenkins@ericlong.com (JIRA)

unread,
Jan 10, 2014, 11:23:37 AM1/10/14
to jenkinsc...@googlegroups.com
Eric Long commented on Bug JENKINS-15128

Thanks Frédéric. I will try this shortly. I appreciate your help.

bpodgursky@gmail.com (JIRA)

unread,
Feb 20, 2014, 3:10:40 PM2/20/14
to jenkinsc...@googlegroups.com

Any hope of seeing a fix for this? The plugin looked to be really useful when we first installed it, but this makes it unusable unfortunately (we have too many projects and developers to rely on manual fixes every time a project is deleted/renamed...)

jenkins@ericlong.com (JIRA)

unread,
Feb 20, 2014, 4:46:39 PM2/20/14
to jenkinsc...@googlegroups.com
Eric Long commented on Bug JENKINS-15128

Richard Raseley
This fix did not appear to work for me either. My job names have spaces in them but not parenthesis. I am still having problems. Unfortunately we are likely to remove this plug in and manage configurations a different way until this is fixed.

fcamblor@java.net (JIRA)

unread,
Feb 21, 2014, 3:42:41 AM2/21/14
to jenkinsc...@googlegroups.com

Another workaround is to avoid renaming jobs, and prefer create new job by copying the old one, then remove the old job.

Drawbacks for this solution :

  • Build history is lost
  • I totally agree this is not ideal, especially on large user codebase where we cannot keep an eye on everyone's job config

But this is the only I can provide now.
Fixing this issue would imply a big refactor on the way the plugin uses the scm abstractions (see my previous comments), and this is not something I have time to do nowadays.

pyrogx1133@gmail.com (JIRA)

unread,
Apr 4, 2014, 7:55:06 PM4/4/14
to jenkinsc...@googlegroups.com
Ronald Chen commented on Bug JENKINS-15128

This is the single biggest blocker for the usage of this plugin. I want people to freely rename jobs and give them better names as they see fit.

scm_issue_link@java.net (JIRA)

unread,
Aug 25, 2014, 10:28:35 PM8/25/14
to jenkinsc...@googlegroups.com

Code changed in jenkins


User: Frédéric Camblor
Path:
src/main/java/hudson/plugins/scm_sync_configuration/scms/customproviders/git/gitexe/ScmSyncGitExeScmProvider.java
src/main/resources/META-INF/plexus/components.xml


Log:
JENKINS-15128: Fix job rename with Git by providing a custom GitExeScmProvider allowing to explicitely set "origin" as remote branch during push (in order to update local reference to avoid problem during subsequent call)

This message is automatically generated by JIRA.

scm_issue_link@java.net (JIRA)

unread,
Aug 25, 2014, 10:28:37 PM8/25/14
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Frédéric Camblor
Path:

src/main/java/hudson/plugins/scm_sync_configuration/SCMManipulator.java
src/main/java/hudson/plugins/scm_sync_configuration/ScmSyncConfigurationBusiness.java
http://jenkins-ci.org/commit/scm-sync-configuration-plugin/780cf5e7dffe3dd78a2037b99b6cfbde2b158dcf
Log:
JENKINS-15128: even if updatedFiles are empty, we should consider current commit as checked in in order to remove it from commitsQueue

scm_issue_link@java.net (JIRA)

unread,
Aug 25, 2014, 10:28:38 PM8/25/14
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: fcamblor
Path:
src/test/java/hudson/plugins/scm_sync_configuration/repository/HudsonExtensionsGitTest.java
http://jenkins-ci.org/commit/scm-sync-configuration-plugin/b794c1a45f487e8579d8303ec1c0a31319fcb7d9
Log:
JENKINS-15128: Re-activated shouldJobRenameBeCorrectlyImpactedOnSCM

Compare: https://github.com/jenkinsci/scm-sync-configuration-plugin/compare/5fd7d4b3e6a8...b794c1a45f48

fcamblor@java.net (JIRA)

unread,
Aug 25, 2014, 10:28:39 PM8/25/14
to jenkinsc...@googlegroups.com
Frédéric Camblor resolved Bug JENKINS-15128 as Fixed

fixed in v0.0.8

Change By: Frédéric Camblor (24/Aug/14 9:07 AM)
Status: Open Resolved
Assignee: Frédéric Camblor
Resolution: Fixed

bpodgursky@gmail.com (JIRA)

unread,
Aug 26, 2014, 10:07:02 AM8/26/14
to jenkinsc...@googlegroups.com

I'm testing out the fix but still seeing an issue. It's throwing an error on:

[INFO] Executing: /bin/sh -c cd /var/lib/jenkins/scm-sync-configuration/checkoutConfiguration/jobs && git rm <old_project_name>
[INFO] Working directory: /var/lib/jenkins/scm-sync-configuration/checkoutConfiguration/jobs
Aug 26, 2014 7:03:49 AM hudson.plugins.scm_sync_configuration.SCMManipulator deleteHierarchy


SEVERE: [deleteHierarchy] Problem during remove : The git command failed.

when I run the command manually, I get:

fatal: not removing 'jobs/<old_project_name>' recursively without -r

any thoughts?

fcamblor@java.net (JIRA)

unread,
Aug 26, 2014, 10:45:03 AM8/26/14
to jenkinsc...@googlegroups.com

mmm.. I didn't tested it against file hierarchy (to test, I only settled simple freestyle job, thus not having any subdirectories)

There must be another issue here, could you file another issue about this please ?

bpodgursky@gmail.com (JIRA)

unread,
Aug 26, 2014, 10:52:02 AM8/26/14
to jenkinsc...@googlegroups.com

This actually doesn't have any subdirectories, it's just erroring because the target is a folder (the only thing inside is config.xml). Unless the job was a single file, I don't see how the simple rm would work.

dev@baltrinic.com (JIRA)

unread,
Nov 25, 2014, 8:24:08 PM11/25/14
to jenkinsc...@googlegroups.com

Has a new ticket been opened for this as @fcamblor requested? We are encountering the same issue when renaming a job. The job folder has no subdirectories but contains a single config.xml file, hence a simple git rm <job-dir-name> fails.

dev@baltrinic.com (JIRA)

unread,
Nov 25, 2014, 8:30:08 PM11/25/14
to jenkinsc...@googlegroups.com
 
Kenneth Baltrinic edited a comment on Bug JENKINS-15128

Has a new ticket been opened for this as @fcamblor requested? We are encountering the same issue when renaming a job. The job folder has no subdirectories but contains a single config.xml file, hence a simple git rm <job-dir-name> fails.

I should add that we are using v 0.0.8 of the plug-in.

dcadwallader@gmail.com (JIRA)

unread,
Apr 27, 2015, 4:24:20 PM4/27/15
to jenkinsc...@googlegroups.com

Seems not to be fixed. When renaming a job, we get this in the logs and all future SCM syncs fail. This is using the latest v0.0.8:

Apr 27, 2015 1:13:20 PM FINE hudson.plugins.scm_sync_configuration.SCMManipulator
Deleting SCM hierarchy [/root/jenkins/scm-sync-configuration/checkoutConfiguration/jobs/Frontend_Test] from SCM ...
Apr 27, 2015 1:13:20 PM SEVERE hudson.plugins.scm_sync_configuration.SCMManipulator deleteHierarchy


[deleteHierarchy] Problem during remove : The git command failed.

This message is automatically generated by JIRA.
Reply all
Reply to author
Forward
0 new messages