Skip to content

Adding zpm "ci" command to install from a lock file - #1080

Open
isc-jlechtne wants to merge 16 commits into
mainfrom
ipm-ci
Open

Adding zpm "ci" command to install from a lock file#1080
isc-jlechtne wants to merge 16 commits into
mainfrom
ipm-ci

Conversation

@isc-jlechtne

Copy link
Copy Markdown
Collaborator

No description provided.

@isc-dchui isc-dchui 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.

Good overall! Just a few small things. Also you'll want to add a description.

Comment thread src/cls/IPM/General/LockFile.cls Outdated
Comment thread src/cls/IPM/Main.cls Outdated
Comment thread CHANGELOG.md Outdated
Comment thread src/cls/IPM/Main.cls Outdated
Comment thread src/cls/IPM/Main.cls Outdated
do ##class(%IPM.Main).Shell("repo -delete -name "_orasRepo)

// Install from Module G's lock file
do ..AssertInstallFromLockFileAsExpected(..#ModuleG)

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.

One thing I noticed here is that the creation of the remote and oras repositories do not include username/password values as environment variables are not set. The repositories and test do still seem to pass but does anyone know if there's a way to set them in this test or should we add them as variables to the docker-compose.yml file?

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.

I believe the ORAS repo doesn't require username/password and the remote one is being configured with it (see line 142)

@isc-dchui isc-dchui 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.

A few things! Also still needs a description

Comment thread src/cls/IPM/General/LockFile.cls Outdated
{
<Mapping xmlns="http://www.intersystems.com/jsonmapping">
<Property Name="LockFileType" FieldName="type" />
<Property Name="OverriddenSortOrder" FieldName="overriddenSortOrder" />

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.

Out of curiosity, what's the reason we're removing this?

set modifiers("url") = lockFileValues.%Get("url")
set modifiers("namespace") = lockFileValues.%Get("orasNamespace")

// The following variables are set as system level variables for us to get

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 should end up being documented somewhere else too. Definitely in the wiki and maybe even in the help text from zpm "help"

do ##class(%IPM.Main).Shell("repo -delete -name "_orasRepo)

// Install from Module G's lock file
do ..AssertInstallFromLockFileAsExpected(..#ModuleG)

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.

I believe the ORAS repo doesn't require username/password and the remote one is being configured with it (see line 142)

@@ -310,13 +414,35 @@ ClassMethod AreLockFilesEqual(
expectedLockFilePath As %String) As %Boolean

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 be As %Status

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.

Still should be %Boolean, but will update the catch block to $$$ThrowOnError instead of returning a status

set sc = ##class(%IPM.Main).Shell("install " _ moduleName)
do $$$AssertStatusOK(sc, "Successfully installed " _ moduleName)

set packagePath = "/home/irisowner/zpm/tests/integration_tests/Test/PM/Integration/_data/lock-test/package/pack"

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.

A bit brittle: this will break if running outside of containers

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.

It will, but our tests have a number of places where /home/irisowner/zpm/tests/integration_tests/Test/PM/Integration/_data/... is hard coded in which this is consistent with. And the tests for now are always run in the container.

I think this should be kept as is for this issue and if we want to refactor, refactor all those references together in their own issue.

Comment thread tests/integration_tests/Test/PM/Integration/LockFile.cls Outdated
Comment thread tests/integration_tests/Test/PM/Integration/LockFile.cls Outdated
Comment thread src/cls/IPM/Main.cls Outdated
Comment thread tests/integration_tests/Test/PM/Integration/LockFile.cls

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.

Out of curiosity, why not move this file into the .../IPM/General/LockFile 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.

This was to be consistent with other directory paths under .../IPM/General/. LogManager, SemanticVersion, and SemanticVersionExpression all have class files directly under General/ with directories to hold other classes that are related

@isc-jlechtne
isc-jlechtne requested a review from isc-dchui August 27, 2026 17:05
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.

2 participants