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

Move from javax.inject to jakarta.inject #8065

Merged
merged 4 commits into from Jun 5, 2023

Conversation

basil
Copy link
Member

@basil basil commented May 29, 2023

Without dropping support for javax.inject annotations, prefer jakarta.inject annotations in our own code wherever possible to facilitate eventually removing support for javax.inject when we move to Guice 7.

Testing done

mvn clean verify -Dtest=hudson.ExtensionFinderTest,jenkins.bugs.Jenkins19124Test,jenkins.install.InstallUtilTest,lib.form.TextAreaTest

Proposed changelog entries

Add support for jakarta.inject annotations.

Proposed upgrade guidelines

N/A

Submitter checklist

  • The Jira issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples).
    • Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • New or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@basil basil added the developer Changes which impact plugin developers label May 29, 2023
Copy link
Member

@NotMyFault NotMyFault left a comment

Choose a reason for hiding this comment

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

Oh, that's nice

@NotMyFault NotMyFault requested a review from a team May 30, 2023 15:07
Copy link
Contributor

@res0nance res0nance left a comment

Choose a reason for hiding this comment

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

LGTM. Should we leave a javax.inject test in ExtensionFinderTest to ensure we don't accidentally break this?

@NotMyFault
Copy link
Member

/label ready-for-merge


This PR is now ready for merge. We will merge it after ~24 hours if there is no negative feedback.
Please see the merge process documentation for more information about the merge process.
Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label May 31, 2023
@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Jun 5, 2023
@github-actions
Copy link

github-actions bot commented Jun 5, 2023

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Jun 5, 2023
@NotMyFault NotMyFault merged commit d54041e into jenkinsci:master Jun 5, 2023
16 checks passed
import java.util.List;
import javax.inject.Provider;
Copy link
Member

Choose a reason for hiding this comment

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

FYI this is a breaking API change because the public extension point uses Provider in its API.

public abstract InstallState getNextInstallState(InstallState current, Provider<InstallState> proceed);

Copy link
Member Author

@basil basil Jun 13, 2023

Choose a reason for hiding this comment

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

Sorry, I had not noticed that before, but you are right. Fortunately I could not find any affected open source plugins, and only a small handful of CloudBees plugins appear to be affected: bluesteel, cloudbees-license-plugin, and cloudbees-assurance-plugin. Since the migration is so easy (just change the imports) I am inclined to leave this as-is in both weeklies and LTS. Since we have to switch to Jakarta injection imports eventually to get to Guice 7, I believe that the benefits of releasing a version with full support for Jakarta injection imports (allowing us to eventually get to Guice 7) outweigh the small cost of adapting to this minor method signature change in a small handful of proprietary plugins. Feel free to let me know if this isn't feasible for some reason.

MarkEWaite added a commit to MarkEWaite/jenkins.io that referenced this pull request Dec 2, 2023
jenkinsci/jenkins#8065 was first included in
2.408 and was not backported to any of the 2.401.x releases.

jenkinsci/jenkins#8121 was backported to 2.401.2.
MarkEWaite added a commit to jenkins-infra/jenkins.io that referenced this pull request Dec 2, 2023
jenkinsci/jenkins#8065 was first included in
2.408 and was not backported to any of the 2.401.x releases.

jenkinsci/jenkins#8121 was backported to 2.401.2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer Changes which impact plugin developers ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback
Projects
None yet
4 participants