ipm
ipm copied to clipboard
Log local package installation history
I just advised an ipm user on how to track a local history of installations of their package through <Invoke> elements, but really this is something the package manager could/should just do itself.
History should be logged for "load", "install" (including as a dependency), and "uninstall".
History records should include:
- Package name
- Version
- Source registry information (for install only)
- Name (uniquely identifies registry)
- Moniker (type of registry in friendlier terms than a classname)
- Details (would capture e.g. the URL or filesystem path)
- Timestamp
- Namespace (set to $Namespace via InitialExpression)
- Username (set to $Username via InitialExpression)
- Success (%Status)
- Committed (e.g., 0 in non-developer mode if installation fails; 1 otherwise)
- IPM command string (e.g., if I zpm "load https://github.com/intersystems/git-source-control -b hcc" would be good to be able to see that)
Note that we still want to log failed installations - this is a minor wrinkle from a transaction handling perspective; if install rolls back we still need the history.
The command zpm "history" should display package installation history. We also need a documented API for retrieving it (even just saying "you can run SQL queries against this table" would be fine); we should also add a cross-namespace class query wrapper around that API to get all history at the instance level.
Should also investigate feasibility of user audit event types in the IRIS Audit database with corresponding data.
The user persona here is a user of IPM looking for history on their own instance - not a publisher of packages looking for analytics on usage.
But it does via ZPM registry. And IRIS BI could be used to visualize it.
Clarifying: this is a local history on the instance where the packages are installed.
Got you. Such a functionality is already implemented in zpmhub: https://openexchange.intersystems.com/package/zpmhub
Would be great to expose this via zpm "history" or something like that, and also to provide a public API for programmatic access.
@isc-kiyer @isc-rkuszews @isc-eneil - could you chime in if you think anything is missing from the spec? This is very important for v1 / inclusion in IRIS.
@isc-tleavitt I don't know what Committed is but the rest makes sense to me. I like the idea of using the IRIS Audit log since we can then leverage its existing UI and capability to turn auditing on/off for specific Audit events (for example, a user may only care about failed installs). We can still have zpm "history" to wrap around the IRIS audit log but have that as the common source of info.