Skip to content

feat: simplify init command to better manage target MES version#736

Open
manel27 wants to merge 1 commit intodevelopment-6xfrom
development-simplify-init
Open

feat: simplify init command to better manage target MES version#736
manel27 wants to merge 1 commit intodevelopment-6xfrom
development-simplify-init

Conversation

@manel27
Copy link
Copy Markdown

@manel27 manel27 commented May 5, 2026

What was done

In init command nugetVersion, testScenariosNuget and ngxSchematicsVersion are not required at launch.
They all use the version from MESVersion flag except the last one that also checks the config file if not mentioned in the command line.

Validation checklist

Please ensure the following conditions are met in order for this PR to be merged:

  • Code validation (careful with side-effects)
  • Integration test run provided
  • Main WorkItem is linked
  • Target branch version is correct

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

.NET Test Results

View full test report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Code Coverage

Package Line Rate Branch Rate Health
cmf 42% 42%
core 68% 50%
Summary 52% (5038 / 9703) 46% (2570 / 5562)

args.AddRange(new [] {"--testScenariosNugetVersion", x.testScenariosNugetVersion});
var configTxt = this.fileSystem.File.ReadAllText(x.config.FullName);
dynamic configJson = JsonConvert.DeserializeObject(configTxt);
x.ngxSchematicsVersion = configJson?["ngxSchematicsVersion"]?.Value;
Copy link
Copy Markdown
Contributor

@Rockdell Rockdell May 5, 2026

Choose a reason for hiding this comment

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

This config file is the parameters file from our CustomerPortal, it does not have any mention of ngxSchematicsVersion.
I believe the goal was to determine the ngxSchematics version through its npm tag which is the MES version, like a ngxSchematics version with the tag release-1126 is the version that should be used for MES 11.2.6.
https://www.npmjs.com/package/@criticalmanufacturing/ngx-schematics?activeTab=versions

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

correct, ngxSchematics is supposed to be optional and, if omitted, assumed using the dist-tag of the version. I think the dist-tag was not directly supported in the option (it was a SemanticVersion object and a dist-tag will not conform to that) but not sure if this was fixed meanwhile.

Copy link
Copy Markdown
Contributor

@Rockdell Rockdell May 5, 2026

Choose a reason for hiding this comment

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

Checking the code, when running ngx-schematics commands it seems that this is trying to be done (for example here) but before this line there is a check that throws an exception if the ngxSchematicsVersion is null, so basically it does nothing 😅 .
I think this logic should be directly in the init command and these fallbacks that seemingly do nothing should be cleaned up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't forget to validate that the tests are passing, specially the New class tests.

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.

3 participants