Skip to content

Commit

Permalink
Merge pull request #317 from mathworks/2.13.1-patch-fix
Browse files Browse the repository at this point in the history
Patch fix for file error issue
  • Loading branch information
nbhoski authored Apr 19, 2024
2 parents a5418f1 + fbd69c0 commit 1805f06
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
30 changes: 17 additions & 13 deletions src/main/resources/+ciplugins/+jenkins/BuildReportPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@

function runTaskGraph(plugin, pluginData)
[email protected](plugin, pluginData);
fID = fopen(fullfile(getenv("WORKSPACE"),'.matlab/buildArtifact.json'), 'w');
taskDetails = struct();
for idx = 1:numel(pluginData.TaskResults)
taskDetails(idx).name = pluginData.TaskResults(idx).Name;
taskDetails(idx).description = pluginData.TaskGraph.Tasks(idx).Description;
taskDetails(idx).failed = pluginData.TaskResults(idx).Failed;
taskDetails(idx).skipped = pluginData.TaskResults(idx).Skipped;
taskDetails(idx).duration = string(pluginData.TaskResults(idx).Duration);
[fID, msg] = fopen(fullfile(getenv("WORKSPACE"),".matlab/buildArtifact.json"), "w");

if fID == -1
warning("ciplugins:jenkins:BuildReportPlugin:UnableToOpenFile","Could not open a file for Jenkins build result table due to: %s", msg);
else
closeFile = onCleanup(@()fclose(fID));
taskDetails = struct();
for idx = 1:numel(pluginData.TaskResults)
taskDetails(idx).name = pluginData.TaskResults(idx).Name;
taskDetails(idx).description = pluginData.TaskGraph.Tasks(idx).Description;
taskDetails(idx).failed = pluginData.TaskResults(idx).Failed;
taskDetails(idx).skipped = pluginData.TaskResults(idx).Skipped;
taskDetails(idx).duration = string(pluginData.TaskResults(idx).Duration);
end
a = struct("taskDetails",taskDetails);
s = jsonencode(a,PrettyPrint=true);
fprintf(fID, "%s",s);
end
a = struct("taskDetails",taskDetails);
s = jsonencode(a,"PrettyPrint",true);
fprintf(fID, '%s',s);
fclose(fID);
end

end
end
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<p><a href="buildresults">MATLAB Build Results</a></p>
<span class="${pst.cssClass}">
<j:if test="${it.totalCount == 0}">
<font color="#EF2929"><h5>Unable to run a MATLAB build. </h5></font>
<font color="#EF2929"><h5>Unable to generate a build artifact. </h5></font>
</j:if>
</span>
<p><b>Tasks run: <font color="Blue">${it.totalCount}</font></b></p>
Expand Down

0 comments on commit 1805f06

Please sign in to comment.