Skip to content

Commit

Permalink
Merge branch 'master' into use-new-table-style
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBtz authored Jul 25, 2022
2 parents cc8c542 + 093e66d commit 541e6bc
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 47 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ updates:
- dependency-name: org.jenkins-ci.main:jenkins-core
versions:
- ">= 0"
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
2 changes: 0 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc
_extends: .github
tag-template: cloudbees-disk-usage-simple-$NEXT_MINOR_VERSION
15 changes: 15 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins

name: cd
on:
workflow_dispatch:
check_run:
types:
- completed

jobs:
maven-cd:
uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1
secrets:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
18 changes: 0 additions & 18 deletions .github/workflows/release-drafter.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.3</version>
</extension>
</extensions>
3 changes: 3 additions & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-Pconsume-incrementals
-Pmight-produce-incrementals
-Dchangelist.format=%d.v%s
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
java adoptopenjdk-8.0.252+9.1
maven 3.6.3
maven 3.8.5
45 changes: 29 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,22 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.31</version>
<version>4.42</version>
</parent>

<artifactId>cloudbees-disk-usage-simple</artifactId>
<version>0.11-SNAPSHOT</version>
<version>${changelist}</version>
<packaging>hpi</packaging>

<name>CloudBees Disk Usage Simple Plugin</name>
<description>This is a simple disk usage plugin that calculates job disk usage while limiting the performance impact on the Jenkins master.</description>
<url>https://github.com/jenkinsci/cloudbees-disk-usage-simple-plugin</url>

<properties>
<jenkins.version>2.334</jenkins.version>
<changelist>999999-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/cloudbees-disk-usage-simple-plugin</gitHubRepo>
<jenkins.version>2.332.4</jenkins.version>
<java.level>8</java.level>
<useBeta>true</useBeta>
</properties>

<licenses>
Expand All @@ -60,28 +61,48 @@
<id>ndeloof</id>
<name>Nicolas De Loof</name>
<email>[email protected]</email>
<roles>
<role>Maintainer (retired)</role>
</roles>
</developer>
<developer>
<id>aheritier</id>
<name>Arnaud Heritier</name>
<email>[email protected]</email>
<roles>
<role>Maintainer (retired)</role>
</roles>
</developer>
<developer>
<id>recena</id>
<name>Manuel Recena</name>
<email>[email protected]</email>
<roles>
<role>Maintainer (retired)</role>
</roles>
</developer>
<developer>
<id>ydubreuil</id>
<name>Yoann Dubreuil</name>
<roles>
<role>Maintainer (retired)</role>
</roles>
</developer>
<developer>
<id>pierrebtz</id>
<name>Pierre Beitz</name>
<email>[email protected]</email>
<roles>
<role>Maintainer</role>
</roles>
</developer>
</developers>

<scm>
<connection>scm:git:git@github.com:jenkinsci/cloudbees-disk-usage-simple-plugin.git</connection>
<developerConnection>scm:git:git@github.com:jenkinsci/cloudbees-disk-usage-simple-plugin.git</developerConnection>
<url>http://github.com/jenkinsci/cloudbees-disk-usage-simple-plugin</url>
<tag>HEAD</tag>
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:https://github.com/${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
</scm>

<!-- get every artifact through repo.jenkins-ci.org, which proxies all the artifacts that we need -->
Expand All @@ -98,14 +119,6 @@
</pluginRepository>
</pluginRepositories>

<dependencies>
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>extended-read-permission</artifactId>
<version>3.2</version>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import hudson.Extension;
import hudson.model.ManagementLink;
import hudson.plugins.extendedread.SystemReadPermission;
import hudson.security.Permission;
import jenkins.model.Jenkins;
import org.kohsuke.stapler.StaplerProxy;
Expand Down Expand Up @@ -54,8 +53,7 @@ public String getUrlName() {

@Override
public Permission getRequiredPermission() {
// replace with Jenkins.SYSTEM_READ after baseline >= 2.222
return SystemReadPermission.SYSTEM_READ;
return Jenkins.SYSTEM_READ;
}

/**
Expand All @@ -77,7 +75,7 @@ public String getCategoryName() {
@Override
public Object getTarget() {
Jenkins jenkins = Jenkins.get();
jenkins.checkPermission(SystemReadPermission.SYSTEM_READ);
jenkins.checkPermission(Jenkins.SYSTEM_READ);
return jenkins.getPlugin(QuickDiskUsagePlugin.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public int getProgress() {
private transient final Runnable computeDiskUsage = new Runnable() {

public void run() {
logger.info("Re-estimating disk usage");
logger.fine("Re-estimating disk usage");
progress.set(0);
lastRunStart = System.currentTimeMillis();
Jenkins jenkins = Jenkins.get();
Expand All @@ -256,10 +256,10 @@ public void run() {
registerDirectories(uc);
total.set(uc.getItemsCount());
uc.compute();
logger.info("Finished re-estimating disk usage.");
logger.fine("Finished re-estimating disk usage.");
lastRunEnd = System.currentTimeMillis();
} catch (IOException | InterruptedException e) {
logger.log(Level.INFO, "Unable to run disk usage check", e);
logger.log(Level.WARNING, "Unable to run disk usage check", e);
lastRunEnd = lastRunStart;
}
try {
Expand All @@ -276,7 +276,7 @@ public void run() {
Jenkins jenkins = Jenkins.get();
while (jenkins.getInitLevel() != InitMilestone.COMPLETED) {
try {
logger.log(Level.INFO, "Waiting for Jenkins to be up before computing disk usage");
logger.log(Level.FINE, "Waiting for Jenkins to be up before computing disk usage");
Thread.sleep(3 * 60 * 1000);
} catch (InterruptedException e) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) th
try {
jenkinsHome.touch(System.currentTimeMillis());
} catch (InterruptedException e) {
logger.log(Level.INFO, "Exception while touching JENKINS_HOME", e);
logger.log(Level.WARNING, "Exception while touching JENKINS_HOME", e);
}
}

Expand All @@ -99,7 +99,7 @@ public FileVisitResult visitFileFailed(Path file, IOException exc) {
@Override
public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
if (exc != null) {
logger.log(Level.INFO, "Exception thrown while walking {}: {}", new Object[] {dir, exc });
logger.log(Level.WARNING, "Exception thrown while walking {}: {}", new Object[] {dir, exc });
}

// throttle the walking process so it only consumes at most half of the available IO bandwidth
Expand Down

0 comments on commit 541e6bc

Please sign in to comment.