Skip to content
20 changes: 15 additions & 5 deletions plugins/+buildframework/ParallelizableBuildSummaryPlugin.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
classdef ParallelizableBuildSummaryPlugin < matlab.buildtool.plugins.BuildRunnerPlugin

% Copyright 2025 The MathWorks, Inc.
% Copyright 2025-2026 The MathWorks, Inc.

properties
TempFolder
Expand Down Expand Up @@ -44,18 +44,28 @@ function runBuild(plugin, pluginData)
function runTask(plugin, pluginData)
runTask@matlab.buildtool.plugins.BuildRunnerPlugin(plugin, pluginData);

name = fullfile(plugin.TempFolder, pluginData.Name + ".mat");
name = fullfile(plugin.TempFolder, matlab.lang.internal.uuid() + ".mat");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should try to avoid using internal packages, especially in code outside of the base product like this. What about using matlab.lang.makeValidName to turn the task name into a valid identifier, which should also be a valid filename?

taskDetail = getCommonTaskDetail(pluginData);
save(name, "taskDetail");

try
save(name, "taskDetail");
catch e
warning("buildframework:BuildSummaryPlugin:UnableToSaveTrace", "Unable to save an artifact required to create the MATLAB build summary table");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to this review but these error/warning ids and package names are not currently consistent with our guidelines. The first component should relate to the product containing the code (I believe we use "ciplugins" on Jenkins). I opened an issue to track this: #4

end
end

function skipTask(plugin, pluginData)
skipTask@matlab.buildtool.plugins.BuildRunnerPlugin(plugin, pluginData);

name = fullfile(plugin.TempFolder, pluginData.Name + ".mat");
name = fullfile(plugin.TempFolder, matlab.lang.internal.uuid() + ".mat");
taskDetail = getCommonTaskDetail(pluginData);
taskDetail.skipReason = pluginData.SkipReason;
save(name, "taskDetail");

try
save(name, "taskDetail");
catch e
warning("buildframework:BuildSummaryPlugin:UnableToSaveTrace", "Unable to save an artifact required to create the MATLAB build summary table");
end
end
end
end
Expand Down