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

Upgrade to Jakarta EE 9 #167

Merged
merged 5 commits into from
Feb 17, 2025
Merged

Conversation

strangelookingnerd
Copy link
Contributor

Require Jenkins 2.479.1 and Jakarta EE 9

Jenkins 2.479.1 provides Jakarta EE 9, Eclipse Jetty 12, Spring Security 6, and Java 17.

  • Update plugin pom and baseline
  • Remove deprecations
  • Use Java 17 language features

Testing done

Confirmed that tests pass.

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

@strangelookingnerd strangelookingnerd requested a review from a team as a code owner February 7, 2025 16:20
private static final Level DEFAULT_LOG_LEVEL = Level.FINEST;
private static final Pattern PAT_SEMICOLON_ENCLOSURE = Pattern.compile("\"(.*?)\"");
private static final Pattern PAT_COMMA = Pattern.compile(",");
private static final transient Level DEFAULT_LOG_LEVEL = Level.FINEST;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MarkEWaite Isn't the transient redundant for static fields? They should not tamper with serialization?

Copy link
Contributor

Choose a reason for hiding this comment

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

@MarkEWaite Isn't the transient redundant for static fields? They should not tamper with serialization?

I've had bad experiences with the git plugin because I changed things related to serialization. Keeping this code unmodified is more about me not wanting to take risks on a plugin that I do not actively use.

Comment on lines +682 to +683
StaplerRequest.fromStaplerRequest2(req),
StaplerResponse.fromStaplerResponse2(rsp),
Copy link
Contributor

Choose a reason for hiding this comment

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

We want to avoid calls to fromStaplerRequest2 whenever possible because they will prevent future removal of the compatibility layer. In this case, the ChartUtil.generateGraph was deprecated long ago. Current instructions say that as of 1.320 Bind Graph to the URL space. See hudson.tasks.junit.History as an example (note that doing so involves a bit of URL structure change.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before settling with fromStaplerRequest2 I tried to make sense of the deprecation note on ChartUtil.generateGraph. Looking at hudson.tasks.junit.History it seems to have been rewritten and refactored quite a lot, to a point where I gave up since I could not find out where to start. If you have any pointers or other examples where I could find a good migration path I‘d be happy to give it another try.

Copy link
Contributor

Choose a reason for hiding this comment

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

Your experience matches with mine. I didn't spend much time searching, but the time that I spent showed no examples that I could reference or hints for the migration. We may just need to accept this one until more research can be done to find the migration path.

private static final Level DEFAULT_LOG_LEVEL = Level.FINEST;
private static final Pattern PAT_SEMICOLON_ENCLOSURE = Pattern.compile("\"(.*?)\"");
private static final Pattern PAT_COMMA = Pattern.compile(",");
private static final transient Level DEFAULT_LOG_LEVEL = Level.FINEST;
Copy link
Contributor

Choose a reason for hiding this comment

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

@MarkEWaite Isn't the transient redundant for static fields? They should not tamper with serialization?

I've had bad experiences with the git plugin because I changed things related to serialization. Keeping this code unmodified is more about me not wanting to take risks on a plugin that I do not actively use.

@MarkEWaite MarkEWaite changed the title Require Jenkins 2.479.1 and Jakarta EE 9 Upgrade to Jakarta EE 9 Feb 17, 2025
@MarkEWaite MarkEWaite added chore General project maintenance feature New feature or improvement and removed chore General project maintenance labels Feb 17, 2025
@MarkEWaite MarkEWaite merged commit 81a319a into jenkinsci:master Feb 17, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants