-
Notifications
You must be signed in to change notification settings - Fork 411
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
Create skipInitiBuildIndex-multibranch.groovy #240
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see calls to save()
. Do these changes actually persist?
Also, what if Multibranch Pipeline is child of Organization Folder and shouldn't be editable?
def emptyCount = 0 | ||
def nonEmptyCount = 0 | ||
|
||
Jenkins.instance.getAllItems(WorkflowMultiBranchProject).each { multibranchProject -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jenkins.instance.getAllItems(WorkflowMultiBranchProject).each { multibranchProject -> | |
Jenkins.instance.allItems(WorkflowMultiBranchProject).each { multibranchProject -> |
If I remember correctly, this should perform better.
println "====================================================================================" | ||
} | ||
|
||
enableBuildStrategy(dryRun) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableBuildStrategy(dryRun) | |
try (ACLContext ctx = ACL.as2(ACL.SYSTEM2)) { | |
enableBuildStrategy(dryRun) | |
} |
When script running through Script Conse this should avoid lookups to RBAC and the security realm, afaik.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this but I am getting this error
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 74: expecting '{', found '(' @ line 74, column 5.
try (ACLContext ctx = ACL.as2(ACL.SYSTEM2)) {
^
1 error
Looking into rbac plugin snippets examples seems correct but maybe is not valid in the groovy context.
Any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is most likely not a valid groovy syntax, since I copy pasted this from Java.
@duemir I believe I have addressed all your comments. Shall we merge this thing? |
What a timing :) https://cloudbees.slack.com/archives/C071AQMLFHR/p1731513126306069 |
This script ensure all Multibranch pipelines has enabled Initial Index Build Prevention to prevent https://www.cloudbees.com/blog/weathering-build-storms-in-the-enterprise in a clean workspaces.
It is useful for job migration use cases.