jenkinsci / configuration-as-code-plugin

Jenkins Configuration as Code Plugin
https://plugins.jenkins.io/configuration-as-code
MIT License
2.7k stars 722 forks source link

JCasC Configuration History: New feature or Plugin #955

Open oleg-nenashev opened 5 years ago

oleg-nenashev commented 5 years ago

There are plugins which show Configuration history for jobs and system settings:

What if we somehow reuse/extend the Pipeline Config History codebase in order to track and visualize YAML configuration changes inside Jenkins? It might be later useful for Pipeline as YAML definitions like Wolox CI or https://github.com/jenkinsci/simple-pull-request-job-plugin

CC @Jochen-A-Fuerbacher @RobinRSchulz

Jochen-A-Fuerbacher commented 5 years ago

Great idea, @oleg-nenashev!

As both history plugins get triggered by a listener, JCasC should provide a listener in order to let them track changes. Then it could be integrated very easily. At the moment I'm not sure which plugin is the best candidate for this issue.

What's your opinion, @RobinRSchulz?

RobinRSchulz commented 5 years ago

I also find that to be a good idea:)

Since PipelineCH and JobCH differ in the way the storage gets triggered (config save (jch) <-> build completion (pch)) maybe the pch plugin is not the best place. On the other hand, it surely would make sense for pch to be able to show pipeline as YAML definitions.

We're currently thinking about a support plugin which also could contain this functionality. Using this plugin, your proposal is implemented (partly in jobconfighistory, which already tracks xml system configs or maybe a separate JCasC Config History plugin) and pipelineconfighistory also profits from that.

However, it might take some time to develop the support plugin and refactor the architecture of both pch and jch to use it.