Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/src/main/java/hudson/model/ManagementLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ public enum Category {
* Configuration pages that don't fit into a more specific section.
*/
CONFIGURATION(Messages._ManagementLink_Category_CONFIGURATION()),
/**
* Configuration pages related to plugin management, including installation,
* updates, and administrative actions for maintaining installed plugins.
*/
@Restricted(NoExternalUse.class)
PLUGINS(Messages._ManagementLink_Category_PLUGINS()),
/**
* Security related options. Useful for plugins providing security related {@code ManagementLink}s (e.g. security realms).
* Use {@link Category#STATUS} instead if the feature is informational.
Expand Down
69 changes: 69 additions & 0 deletions core/src/main/java/jenkins/management/PluginsAvailableLink.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* The MIT License
*
* Copyright (c) 2025, Jan Faracik
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package jenkins.management;

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.ManagementLink;
import hudson.security.Permission;
import jenkins.model.Jenkins;
import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag;

@Extension(ordinal = Integer.MAX_VALUE - 1)
public class PluginsAvailableLink extends ManagementLink {

@Override
public String getIconFileName() {
var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue();

if (!flagEnabled) {

Check warning on line 41 in core/src/main/java/jenkins/management/PluginsAvailableLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 41 is only partially covered, one branch is missing
return null;
}

return "symbol-shopping-bag";
}

@Override
public String getDisplayName() {
return Messages.PluginsAvailableLink_DisplayName();

Check warning on line 50 in core/src/main/java/jenkins/management/PluginsAvailableLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 45-50 are not covered by tests
}

@Override
public String getUrlName() {
return "pluginManager/available";
}

@NonNull
@Override
public Permission getRequiredPermission() {
return Jenkins.SYSTEM_READ;
}

@NonNull
@Override
public Category getCategory() {
return Category.PLUGINS;

Check warning on line 67 in core/src/main/java/jenkins/management/PluginsAvailableLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 61-67 are not covered by tests
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* The MIT License
*
* Copyright (c) 2025, Jan Faracik
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package jenkins.management;

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.ManagementLink;
import hudson.security.Permission;
import jenkins.model.Jenkins;
import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag;

@Extension(ordinal = Integer.MAX_VALUE - 3)
public class PluginsDownloadProgressLink extends ManagementLink {

@Override
public String getIconFileName() {
var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue();

if (!flagEnabled) {

Check warning on line 41 in core/src/main/java/jenkins/management/PluginsDownloadProgressLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 41 is only partially covered, one branch is missing
return null;
}

// Hide the 'Download progress' link if there are
// no active downloads or restarts pending
if (Jenkins.get().getUpdateCenter().getJobs().isEmpty()) {
return null;
}

return "symbol-list";
}

@Override
public String getDisplayName() {
return Messages.PluginsDownloadProgressLink_DisplayName();

Check warning on line 56 in core/src/main/java/jenkins/management/PluginsDownloadProgressLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 47-56 are not covered by tests
}

@Override
public String getUrlName() {
return "pluginManager/updates/";
}

@NonNull
@Override
public Permission getRequiredPermission() {
return Jenkins.SYSTEM_READ;
}

@NonNull
@Override
public Category getCategory() {
return Category.PLUGINS;

Check warning on line 73 in core/src/main/java/jenkins/management/PluginsDownloadProgressLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 67-73 are not covered by tests
}
}
69 changes: 69 additions & 0 deletions core/src/main/java/jenkins/management/PluginsInstalledLink.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* The MIT License
*
* Copyright (c) 2025, Jan Faracik
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package jenkins.management;

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.ManagementLink;
import hudson.security.Permission;
import jenkins.model.Jenkins;
import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag;

@Extension(ordinal = Integer.MAX_VALUE - 2)
public class PluginsInstalledLink extends ManagementLink {

@Override
public String getIconFileName() {
var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue();

if (!flagEnabled) {

Check warning on line 41 in core/src/main/java/jenkins/management/PluginsInstalledLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 41 is only partially covered, one branch is missing
return null;
}

return "symbol-plugins";
}

@Override
public String getDisplayName() {
return Messages.PluginsInstalledLink_DisplayName();

Check warning on line 50 in core/src/main/java/jenkins/management/PluginsInstalledLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 45-50 are not covered by tests
}

@Override
public String getUrlName() {
return "pluginManager/installed";
}

@NonNull
@Override
public Permission getRequiredPermission() {
return Jenkins.SYSTEM_READ;
}

@NonNull
@Override
public Category getCategory() {
return Category.PLUGINS;

Check warning on line 67 in core/src/main/java/jenkins/management/PluginsInstalledLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 61-67 are not covered by tests
}
}
7 changes: 7 additions & 0 deletions core/src/main/java/jenkins/management/PluginsLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import hudson.model.UpdateCenter;
import hudson.security.Permission;
import jenkins.model.Jenkins;
import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag;
import org.jenkinsci.Symbol;

/**
Expand All @@ -40,6 +41,12 @@

@Override
public String getIconFileName() {
var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue();

if (flagEnabled) {

Check warning on line 46 in core/src/main/java/jenkins/management/PluginsLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 46 is only partially covered, one branch is missing
return null;

Check warning on line 47 in core/src/main/java/jenkins/management/PluginsLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 47 is not covered by tests
}

return "plugin.svg";
}

Expand Down
76 changes: 76 additions & 0 deletions core/src/main/java/jenkins/management/PluginsUpdatesLink.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* The MIT License
*
* Copyright (c) 2025, Jan Faracik
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package jenkins.management;

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.ManagementLink;
import hudson.model.UpdateCenter;
import hudson.security.Permission;
import jenkins.model.Jenkins;
import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag;

@Extension(ordinal = Integer.MAX_VALUE)
public class PluginsUpdatesLink extends ManagementLink {

@Override
public String getIconFileName() {
var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue();

if (!flagEnabled) {

Check warning on line 42 in core/src/main/java/jenkins/management/PluginsUpdatesLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 42 is only partially covered, one branch is missing
return null;
}

return "symbol-download";
}

@Override
public String getDisplayName() {
return Messages.PluginsUpdatesLink_DisplayName();

Check warning on line 51 in core/src/main/java/jenkins/management/PluginsUpdatesLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 46-51 are not covered by tests
}

@Override
public String getUrlName() {
return "pluginManager";
}

@NonNull
@Override
public Permission getRequiredPermission() {
return Jenkins.SYSTEM_READ;
}

@NonNull
@Override
public Category getCategory() {
return Category.PLUGINS;
}

@Override
public Badge getBadge() {
final UpdateCenter updateCenter = Jenkins.get().getUpdateCenter();
return updateCenter.getBadge();

Check warning on line 74 in core/src/main/java/jenkins/management/PluginsUpdatesLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 62-74 are not covered by tests
}
}
Loading
Loading