https://github.com/jenkinsci/role-strategy-plugin/pull/46 is a foundation pull request for it.
Now the code can be moved from JCasC to Role Strategy
I have also added this issue as an example of changes which could be done in the plugin for Google Summer of Code 2016
So JCasC is not yet fully supported? I saw it mentioned in the changelog for v2.7.0.
I still see issues with a simple setup:
Exporting the configuration with JCasC results in:
authorizationStrategy: "FAILED TO EXPORT hudson.model.Hudson#authorizationStrategy:\ \ \nio.jenkins.plugins.casc.ConfiguratorException: Cannot find configurator for\ \ type class com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy\n\ \tat io.jenkins.plugins.casc.impl.DefaultConfiguratorRegistry$1.load(DefaultConfiguratorRegistry.java:97)\n\ \tat io.jenkins.plugins.casc.impl.DefaultConfiguratorRegistry$1.load(DefaultConfiguratorRegistry.java:93)\n\ \tat com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3568)\n\ \tat com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2350)\n\ \tat com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2313)\n\ \tat com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2228)\n\t\ at com.google.common.cache.LocalCache.get(LocalCache.java:3965)\n\tat com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3969)\n\ \tat com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4829)\n\ \tat io.jenkins.plugins.casc.impl.DefaultConfiguratorRegistry.lookupOrFail(DefaultConfiguratorRegistry.java:70)\n\ \tat io.jenkins.plugins.casc.ConfigurationContext.lookupOrFail(ConfigurationContext.java:71)\n\ \tat io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:160)\n\ \tat io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:43)\n\ \tat io.jenkins.plugins.casc.Attribute.describe(Attribute.java:196)\n\tat io.jenkins.plugins.casc.core.JenkinsConfigurator.describe(JenkinsConfigurator.java:8 \tat io.jenkins.plugins.casc.core.JenkinsConfigurator.describe(JenkinsConfigurator.java:30)\n\ \tat io.jenkins.plugins.casc.ConfigurationAsCode.export(ConfigurationAsCode.java:411)\n\ \tat io.jenkins.plugins.casc.ConfigurationAsCode.doExport(ConfigurationAsCode.java:401)\n\ ...
Really need this to be done. I'm willing to support, please tell me where I can start.
An Nguyen You could fork the project and introduce the fix in a PR. Afterwards ask the maintainer to review the PR.
v1.17 of JCasC has fixed the exporting issue for this plugin in the support plugin
https://github.com/jenkinsci/role-strategy-plugin/pull/60 migrates the code from support plugin to the role strategy plugin
It's now awaiting review, Oleg Nenashev would you be able to take a look at this please?
Tim Jacomb I provided feedback in the PR. Once I get confirmation from the second maintainer, I am ready to merge and ship the release