Skip to content
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

[Bug]: JTE libraries plugin does not load libraries without WebUI Apply/Save button #337

Open
kirill-a opened this issue Apr 4, 2024 · 3 comments
Assignees
Labels
bug Something isn't working waiting on user input This issue requires additional information from the reporter

Comments

@kirill-a
Copy link

kirill-a commented Apr 4, 2024

Jenkins Version

CloudBees Jenkins Enterprise 2.346.4.1-rolling

JTE Version

2.5.3

Bug Description

When I programmatically update folder's config.xml with JTE libraries packaged as a plugin, they don't load during job execution.
After that, I open the folder in Web UI and press Apply/Save without changing anything, now library works as expected.
Tried restarting Jenkins controller, it didn't help.

Is there any way to load libraries from plugin programmatically?

Steps to Reproduce

Prerequisite: JTE libraries packaged as a plugin and installed in Jenkins

When I programmatically update folder's config.xml with plugin config libraries, they don't load:

<librarySources>
   <org.boozallen.plugins.jte.init.governance.libs.LibrarySource>
       <libraryProvider class="org.boozallen.plugins.jte.init.governance.libs.PluginLibraryProvider">
           <plugin class="jte.generated.a8a8a19c2afe944718b0dd663d210afc0.LibrarySourcePlugin" plugin="[email protected]" />
           <libraries class="linked-hash-map" />
           <jarLastModified>0</jarLastModified>
       </libraryProvider>
   </org.boozallen.plugins.jte.init.governance.libs.LibrarySource>
</librarySources>

Job log:

[JTE] 2: Library git not found.  
[JTE] java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...

After that, I open the folder in Web UI and press Apply/Save without changing anything, now library works as expected.

@kirill-a kirill-a added the bug Something isn't working label Apr 4, 2024
@cokieffebah cokieffebah self-assigned this Jun 18, 2024
@cokieffebah
Copy link

replicated behavior by adding an SCM library source to an existing job.

@cokieffebah
Copy link

@kirill-a could you describe what you did to 'programmatically update folder's config.xml'?
Did you call an API with the file? if so, include the command line and the file sent
Did you run a script from locahost:8080/script ? if so, include the commands
Did you run a command/script on the jenkins server/container ? if so, include the commands.
Thanks

@cokieffebah cokieffebah added the waiting on user input This issue requires additional information from the reporter label Jul 11, 2024
@faridelmouhsine
Copy link

faridelmouhsine commented Sep 10, 2024

Hi @kirill-a
If you use jenkins-cli.jar to create the jobs prograamatically from config.xml you need to reload job configuration using reload-configuration option so the job gets is loaded from xml config file
Regards
Farid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting on user input This issue requires additional information from the reporter
Projects
None yet
Development

No branches or pull requests

3 participants