Skip to content

feat(cli): add -outdated modifier in list command#1095

Open
AshokThangavel wants to merge 4 commits intointersystems:mainfrom
AshokThangavel:feat/list-outdated-flag
Open

feat(cli): add -outdated modifier in list command#1095
AshokThangavel wants to merge 4 commits intointersystems:mainfrom
AshokThangavel:feat/list-outdated-flag

Conversation

@AshokThangavel
Copy link
Contributor

@AshokThangavel AshokThangavel commented Mar 10, 2026

Description:

Introduced the -outdated modifier (alias -o) to the list command to allow users to quickly identify installed modules with newer versions available in the registry.

#586

Key Changes:

  • New Modifier: Added -outdated and the short-form alias -o to the list-installed command logic.
zpm:USER>list -o
irisjwt 1.0.0  1.0.1

CLI Documentation Update:

Component Text
Modifier -outdated, -o
Description Lists installed modules that have available updates in the registry.
Example list -outdated

Testing Performed:

  1. Executed list -o and verified that only modules with pending updates are displayed.
  2. Confirmed that the output adheres to the existing project format (Module : OldVersion NewVersion).

- Implement '-outdated' (alias '-o') to filter for modules with updates.
- Update CLI help text with descriptions and usage examples.
}
}

ClassMethod GetOutdatedModulesList(Output List)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this also check if the new versions satisfy the existing version constraints? If not, it should.

For example, if we have module-a that depends on module-b ^1.3.0, and the available versions of module-b are 1.3.0 and 2.0.0, then list -outdated should not include module-b since 2.0.0 cannot be installed anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @isc-dchui
Thank you for pointing out this excellent case. Currently, the check only determines whether a newer version exists and does not verify whether that version satisfies the existing version constraints.

So, in this scenario, module-b is not a directly installed module; it is installed as a dependency of module-a. Because of that, it likely should not appear in the list -outdated output.
Thank you!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok! Let's add a test to make sure this works! (Also you have some failing tests)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @isc-dchui Thanks for pointing that out. Since the irisjwt module cannot be resolved from the external registry in CI, Could you suggest the best way to utilize local custom modules as test assets to bypass the registry requirement?
Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @isc-dchui
I’ve implemented the -outdated flag to skip modules installed only as dependencies. Thank you!

Copy link
Collaborator

Choose a reason for hiding this comment

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

The simplest would probably be adding the test modules to the Integration/_data directory and setting up a filesystem repo to point to it like so:

repo -fs -name local -path /home/irisowner/zpm/tests/integration_tests/Test/PM/Integration/_data/<dtest_directory>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the suggestion. Setting up a filesystem repository is a new configuration for me. Could you please point me toward the official documentation or a guide for this? That would be very helpful for my setup.

Copy link
Collaborator

Choose a reason for hiding this comment

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

There isn't much, but here's an example in the wiki:
https://github.com/intersystems/ipm/wiki/02.-CLI-commands#repo

Copy link
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.

Two little nits and a suggestion for the testing

{
do ..GetListModules($namespace,,.installedModules)
// Get the dependencies list to prevent displaying an outdated list
set List=""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: make "List" lowercase

<modifier name="repository" aliases="repo" value="true" description="If specified, only show modules installed that belong to the provided repository." />
<modifier name="python" aliases="py" description="If specified, lists installed Embedded Python libraries instead of IPM modules." />
<modifier name="outdated" aliases="o" description="Lists installed modules that have available updates in the registry." />
<modifier name="outdated" aliases="o" description="If specified, only lists installed modules that have available updates in the registry. Modules installed only as dependencies are skipped." />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I would reword this by removing the "only" from the second sentence, i.e. " Modules installed as dependencies are skipped"

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