feat: Add config-manager push restart command#97
Conversation
5c40799 to
092fe7a
Compare
4af46ce to
b2cca19
Compare
phalestrivir
left a comment
There was a problem hiding this comment.
Make sure to run npm run lint:fix when you are finished with these last changes, I noticed a few formatting issues that would've been fixed with it.
| if (await getTokens(false, true, deploymentTypes)) { | ||
| verboseMessage('Restarting Tenant'); | ||
| const outcome = await configManagerRestart( | ||
|
|
||
| options.status, | ||
| options.check, | ||
| options.wait | ||
| ); | ||
| if (!outcome) process.exitCode = 1; | ||
| }}); |
There was a problem hiding this comment.
Change this code to look something like this:
What you have is almost correct, but I noticed you removed the process.exitCode=1 in the event that getTokens fails. If getTokens fails, we need to exit with code 1, which this example shows
| printMessage(await readStatus()); | ||
| return true; | ||
| } | ||
| if (check) { |
There was a problem hiding this comment.
Right before this if statement, we should check if the status is "restarting" since fr config manager does this:
if (restartStatus === "restarting") {
printMessage("Environment already restarting.", "error");
return false;
}Before the if statement for status, I would do
const restartStatus = await readStatus();And use that result in the if statement for status. That way we can reuse the status for this new if statement.
| const outcome = await applyUpdates(!!wait); | ||
| return outcome; |
There was a problem hiding this comment.
Simplify this to
return await applyUpdates(!!wait);| const { stdout } = await exec(CMD, cloudEnv); | ||
| expect(removeAnsiEscapeCodes(stdout)).toMatchSnapshot(); |
There was a problem hiding this comment.
This is more of a suggestion, but since you need to make other changes I thought I'd mention it.
I created a helper that simplifies this to:
await testSuccess(CMD, cloudEnv);I would update your tests to use it just to help simplify the testing code a bit.
No description provided.