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
CasC is unable to reapply GlobalJobDslSecurityConfiguration after Jenkins restart #253
Comments
I hardly understand why we get descriptor.getCategory() == category after restart. |
GlobalConfigurationCategory.all() = {ExtensionList@9902} size = 5 but JobDsl descriptor's category reference another instance {GlobalConfigurationCategory$Security@9523} despite it is set by |
a possible fix is to compare class name, but I'd like to understand why we get two instances of |
(contributed by @hawky-4s-) Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
I think this issue is still present somehow. I am experimenting with version
Here is my configuration:
Let me know if there is anything else I can provide. |
Can you please try using uppercase |
Looks to be the same result when using CamelCase
|
Circled back around to this. At first I thought the issue only occurred when doing a Jenkins restart via |
I got this issue too, for me a temporary solution was to delete the |
some groovy weirdness seems to take place here, which doesn't make any sense to me. |
The example/test from
The Update:
|
got it: serialized xml for GlobalJobDslSecurityConfiguration includes an unexpected line: <category class="jenkins.model.GlobalConfigurationCategory$Security"/> This is caused by groovy style property used to override getCategory final GlobalConfigurationCategory category = GlobalConfigurationCategory.get(GlobalConfigurationCategory.Security) doing so, XStream do consider a filed to be serialized, not just a method override. |
I tested a build of job-dsl-plugin with jenkinsci/job-dsl-plugin#1143 applied and that change fixed this issue. I am able to restart Jenkins repeatedly without any problems. |
Hi, jenkins configuration as code is not usable until they merged this pull request, because any restart need a manual action to recover the service. Can you help to land the fix in a job-dsl-plugin release @ndeloof please ? |
Nothing I can do for job-dsl maintainer to accept this PR. Better report success using it jenkinsci/job-dsl-plugin#1143 so they get more confident and eventually merge |
@ndeloof @ewelinawilkosz I think this issue can be closed :
|
Thanks ! |
#1394 should fix the ordering of JobDSL and security section. |
I firstly observed that behavior when killing our Jenkins pod in K8s and it didn't get back up.
CasC 0.7-alpha was unable to reapply following part of the configuration. It also happened with earlier versions.
The exception thrown is:
I traced it back to following line not resolving to true after restart for the GlobalJobDslSecurityConfiguration: https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/src/main/java/org/jenkinsci/plugins/casc/GlobalConfigurationCategoryConfigurator.java#L61
The culprit is
resolving to false after restart.
See PR #255 for failing testcase.
The text was updated successfully, but these errors were encountered: