Skip to content

Fix two issues around uninstalling IPM - #1235

Open
isc-dchui wants to merge 1 commit into
mainfrom
fix-uninstall-bugs
Open

Fix two issues around uninstalling IPM#1235
isc-dchui wants to merge 1 commit into
mainfrom
fix-uninstall-bugs

Conversation

@isc-dchui

Copy link
Copy Markdown
Collaborator

Description

Testing

Manually tested by trying to uninstall IPM without another module installed and the prompt to delete metadata appeared. Reinstalling IPM in the same process also allowed me to use it without being kicked out of the shell after every command

Checklist

  • This branch has the latest changes from the main branch rebased or merged.
  • Changelog entry added.
  • Unit (zpm test -only) and integration tests (zpm verify -only) pass.
  • Style matches the style guide in the contributing guide.
  • Documentation has been/will be updated
    • Source controlled docs, e.g. README.md, should be included in this PR and Wiki changes should be made after this PR is merged (add an extra issue for this if needed)
  • Pull request correctly renders in the "Preview" tab.

@isc-kiyer isc-kiyer left a comment

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.

@isc-dchui few small notes

Comment thread src/cls/IPM/Main.cls
// Check if other modules are installed
set hasModules = 0
// List the other modules that a full cleanup would remove
set rs = ##class(%SQL.Statement).%ExecDirect(,

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.

Should have $$$ThrowSQLIfError(rs.%SQLCODE,rs.%Message)

Comment thread src/cls/IPM/Main.cls
write !,"This is required for downgrading IPM. [y/N]: "
read fullCleanupResponse
set tParams("Clean","FullCleanup") = $case($zconvert(fullCleanupResponse,"L"),"y":1,"yes":1,:0)
set hasModules = 0

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.

You can check this by checking %SQLCODE. if its 100, then there were no records returned

Comment thread src/cls/IPM/Main.cls
read fullCleanupResponse
set tParams("Clean","FullCleanup") = $case($zconvert(fullCleanupResponse,"L"),"y":1,"yes":1,:0)
set hasModules = 0
while rs.%Next() {

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.

Should check status here and $$$ThrowOnError(sc) outside the loop

Comment thread src/cls/IPM/Main.cls
if 'tForce {
// Dialog: Ask about full cleanup (downgrade scenario)
write !,"Do you want to fully remove all modules and IPM metadata (except history log)?"
write !,"This is required for downgrading IPM. [y/N]: "

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.

Use %Library.Prompt here so default answer can be provided (default should be no?)

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

Labels

None yet

Projects

None yet

2 participants