Skip to content

Add support for user-configurable ModuleRoot#1149

Open
isc-dchui wants to merge 15 commits into
mainfrom
feat/configurable-module-rrot
Open

Add support for user-configurable ModuleRoot#1149
isc-dchui wants to merge 15 commits into
mainfrom
feat/configurable-module-rrot

Conversation

@isc-dchui
Copy link
Copy Markdown
Collaborator

Description

Testing

Added both unit and integration tests

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.

AshokThangavel and others added 7 commits May 12, 2026 13:10
- Implemented ModuleRoot setting in %IPM.Repo.UniversalSettings
- Added rwx permission validation for custom directory paths
- Updated module installation logic to prioritize configured ModuleRoot
- Included unit tests to verify path redirection and permission checks
isc-tleavitt
isc-tleavitt previously approved these changes May 12, 2026
Copy link
Copy Markdown
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-dchui few small notes

ClassMethod CheckDirPermission(directory As %String)
{
if '##class(%File).DirectoryExists(directory) {
$$$ThrowOnError(##class(%IPM.Utils.File).CreateDirectoryChain(directory))
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.

This is a side effect and should be documented and conveyed in the method name. The name sounds like its just checking. Not creating

Comment thread src/cls/IPM/Repo/UniversalSettings.cls Outdated
set sc = ..SetTestReportFormat(value)
} else {
set sc = ..SetValue($parameter(..%ClassName(1),key), value)
} elseif key = "ModuleRoot" {
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.

Nit: use parameter since it exists

Comment thread preload/cls/IPM/Installer.cls Outdated
$$$QuitOnError(##class(%IPM.Repo.UniversalSettings).SetValue("UseStandalonePip", "", 0))
$$$QuitOnError(##class(%IPM.Repo.UniversalSettings).SetValue("SemVerPostRelease", 0, 0))
$$$QuitOnError(##class(%IPM.Repo.UniversalSettings).SetValue("DefaultLogEntryLimit",20, 0))
$$$QuitOnError(##class(%IPM.Repo.UniversalSettings).SetValue("ModuleRoot",##class(%SYSTEM.Util).DataDirectory() _ "ipm/", 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.

Nit: can use parameter since it exists from UniversalSettings

set customPath = ##class(%File).NormalizeDirectory("/tmp/ipm-test-root/")

// Ensure custom path exists and is writable before configuring it
do $$$AssertTrue(##class(%File).CreateDirectoryChain(customPath), "Created custom ModuleRoot directory.")
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 this be done in the test or do you want to test this dir gets created by IPM? Perhaps testing both cases where the dir already exists vs doesn't exist would be nice. Also I'm not sure how you would test this but it would be interesting to test a case where the instance doesn't have permission to the directory

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Split the test into the two cases.

For the permissions testing, I did some manual testing where I did chmod 555 /usr/irissys/ and then tried to set the module root to a non-existent directory:

zpm:USER>config set ModuleRoot /usr/irissys/ipm_temp

ERROR! Error creating directory chain /usr/irissys/ipm_temp/: <13> Permission denied

If ipm_temp already exists, then this error results:

zpm:USER>config set ModuleRoot /usr/irissys/ipm_temp

ERROR! No write permission on directory /usr/irissys/ipm_temp/

@isc-dchui isc-dchui force-pushed the feat/configurable-module-rrot branch from e1d0370 to ed91363 Compare May 13, 2026 19:48
@isc-dchui isc-dchui requested a review from isc-kiyer May 14, 2026 13:43
@isc-dchui isc-dchui requested a review from isc-tleavitt May 14, 2026 13:48
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.

Support for User-Configurable Module Installation Root

4 participants