Code Monkey home page Code Monkey logo

Comments (20)

butchyyyy avatar butchyyyy commented on July 1, 2024 5

I have started working on a new major version, it will:

  • Make the plugin compatible with LTS Jenkins version
  • Bump the minimal Jenkins version to 2.387.3
  • Bump the minimal Java version to 11
  • Migrate away from apache commons http client to java.net http client

I have bulk of the work done. I just need to adjust the unit tests and give this a proper test flight before shipping the new version. Will keep you posted.

from zulip-plugin.

butchyyyy avatar butchyyyy commented on July 1, 2024 3

Thanks for reporting and apologies for the inconvenience. I'll try to come up with a quick fix this week (adding the commons HttpClient dependency).

from zulip-plugin.

butchyyyy avatar butchyyyy commented on July 1, 2024 2

Thanks a lot for testing it @epaul13!
The certificate chain validation is correct and afaik it was performed also with the Apache http client. Let me know if you think this is behaving differently than before.

I was also testing on my end today and verified several scenarios including proxy being setup in Jenkins both with and without authentication.

I think we are good to go, will most probably do the release tomorrow.

from zulip-plugin.

butchyyyy avatar butchyyyy commented on July 1, 2024 2

Resolved in version 2.0.0

from zulip-plugin.

EvgenyKuzavlev avatar EvgenyKuzavlev commented on July 1, 2024 1

I tried add а dependency for plugin commons-httpclient3-api to pom. I builded .hpi and tested it in my jenkins server(v. 2.386) and it worked successful, BUT unit-tests were failed. I am going to try fix a problem with tests.

from zulip-plugin.

jamesvl avatar jamesvl commented on July 1, 2024 1

This release of Jenkins just hide the wider apt repositories in Ubuntu, so I hit this bug today when I upgraded.

Is there a quick way to fix this locally? I can still in the Commons HttpClient 3.x API Plugin, but that alone doesn't appear sufficient.

from zulip-plugin.

EvgenyKuzavlev avatar EvgenyKuzavlev commented on July 1, 2024 1

@jamesvl You can pull my fork and execute mvn hpi:hpi for build a hpi file. After you can manually install it. See https://www.jenkins.io/doc/book/managing/plugins/ for more details.

from zulip-plugin.

ipikiiskinen avatar ipikiiskinen commented on July 1, 2024 1

@butchyyyy you mentioned that you would be looking at this. Any chance to get this fixed?

from zulip-plugin.

EvgenyKuzavlev avatar EvgenyKuzavlev commented on July 1, 2024 1

@ipikiiskinen @epaul13 I didn't try to use my fork with latest Jenkins, maybe it doesn't work. I am going to update Jenkins and test it later.

My env:
centos-release-7-9.2009.1.el7.centos.x86_64
openjdk 11.0.17 2022-10-18 LTS
jenkins 2.386

from zulip-plugin.

butchyyyy avatar butchyyyy commented on July 1, 2024 1

^^ The PR is up, all unit and integration tests are passing.

There are more or less no functional changes besides the http client migration. The rest is mostly formatting stuff and test migration away from Powermock.

I still need to run some manual testing against Jenkins + Zulip before I release this. If anyone has time to also give the branch a quick test and report any issues, it will be much appreciated.

Of course feel free to leave comments on the PR as well, it's first Java code I did in ~4 years 🙈

from zulip-plugin.

epaul13 avatar epaul13 commented on July 1, 2024 1

Thanks a lot for testing it @epaul13! The certificate chain validation is correct and afaik it was performed also with the Apache http client. Let me know if you think this is behaving differently than before.

I was also testing on my end today and verified several scenarios including proxy being setup in Jenkins both with and without authentication.

I think we are good to go, will most probably do the release tomorrow.

Good news. For the certificate validation, my bad. I tested on a brand-new container, and my old jenkins is probably ten years old. I just checked and I have the same chain on the old server. So everything' good!

from zulip-plugin.

eXtrem0us avatar eXtrem0us commented on July 1, 2024

It seems in the changelog of Jenkins the reason for this issue is mentioned:

