-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid failing when delete or rename a branch #49
Avoid failing when delete or rename a branch #49
Conversation
If the deletion and adding path share some characters the contains() function succeed and removes the added path. It should be checked if they are equal. This fixes some rename issues we discovered in our environment.
Before deleting the job hierarchy it is needed to check for changes on the files, e.g config.xml. While deleting a job it gets updated, this blocks the git -rm command from deleting this hierarchy. Commits should always come with proper messages, git command fails if the commit message is empty. Which put scm-sync in an dirty state if there are commits which cannot be pushed.
As i encountered some copy issues, e.g was not able to copy blank build/ dir, i implemented a basic filter for the FileUtil.copy function. This matches on any XML-File and on includes specified on ManualIncludes list from scm-sync-configuration.
Signed-off-by: Marco Nenciarini <marco.nenciarini@2ndquadrant.it> Signed-off-by: Giulio Calacoci <giulio.calacoci@2ndquadrant.it>
This PR is a big deal for us since we are using Jenkins Pipeline with the Github Organization Plugin which creates and deletes nested jobs constantly. Thanks for your work! |
We'd love to see this fix as well, it seems inconsistent but we seem to hit this occasionally even when just deleting "normal" jobs... |
I am honestly baffled that such an issue has been discussed from over an year on #32 and it has never seen official feedback from the repository admins. This is a blocker issue that needs to be fixed otherwise the plugin is totally useless. |
I think that the right place to complain is the JIRA issue https://issues.jenkins-ci.org/browse/JENKINS-37500 |
@rodrigc hi! Is there a chance for this PR to be merged and released any time soon? |
@rodrigc bump! would really like to add this fix |
@rodrigc +1 from me. I have to do the manual workaround daily now. Is this plugin abandoned? Perhaps you could give it up for adoption. |
@rodrigc any eta on this getting merged anytime soon? |
@erikhakansson if it's a help for you i've compiled this plugin with the PR applied here: https://purley.hogarthuk.com/scm-sync-configuration.hpi replace it with the official one when there's eventually a release of course |
Friendly bump. Without this merge this plugin is DOA for any new jenkins projects |
Bumping again, confirming this solved our problem and has been working great for use for the past 4 months. |
I was wondering why this hasn't been merged yet? We would like to use the multibranch plugin in our current environment that is using the scm sync plugin. If there is something that needs to be done please let us know |
The issue is explained in #54 |
@hogarthj thanks a lot! in order to fix this issue, you can use the following workaround -
more details on using custom plugin versions here - |
any updates on getting this merged |
I have the strong feeling that this plugin is abandoned and this patch will never be merged. I've personally stopped using it in favour of generating the configuration through jenkins-job-builder |
@guipal as you have taken ownership of this plugin, are you able to release a new version now that this has been merged? |
The content of #38 has been rebased on current master, it should fix #32 #37 and JENKINS-37500
I've cleaned up the commits from the previous pull requests and added one to prevent the SCM manager to delete any path that doesn't exists in the repository.