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

Apply Jenkins plugin standards #3

Merged
merged 1 commit into from Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
@@ -0,0 +1 @@
* @jenkinsci/mathworks-polyspace-plugin-developers
12 changes: 12 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,12 @@
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates

version: 2
updates:
- package-ecosystem: maven
directory: /
schedule:
interval: monthly
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
2 changes: 2 additions & 0 deletions .github/release-drafter.yml
@@ -0,0 +1,2 @@
_extends: .github
tag-template: ${artifactId}-$NEXT_MINOR_VERSION
22 changes: 22 additions & 0 deletions .github/workflows/jenkins-security-scan.yml
@@ -0,0 +1,22 @@
# More information about the Jenkins security scan can be found at the developer docs: https://www.jenkins.io/redirect/jenkins-security-scan/

name: Jenkins Security Scan
on:
push:
branches:
- "master"
pull_request:
types: [ opened, synchronize, reopened ]
workflow_dispatch:

permissions:
security-events: write
contents: read
actions: read

jobs:
security-scan:
uses: jenkins-infra/jenkins-security-scan/.github/workflows/jenkins-security-scan.yaml@v2
with:
java-cache: 'maven' # Optionally enable use of a build dependency cache. Specify 'maven' or 'gradle' as appropriate.
java-version: 11 # What version of Java to set up for the build.
16 changes: 16 additions & 0 deletions .github/workflows/release-drafter.yml
@@ -0,0 +1,16 @@
# Automates creation of Release Drafts using Release Drafter
# More Info: https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc

on:
push:
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into the default branch
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 14 additions & 4 deletions .gitignore
@@ -1,5 +1,15 @@
.vscode
work
target
release.properties
pom.xml.releaseBackup

# mvn hpi:run
work

# IntelliJ IDEA project files
*.iml
*.iws
*.ipr
.idea

# Eclipse project files
.settings
.classpath
.project
7 changes: 7 additions & 0 deletions .mvn/extensions.xml
@@ -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.7</version>
</extension>
</extensions>
2 changes: 2 additions & 0 deletions .mvn/maven.config
@@ -0,0 +1,2 @@
-Pconsume-incrementals
-Pmight-produce-incrementals
13 changes: 11 additions & 2 deletions Jenkinsfile
@@ -1,2 +1,11 @@
buildPlugin()

/*
See the documentation for more options:
https://github.com/jenkins-infra/pipeline-library/
*/
buildPlugin(
forkCount: '1C', // run this number of tests in parallel for faster feedback. If the number terminates with a 'C', the value will be multiplied by the number of available CPU cores
useContainerAgent: true, // Set to `false` if you need to use Docker for containerized tests
configurations: [
[platform: 'linux', jdk: 21],
[platform: 'linux', jdk: 17],
])
38 changes: 22 additions & 16 deletions pom.xml
Expand Up @@ -3,17 +3,15 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.73</version>
<version>4.78</version>
<relativePath />
</parent>

<properties>
<!--
If your are using the Plugin Parent POM version 2.3 or later, just set the jenkins.version property to the version you need to depend on
Source: https://wiki.jenkins-ci.org/display/JENKINS/Choosing+Jenkins+version+to+build+against
-->
<jenkins.version>2.387.3</jenkins.version>
<jenkins.version>2.426.3</jenkins.version>
sbobin marked this conversation as resolved.
Show resolved Hide resolved
<findbugs.failOnError>true</findbugs.failOnError>
<!-- <java.level>8</java.level> -->
<!-- TODO fix violations before release and remove threshold -->
<spotbugs.threshold>High</spotbugs.threshold>
sbobin marked this conversation as resolved.
Show resolved Hide resolved
</properties>

<artifactId>mathworks-polyspace</artifactId>
Expand All @@ -22,7 +20,6 @@
<name>MathWorks Polyspace Plugin</name>
<url>https://github.com/jenkinsci/mathworks-polyspace-plugin</url>
<packaging>hpi</packaging>
<description>Jenkins plugin for Polyspace</description>
sbobin marked this conversation as resolved.
Show resolved Hide resolved

<licenses>
<license>
Expand All @@ -41,10 +38,10 @@
</developers>

<scm>
<connection>scm:git:ssh://github.com:jenkinsci/${project.artifactId}-plugin.git</connection>
<developerConnection>scm:git:ssh://git@github.com/jenkinsci/${project.artifactId}-plugin.git</developerConnection>
<connection>scm:git:https://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
<developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
sbobin marked this conversation as resolved.
Show resolved Hide resolved
<url>https://github.com/jenkinsci/${project.artifactId}-plugin.git</url>
<tag>mathworks-polyspace-1.0.8</tag>
<tag>${scmTag}</tag>
sbobin marked this conversation as resolved.
Show resolved Hide resolved
</scm>

<repositories>
Expand Down Expand Up @@ -76,26 +73,35 @@
</plugins>
</build>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.414.x</artifactId>
<version>2857.v01a_0144eb_20b_</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
sbobin marked this conversation as resolved.
Show resolved Hide resolved

<dependencies>
<!-- StringUtils -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.13.0</version>
<groupId>io.jenkins.plugins</groupId>
<artifactId>commons-lang3-api</artifactId>
sbobin marked this conversation as resolved.
Show resolved Hide resolved
</dependency>

<!-- Credential plugin -->
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>1271.v54b_1c2c6388a_</version>
</dependency>

<!-- Mailer plugin -->
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>mailer</artifactId>
<version>463.vedf8358e006b_</version>
sbobin marked this conversation as resolved.
Show resolved Hide resolved
</dependency>
</dependencies>
</project>
Expand Up @@ -220,7 +220,7 @@ public static long getCountFindings(final Path report) throws IOException {
*
* @param report - Path to the report
* @param max - Thereshold for status
* @return - Job status string: SUCCESS if num findings < {@code max}, UNSTABLE otherwise
* @return - Job status string: SUCCESS if num findings smaller than {@code max}, UNSTABLE otherwise
sbobin marked this conversation as resolved.
Show resolved Hide resolved
* @throws IOException
*/
public static String getReportStatus(final Path report, final long max) throws IOException
Expand Down