I implemented and released Markus solution 2024-04-14. There are now 2 
issues as a result of this change:
 - https://github.com/jenkinsci/generic-webhook-trigger-plugin/issues/311
 - https://github.com/jenkinsci/generic-webhook-trigger-plugin/issues/312

Both issues are scenarios where my ItemListener-implementation:
https://github.com/jenkinsci/generic-webhook-trigger-plugin/blob/3954ee99f8c8801877f6a9b998fe7fdcaa78e6d7/src/main/java/org/jenkinsci/plugins/gwt/jobfinder/JobFinderImpersonater.java#L20
Is not being invoked for the created jobs.

311 seems to be a bug in Job DSL, reported in 2021 
here: https://issues.jenkins.io/browse/JENKINS-64553
312 might be a bug in Jenkins core? I could not find an existing Jira but 
perhaps one should be opened.

To answer Jesse, no I don't think it can be redesigned (without breaking 
API and forcing many of the 34k users to make big changes). But suggestions 
on that are very welcome.

måndag 15 april 2024 kl. 19:06:38 UTC+2 skrev jgl...@cloudbees.com:

> On Sat, Apr 13, 2024 at 1:13 AM Tomas Bjerre <tomas.b...@gmail.com> wrote:
>
>> - Is there a faster way 
>> to Jenkins.getInstance().getAllItems(ParameterizedJob.class); ?
>>
>
> Yes, 
> https://javadoc.jenkins.io/hudson/model/ItemGroup.html#allItems(java.lang.Class)
>  
> is faster since it avoids the need to sort. Also if this code is running as 
> a particular user identity yet the particular block of logic should apply 
> regardless of the user’s permissions to learn of the existence of 
> particular jobs, you can impersonate `ACL.SYSTEM` which will be faster 
> since a typical `AuthorizationStrategy` implementation has a quick path for 
> this principal.
>
> Without knowing what the plugin does or why it is enumerating all projects 
> in a performance-sensitive call site, I cannot offer further advice, but 
> creating a cache smells like a poor solution. Can the plugin be redesigned 
> to look up the required project by name rather than conducting a search?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/5d851a22-9803-4b90-a905-4dca95817531n%40googlegroups.com.

Reply via email to