What's new in 2.379 (2022-11-22)

Jenkins no longer bundles a patched version of the deprecated Commons HttpClient 3.x library for use by plugins.
Plugins should be migrated to the native Java 11 HTTP client or updated to depend on the legacy Commons HttpClient 3.x API plugin.

from zulip-plugin.

timabbott avatar timabbott commented on July 1, 2024

@butchyyyy do you have time to investigate this?

In any case, pull requests are welcome.

from zulip-plugin.

xavier-calland avatar xavier-calland commented on July 1, 2024

FWIW I tried switch to java.net.http client which requires upgrading to java 11+. I had problems with the tests: powermock, mokito, … are not compatible.
If you want, I can share my work as WIP.

from zulip-plugin.

koval-jan avatar koval-jan commented on July 1, 2024

Quick fix is to add pom dependency for plugin commons-httpclient3-api (https://plugins.jenkins.io/commons-httpclient3-api/)

<dependency>
    <groupId>io.jenkins.plugins</groupId>
    <artifactId>commons-httpclient3-api</artifactId>
    <version>3.1-3</version>
</dependency>

from zulip-plugin.

epaul13 avatar epaul13 commented on July 1, 2024

@EvgenyKuzavlev: I used your fork and build it with last maven without problems. After copying the zulip.hpi to plugins/zulip.jpi, the plugin is correctly loaded, but the global configuration and post-build step are not showing up. Any clue?

Note:
Maven home: /opt/apache-maven-3.9.1
Java version: 11.0.18, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.15.104-1-pve", arch: "amd64", family: "unix"

from zulip-plugin.

ipikiiskinen avatar ipikiiskinen commented on July 1, 2024

@EvgenyKuzavlev
I also used your fork and build it with:

$ mvn --version Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8) Maven home: /opt/apache-maven-3.9.1 Java version: 11.0.18, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.18.0.10-1.el7_9.x86_64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-1160.88.1.el7.x86_64", arch: "amd64", family: "unix"
I got the same results as @epaul13
Plugin does not report any error in start up, gets listed as installed plugin, but it does not show in global config or in build definitions.
Tested with the latest Jenkins LTS release 2.387.3 (RedHat 7 RPM installation) and openjdk version "11.0.19" 2023-04-18 LTS

@EvgenyKuzavlev Have you managed to the get the plugin working with the latest LTS Jenkins?

from zulip-plugin.

epaul13 avatar epaul13 commented on July 1, 2024

Any news? I can try to make a correction, but my java is rusted, and I don't know maven nor Jenkins dev env... Might not be the most efficient move :)

from zulip-plugin.

epaul13 avatar epaul13 commented on July 1, 2024

@butchyyyy

I checked out your PR and tested it. I have now access to global configuration and project post-build actions. Great work!

At first, I was unable to get any messages, with an error in Jenkins logs:

#011SEVERE#011jenkins.plugins.zulip.Zulip#post: Error sending Zulip message:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I had to add my zulip server chain certificate to make it work. On Ubuntu 22.04, it means:

sudo cp zulip.combined-chain.crt /usr/local/share/ca-certificates
sudo update-ca-certificates
sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure
sudo systemctl restart jenkins

Now I get my jenkins post messages from Jenkins!
Thank you again!

So this work on Jenkins 2.387.3 on java 11.0.18 on Ubuntu 22.04


To build, for maven/jenkins devenv noobs like me:

git clone https://github.com/jenkinsci/zulip-plugin.git                                                                                                                                
cd zulip-plugin/
git checkout origin/version2
mvn package
# uninstall previous zulip plugin
sudo -u jenkins cp target/zulip.hpi /var/lib/jenkins/plugins/
sudo systemctl restart jenkins

with:

mvn --version
Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8)
Maven home: /opt/apache-maven-3.9.1
Java version: 11.0.18, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.15.104-1-pve", arch: "amd64", family: "unix"

from zulip-plugin.

eXtrem0us avatar eXtrem0us commented on July 1, 2024

Thank You @butchyyyy ! ❤️

from zulip-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.