Start the removal of obsolete permissions#23883
Start the removal of obsolete permissions#23883jtnord wants to merge 4 commits intojenkinsci:masterfrom
Conversation
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).
| @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) |
There was a problem hiding this comment.
Do not use @Restricted on a @Deprecated member. These are two different things with different purposes and should not be mixed.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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}); |
There was a problem hiding this comment.
May as well delete localized key while we are here and replace with some text that mentions it is deprecated.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
disable obsolete permissions (UploadPlugins, ConfigureUpdateCenter and RunScripts).
DoNotUseso that plugins updating core will now fail to compileamends #4365 (released in Jenkins 2.222) relates to JEP-223 / #20740
#23873 (comment)
Testing done
ConfigureUpdateCenterrole-strategy-pluginremove obsolete permissions role-strategy-plugin#430matrix-authTBDfolder-authTBDazure-ad-pluginnectar-rbac(CloudBees internal)TBDRunScriptsscriptler-pluginfalse positivejob-dslTBDbuild-flowplugin is deprecated and suspendedmaven-pluginremove obsolete permission maven-plugin#421nectar-rbac(CloudBees internal) TBDrole-strategy-pluginremove obsolete permissions role-strategy-plugin#430matrix-authTBDopenshift-loginTBDauthorize-projectTBDfolder-authTBDgoogle-oauthTBDopenstack-cloud-pluginTBDazure-ad-pluginapp-detectorTBDsounds-pluginTBDjenkins-test-harnessremove obsolete RUN_SCRIPTS permission jenkins-test-harness#1126UploadPluginsrole-strategy-pluginremove obsolete permissions role-strategy-plugin#430matrix-authTBDfolder-authTBDazure-ad-pluginnectar-rbac(CloudBees internal)TBDProposed changelog entries
Overall/Administerpermission:Proposed changelog category
/label developer
Proposed upgrade guidelines
N/A
Submitter checklist
@Restrictedor have@since TODOJavadocs, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO"), if applicable.evalto ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
@mention
Before the changes are marked as
ready-for-merge:Maintainer checklist
upgrade-guide-neededlabel is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidateto be considered.