Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Installation Stage to Run 'zwe init mvs' #83

Merged
merged 10 commits into from
Nov 28, 2023

Conversation

timgerstel
Copy link
Contributor

Proposed changes

This PR addresses Issue: [Link to Github issue within https://github.com/zowe/zen/issues if any]

This PR depends upon the following PRs:

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Change in a documentation
  • Refactor the code
  • Chore, repository cleanup, updates the dependencies.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

PR Checklist

Please delete options that are not relevant.

  • If the changes in this PR are meant for the next release / mainline, this PR targets a "staging" branch.
  • My code follows the style guidelines of this project (see: Contributing guideline)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes
  • video or image is included if visual changes are made
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works, or describe a test method below

Testing

Further comments

…type. Added method to run zwe init mvs

Signed-off-by: Timothy Gerstel <tim.gerstel@gmail.com>
Signed-off-by: Timothy Gerstel <tim.gerstel@gmail.com>
}

console.log("running zwe init mvs...");
const initMvs = await this.initMVS(connectionArgs, installationArgs.installationDir);
Copy link
Member

Choose a reason for hiding this comment

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

it looks to me like init mvs is run regardless of the status of install.

i think this file needs to be reorged a little bit to have a step only continue if the previous step succeeded.

because if you didnt upload, you cant unpax. if you didnt unpax, you cant install. if you didnt install, you cant init.

Signed-off-by: Timothy Gerstel <tim.gerstel@gmail.com>
initMvs = await this.initMVS(connectionArgs, installationArgs.installationDir);
ProgressStore.set('installation.initMVS', initMvs.status);
} else {
initMvs = {status: true}
Copy link
Member

Choose a reason for hiding this comment

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

if installMvs = false, initMvs = true?
unconditionally?
i can't think of why this wouldnt be false.

Signed-off-by: Timothy Gerstel <tim.gerstel@gmail.com>
…nitMvs

Signed-off-by: Timothy Gerstel <tim.gerstel@gmail.com>

return {status: download.status && uploadYaml.status && upload.status && unpax.status && install.status, details: ''};
return {status: download.status && uploadYaml.status && upload.status && unpax.status && installation.status && initMvs.status, details: ''};
} catch (error) {
return {status: false, details: error.message};
Copy link
Member

Choose a reason for hiding this comment

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

This code does not properly present errors to users.

We have a try { } catch { } here, but not all failures go to the catch { } block.

If init mvs fails, there is no exception but the return would say {status: false, details: ''}.
There would be no way to differentiate that from a zwe install or extract step failure.

You should set details to what actually failed.
In fact, initMVS() is returning a details, so it could be formatted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This return statement existed prior to this PR, I'd be happy to fix it but I think it should be a separate ticket to enhance the error detailing of this stage @1000TurquoisePogs

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@1000TurquoisePogs 1000TurquoisePogs left a comment

Choose a reason for hiding this comment

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

It is an improvement so I will merge it but there still are situations that need to be caught:

image

If you run it twice, because "--allow-overwrite" is not used, technically init does nothing the second time.
It prints out warnings and then says success.
Those warnings should be propagated to the UI, which can be done in a follow-up PR.

@1000TurquoisePogs 1000TurquoisePogs merged commit 2b0e6d8 into v2.x/staging Nov 28, 2023
5 checks passed
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.

None yet

3 participants