Skip to content

Conversation

@jtnord
Copy link
Member

@jtnord jtnord commented Dec 1, 2025

disable obsolete permissions (UploadPlugins, ConfigureUpdateCenter and RunScripts).

  • disable the permissions
  • mark the permissions as DoNotUse so that plugins updating core will now fail to compile
  • retain API compatibility for now (full removal can be done for a future PR).

amends #4365 (released in Jenkins 2.222) relates to JEP-223 / #20740

#23873 (comment)

Testing done

Proposed changelog entries

  • The following permissions are now disabled and will be removed in a future Jenkins version, any code relying on them should be updated to instead check for the Overall/Administer permission:
    • Overall/ConfigureUpdateCenter
    • Overall/RunScripts
    • Overall/UploadPlugins

Proposed changelog category

/label developer

Proposed upgrade guidelines

N/A

Submitter checklist

  • The 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.
  • UI changes do not introduce regressions when enforcing the current default rules of Content Security Policy Plugin. In particular, 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

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

Maintainer checklist

  • 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, be a Bug or Improvement, and either the issue or pull request must be labeled as lts-candidate to be considered.

disable obsolete permissions (UploadPlugins, ConfigureUpdateCenter and
RunScripts).
* disable the permissions
* mark the permissions as DoNotUse so that plugins updating core will
  now fail to compile
* retain API compatability for now (full removal can be done for a future LTS).
@jtnord jtnord added the developer Changes which impact plugin developers label Dec 1, 2025
@Deprecated
public static final Permission UPLOAD_PLUGINS = new Permission(Jenkins.PERMISSIONS, "UploadPlugins", Messages._PluginManager_UploadPluginsPermission_Description(), Jenkins.ADMINISTER, PermissionScope.JENKINS);
@Deprecated(forRemoval = true)
@Restricted(DoNotUse.class)
Copy link
Member

Choose a reason for hiding this comment

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

Do not use @Restricted on a @Deprecated member. These are two different things with different purposes and should not be mixed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

done in 90d00cf

Copy link
Member

@jglick jglick Dec 2, 2025

Choose a reason for hiding this comment

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

Well, FWIW I meant to keep the @Deprecated and delete the @Restricted. That is, obviously these fields should be @Deprecated; I was asking to not add @Restricted.

(same on RUN_SCRIPTS of course)

Copy link
Member Author

@jtnord jtnord Dec 2, 2025

Choose a reason for hiding this comment

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

I explicitly wanted to break source compatibility :)
its been deprecated for 5 years, devs (outside of the authZ plugins where its use is still semi legitimate) are not paying attention to it today.

public static final Permission RUN_SCRIPTS = new Permission(PERMISSIONS, "RunScripts", Messages._Hudson_RunScriptsPermission_Description(), ADMINISTER, PermissionScope.JENKINS);
@Deprecated(forRemoval = true)
@Restricted(DoNotUse.class)
public static final Permission RUN_SCRIPTS = new Permission(PERMISSIONS, "RunScripts", Messages._Hudson_RunScriptsPermission_Description(), null, false, new PermissionScope[] {PermissionScope.JENKINS});
Copy link
Member

Choose a reason for hiding this comment

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

May as well delete localized key while we are here and replace with some text that mentions it is deprecated.

Copy link
Member Author

Choose a reason for hiding this comment

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

the text is already "Deprecated - Please use the Overall/Administer permission instead".
Are you suggesting that we hard code the English message here and remove the translations?

Copy link
Member

Choose a reason for hiding this comment

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

If it already notes that it is deprecated I guess it does not matter; would just be a tiny bit of tech debt reduction to eliminate a few localizable keys since the values should never be displayed in the GUI any more.

@jglick requested not to mix deprecation and restricted annotations

What we want here is to break source compatability so keeping the
Restricted annotation.  Whilst some plugins may have disabled the
annotation checker and no longer get any warnings about this that would
be their issue for using this well after it was deprecated 5 years ago.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants