Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53931

Role Strategy: Configuration-as-Code compatibility

    • Role Strategy 2.11

      Configuration-as-Code is the (proposed) mechanism to configure jenkins master automatically from plain text recipes. It relies on component internal model auto-discovery, and as such assume plugins do follow best practices for UI data-binding and internal design. Updating this component to allow for direct interaction is requested. There is a current work-around in the Configuration-as-Code-Support plugin, which would be appreciated if it got incorporated into this plugin. The bits pertaining this specific plugin, can be found here

          [JENKINS-53931] Role Strategy: Configuration-as-Code compatibility

          Oleg Nenashev added a comment -

          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

           

          Oleg Nenashev added a comment - 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  

          Oleg Nenashev added a comment -

          I have also added this issue as an example of changes which could be done in the plugin for Google Summer of Code 2016

          Oleg Nenashev added a comment - I have also added this issue as an example of changes which could be done in the plugin for Google Summer of Code 2016

          René Scheibe added a comment -

          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:

          • role-strategy plugin v2.9.0
          • enabled Authorization "Role-Based Strategy"
          • no further configuration of this plugin

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

          René Scheibe added a comment - 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: role-strategy plugin v2.9.0 enabled Authorization "Role-Based Strategy" no further configuration of this plugin 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\ ...

          An Nguyen added a comment -

          Really need this to be done. I'm willing to support, please tell me where I can start. 

          An Nguyen added a comment - Really need this to be done. I'm willing to support, please tell me where I can start. 

          Jon Brohauge added a comment -

          nthienan You could fork the project and introduce the fix in a PR. Afterwards ask the maintainer to review the PR.

          Jon Brohauge added a comment - nthienan You could fork the project and introduce the fix in a PR. Afterwards ask the maintainer to review the PR.

          Tim Jacomb added a comment -

          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 added a comment - 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?

          Oleg Nenashev added a comment -

          timja I provided feedback in the PR. Once I get confirmation from the second maintainer, I am ready to merge and ship the release

          Oleg Nenashev added a comment - timja I provided feedback in the PR. Once I get confirmation from the second maintainer, I am ready to merge and ship the release

            oleg_nenashev Oleg Nenashev
            jnz_topdanmark Jon Brohauge
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: