Skip to content
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

Merged
merged 4 commits into from
Nov 9, 2017
Merged

Avoid failing when delete or rename a branch #49

merged 4 commits into from
Nov 9, 2017

Conversation

mnencia
Copy link
Contributor

@mnencia mnencia commented Nov 2, 2016

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.

zilmTT and others added 4 commits November 2, 2016 16:42
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>
@j-martin
Copy link

j-martin commented Nov 5, 2016

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!

@daubman
Copy link

daubman commented Nov 14, 2016

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...

@marcolenzo
Copy link

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.

@mnencia
Copy link
Contributor Author

mnencia commented Nov 16, 2016

I think that the right place to complain is the JIRA issue https://issues.jenkins-ci.org/browse/JENKINS-37500

@pupssman
Copy link
Member

pupssman commented Dec 8, 2016

@rodrigc hi! Is there a chance for this PR to be merged and released any time soon?

@shraykay
Copy link

@rodrigc bump! would really like to add this fix

@erikhakansson
Copy link

@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.

@xocasdashdash
Copy link

@rodrigc any eta on this getting merged anytime soon?

@hogarthj
Copy link

@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

@cpoole
Copy link

cpoole commented Apr 13, 2017

Friendly bump. Without this merge this plugin is DOA for any new jenkins projects

@j-martin
Copy link

Bumping again, confirming this solved our problem and has been working great for use for the past 4 months.

@incedo
Copy link

incedo commented Jul 3, 2017

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

@mnencia
Copy link
Contributor Author

mnencia commented Jul 3, 2017

The issue is explained in #54
This plugin is orphan, so no one will merge it, unless a new maintainer will arise.

@giladsh1
Copy link

giladsh1 commented Oct 2, 2017

@hogarthj thanks a lot!

in order to fix this issue, you can use the following workaround -

  • compile your own version of the plugin from this PR (or use @hogarthj version above)
  • stop jenkins master service
  • go to $JENKINS_HOME/plugins
  • Remove the previously expanded plugin directory
  • Copy the custom HPI file to $JENKINS_HOME/plugins
  • touch .hpi.pinned
  • restart your jenkins master

more details on using custom plugin versions here -
https://wiki.jenkins.io/display/JENKINS/Plugin+tutorial

@sharksforarms
Copy link

any updates on getting this merged

@mnencia
Copy link
Contributor Author

mnencia commented Nov 7, 2017

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 guipal merged commit 16e5593 into jenkinsci:master Nov 9, 2017
@sharksforarms
Copy link

@guipal Thanks for looking at this! Hopefully a release can be pushed and bring this plugin back to glory!

@mnencia Merged!

@clintharrison
Copy link

@guipal as you have taken ownership of this plugin, are you able to release a new version now that this has been merged?

@mnencia mnencia deleted the avoid-failing-when-delete-a-branch branch February 12, 2018 19:38
@dragon788 dragon788 mentioned this pull request Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.