jenkinsci / scm-sync-configuration-plugin

Jenkins scm-sync-configuration plugin
https://plugins.jenkins.io/scm-sync-configuration/
MIT License
115 stars 123 forks source link

Changes to Jenkins config via Jenkins API are ignored by the plugin #29

Open bpoplauschi opened 9 years ago

bpoplauschi commented 9 years ago

Hi guys,

We are using the Jenkins API to create/update/delete jobs and it seems all those changes are ignored by the SCM Sync plugin. Even if probably this will require some serious changes on your side to get those API events tracked, we decided to create an issue and talk to the owners. Is there an easy way to achieve this?

PS: Great plugin you have here. I think it's great we can easily enable a versioning system over all the Jenkins configs using this plugin without the need for people that use Jenkins to know about this.

fcamblor commented 9 years ago

Don't think it would be difficult to implement this.

Currently, you already have an endpoint allowing to say "hey, this path has been changed, register it in future commit" : look at there (FYI, doXXX methods are HTTP endpoints as well, so you might call this with an HTTP request)

I'm not completely sure about this, but I think by calling the API to create/update/delete job, you're already calling a Saveable.change() which should trigger the registerPath() call I exposed before.

As soon as you will have registered paths, all you will have to do is to commit the transaction, maybe by providing some comment to your commit before.

Hope this helps.

lloydoliver commented 9 years ago

I too have run into this exact issue. Creating/updating a job via the API does not trigger an SCM save, we have to manually go to the Jenkins job page, click the 'save' button which then triggers the scm-sync-configuration plugin.

starwarsfan commented 6 years ago

Any news on this? We use Jenkins-CLI and Jenkins REST-API for a complete automated job setup in case a new package was added to the VCS in the background. But all these auto-generated-jobs where missed on the configuration repo until someone "touches" them in some other way. Would be great if this could be fixed!

phl0 commented 6 years ago

Would like to see this solved :)