feat(cli): add -outdated modifier in list command#1095
feat(cli): add -outdated modifier in list command#1095AshokThangavel wants to merge 4 commits intointersystems:mainfrom
Conversation
- Implement '-outdated' (alias '-o') to filter for modules with updates. - Update CLI help text with descriptions and usage examples.
| } | ||
| } | ||
|
|
||
| ClassMethod GetOutdatedModulesList(Output List) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
Ok! Let's add a test to make sure this works! (Also you have some failing tests)
There was a problem hiding this comment.
sure. Thank you!
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
Hi @isc-dchui
I’ve implemented the -outdated flag to skip modules installed only as dependencies. Thank you!
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
There isn't much, but here's an example in the wiki:
https://github.com/intersystems/ipm/wiki/02.-CLI-commands#repo
isc-dchui
left a comment
There was a problem hiding this comment.
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="" |
There was a problem hiding this comment.
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." /> |
There was a problem hiding this comment.
Nit: I would reword this by removing the "only" from the second sentence, i.e. " Modules installed as dependencies are skipped"
Description:
Introduced the
-outdatedmodifier (alias-o) to thelistcommand to allow users to quickly identify installed modules with newer versions available in the registry.#586
Key Changes:
-outdatedand the short-form alias-oto thelist-installedcommand logic.CLI Documentation Update:
-outdated, -olist -outdatedTesting Performed:
list -oand verified that only modules with pending updates are displayed.Module : OldVersion NewVersion).