Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Conversation

nbhoski
Copy link
Member

@nbhoski nbhoski commented Jul 19, 2019

Added Jenkins Environment variable support for both MATLAB root field and Custom command field.
Added unit tests for the same.


matlabDefaultArgs =
Arrays.asList(this.localMatlab + File.separator + "bin" + File.separator + "matlab",
Arrays.asList(env.expand(this.localMatlab) + File.separator + "bin" + File.separator + "matlab",

Choose a reason for hiding this comment

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

Would it be possible to use Java's Path object here to build up this value? String concatenation can sometimes be a code smell that perhaps could be handled another way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we will have to use FilePath from hudson. this requires the overall changes across code which uses this string . I am planning to do that during remote execution support.

Copy link
Member

@mw-akumar mw-akumar left a comment

Choose a reason for hiding this comment

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

I have 2 basic concerns with this change

  1. We are passing env in too many places, and there doesn't seem to be pattern. It is basically on an as-needed basis

  2. The calls to env.expand is sprinkled all through the code. This makes things challenging from a maintenance perspective. As every new line of code is added, you will have to think about whether env.expand needs to be called on it, or not. I think this needs to be encapsulated better.

@nbhoski nbhoski requested a review from mw-akumar August 1, 2019 10:16

Function<String, FormValidation> chkCoberturaSupport = (String matlabRoot) -> {
rel = new MatlabReleaseInfo(matlabRoot);
final MatrixPatternResolver resolver = new MatrixPatternResolver(matlabRoot);
Copy link
Member

Choose a reason for hiding this comment

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

Add a comment explaining this logic.

@nbhoski nbhoski merged commit 84aee1d into master Aug 5, 2019
@SangaviJayagopi
Copy link
Member

SangaviJayagopi commented Aug 5, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants