Skip to content

Conversation

@mw-kapilg
Copy link
Contributor

@mw-kapilg mw-kapilg commented Oct 29, 2025

This PR includes changes required with matlab-actions/common-utils#1 to begin using the new common utility.

NOTE: Before merging, the version for common-utils dependency in package.json, package-lock.json will be updated after its release (couldn't add a comment since it's a JSON file). At the moment, the dependency refers to my working branch

@mw-kapilg mw-kapilg marked this pull request as ready for review November 5, 2025 23:09
Copy link
Contributor

@sameagen-MW sameagen-MW left a comment

Choose a reason for hiding this comment

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

LGTM!

There's a couple of comments / questions on my end, but it looks good overall. Thanks for working on this!

@@ -0,0 +1,16 @@
classdef GitHubLogPlugin < matlab.unittest.plugins.TestRunnerPlugin
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add Test into the name of the file somewhere so that it's more clear that this is a test runner plugin rather than a build runner plugin?

import * as exec from "@actions/exec";
import { matlab } from "run-matlab-command-action";
import * as scriptgen from "./scriptgen";
// TODO: update common-utils version when new version is released
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this TODO still left to do later?

@@ -0,0 +1,9 @@
classdef GitHubLogPluginService < matlab.buildtool.internal.services.ciplugins.CITestRunnerPluginService
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to ship and set up this plugin in the common component? That way tests always run with groupings on the output?

# Download and extract in a temporary directory
WORKINGDIR=$(mktemp -d -t rmc_build.XXXXXX)
cd $WORKINGDIR
source ./node_modules/common-utils/scripts/setupdeps.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, this makes me a little bit nervous. I might almost rather have the same contents in both scripts rather than calling an upstream script. It feels like it makes it much more fragile, and I'm slightly worried about security concerns if that script happens to be hijacked.

That's just my preference though. I'll let others weigh in but I think I like it that the entire set up script is captured within the action itself.

Comment on lines +36 to +37
const pluginsPath = path.join(__dirname, "plugins").replaceAll("'","''");
const command = "addpath('"+ pluginsPath +"'); " + scriptgen.generateCommand(options);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we extract this logic to somewhere else? It seems like it will likely have to be run by all of the actions to make sure the plugins get added correctly.


await core.group("Run command", async () => {
await matlab.runCommand(helperScript, platform, architecture, exec.exec, startupOptions);
await matlab.runCommand(helperScript, platform, architecture, exec.exec, startupOptions).finally(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be setting the exec options (specifically MW_BATCH_LICENSING_ONLINE) here like we do in run-command?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants