Skip to content

Update should check version requirements using post-update values instead of what's currently installed#1120

Merged
isc-jlechtne merged 5 commits intomainfrom
fix-1119
Apr 21, 2026
Merged

Update should check version requirements using post-update values instead of what's currently installed#1120
isc-jlechtne merged 5 commits intomainfrom
fix-1119

Conversation

@isc-jlechtne
Copy link
Copy Markdown
Collaborator

Description

Addresses issue #1119

Source of the fix is centered around the %IPM.Utils.Module::GetRequiredVersionExpression() method. It uses a SQL call to determine what versions are installed and what relies on them for checking version requirements. It also accepts a list of modules to exclude from this check. This fix adds a dependency graph to that list. When given a dependency graph, the method will now add the modules from the exclusion list to add them manually after the SQL call. This addresses the update case since the dependency graph will have the required version expressions associated with what update will install as opposed to what's currently installed.

Testing

PR includes a new integration test to the update suite to check for this case.

Copy link
Copy Markdown
Collaborator

@isc-dchui isc-dchui left a comment

Choose a reason for hiding this comment

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

First round of feedback!

Comment thread src/cls/IPM/Utils/Module.cls
Comment thread src/cls/IPM/Utils/Module.cls
Comment thread src/cls/IPM/Utils/Module.cls Outdated
Comment thread src/cls/IPM/Utils/Module.cls Outdated
@isc-jlechtne isc-jlechtne requested a review from isc-dchui April 15, 2026 14:18
Copy link
Copy Markdown
Collaborator

@isc-jili isc-jili left a comment

Choose a reason for hiding this comment

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

Left a couple comments but looks good @isc-jlechtne !

Comment thread tests/integration_tests/Test/PM/Integration/Update.cls Outdated
// Iterate over sourceList; if the required version expression is equivalent to this one, add this module name to that version
set newVersion = 1
for i=1:1:$listlength(sourceList) {
if $find($listget(sourceList, i), version) {
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.

Is is possible that $find is too loose of a search? ie. would there be a case where the version incorrectly matches only a substring?

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.

The syntax of one element in sourceList looks like "module-a, module-b: ^1.0.0" for a case where both module-a and module-b require version ^1.0.0 of whatever module is being evaluated (the case here being adding some module-x to this string if it also requires ^1.0.0) so there won't be a case of this incorrectly passing since that would require a module name to have the identical version string in it.

Could alternatively do $piece($listget(sourceList, i), " ", *) = version as a way to completely isolate the version expression but splitting up the string on the delimiter should be unnecessary for this case.

Comment thread src/cls/IPM/Utils/Module.cls Outdated
Comment thread CHANGELOG.md Outdated
@isc-jili
Copy link
Copy Markdown
Collaborator

I am realizing actually that even though we framed this issue as "update command" related, GetRequiredVersionExpression() is called by many more functionalities than just update. So I have 2 questions:

  1. With regards to wording, I am not sure if we should tweak places that this change explicitly refer to the update command to be more general?
  2. Should we add a test case for another situation that this would also fix (theoretically) like ModuleDependencies and Version #430 to kill 2 birds with one stone?

@isc-dchui
Copy link
Copy Markdown
Collaborator

I am realizing actually that even though we framed this issue as "update command" related, GetRequiredVersionExpression() is called by many more functionalities than just update. So I have 2 questions:

  1. With regards to wording, I am not sure if we should tweak places that this change explicitly refer to the update command to be more general?
  2. Should we add a test case for another situation that this would also fix (theoretically) like ModuleDependencies and Version #430 to kill 2 birds with one stone?

For 2, there's a sample module in PR #1050 you can copy over.

@isc-jlechtne isc-jlechtne requested a review from isc-jili April 17, 2026 18:04
Copy link
Copy Markdown
Collaborator

@isc-cborbonm isc-cborbonm left a comment

Choose a reason for hiding this comment

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

looks good to me!

@isc-jlechtne isc-jlechtne merged commit 01161f9 into main Apr 21, 2026
16 checks passed
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.

4 participants