Skip to content

Conversation

@romanisb
Copy link
Contributor

@romanisb romanisb commented Jun 9, 2023

This PR is trying to address the current issues were using/building a JFR image with a Jenkins version > 2.346.3 fails (e.g. #686 or #657).

The changes are addressing:

  • Jenkins refactoring from JEP-230
  • Couple of dependency updates
  • Refactoring of some deprecations

I have commented some dependencies were @oleg-nenashev has added a TODO to remove.
I'm not 100% sure, but they could be safely removed now.

Testing done

Test Image

romanisb/jenkinsfile-runner:jenkins-core-2.375.4

(Build from packaging/docker/unix/eclipse-temurin-11-jre/Dockerfile):

Test Pipeline

Jenkinsfile
node() {
    echo("${Jenkins.instance.getVersion()}")
}
Command

docker run --rm -v ${pwd}:/workspace romanisb/jenkinsfile-runner:jenkins-core-2.375.4 -ns

Output
...<jpi related warnings removed>
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/app/jenkins/WEB-INF/lib/groovy-all-2.4.21.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Started
Resume disabled by user, switching to high-performance, low-durability mode.
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /build
[Pipeline] {
[Pipeline] echo
2.375.4
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@romanisb romanisb requested a review from a team as a code owner June 9, 2023 12:07
Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good, thanks you! I would likely go straight to Jetty 11 but it is a separate topic

@romanisb
Copy link
Contributor Author

romanisb commented Jun 27, 2023

Everything looks good, thanks you! I would likely go straight to Jetty 11 but it is a separate topic

Thanks for the approval. Before merging this change, let me remove a change which shouldn't end up in this PR and clean up the commented dependencies.

@romanisb
Copy link
Contributor Author

Done from my side. If I find the time I'll try to look into updating Jetty to version 11, but rather in another PR.

@romanisb
Copy link
Contributor Author

romanisb commented Jul 17, 2023

Everything looks good, thanks you! I would likely go straight to Jetty 11 but it is a separate topic
@oleg-nenashev

I've looked into updating to Jetty 11 and straight away the compilation will fail because auf the namespace change from javax.* to jakarta.*:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /mnt/c/Users/dev/romanisb/jenkinsfile-runner/setup/src/main/java/io/jenkins/jenkinsfile/runner/JenkinsLauncher.java:[20,20] error: package javax.servlet does not exist
[ERROR] /mnt/c/Users/dev/romanisb/jenkinsfile-runner/setup/src/main/java/io/jenkins/jenkinsfile/runner/JenkinsLauncher.java:[21,20] error: package javax.servlet does not exist
[ERROR] /mnt/c/Users/dev/romanisb/jenkinsfile-runner/setup/src/main/java/io/jenkins/jenkinsfile/runner/JenkinsEmbedder.java:[77,20] error: package javax.servlet does not exist
[ERROR] /mnt/c/Users/dev/romanisb/jenkinsfile-runner/setup/src/main/java/io/jenkins/jenkinsfile/runner/JenkinsLauncher.java:[80,14] error: cannot find symbol
  symbol:   class ServletContext
  location: class JenkinsLauncher<T>
  where T is a type-variable:
    T extends JenkinsLauncherCommand declared in class JenkinsLauncher
[ERROR] /mnt/c/Users/dev/romanisb/jenkinsfile-runner/setup/src/main/java/io/jenkins/jenkinsfile/runner/JenkinsEmbedder.java:[375,23] error: cannot find symbol
  symbol:   class ServletContext
  location: class JenkinsEmbedder
[ERROR] /mnt/c/Users/dev/romanisb/jenkinsfile-runner/setup/src/main/java/io/jenkins/jenkinsfile/runner/PluginManagerImpl.java:[14,29] error: cannot find symbol
  symbol:   class ServletContext
  location: class PluginManagerImpl
[ERROR] /mnt/c/Users/dev/com/romanisb/jenkinsfile-runner/setup/src/main/java/io/jenkins/jenkinsfile/runner/NoListenerConfiguration.java:[8,20] error: package javax.servlet does not exist
[INFO] 7 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Jenkinsfile Runner 1.0-beta-32-SNAPSHOT:
[INFO]
[INFO] Jenkinsfile Runner ................................. SUCCESS [  1.422 s]
[INFO] bootstrap .......................................... SUCCESS [  7.175 s]
[INFO] setup .............................................. FAILURE [  7.503 s]
[INFO] Jenkinsfile Runner: Plugin dependencies ............ SKIPPED
[INFO] payload ............................................ SKIPPED
[INFO] jenkinsfile-runner ................................. SKIPPED
[INFO] packaging-parent-pom-resources ..................... SKIPPED
[INFO] packaging-parent-pom ............................... SKIPPED
[INFO] packaging-parent-pom-slim .......................... SKIPPED
[INFO] vanilla-package .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  30.009 s
[INFO] Finished at: 2023-07-17T10:26:19+02:00
[INFO] ------------------------------------------------------------------------

Also I'm not sure if Jetty 11 will somehow work with Jenkins core in the future, but I do not have that much in-depth knowledge in this:
https://www.jenkins.io/doc/administration/requirements/servlet-containers/

Tested with romanisb/jenkinsfile-runner@update-jenkins-core-2.375...romanisb:jenkinsfile-runner:jenkins-core-2.387-jetty-11

@oleg-nenashev
Copy link
Member

Sorry for the response delays, is definitely something to look into

@oleg-nenashev
Copy link
Member

I hope to catch up with the discussions here but it realistically won't happen until August

@romanisb
Copy link
Contributor Author

I hope to catch up with the discussions here but it realistically won't happen until August

Yeah. No worries. Since this discussion is a bit off-topic with this PR, I've created a Github issue (#699), where the discussion could be continued.

@oleg-nenashev oleg-nenashev added the dependencies Pull requests that update a dependency file label Aug 6, 2023
@oleg-nenashev oleg-nenashev merged commit f6f1061 into jenkinsci:main Aug 6, 2023
@lhupfeldt
Copy link

Hi @oleg-nenashev, will there be a new (beta) release soon? I'm hoping for a fix for #686

@lhupfeldt
Copy link

Hi @oleg-nenashev, sorry to ask again, but will there be a new (beta) release soon? We have been unable to execute our pipeline tests for while.

@oleg-nenashev
Copy link
Member

Sorry, catching up on the technical debt

@lhupfeldt
Copy link

Hi @oleg-nenashev is the fix in beta-32?

@oleg-nenashev
Copy link
Member

@lhupfeldt yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants