-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use development version numbers #19
Conversation
https://plugins.jenkins.io/apache-httpcomponents-client-4-api/ avoids the plugin bundling an outdated version of the Apache httpclient library. It replaces the bundling of the jar file with a dependency on the Apache HttpComponents Client 4.x API plugin. That plugin is installed on over 96% of all Jenkins installations. By depending on the plugin instead of the jar file, the plugin bill of materials will manage the dependency version and the plugin will use the most recent version that is installed on the Jenkins controller. This is a common technique used by many Jenkins plugins. Refer to https://plugins.jenkins.io/apache-httpcomponents-client-4-api/dependencies/ for the list of plugins that depend on the Apache httpclient plugin.
Version 1.15.0 and 1.15.1 of the plugin have been released to the Jenkins update center, even though there is no tag in the repository for those releases. Avoid user confusion by setting the version number to 1.15.2-SNAPSHOT. When the maintainer performs `mvn release:prepare release:perform`, Apache Maven will prompt for a new version number and will suggest 1.15.2. The maintainer can press enter to accept the recommendation and Apache Maven will create two commits, one that sets the release to 1.15.2 and then a second that sets it to 1.15.3-SNAPSHOT.
Allows compilation with Java 11, Java 17, and Java 21. Preparing for Oct 2024 when Java 11 support in Jenkins will be end of life.
https://www.jenkins.io/doc/developer/tutorial-improve/add-a-jenkinsfile/ describes the benefits of including a Jenkinsfile in the plugin repository. This will provide a ci.jenkins.io job that evaluates the master branch and any pull request branches automatically.
@itaibh if there are parts of this pull request that are unacceptable, let me know and I will be happy to remove them or happy to create a new pull request with the subset that you prefer. |
@MarkEWaite I'm fine with those changes, but I need to be able to debug the plugin, and I'm not there yet. I see it loading correctly but I have a bug in the logic and I don't know how I can debug it. Where can I find more info about debugging jenkins plugins? The new docs doesn't seem to cover this and the old ones are outdated and seem irrelevant. |
https://www.jenkins.io/doc/developer/building/intellij/ provides guidance to configure IntelliJ for development and debugging of Jenkins core. I use Netbeans for debugging with Jenkins plugins and Jenkins core. I believe those are the two most commonly used development environments for Jenkins plugin maintainers. |
well, now I have a different problem: after changing |
If you want to debug, you'll have a much better experience if you run Jenkins core from your own account rather than running Jenkins from the service that was installed with the Debian package (the ".deb" file). |
what do you mean "my own account"? account where? |
also I need to verify something in the UI, does jenkins core supports this? |
ok, I think I got what you meant. I'll try. thanks! |
The Jenkins test harness includes a Examples of tests that use the JenkinsRule WebClient to perform tests include:
There are many others, but a search for WebClient in those plugins will find examples that may be helpful. |
@MarkEWaite I'm able to debug the plugin and fixed some env. vars. issue. But I have a problem with artifacts. It seems the |
Use development version numbers
Version 1.15.0 and 1.15.1 of the plugin have been released to the Jenkins update center, even though there is no tag in the repository for those releases.
Avoid user confusion by setting the version number to 1.15.2-SNAPSHOT.
When the maintainer performs
mvn release:prepare release:perform
, Apache Maven will prompt for a new version number and will suggest 1.15.2. The maintainer can press enter to accept the recommendation and Apache Maven will create two commits, one that sets the release to 1.15.2 and then a second that sets it to 1.15.3-SNAPSHOT.Depend on Apache httpclient 4 plugin instead of jar file
https://plugins.jenkins.io/apache-httpcomponents-client-4-api/ avoids the plugin bundling an outdated version of the Apache httpclient library. It replaces the bundling of the jar file with a dependency on the Apache HttpComponents Client 4.x API plugin. That plugin is installed on over 96% of all Jenkins installations.
By depending on the plugin instead of the jar file, the plugin bill of materials will manage the dependency version and the plugin will use the most recent version that is installed on the Jenkins controller.
This is a common technique used by many Jenkins plugins. Refer to https://plugins.jenkins.io/apache-httpcomponents-client-4-api/dependencies/ for the list of plugins that depend on the Apache httpclient plugin.
Use bom-2.361.x to match Jenkins minimum version
The Jenkins plugin bill of materials dependency should match the Jenkins minimum version from the
jenkins.version
property. Refer to https://www.jenkins.io/doc/developer/tutorial-improve/use-plugin-bill-of-materials/ for more details about the plugin bill of materials.Use most recent parent pom - 4.76
Allows compilation with Java 11, Java 17, and Java 21. Preparing for Oct 2024 when Java 11 support in Jenkins will be end of life.
Add Jenkinsfile to check plugin on ci.jenkins.io
https://www.jenkins.io/doc/developer/tutorial-improve/add-a-jenkinsfile/ describes the benefits of including a Jenkinsfile in the plugin repository. This will provide a ci.jenkins.io job that evaluates the master branch and any pull request branches automatically.
Testing done
Interactive tests confirmed that the correct plugin version is displayed to the user. Interactive tests also confirmed that the Apache httpclient library dependency was added as expected. Compilation messages no longer report that a transitive dependency on an older Apache httpclient library is being added to the hpi file.
Submitter checklist
Additional notes
Confirmed that the contents of the plugin hpi file are further simplified so that the plugin hpi file now contains:
The change removed several dependencies that were being included as transitive dependencies.