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

Support enabling IPM instance-wide #485

Draft
wants to merge 1 commit into
base: v1
Choose a base branch
from
Draft

Conversation

isc-tleavitt
Copy link
Contributor

@isc-tleavitt isc-tleavitt commented May 22, 2024

This is done via new options in the existing zpm "enable" command that add package mappings.

We looked into using %ALL but ultimately that doesn't work, because namespace-specific mappings aren't allowed to override %ALL mappings (!?).

Fixes #470

Even %SYS, but not using the %ALL namespace because that ends up overriding namespace-specific mappings (gah).
@isc-tleavitt isc-tleavitt changed the base branch from master to v1 May 22, 2024 20:09
Copy link
Collaborator

@isc-kiyer isc-kiyer left a comment

Choose a reason for hiding this comment

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

@isc-tleavitt a few comments but looks good!

}
Set pointer = 0
While $ListNext(namespaces,pointer,namespace) {
Set $Namespace = namespace
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Defensive coding to string leading/trailing white space and control characters from namespace name before trying to switch to it

Set key = ""
For {
Set key = $Order(list(key))
Quit:key=""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Avoid using post conditionals

If globally {
Set namespaces = ""
Do ..GetListNamespace(.list)
Kill list("%ALL")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Add a comment as to why removing %ALL so we don't forget the context.

Set pointer = 0
While $ListNext(namespaces,pointer,namespace) {
Set $Namespace = namespace
If $$$comClassDefined("%IPM.Storage.Module") && ##class(%IPM.Storage.Module).NameExists($$$IPMModuleName) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move existence check for IPM in a specific namespace to a utility helper method so we can keep the checks consistent (will also be helpful for some HS utilities to call probably)

src/cls/IPM/Main.cls Show resolved Hide resolved
@@ -1150,6 +1156,38 @@ ClassMethod Version(ByRef pCommandInfo) [ Internal ]
Quit $$$OK
}

ClassMethod AddIPMMappedNamespaces(ByRef list) [ Private ]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Document expected format of list

Set namespace = ""
For {
Set namespace = $Order(allNS(namespace))
Quit:namespace=""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: use if instead

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

2 participants