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

2.15.1 snapshot qualification #368

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
3d944a7
Added check for command textbox
nbhoski Aug 6, 2024
ed8070a
Updated as per review comment
nbhoski Aug 7, 2024
b88d782
Updated as per review comment
nbhoski Aug 7, 2024
3480719
Merge pull request #353 from mathworks/gecko_2221893
nbhoski Aug 7, 2024
090ee01
Add build results support in Run Command step and skipped task logs l…
mw-kapilg Aug 28, 2024
8afb9e2
Add skip reason for skipped tasks in build results table (#356)
mw-kapilg Sep 5, 2024
2640d54
Merge pull request #363 from jenkinsci/master
mw-kapilg Sep 27, 2024
aa45f72
Intial commit
nbhoski Oct 1, 2024
16cdd59
Added unit tests and updated the install logic
nbhoski Oct 3, 2024
3e1bc04
Updated test and seperated system properties
nbhoski Oct 3, 2024
f85001e
Updated the logic
nbhoski Oct 3, 2024
5a663c2
Added tests and refactored code
nbhoski Oct 4, 2024
379145a
Fixed spotbug issue
nbhoski Oct 4, 2024
64fd16d
Updated Mockito version
nbhoski Oct 7, 2024
fbb631f
Updated buddy bytes version
nbhoski Oct 7, 2024
f57d86d
Updated azure pipeline for java version
nbhoski Oct 7, 2024
8dd2c69
Added help icons for Version & products
nbhoski Oct 7, 2024
2062e32
Updated the help files
nbhoski Oct 8, 2024
c1ef42b
Updated Indentation
nbhoski Oct 8, 2024
eaf7f4b
Updated indentation
nbhoski Oct 8, 2024
fc66b88
Added error for empty version
nbhoski Oct 8, 2024
507bbd0
Updated log for exeception
nbhoski Oct 8, 2024
c9fc25b
Added copyright
nbhoski Oct 8, 2024
dcf47b6
Addd batch executable build env for DSL
nbhoski Oct 10, 2024
43cd307
Support to maintain insalled matlab products
nbhoski Oct 10, 2024
028510f
Fixed spotbug
nbhoski Oct 10, 2024
328d9eb
Updated product list logic
nbhoski Oct 10, 2024
0261e99
Updated as per review comments
nbhoski Oct 16, 2024
c29ae44
Updated as per review comments
nbhoski Oct 17, 2024
9c08600
Revoked support for windows and other comments
nbhoski Oct 23, 2024
1a2acbc
Fixed test failures
nbhoski Oct 23, 2024
836dc3e
Removed Windows support
nbhoski Oct 24, 2024
c822a0f
Updated as per review comments
nbhoski Oct 28, 2024
22b2351
Removed product hash
nbhoski Oct 29, 2024
83f4547
Updated as per review comments
nbhoski Oct 30, 2024
25b3608
Fixed path issue on Mac OS
nbhoski Oct 30, 2024
2e6f385
Updated as per Review comments
nbhoski Nov 4, 2024
eb93324
Use ToolInstaller (#366)
davidbuzinski Nov 6, 2024
0b31a13
Merge pull request #364 from mathworks/mpm_tools
nbhoski Nov 6, 2024
1614850
Changed Version to release in setter
nbhoski Nov 7, 2024
94c46cc
Updated Version to Release
nbhoski Nov 7, 2024
ab4d32d
Merge pull request #367 from mathworks/mpm_tools
nbhoski Nov 7, 2024
f8e20d2
Revereted the mpm failure mechanism
nbhoski Nov 7, 2024
0b7681a
Fixed spotbug
nbhoski Nov 7, 2024
61bc2b1
Changed name of release help
nbhoski Nov 7, 2024
e5ab50b
Fixed issue 369
nbhoski Nov 7, 2024
8586774
Fixed issue 370
nbhoski Nov 7, 2024
32432d6
remove unused imports and fix validation bug (#375) (#377)
davidbuzinski Nov 14, 2024
fbb611e
Fixed issue378
nbhoski Nov 22, 2024
5daac9c
Merge branch '2.15.1-SNAPSHOT-Qualification' of https://github.com/ma…
nbhoski Nov 22, 2024
a2ac30e
Fixed 371 379
nbhoski Nov 22, 2024
aa291d8
Fixed 374
nbhoski Nov 22, 2024
058cd76
Fixed 371
nbhoski Nov 22, 2024
a7cb770
Fixed concurrency issue
nbhoski Nov 25, 2024
e2ea2bb
Bump minimum jenkins version and fix failing tests (#381)
davidbuzinski Dec 5, 2024
11259b8
run default java formatter (#382)
davidbuzinski Dec 6, 2024
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 azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ trigger:
- master

steps:
- task: JavaToolInstaller@0
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'

- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
Expand Down
62 changes: 42 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,74 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.57</version>
<version>4.75</version>
<relativePath />
</parent>

<artifactId>matlab</artifactId>
<version>2.15.1-SNAPSHOT</version>
<packaging>hpi</packaging>

<name>MATLAB Plugin</name>
<url>https://github.com/jenkinsci/matlab-plugin</url>
<description>Jenkins plugin for MATLAB</description>

<developers>
<developer>
<id>mathworks_ci_team</id>
<name>MathWorks</name>
<email>nbhoski@mathworks.com</email>
<email>continuous-integration@mathworks.com</email>
</developer>
</developers>
<properties>
<jenkins.version>2.164.3</jenkins.version>
<java.level>8</java.level>
</properties>
<name>MATLAB Plugin</name>
<description>Jenkins plugin for MATLAB</description>
<url>https://github.com/jenkinsci/matlab-plugin</url>

<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>

<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>

<scm>
<connection>scm:git:ssh://github.com/jenkinsci/matlab-plugin.git</connection>
<developerConnection>scm:git:ssh://[email protected]/jenkinsci/matlab-plugin.git</developerConnection>
<url>http://github.com/jenkinsci/matlab-plugin</url>
<url>https://github.com/jenkinsci/matlab-plugin</url>
<tag>HEAD</tag>
</scm>

<properties>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.387</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
<!-- TODO fix violations -->
<spotbugs.threshold>High</spotbugs.threshold>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.164.x</artifactId>
<version>4</version>
<scope>import</scope>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>2543.vfb_1a_5fb_9496d</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- JSON Parser -->
<dependency>
Expand Down Expand Up @@ -100,16 +113,25 @@
<artifactId>workflow-job</artifactId>
<scope>test</scope>
</dependency>
<!-- Mockito -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>11.0.24</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
</plugin>
<!-- Plugin to download the matlab run scripts and keep it under class
resource folder -->
<plugin>
Expand Down
21 changes: 10 additions & 11 deletions src/main/java/com/mathworks/ci/BuildArtifactAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/**
* Copyright 2024 The MathWorks, Inc.
*
*/

import hudson.FilePath;
Expand Down Expand Up @@ -36,16 +35,16 @@ public BuildArtifactAction(Run<?, ?> build, String actionID) {
this.actionID = actionID;

// Setting the counts of task when Action is created.
try{
try {
setCounts();
} catch (ParseException e) {
throw new RuntimeException(e);
} catch (InterruptedException e){
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}

public String getActionID(){
public String getActionID() {
return (this.actionID == null) ? "" : this.actionID;
}

Expand All @@ -64,13 +63,13 @@ public String getDisplayName() {
@CheckForNull
@Override
public String getUrlName() {
return (this.actionID == null) ? "buildresults" : "buildresults" + this.actionID ;
return (this.actionID == null) ? "buildresults" : "buildresults" + this.actionID;
}

public List<BuildArtifactData> getBuildArtifact() throws ParseException, InterruptedException, IOException {
List<BuildArtifactData> artifactData = new ArrayList<BuildArtifactData>();
FilePath fl;
if(this.actionID == null){
if (this.actionID == null) {
fl = new FilePath(new File(build.getRootDir().getAbsolutePath() + "/" +
MatlabBuilderConstants.BUILD_ARTIFACT + ".json"));
} else {
Expand Down Expand Up @@ -147,7 +146,7 @@ public void setOwner(Run owner) {
private void setCounts() throws InterruptedException, ParseException {
List<BuildArtifactData> artifactData = new ArrayList<BuildArtifactData>();
FilePath fl;
if(this.actionID == null){
if (this.actionID == null) {
fl = new FilePath(new File(build.getRootDir().getAbsolutePath() + "/" +
MatlabBuilderConstants.BUILD_ARTIFACT + ".json"));
} else {
Expand Down Expand Up @@ -206,11 +205,11 @@ private void setCounts() throws InterruptedException, ParseException {
private void iterateAllTaskAttributes(Entry pair, BuildArtifactData data) {
// Iterates across all task attributes and updates
String key = pair.getKey().toString();
switch(key){
switch (key) {
case "duration":
data.setTaskDuration(pair.getValue().toString());
break;
case "name" :
case "name":
data.setTaskName(pair.getValue().toString());
break;
case "description":
Expand All @@ -225,7 +224,7 @@ private void iterateAllTaskAttributes(Entry pair, BuildArtifactData data) {
case "skipReason":
String skipReasonKey = pair.getValue().toString();
String skipReason;
switch(skipReasonKey){
switch (skipReasonKey) {
case "UpToDate":
skipReason = "up-to-date";
break;
Expand All @@ -242,7 +241,7 @@ private void iterateAllTaskAttributes(Entry pair, BuildArtifactData data) {
}
data.setSkipReason(skipReason);
break;
default :
default:
break;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/mathworks/ci/BuildArtifactData.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/**
* Copyright 2024 The MathWorks, Inc.
*
*/

public class BuildArtifactData {
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/mathworks/ci/BuildConsoleAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/**
* Copyright 2024 The MathWorks, Inc.
*
*/

import com.google.common.base.Charsets;
Expand Down Expand Up @@ -39,7 +38,7 @@ private static byte[][] createBuildNotes() {
ByteArrayOutputStream targetNote = new ByteArrayOutputStream();
new BuildTargetNote().encodeTo(targetNote);
ByteArrayOutputStream outcomeNote = new ByteArrayOutputStream();
return new byte[][]{targetNote.toByteArray(), outcomeNote.toByteArray()};
return new byte[][] { targetNote.toByteArray(), outcomeNote.toByteArray() };
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down Expand Up @@ -71,7 +70,7 @@ private static class ConsoleLogFilterImpl extends ConsoleLogFilter implements Se
private static final long serialVersionUID = 1;
private byte[][] buildNotes = createBuildNotes();

//Taking care of old MATLAB build actions.
// Taking care of old MATLAB build actions.
private Object readResolve() {
if (buildNotes == null) {
buildNotes = createBuildNotes();
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/com/mathworks/ci/BuildTargetNote.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/**
* Copyright 2024 The MathWorks, Inc.
*
*/

import com.google.common.annotations.VisibleForTesting;
Expand All @@ -14,7 +13,6 @@
import hudson.console.ConsoleNote;
import java.util.regex.Pattern;


public class BuildTargetNote extends ConsoleNote {
@VisibleForTesting
@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Visible for testing")
Expand All @@ -26,10 +24,10 @@ public BuildTargetNote() {
@Override
public ConsoleAnnotator annotate(Object context, MarkupText text, int charPos) {
MarkupText.SubText t = text.findToken(Pattern.compile("MATLAB-Build-"));
String taskName = text.subText(13, text.length()-2).getText();
taskName = taskName.replace("]","").trim();
String taskName = text.subText(13, text.length() - 2).getText();
taskName = taskName.replace("]", "").trim();
if (t != null)
t.addMarkup(0, t.length()-1, "<a id= matlab" + taskName + " name=matlab" + taskName + ">", "</a>");
t.addMarkup(0, t.length() - 1, "<a id= matlab" + taskName + " name=matlab" + taskName + ">", "</a>");
return null;
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/mathworks/ci/FormValidationUtil.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.mathworks.ci;

/**
* Copyright 2019-2020 The MathWorks, Inc.
* Copyright 2019-2024 The MathWorks, Inc.
*
* This is Utility class which provides commonly used methods for form validations across builders
*
*/

import java.util.List;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/mathworks/ci/ListenerLogDecorator.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.mathworks.ci;

/*
* Copyright 2018 The MathWorks, Inc.
*/
/**
* Copyright 2018-2024 The MathWorks, Inc.
*/

import java.io.IOException;
import java.io.OutputStream;
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/mathworks/ci/MatlabBuildWrapperContent.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.mathworks.ci;

/**
* Copyright 2020 The MathWorks, Inc.
* Copyright 2020-2024 The MathWorks, Inc.
*
* Class to parse Stapler request for Use MATLAB Version build wrapper.
*
*/

import org.kohsuke.stapler.DataBoundConstructor;
Expand All @@ -15,7 +14,7 @@ public class MatlabBuildWrapperContent {
private final String matlabRootFolder;

@DataBoundConstructor
public MatlabBuildWrapperContent(String matlabInstallationName, String matlabRootFolder){
public MatlabBuildWrapperContent(String matlabInstallationName, String matlabRootFolder) {
this.matlabInstallationName = matlabInstallationName;
this.matlabRootFolder = matlabRootFolder;
}
Expand Down
37 changes: 19 additions & 18 deletions src/main/java/com/mathworks/ci/MatlabBuilderConstants.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.mathworks.ci;

/*
* Copyright 2019-2020 The MathWorks, Inc.
* Copyright 2019-2024 The MathWorks, Inc.
*/

public class MatlabBuilderConstants {
Expand All @@ -11,43 +11,44 @@ public class MatlabBuilderConstants {
public static final double BASE_MATLAB_VERSION_COBERTURA_SUPPORT = 9.3;
public static final double BASE_MATLAB_VERSION_MODELCOVERAGE_SUPPORT = 9.5;
public static final double BASE_MATLAB_VERSION_EXPORTSTMRESULTS_SUPPORT = 9.6;

public static final String MATLAB_RUNNER_TARGET_FILE = "Builder.matlab.runner.target.file.name";
public static final String MATLAB_TESTS_RUNNER_TARGET_FILE = "runMatlabTests.m";
public static final String MATLAB_RUNNER_RESOURCE = "com/mathworks/ci/MatlabBuilder/runMatlabTests.m";
public static final String AUTOMATIC_OPTION = "RunTestsAutomaticallyOption";

// Input parameter names (Passed to runMatlabTests.m as name-value pair arguments)

// Input parameter names (Passed to runMatlabTests.m as name-value pair
// arguments)
public static final String PDF_REPORT = "'PDFReport'";
public static final String TAP_RESULTS = "'TAPResults'";
public static final String JUNIT_RESULTS = "'JUnitResults'";
public static final String STM_RESULTS = "'SimulinkTestResults'";
public static final String COBERTURA_CODE_COVERAGE = "'CoberturaCodeCoverage'";
public static final String COBERTURA_MODEL_COVERAGE = "'CoberturaModelCoverage'";
//Matlab Script generator package

// Matlab Script generator package
public static final String MATLAB_SCRIPT_GENERATOR = "matlab-script-generator.zip";
//Test runner file prefix

// Test runner file prefix
public static final String MATLAB_TEST_RUNNER_FILE_PREFIX = "runner_";
//Temporary MATLAB folder name in workspace

// Temporary MATLAB folder name in workspace
public static final String TEMP_MATLAB_FOLDER_NAME = ".matlab";

// MATLAB default function/plugin paths
public static final String DEFAULT_PLUGIN = "+ciplugins/+jenkins/getDefaultPlugins.m";
public static final String BUILD_REPORT_PLUGIN = "+ciplugins/+jenkins/BuildReportPlugin.m";
public static final String TASK_RUN_PROGRESS_PLUGIN = "+ciplugins/+jenkins/TaskRunProgressPlugin.m";
public static final String BUILD_ARTIFACT = "buildArtifact";

public static final String NEW_LINE = System.getProperty("line.separator");

//MATLAB Runner Script
// MATLAB Runner Script
public static final String TEST_RUNNER_SCRIPT = String.join(NEW_LINE,
"addpath('${TEMP_FOLDER}');",
"testScript = genscript(${PARAMS});",
"disp('Running MATLAB script with content:');",
"disp(testScript.Contents);",
"fprintf('___________________________________\\n\\n');",
"run(testScript);");
"addpath('${TEMP_FOLDER}');",
"testScript = genscript(${PARAMS});",
"disp('Running MATLAB script with content:');",
"disp(testScript.Contents);",
"fprintf('___________________________________\\n\\n');",
"run(testScript);");
}
Loading