From 8768058290e0ca021e60e54be69a7ae0774169a9 Mon Sep 17 00:00:00 2001 From: "Shuheng Liu (InterSystems)" <155992272+isc-shuliu@users.noreply.github.com> Date: Mon, 16 Dec 2024 09:24:25 -0500 Subject: [PATCH 01/51] chore(ci): include `main` branch for CI --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e9f9a32e..a28d2004 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,11 +2,13 @@ name: CI on: push: branches: + - main - v0.7.x - v0.9.x - v0.10.x pull_request: branches: + - main - v0.7.x - v0.9.x - v0.10.x From 0acd8f676f276386ab8e3a315ec174ba0e8bf945 Mon Sep 17 00:00:00 2001 From: "Shuheng Liu (InterSystems)" <155992272+isc-shuliu@users.noreply.github.com> Date: Mon, 16 Dec 2024 09:31:56 -0500 Subject: [PATCH 02/51] fix(ci): change ref from master to main on release --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a28d2004..a66b999d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -241,7 +241,7 @@ jobs: - uses: actions/checkout@master if: github.event_name == 'release' with: - ref: master + ref: main - uses: actions/download-artifact@v3 with: name: zpm-${{ needs.prepare.outputs.version }} From fa8ff89707688d610b95bd06cd61a49d1e7ffce5 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 09:15:17 -0500 Subject: [PATCH 03/51] fix(ci): update path to preload Installer.cls --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a66b999d..28e2dcbd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -275,7 +275,7 @@ jobs: CONTAINER=$(docker run -d --rm -v $(pwd):/home/irisowner/zpm/ containers.intersystems.com/intersystems/${{ needs.prepare.outputs.main }} --check-caps false) sleep 5; docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh docker exec -i $CONTAINER iris session iris -UUSER << EOF - set sc=##class(%SYSTEM.OBJ).Load("/home/irisowner/zpm/Installer.cls","ck") + set sc=##class(%SYSTEM.OBJ).Load("/home/irisowner/zpm/preload/cls/IPM/Installer.cls","ck") set sc=##class(IPM.Installer).setup("/home/irisowner/zpm/",3) zpm "repo -r -name registry -url ""https://pm.community.intersystems.com/"" -username ${{ secrets.REGISTRY_USERNAME }} -password ${{ secrets.REGISTRY_PASSWORD }}":1 zpm "publish zpm -v":1 From 8a7bb4d9dbc627f263dffa80530b78e3762b8c17 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 10:24:56 -0500 Subject: [PATCH 04/51] feat(enable): allow mapping repo settings in addition to IPM itself --- src/cls/IPM/Main.cls | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index df96edb8..b455b67a 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -654,6 +654,7 @@ generate /my/path -export 00000,PacketName2,IgnorePacket2^00000,PacketName3,Igno + @@ -2848,6 +2849,7 @@ ClassMethod EnableIPM(ByRef pCommandInfo) Set version = $$$GetModifier(pCommandInfo, "version") Set namespaces = $$$GetModifier(pCommandInfo, "namespaces") Set allowUpgrade = $$$HasModifier(pCommandInfo,"allow-upgrade") + Set mapRepos = $$$HasModifier(pCommandInfo,"repos") Set useLocal = 1 // var to store the final decision of whether to use local manifest or get from server Set targetVersion = "" // var to store the final version of IPM to be installed Kill targetNamespaces // multi-dim array to store the final namespaces that need to install IPM @@ -2866,6 +2868,9 @@ ClassMethod EnableIPM(ByRef pCommandInfo) If map && 'globally && (namespaces = "") { $$$ThrowOnError($$$ERROR($$$GeneralError,"If mapping from the current namespace's routine database with -map, must specify either -globally or a list of namespaces with -ns")) } + If ('map) && (mapRepos) { + $$$ThrowOnError($$$ERROR($$$GeneralError,"Cannot specify -repos without -map")) + } If map { If globally { @@ -2884,13 +2889,15 @@ ClassMethod EnableIPM(ByRef pCommandInfo) } Else { Set namespaces = $ListFromString(namespaces) } + + // First try to map IPM itself Set pointer = 0 While $ListNext(namespaces,pointer,namespace) { Set namespace = $Zstrip(namespace, "<>WC") Set $Namespace = namespace If ..IPMInstalled() { If 'quiet || preview { - Write !,"Skipping "_namespace_" - IPM already installed." + Write !,"Skipping IPM mapping of "_namespace_" - IPM already installed." } Continue } @@ -2908,6 +2915,41 @@ ClassMethod EnableIPM(ByRef pCommandInfo) } $$$ThrowOnError(##class(%IPM.Utils.Build).MapRoutineEquivalently("%IPM.*",initNamespace,,namespace)) } + + // Then try to map Repo settings if -repos is specified + If mapRepos { + Do ..GetMapInfo(.isMappedFrom) + Set pointer = 0 + While $ListNext(namespaces,pointer,namespace) { + Set namespace = $ZStrip(namespace, "<>WC") + // If IPM is not mapped from source namespace, skip repo mapping + If $Get(isMappedFrom(namespace)) '= initNamespace { + If 'quiet || preview { + Write !,"Skipping repository settings mapping of "_namespace_" - IPM not mapped from source namespace." + } + Continue + } + // If repository settings are already present, also skip repo mapping avoid override + If $Data(^IPM.Repo.DefinitionD) \ 2 { + If 'quiet || preview { + Write !,"Skipping repository settings mapping of "_namespace_" - IPM Repo settings found." + } + Continue + } + Set $Namespace = initNamespace + If preview { + Write !,"Would add IPM repository settings mappings to "_namespace + Continue + } + If 'quiet { + Write !,"Mapping IPM repository settings in "_namespace_" equivalently to "_initNamespace + } + For suffix = "D", "S", "I" { + $$$ThrowOnError(##class(%IPM.Utils.Build).MapGlobalEquivalently("IPM.Repo.Definition"_suffix, initNamespace, namespace)) + } + } + } + Set $Namespace = initNamespace If preview { Write !,"Preview mode; no configuration changes were made." From 93f0385d01b96ea0010e73dcdee2fd14ca8d604a Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 10:50:20 -0500 Subject: [PATCH 05/51] fix: forgot to change namespace when checking IPM globals --- src/cls/IPM/Main.cls | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index b455b67a..181f79bc 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -2930,6 +2930,7 @@ ClassMethod EnableIPM(ByRef pCommandInfo) Continue } // If repository settings are already present, also skip repo mapping avoid override + Set $Namespace = namespace If $Data(^IPM.Repo.DefinitionD) \ 2 { If 'quiet || preview { Write !,"Skipping repository settings mapping of "_namespace_" - IPM Repo settings found." From fa560e0758e4ea9b2c4ca242d616445faaf0321c Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 10:52:01 -0500 Subject: [PATCH 06/51] feat: support "enable -community" to map community repo & IPM globally --- src/cls/IPM/Main.cls | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index 181f79bc..f79cf0a2 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -657,6 +657,7 @@ generate /my/path -export 00000,PacketName2,IgnorePacket2^00000,PacketName3,Igno + enable -map -globally @@ -673,6 +674,9 @@ generate /my/path -export 00000,PacketName2,IgnorePacket2^00000,PacketName3,Igno enable -v latest -allow-upgrade NS1,NS2,NS3 + + enable -community + @@ -2841,6 +2845,19 @@ ClassMethod EnableIPM(ByRef pCommandInfo) Write !,($namespace)_"> "_$$$FormattedLine($$$Green,$$$IPMModuleName_" ")_modDef.VersionString } + If $$$HasModifier(pCommandInfo,"community") { + For cmd = "repo -delete-all", "repo -reset-defaults", "enable -map -repos -globally" { + Write !!, "RUNNING command: """, cmd, """" + Do ..ShellInternal(cmd, .exc) + If exc '= $$$NULLOREF { + Write !, $$$FormattedLine($$$Red, $$$FormatText("Error running command ""%1"" - %2", cmd, exc.DisplayString())) + } Else { + Write !, $$$FormattedLine($$$Green, $$$FormatText("Command ""%1"" finished successfull", cmd)) + } + } + Return + } + Set quiet = $$$HasModifier(pCommandInfo,"quiet") Set preview = $$$HasModifier(pCommandInfo,"preview") Set map = $$$HasModifier(pCommandInfo,"map") From 40d064526703973e0b9da636ff153773e1c5018b Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 10:53:37 -0500 Subject: [PATCH 07/51] style: reduce verbosity --- src/cls/IPM/Main.cls | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index f79cf0a2..8ff9f13c 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -2933,7 +2933,7 @@ ClassMethod EnableIPM(ByRef pCommandInfo) $$$ThrowOnError(##class(%IPM.Utils.Build).MapRoutineEquivalently("%IPM.*",initNamespace,,namespace)) } - // Then try to map Repo settings if -repos is specified + // Then try to map repositories if -repos is specified If mapRepos { Do ..GetMapInfo(.isMappedFrom) Set pointer = 0 @@ -2942,25 +2942,25 @@ ClassMethod EnableIPM(ByRef pCommandInfo) // If IPM is not mapped from source namespace, skip repo mapping If $Get(isMappedFrom(namespace)) '= initNamespace { If 'quiet || preview { - Write !,"Skipping repository settings mapping of "_namespace_" - IPM not mapped from source namespace." + Write !,"Skipping repository mapping of "_namespace_" - IPM not mapped from source namespace." } Continue } - // If repository settings are already present, also skip repo mapping avoid override + // If repository are already present, also skip repo mapping avoid override Set $Namespace = namespace If $Data(^IPM.Repo.DefinitionD) \ 2 { If 'quiet || preview { - Write !,"Skipping repository settings mapping of "_namespace_" - IPM Repo settings found." + Write !,"Skipping repository mapping of "_namespace_" - IPM repositories found." } Continue } Set $Namespace = initNamespace If preview { - Write !,"Would add IPM repository settings mappings to "_namespace + Write !,"Would add IPM repository mappings to "_namespace Continue } If 'quiet { - Write !,"Mapping IPM repository settings in "_namespace_" equivalently to "_initNamespace + Write !,"Mapping IPM repository in "_namespace_" equivalently to "_initNamespace } For suffix = "D", "S", "I" { $$$ThrowOnError(##class(%IPM.Utils.Build).MapGlobalEquivalently("IPM.Repo.Definition"_suffix, initNamespace, namespace)) From 328c54df909f12c2d7136fd2911c6e56981642c0 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 11:19:54 -0500 Subject: [PATCH 08/51] fix: improve output of zpm error message in namespaces without IPM --- src/cls/IPM/Main.cls | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index 8ff9f13c..d29bc795 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -2808,9 +2808,12 @@ ZPM(pArgs...) Set found = 0 While rs.%Next() { Set $Namespace = $Zstrip(rs.%Get("Nsp"), "<>WC") - If $System.CLS.IsMthd("%IPM.Main", "Shell") { + // Some I4H containers come with %IPM.Main but the "version" command doesn't work ?! + If $System.CLS.IsMthd("%IPM.Main", "Shell") && ($Namespace '= "HSLIB") && ($Namespace '= "HSSYS") { Write !, "Change namepace to one of the following to run the ""zpm"" command" Do ##class(%IPM.Main).Shell("version") + Write !, "If you want to map IPM globally, switch to one of the namesapaces above and run: zpm ""enable -map -globally""." + Write !, "If you want to reset repository and map IPM globally along with repository settings, switch to one of the namesapaces above and run: zpm ""enable -community""." Set found = 1 Quit } From 938d3807438159e5724700deda1825f29af8071a Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 11:39:26 -0500 Subject: [PATCH 09/51] feat(unmap): support unmapping of repository settings --- src/cls/IPM/Main.cls | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index d29bc795..eeb0edca 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -680,12 +680,15 @@ generate /my/path -export 00000,PacketName2,IgnorePacket2^00000,PacketName3,Igno + Unmap %IPM package and routines in specified namespaces. Unmap %IPM package and routines in specified namespaces. Will Skip non-mapped namespaces. + If repository settings are mapped, will also unmap repository settings. + unmap -ns NS1,NS2,NS3 @@ -3204,6 +3207,7 @@ ClassMethod UnmapIPM(ByRef pCommandInfo) Set globally = $$$HasModifier(pCommandInfo,"globally") Set namespaces = $ListFromString($$$GetModifier(pCommandInfo,"namespaces"), ",") Set verbose = '$$$HasModifier(pCommandInfo,"quiet") + set reposOnly = $$$HasModifier(pCommandInfo,"repos-only") // Sanity check If (globally && (namespaces '= "")) { $$$ThrowOnError($$$ERROR($$$GeneralError,"Cannot specify namespaces and global unmap flag at the same time.")) @@ -3224,7 +3228,11 @@ ClassMethod UnmapIPM(ByRef pCommandInfo) } } If verbose { - Write !,"Will attempt to unmap %IPM package and routines from: "_ $ListToString(namespaces, ", ") + If reposOnly { + Write !,"Will attempt to unmap IPM repository settings from: "_ $ListToString(namespaces, ", ") + } Else { + Write !,"Will attempt to unmap IPM package, routines, and repository settings from: "_ $ListToString(namespaces, ", ") + } } // Gather namespaces where %IPM is mapped into @@ -3239,11 +3247,21 @@ ClassMethod UnmapIPM(ByRef pCommandInfo) } Continue } + If verbose { - Write !,"Unmapping %IPM package and routines from "_ns_" (mapped from "_src_")" + Write !,"Unmapping repository settings from "_ns_" (mapped from "_src_")" + } + For suffix = "D", "S", "I" { + $$$ThrowOnError(##class(%IPM.Utils.Module).RemoveGlobalMapping(ns, "IPM.Repo.Definition"_suffix)) + } + + If 'reposOnly { + If verbose { + Write !,"Unmapping IPM package and routines from "_ns_" (mapped from "_src_")" + } + $$$ThrowOnError(##class(%IPM.Utils.Module).RemovePackageMapping(ns, "%IPM")) + $$$ThrowOnError(##class(%IPM.Utils.Module).RemoveRoutineMapping(ns, "%IPM.*")) } - $$$ThrowOnError(##class(%IPM.Utils.Module).RemovePackageMapping(ns, "%IPM")) - $$$ThrowOnError(##class(%IPM.Utils.Module).RemoveRoutineMapping(ns, "%IPM.*")) } } From 93eb017181037559445bcc8f0e38b22e9a94be95 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 11:46:22 -0500 Subject: [PATCH 10/51] chore: update change log --- CHANGELOG.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab5ca72b..3813bc1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased - 0.9.0+snapshot] +## [0.9.1] - 2024-12-17 + +### Added +- #663 Added support for mapping of repository settings along with, or in addition to, IPM package and routines +- #663 Added functionlity to always unmap repository settings when IPM package and routines are unmapped +- #663 Added support for unmapping of repository settings alone +- #663 Added support for `enable -community` which resets repository settings to default and map IPM along with repo settings globally + +### Changed +- #663 Improved error output and instructions in the language extension when running "zpm" is run from a namespace without IPM + +## [0.9.0] - 2024-12-16 ### Added - #364 Added ability to restrict the installation to IRIS or IRIS for Health platform to the SystemRequirements attribute @@ -64,11 +75,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - #606: Don't put garbage folders in tar archive - #652: Don't create extra needless mappings (could cause deadlock with parallel installation of dependencies) -### Security -- - -### Removed -- - ### Deprecated - #593 CSPApplication is deprecated in favor of WebApplication. User will be warned when installing a package containing CSPApplication. From 0cf51ffb6535b431d697582630545305cb22b915 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 11:53:35 -0500 Subject: [PATCH 11/51] chore: changelog typo fix --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3813bc1d..4c2d510d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,12 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - #663 Added support for mapping of repository settings along with, or in addition to, IPM package and routines -- #663 Added functionlity to always unmap repository settings when IPM package and routines are unmapped +- #663 Added functionality to always unmap repository settings when IPM package and routines are unmapped - #663 Added support for unmapping of repository settings alone -- #663 Added support for `enable -community` which resets repository settings to default and map IPM along with repo settings globally +- #663 Added support for `enable -community`, which resets repository settings to default and maps IPM along with repo settings globally ### Changed -- #663 Improved error output and instructions in the language extension when running "zpm" is run from a namespace without IPM +- #663 Improved error output and instructions in the language extension when "zpm" is run from a namespace without IPM ## [0.9.0] - 2024-12-16 From 5723f39f4e68df20cc87ff16eb7bb62dc7b4a0e6 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 14:24:43 -0500 Subject: [PATCH 12/51] chore: update change log to reflect the compatibility of changes --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c2d510d..42de29dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - #663 Added support for unmapping of repository settings alone - #663 Added support for `enable -community`, which resets repository settings to default and maps IPM along with repo settings globally -### Changed +### Fixed - #663 Improved error output and instructions in the language extension when "zpm" is run from a namespace without IPM ## [0.9.0] - 2024-12-16 From 887bdd20cff9e82fd65c5d7d21f92d6c6d78b22a Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 14:27:17 -0500 Subject: [PATCH 13/51] docs: explain v0.9.0 changes and how to keep the legacy behavior --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c65ec88b..d1ab2e35 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,18 @@ -# ObjectScript Package Manager Client - ZPM +# InterSystems Package Manager - IPM -Helps to install ObjectScript classes and routines, globals, Embedded Python modules, CSP and Frontend packages, and any files into InterSystems IRIS published on the official [ZPM Registry](https://pm.community.intersystems.com/packages/-/all) or private ZPM registry of your own. +Helps to install ObjectScript classes and routines, globals, Embedded Python modules, CSP and Frontend packages, and any files into InterSystems IRIS published on the official [Registry](https://pm.community.intersystems.com/packages/-/all) or private registry of your own. ## Documentation * [The official documenation in the wiki](https://github.com/intersystems-community/zpm/wiki/) * [Articles on the InterSystems Developer Community](https://community.intersystems.com/tags/objectscript-package-manager-zpm) * [Videos on YouTube](https://www.youtube.com/playlist?list=PLKb2cBVphNQRcmxt4LtYDyLJEPfF4X4-4) +## Compatibility Note +With the release of IPM v0.9.0 on Dec 2024, IPM is no longer mapped across namespaces. Users can have different IPM versions and configurations in different namespaces. + +* To retain the old behavior where %IPM routines and classes mapped across all namespaces, run `zpm "enable -map -globally`. This is automatically performed when upgrading from a legacy version and can be undone by running `zpm "unmap -globally`. +* You can optionally choose to map IPM repositories across namespaces with `zpm "enable -map -repos -namespaces NS1,NS2,NS3` or `zpm "enable -map -repos -globally`. Repositories are only mapped if %IPM classes and rountines are also mapped from the same namespace. +* As a convenience command, `zpm "enable -community"` will make IPM behave essentially the same as legeacy versions (v0.7.x) by setting up the the community registry and maping %IPM routines and classes, as well IPM repository settings to all namespaces. ## Installing ObjectScript Package Manager Client: @@ -14,6 +20,7 @@ Helps to install ObjectScript classes and routines, globals, Embedded Python mod ``` s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c") ``` +**If you want the legacy behavior of mapping IPM classes, routines, and repository settings to all namespaces, run `zpm "enable -community"` after installing IPM. See `zpm "help enable"` for details.** OR: From 0afbc77d1a4c451c02a8927f7c8e5f510c8e5edf Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 14:31:20 -0500 Subject: [PATCH 14/51] docs: improve readme explanation on IPM 0.9 --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d1ab2e35..72571ade 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,11 @@ Helps to install ObjectScript classes and routines, globals, Embedded Python mod * [Videos on YouTube](https://www.youtube.com/playlist?list=PLKb2cBVphNQRcmxt4LtYDyLJEPfF4X4-4) ## Compatibility Note -With the release of IPM v0.9.0 on Dec 2024, IPM is no longer mapped across namespaces. Users can have different IPM versions and configurations in different namespaces. +With the release of IPM v0.9.0 on Dec 2024, IPM is no longer mapped across namespaces. +This is an intentioal change so that users can have different IPM versions and configurations in different namespaces. +If you install IPM on an instance without the legacy 0.7.x version, IPM is only installed to the current namespace. -* To retain the old behavior where %IPM routines and classes mapped across all namespaces, run `zpm "enable -map -globally`. This is automatically performed when upgrading from a legacy version and can be undone by running `zpm "unmap -globally`. +* To retain the old behavior where %IPM routines and classes mapped across all namespaces, run `zpm "enable -map -globally`. This is automatically performed when upgrading from a legacy version and can be undone by running `zpm "unmap -globally"`. * You can optionally choose to map IPM repositories across namespaces with `zpm "enable -map -repos -namespaces NS1,NS2,NS3` or `zpm "enable -map -repos -globally`. Repositories are only mapped if %IPM classes and rountines are also mapped from the same namespace. * As a convenience command, `zpm "enable -community"` will make IPM behave essentially the same as legeacy versions (v0.7.x) by setting up the the community registry and maping %IPM routines and classes, as well IPM repository settings to all namespaces. From ea13ebc4092280dd0ebbd7e148348d4b6e3ab384 Mon Sep 17 00:00:00 2001 From: isc-tleavitt <73311181+isc-tleavitt@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:17:31 -0500 Subject: [PATCH 15/51] docs: a few more readme tweaks --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 72571ade..cbc0e272 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Helps to install ObjectScript classes and routines, globals, Embedded Python mod ## Compatibility Note With the release of IPM v0.9.0 on Dec 2024, IPM is no longer mapped across namespaces. -This is an intentioal change so that users can have different IPM versions and configurations in different namespaces. +This is an intentional change so that users can have different IPM versions and configurations in different namespaces. If you install IPM on an instance without the legacy 0.7.x version, IPM is only installed to the current namespace. * To retain the old behavior where %IPM routines and classes mapped across all namespaces, run `zpm "enable -map -globally`. This is automatically performed when upgrading from a legacy version and can be undone by running `zpm "unmap -globally"`. @@ -20,9 +20,10 @@ If you install IPM on an instance without the legacy 0.7.x version, IPM is only 0. Use one-liner in terminal call or programmatically: ``` -s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c") +s version="latest" s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/"_version_"/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c") ``` **If you want the legacy behavior of mapping IPM classes, routines, and repository settings to all namespaces, run `zpm "enable -community"` after installing IPM. See `zpm "help enable"` for details.** +**In a CI script, for deterministic behavior, you should replace version="latest" with the IPM version you wish to use.** OR: From c1f67545a7c269497f390462e1695830c0b896ed Mon Sep 17 00:00:00 2001 From: "Shuheng Liu (InterSystems)" <155992272+isc-shuliu@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:56:49 -0500 Subject: [PATCH 16/51] style: fix typos in readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cbc0e272..9f897600 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ This is an intentional change so that users can have different IPM versions and If you install IPM on an instance without the legacy 0.7.x version, IPM is only installed to the current namespace. * To retain the old behavior where %IPM routines and classes mapped across all namespaces, run `zpm "enable -map -globally`. This is automatically performed when upgrading from a legacy version and can be undone by running `zpm "unmap -globally"`. -* You can optionally choose to map IPM repositories across namespaces with `zpm "enable -map -repos -namespaces NS1,NS2,NS3` or `zpm "enable -map -repos -globally`. Repositories are only mapped if %IPM classes and rountines are also mapped from the same namespace. -* As a convenience command, `zpm "enable -community"` will make IPM behave essentially the same as legeacy versions (v0.7.x) by setting up the the community registry and maping %IPM routines and classes, as well IPM repository settings to all namespaces. +* You can optionally choose to map IPM repositories across namespaces with `zpm "enable -map -repos -namespaces NS1,NS2,NS3` or `zpm "enable -map -repos -globally`. Repositories are only mapped if %IPM classes and routines are also mapped from the same namespace. +* As a convenience command, `zpm "enable -community"` will make IPM behave essentially the same as legacy versions (v0.7.x) by setting up the the community registry and maping %IPM routines and classes, as well IPM repository settings to all namespaces. ## Installing ObjectScript Package Manager Client: @@ -75,4 +75,4 @@ Here is the [alternative supported folder structure.](https://openexchange.inter ## Support and Collaboration ObjectScript Package Manager is a community supported project and thus open to collaboration via Pull Requests. -Issues and feature requests [are very welcome](https://github.com/intersystems-community/zpm/issues) \ No newline at end of file +Issues and feature requests [are very welcome](https://github.com/intersystems-community/zpm/issues) From bd30a19e2dd2f2b5db48196db9ed9a34c721ebb4 Mon Sep 17 00:00:00 2001 From: "Shuheng Liu (InterSystems)" <155992272+isc-shuliu@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:58:00 -0500 Subject: [PATCH 17/51] style: fix typos in Main.cls --- src/cls/IPM/Main.cls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index eeb0edca..e478bfb7 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -2815,8 +2815,8 @@ ZPM(pArgs...) If $System.CLS.IsMthd("%IPM.Main", "Shell") && ($Namespace '= "HSLIB") && ($Namespace '= "HSSYS") { Write !, "Change namepace to one of the following to run the ""zpm"" command" Do ##class(%IPM.Main).Shell("version") - Write !, "If you want to map IPM globally, switch to one of the namesapaces above and run: zpm ""enable -map -globally""." - Write !, "If you want to reset repository and map IPM globally along with repository settings, switch to one of the namesapaces above and run: zpm ""enable -community""." + Write !, "If you want to map IPM globally, switch to one of the namespaces above and run: zpm ""enable -map -globally""." + Write !, "If you want to reset repository and map IPM globally along with repository settings, switch to one of the namespaces above and run: zpm ""enable -community""." Set found = 1 Quit } From f4c2d86285af910c513d64313b29f05f404f55bc Mon Sep 17 00:00:00 2001 From: ProjectBot Date: Wed, 18 Dec 2024 21:14:33 +0000 Subject: [PATCH 18/51] auto bump version with release --- module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module.xml b/module.xml index 4d8205d7..e113b419 100644 --- a/module.xml +++ b/module.xml @@ -2,7 +2,7 @@ ZPM - 0.9.1-SNAPSHOT + 0.9.2-SNAPSHOT Package Management System Provides development tools and infrastructure for defining, building, distributing, and installing modules and applications. Package Manager From 3d31bfe9e20be1d06b76fcedd86f812f699193a5 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Fri, 3 Jan 2025 11:41:09 -0500 Subject: [PATCH 19/51] fix: preserve user-side changes to lang. ext. outside of comment tags --- src/cls/IPM/Main.cls | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index df96edb8..b8ef9f20 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -2723,7 +2723,10 @@ ClassMethod UpdateLanguageExtensionsOne(RoutineName As %String, pTestOnly As %Bo For i=1:1:tGenLines { Set tRtnLines($Increment(tRtnLines)) = tGenLines(i) } - } + } Else { + // outside of the tags, just copy the lines to preserve users' custom code + Set tRtnLines($Increment(tRtnLines)) = tLine + } } If 'tEnded { Set tRtnLines($Increment(tRtnLines)) = $$$ENDTAGQ From 584e29acdebc7842804f8b6d45c4aa96250ffa3a Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Fri, 3 Jan 2025 12:31:30 -0500 Subject: [PATCH 20/51] style: remove dead code when updating lang. ext. --- src/cls/IPM/Main.cls | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index b8ef9f20..31ae7868 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -2711,7 +2711,6 @@ ClassMethod UpdateLanguageExtensionsOne(RoutineName As %String, pTestOnly As %Bo { Set tRtn = ##class(%Routine).%New(RoutineName) If ##class(%Routine).Exists(RoutineName) { - Set tEnded = 1 While 'tRtn.AtEnd { Set tLine = tRtn.ReadLine() If $Match(tLine,$$$STARTTAGREGEX) { @@ -2728,9 +2727,7 @@ ClassMethod UpdateLanguageExtensionsOne(RoutineName As %String, pTestOnly As %Bo Set tRtnLines($Increment(tRtnLines)) = tLine } } - If 'tEnded { - Set tRtnLines($Increment(tRtnLines)) = $$$ENDTAGQ - } ElseIf 'pFound { + If 'pFound { For i=1:1:tGenLines { Set tRtnLines($Increment(tRtnLines)) = tGenLines(i) } From 10eef9559fa34101eb147dbb0b3f62803d3cd7f7 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Fri, 3 Jan 2025 15:59:09 -0500 Subject: [PATCH 21/51] test: add test cases for updating lang. ext. with custom code --- .../PM/Unit/LanguageExtension/Abstract.cls | 168 ++++++++++++++++++ .../Unit/LanguageExtension/FreshInstall.cls | 23 +++ .../FreshInstallWithCustomCode.cls | 25 +++ .../Unit/LanguageExtension/IllFormedTags.cls | 28 +++ .../LanguageExtension/UpgradeFromLegacy.cls | 26 +++ .../UpgradeFromLegacyWithCustomCode.cls | 30 ++++ 6 files changed, 300 insertions(+) create mode 100644 tests/unit_tests/Test/PM/Unit/LanguageExtension/Abstract.cls create mode 100644 tests/unit_tests/Test/PM/Unit/LanguageExtension/FreshInstall.cls create mode 100644 tests/unit_tests/Test/PM/Unit/LanguageExtension/FreshInstallWithCustomCode.cls create mode 100644 tests/unit_tests/Test/PM/Unit/LanguageExtension/IllFormedTags.cls create mode 100644 tests/unit_tests/Test/PM/Unit/LanguageExtension/UpgradeFromLegacy.cls create mode 100644 tests/unit_tests/Test/PM/Unit/LanguageExtension/UpgradeFromLegacyWithCustomCode.cls diff --git a/tests/unit_tests/Test/PM/Unit/LanguageExtension/Abstract.cls b/tests/unit_tests/Test/PM/Unit/LanguageExtension/Abstract.cls new file mode 100644 index 00000000..09200987 --- /dev/null +++ b/tests/unit_tests/Test/PM/Unit/LanguageExtension/Abstract.cls @@ -0,0 +1,168 @@ +Include %IPM.Common + +Class Test.PM.Unit.LanguageExtension.Abstract Extends %UnitTest.TestCase +{ + +/// Controls whether the test case will be run. Only the Abstract case should have this set to 1. +Parameter IsAbstractTestCase As Boolean = 1; + +/// Name of the routine to be tested. +Parameter TestRoutine = "DummyRoutineForIPMTest.MAC"; + +/// Constant string to be used as custom code in the test cases. +Parameter CustomCode = " // This is some custom code"; + +/// Run by RunTest immediately before each test method in the test class is run.
+///
+///
testname +///
Name of the test to be run. Required. +///
+Method OnBeforeOneTest(testname As %String) As %Status +{ + If ##class(%Routine).Exists(..#TestRoutine) { + Quit ##class(%Routine).Delete(..#TestRoutine) + } + Quit $$$OK +} + +/// Run by RunTest immediately after each test method in the test class is run.
+///
+///
testname +///
Name of the test to be run. Required. +///
+Method OnAfterOneTest(testname As %String) As %Status +{ + Quit ..OnBeforeOneTest(testname) +} + +ClassMethod AppendLangExt1(ByRef content) +{ + Set content($Increment(content)) = "ZPMDUMMYLANGUAGEEXTENSION(pArgs...)" + Set content($Increment(content)) = " Set x = 1" +} + +ClassMethod AppendLangExt2(ByRef content) +{ + Set content($Increment(content)) = "ZPMDUMMYLANGUAGEEXTENSION(pArgs...)" + Set content($Increment(content)) = " Set y = 2" +} + +ClassMethod AppendLegacyStart(ByRef content) +{ + Set content($Increment(content)) = $Replace($$$STARTTAGQ, "%IPM.Main", "%ZPM.PackageManager") +} + +ClassMethod AppendLegacyEnd(ByRef content) +{ + Set content($Increment(content)) = $Replace($$$ENDTAGQ, "%IPM.Main", "%ZPM.PackageManager") +} + +ClassMethod AppendStart(ByRef content) +{ + Set content($Increment(content)) = $$$STARTTAGQ +} + +ClassMethod AppendEnd(ByRef content) +{ + Set content($Increment(content)) = $$$ENDTAGQ +} + +ClassMethod AppendContent(ByRef dest, ByRef src) +{ + For i = 1:1:$Get(src) { + Set dest($Increment(dest)) = src(i) + } +} + +/// Open TestRoutine, clear it, and write to it. The input should be a multi-dimensional array. +ClassMethod WriteToRoutine(ByRef input) +{ + // Creating and saving an empty routine causes the routine to contain a whitespace, which causes tests to fail. + If '$Data(input) { + Quit + } + Set routine = ##class(%Routine).%New(..#TestRoutine) + Do routine.Clear() + For i = 1:1:$Get(input) { + Do routine.WriteLine(input(i)) + } + $$$ThrowOnError(routine.Save()) +} + +/// Get the content of TestRoutine as a multi-dimensional array +ClassMethod ReadFromRoutine(Output output) +{ + Kill output + + If '##class(%Routine).Exists(..#TestRoutine) { + Quit + } + Set routine = ##class(%Routine).%New(..#TestRoutine) + While ('routine.AtEnd) { + Set output($Increment(output)) = routine.ReadLine() + } +} + +ClassMethod CompareContents(ByRef content1, ByRef content2) As %Boolean +{ + If $Data(content1) '= $Data(content2) { + Quit 0 + } + For i = 1:1:$Get(content1) { + If content1(i) '= content2(i) { + Return 0 + } + } + Return 1 +} + +ClassMethod ContentToString(ByRef content, LineSep As %String = "\n") As %String +{ + Set str = "" + For i = 1:1:$Get(content) { + Set str = str _ content(i) _ LineSep + } + Quit str +} + +Method TestLanguageExtension() +{ + If ..#IsAbstractTestCase { + Do $$$AssertSkipped($classname() _ "is an abstract test case") + Quit + } + // Get initial content and write to it + Do ..GetInitial(.initialContent) + Do ..WriteToRoutine(.initialContent) + + // Update language extension + Do ..AppendStart(.routineContent) + Do ..AppendLangExt2(.routineContent) + Do ..AppendEnd(.routineContent) + Do ##class(%IPM.Main).UpdateLanguageExtensionsOne(..#TestRoutine, 0, .found, .routineContent) + + // Get expected content, and expected found + Do ..GetExpected(.expectedContent, .expectedFound) + + // Compare against routine content + Do ..ReadFromRoutine(.outputContent) + Do $$$AssertEquals((''found), (''expectedFound)) + If '$$$AssertTrue(..CompareContents(.outputContent, .expectedContent)) { + Do $$$LogMessage("Output and expected content do not match !!!") + Do $$$LogMessage("Output : " _ ..ContentToString(.outputContent)) + Do $$$LogMessage("Expected : " _ ..ContentToString(.expectedContent)) + } +} + +/// Construct the initial content of the routine. Could be empty. +ClassMethod GetInitial(Output content) +{ +} + +/// Construct the expected content of the routine after the language extension is updated. +/// Also construct the expected "found" value indicating if an older language extension was found. +ClassMethod GetExpected(Output content, Output found) +{ +} + +} diff --git a/tests/unit_tests/Test/PM/Unit/LanguageExtension/FreshInstall.cls b/tests/unit_tests/Test/PM/Unit/LanguageExtension/FreshInstall.cls new file mode 100644 index 00000000..25a7bee8 --- /dev/null +++ b/tests/unit_tests/Test/PM/Unit/LanguageExtension/FreshInstall.cls @@ -0,0 +1,23 @@ +/// Simulate a fresh install of the language extension, assuming the routine is nonexistent at the time of install. +Class Test.PM.Unit.LanguageExtension.FreshInstall Extends Test.PM.Unit.LanguageExtension.Abstract +{ + +Parameter IsAbstractTestCase As Boolean = 0; + +/// Construct the expected content of the routine after the language extension is updated. +/// Also construct the expected "found" value indicating if an older language extension was found. +ClassMethod GetExpected(Output content, Output found) +{ + Set found = 0 + + Do ..AppendStart(.content) + Do ..AppendLangExt2(.content) + Do ..AppendEnd(.content) +} + +/// Construct the initial content of the routine. Could be empty. +ClassMethod GetInitial(Output content) +{ +} + +} diff --git a/tests/unit_tests/Test/PM/Unit/LanguageExtension/FreshInstallWithCustomCode.cls b/tests/unit_tests/Test/PM/Unit/LanguageExtension/FreshInstallWithCustomCode.cls new file mode 100644 index 00000000..a9efcba2 --- /dev/null +++ b/tests/unit_tests/Test/PM/Unit/LanguageExtension/FreshInstallWithCustomCode.cls @@ -0,0 +1,25 @@ +/// Simulate a fresh install of the language extension, assuming the routine contains only custom code at the time of install. +Class Test.PM.Unit.LanguageExtension.FreshInstallWithCustomCode Extends Test.PM.Unit.LanguageExtension.Abstract +{ + +Parameter IsAbstractTestCase As Boolean = 0; + +/// Construct the expected content of the routine after the language extension is updated. +/// Also construct the expected "found" value indicating if an older language extension was found. +ClassMethod GetExpected(Output content, Output found) +{ + Set found = 0 + + Set content($Increment(content)) = ..#CustomCode + Do ..AppendStart(.content) + Do ..AppendLangExt2(.content) + Do ..AppendEnd(.content) +} + +/// Construct the initial content of the routine. Could be empty. +ClassMethod GetInitial(Output content) +{ + Set content($Increment(content)) = ..#CustomCode +} + +} diff --git a/tests/unit_tests/Test/PM/Unit/LanguageExtension/IllFormedTags.cls b/tests/unit_tests/Test/PM/Unit/LanguageExtension/IllFormedTags.cls new file mode 100644 index 00000000..b0584b45 --- /dev/null +++ b/tests/unit_tests/Test/PM/Unit/LanguageExtension/IllFormedTags.cls @@ -0,0 +1,28 @@ +/// Ill-formed test case with only start tag but no end tag. +Class Test.PM.Unit.LanguageExtension.IllFormedTags Extends Test.PM.Unit.LanguageExtension.Abstract +{ + +Parameter IsAbstractTestCase As Boolean = 0; + +/// Construct the expected content of the routine after the language extension is updated. +/// Also construct the expected "found" value indicating if an older language extension was found. +ClassMethod GetExpected(Output content, Output found) +{ + Set found = 1 + + Set content($Increment(content)) = ..#CustomCode + Do ..AppendStart(.content) + Do ..AppendLangExt2(.content) + Do ..AppendEnd(.content) +} + +/// Construct the initial content of the routine. Could be empty. +ClassMethod GetInitial(Output content) +{ + Set content($Increment(content)) = ..#CustomCode + Do ..AppendStart(.content) + Do ..AppendLangExt1(.content) + Set content($Increment(content)) = ..#CustomCode +} + +} diff --git a/tests/unit_tests/Test/PM/Unit/LanguageExtension/UpgradeFromLegacy.cls b/tests/unit_tests/Test/PM/Unit/LanguageExtension/UpgradeFromLegacy.cls new file mode 100644 index 00000000..21a0498a --- /dev/null +++ b/tests/unit_tests/Test/PM/Unit/LanguageExtension/UpgradeFromLegacy.cls @@ -0,0 +1,26 @@ +/// Simulate upgrading from an older version of the language extension, assuming the routine contains only the older language extension. +Class Test.PM.Unit.LanguageExtension.UpgradeFromLegacy Extends Test.PM.Unit.LanguageExtension.Abstract +{ + +Parameter IsAbstractTestCase As Boolean = 0; + +/// Construct the expected content of the routine after the language extension is updated. +/// Also construct the expected "found" value indicating if an older language extension was found. +ClassMethod GetExpected(Output content, Output found) +{ + Set found = 1 + + Do ..AppendStart(.content) + Do ..AppendLangExt2(.content) + Do ..AppendEnd(.content) +} + +/// Construct the initial content of the routine. Could be empty. +ClassMethod GetInitial(Output content) +{ + Do ..AppendStart(.content) + Do ..AppendLangExt1(.content) + Do ..AppendEnd(.content) +} + +} diff --git a/tests/unit_tests/Test/PM/Unit/LanguageExtension/UpgradeFromLegacyWithCustomCode.cls b/tests/unit_tests/Test/PM/Unit/LanguageExtension/UpgradeFromLegacyWithCustomCode.cls new file mode 100644 index 00000000..bc40ef9d --- /dev/null +++ b/tests/unit_tests/Test/PM/Unit/LanguageExtension/UpgradeFromLegacyWithCustomCode.cls @@ -0,0 +1,30 @@ +/// Simulate upgrading from an older version of the language extension, assuming the routine contains both the older language extension and some custom code. +Class Test.PM.Unit.LanguageExtension.UpgradeFromLegacyWithCustomCode Extends Test.PM.Unit.LanguageExtension.Abstract +{ + +Parameter IsAbstractTestCase As Boolean = 0; + +/// Construct the expected content of the routine after the language extension is updated. +/// Also construct the expected "found" value indicating if an older language extension was found. +ClassMethod GetExpected(Output content, Output found) +{ + Set found = 1 + + Set content($Increment(content)) = ..#CustomCode + Do ..AppendStart(.content) + Do ..AppendLangExt2(.content) + Do ..AppendEnd(.content) + Set content($Increment(content)) = ..#CustomCode +} + +/// Construct the initial content of the routine. Could be empty. +ClassMethod GetInitial(Output content) +{ + Set content($Increment(content)) = ..#CustomCode + Do ..AppendStart(.content) + Do ..AppendLangExt1(.content) + Do ..AppendEnd(.content) + Set content($Increment(content)) = ..#CustomCode +} + +} From da19028e39edcd684132793a251f22a4b947c4d0 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Fri, 3 Jan 2025 15:59:36 -0500 Subject: [PATCH 22/51] chore: update change log --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1c2ab57..be96a089 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased - 0.10.0+snapshot] +### Fixed +- #678 Only update comment-flagged part of the language extension, allowing users to keep their custom code when upgrading + ## [0.9.1] - 2024-12-18 ### Added From 95d57632a051fac8e81255b15ac1ad630e3ccd92 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Fri, 3 Jan 2025 16:01:20 -0500 Subject: [PATCH 23/51] chore: update change log --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be96a089..7bbc0adf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased - 0.10.0+snapshot] +## [Unreleased - 0.9.2+snapshot] ### Fixed - #678 Only update comment-flagged part of the language extension, allowing users to keep their custom code when upgrading From d6564382a7c8d8bc1ca58d729b47067f1900fd1b Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Fri, 3 Jan 2025 16:02:58 -0500 Subject: [PATCH 24/51] test: improve comparison of 2 multidim arrays --- tests/unit_tests/Test/PM/Unit/LanguageExtension/Abstract.cls | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/unit_tests/Test/PM/Unit/LanguageExtension/Abstract.cls b/tests/unit_tests/Test/PM/Unit/LanguageExtension/Abstract.cls index 09200987..0460bdac 100644 --- a/tests/unit_tests/Test/PM/Unit/LanguageExtension/Abstract.cls +++ b/tests/unit_tests/Test/PM/Unit/LanguageExtension/Abstract.cls @@ -108,6 +108,9 @@ ClassMethod CompareContents(ByRef content1, ByRef content2) As %Boolean If $Data(content1) '= $Data(content2) { Quit 0 } + If $Get(content1) '= $Get(content2) { + Quit 0 + } For i = 1:1:$Get(content1) { If content1(i) '= content2(i) { Return 0 From 7afab1d20ff55792a9aef3c7e6cffec2dd548d0e Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Mon, 6 Jan 2025 10:31:45 -0500 Subject: [PATCH 25/51] fix: always export static files if existent --- src/cls/IPM/Lifecycle/Base.cls | 6 ++-- .../Test/PM/Integration/StaticFileExport.cls | 29 +++++++++++++++++++ .../_data/static-file-export-test/LICENSE | 1 + .../_data/static-file-export-test/README.md | 1 + .../_data/static-file-export-test/module.xml | 12 ++++++++ .../static-file-export-test/requirements.txt | 1 + 6 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 tests/integration_tests/Test/PM/Integration/StaticFileExport.cls create mode 100644 tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/LICENSE create mode 100644 tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/README.md create mode 100644 tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/module.xml create mode 100644 tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/requirements.txt diff --git a/src/cls/IPM/Lifecycle/Base.cls b/src/cls/IPM/Lifecycle/Base.cls index ab4e6d4d..0ef7ec56 100644 --- a/src/cls/IPM/Lifecycle/Base.cls +++ b/src/cls/IPM/Lifecycle/Base.cls @@ -1184,9 +1184,9 @@ Method %Export(ByRef pParams, ByRef pTargetDirectory As %String, Output pDepende } /// Always keep these files Set staticFiles = $ListBuild( - // "readme.md", - // "license", - // "requirements.txt", + "readme.md", + "license", + "requirements.txt", ) Set tRes = ##class(%File).FileSetFunc(..Module.Root) While tRes.%Next() { diff --git a/tests/integration_tests/Test/PM/Integration/StaticFileExport.cls b/tests/integration_tests/Test/PM/Integration/StaticFileExport.cls new file mode 100644 index 00000000..382f613a --- /dev/null +++ b/tests/integration_tests/Test/PM/Integration/StaticFileExport.cls @@ -0,0 +1,29 @@ +Include %IPM.Common + +Class Test.PM.Integration.StaticFileExport Extends Test.PM.Integration.Base +{ + +Method TestWSGIApp() +{ + Set tSC = $$$OK + Try { + Set tTestRoot = ##class(%File).NormalizeDirectory($Get(^UnitTestRoot)) + set tModuleDir = ##class(%File).NormalizeDirectory(##class(%File).GetDirectory(tTestRoot)_"/_data/static-file-export-test/") + Set tSC = ##class(%IPM.Main).Shell("load -verbose " _ tModuleDir) + Do $$$AssertStatusOK(tSC,"Module successfully. " _ tModuleDir) + Set exportDir = ##class(%File).NormalizeDirectory($$$FileTempDirSys) + Set tSC = ##class(%IPM.Main).Shell("static-file-export-test package -DPath="_exportDir) + Do $$$AssertStatusOK(tSC,"Exported to directory " _ exportDir _ " successfully.") + Do $$$AssertTrue(##class(%File).DirectoryExists(exportDir)) + For file = "LICENSE","README.md","requirements.txt" { + Set tFile = ##class(%File).NormalizeFilename(file, exportDir) + If '$$$AssertTrue(##class(%File).Exists(tFile)) { + Do $$$LogMessage("File "_tFile_" does not exist.") + } + } + } Catch e { + Do $$$AssertStatusOK(e.AsStatus(), "An exception occurred.") + } +} + +} diff --git a/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/LICENSE b/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/LICENSE new file mode 100644 index 00000000..8e7b50d6 --- /dev/null +++ b/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/LICENSE @@ -0,0 +1 @@ +This is a license \ No newline at end of file diff --git a/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/README.md b/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/README.md new file mode 100644 index 00000000..1e6db8dd --- /dev/null +++ b/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/README.md @@ -0,0 +1 @@ +This is a readme \ No newline at end of file diff --git a/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/module.xml b/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/module.xml new file mode 100644 index 00000000..fb7010ba --- /dev/null +++ b/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/module.xml @@ -0,0 +1,12 @@ + + + + + static-file-export-test + 1.0.0 + Test whether static files (readme.md, licence, requirements.txt) are properly exported + module + Module installed successfully! + + + diff --git a/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/requirements.txt b/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/requirements.txt new file mode 100644 index 00000000..663bd1f6 --- /dev/null +++ b/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/requirements.txt @@ -0,0 +1 @@ +requests \ No newline at end of file From 94ecc8338feb9451dd9fdac87cb712c3131d1c0e Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Mon, 6 Jan 2025 10:33:16 -0500 Subject: [PATCH 26/51] chore: update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1c2ab57..946ad75d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased - 0.9.2+snapshot] +### Fixed +- #680 Always export static files (README.md, LICENSE, requirements.txt) if existent + ## [0.9.1] - 2024-12-18 ### Added From f8a470998d0605d5326fd81fe1232589e41a9683 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Mon, 6 Jan 2025 10:46:41 -0500 Subject: [PATCH 27/51] fix: convert namespaces to uppercase for `enable` and `unmap` --- CHANGELOG.md | 5 +++++ src/cls/IPM/Main.cls | 2 ++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1c2ab57..84d7ae21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased - 0.9.2+snapshot] +### Fixed +- #681 Convert specified namespaces to upper case for `enable` and `unmap` commands. + ## [0.9.1] - 2024-12-18 ### Added diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index e478bfb7..5c79cfb5 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -2871,6 +2871,7 @@ ClassMethod EnableIPM(ByRef pCommandInfo) Set localOnly = $$$HasModifier(pCommandInfo, "local-only") Set version = $$$GetModifier(pCommandInfo, "version") Set namespaces = $$$GetModifier(pCommandInfo, "namespaces") + Set namespaces = $$$ucase(namespaces) Set allowUpgrade = $$$HasModifier(pCommandInfo,"allow-upgrade") Set mapRepos = $$$HasModifier(pCommandInfo,"repos") Set useLocal = 1 // var to store the final decision of whether to use local manifest or get from server @@ -3206,6 +3207,7 @@ ClassMethod UnmapIPM(ByRef pCommandInfo) { Set globally = $$$HasModifier(pCommandInfo,"globally") Set namespaces = $ListFromString($$$GetModifier(pCommandInfo,"namespaces"), ",") + Set namespaces = $$$ucase(namespaces) Set verbose = '$$$HasModifier(pCommandInfo,"quiet") set reposOnly = $$$HasModifier(pCommandInfo,"repos-only") // Sanity check From dce50aeb560ae87f404afa050aa686f39f15e8ed Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Mon, 6 Jan 2025 12:46:27 -0500 Subject: [PATCH 28/51] fix: fix small typo when outputing mapping info --- src/cls/IPM/Main.cls | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index e478bfb7..59405555 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -2930,11 +2930,11 @@ ClassMethod EnableIPM(ByRef pCommandInfo) Continue } If 'quiet { - Write !,"Mapping %IPM package in "_namespace_" equivalently to "_initNamespace + Write !,"Mapping %IPM package in "_initNamespace_" equivalently to "_namespace } $$$ThrowOnError(##class(%IPM.Utils.Build).MapPackageEquivalently("%IPM",initNamespace,namespace)) If 'quiet { - Write !,"Mapping %IPM.* routines in "_namespace_" equivalently to "_initNamespace + Write !,"Mapping %IPM.* routines in "_initNamespace_" equivalently to "_namespace } $$$ThrowOnError(##class(%IPM.Utils.Build).MapRoutineEquivalently("%IPM.*",initNamespace,,namespace)) } @@ -2966,7 +2966,7 @@ ClassMethod EnableIPM(ByRef pCommandInfo) Continue } If 'quiet { - Write !,"Mapping IPM repository in "_namespace_" equivalently to "_initNamespace + Write !,"Mapping IPM repository in "_initNamespace_" equivalently to "_namespace } For suffix = "D", "S", "I" { $$$ThrowOnError(##class(%IPM.Utils.Build).MapGlobalEquivalently("IPM.Repo.Definition"_suffix, initNamespace, namespace)) From dc47672f89e2c70b4b3b7eaed24fcf358ad3e11e Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Mon, 6 Jan 2025 12:47:36 -0500 Subject: [PATCH 29/51] fix: allow specifying remote instead of using publish server on `enable` --- src/cls/IPM/Main.cls | 18 ++++++++++-------- src/cls/IPM/Repo/Definition.cls | 25 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index 59405555..697a53e4 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -655,6 +655,7 @@ generate /my/path -export 00000,PacketName2,IgnorePacket2^00000,PacketName3,Igno + @@ -662,16 +663,16 @@ generate /my/path -export 00000,PacketName2,IgnorePacket2^00000,PacketName3,Igno enable -map -globally - - enable -v 0.3.4 -q -ns NS1,NS2,NS3 + + enable -v 0.3.4 -q -ns NS1,NS2,NS3 -remote registry - + enable -globally - + enable -v latest -globally - + enable -v latest -allow-upgrade NS1,NS2,NS3 @@ -2873,6 +2874,7 @@ ClassMethod EnableIPM(ByRef pCommandInfo) Set namespaces = $$$GetModifier(pCommandInfo, "namespaces") Set allowUpgrade = $$$HasModifier(pCommandInfo,"allow-upgrade") Set mapRepos = $$$HasModifier(pCommandInfo,"repos") + Set remoteName = $$$GetModifier(pCommandInfo,"remote") Set useLocal = 1 // var to store the final decision of whether to use local manifest or get from server Set targetVersion = "" // var to store the final version of IPM to be installed Kill targetNamespaces // multi-dim array to store the final namespaces that need to install IPM @@ -3056,7 +3058,7 @@ ClassMethod EnableIPM(ByRef pCommandInfo) Set localIPMCount = $Get(menuList, 0) If 'localOnly { // Add remote version options to menuList - Set server = ##class(%IPM.Repo.Remote.Definition).DeploymentServerOpen(1,,.sc) + Set server = ##class(%IPM.Repo.Remote.Definition).GetOne(remoteName, .sc) $$$ThrowOnError(sc) If $IsObject(server) { Set latestVersion = server.GetPackageService().GetLatestModuleVersion($$$IPMModuleName) @@ -3127,7 +3129,7 @@ ClassMethod EnableIPM(ByRef pCommandInfo) // 4. Now that we got all the namespaces that need to install IPM, do the actual installation If 'useLocal { - Set server = ##class(%IPM.Repo.Remote.Definition).DeploymentServerOpen(1,,.sc) + Set server = ##class(%IPM.Repo.Remote.Definition).GetOne(remoteName, .sc) $$$ThrowOnError(sc) If $IsObject(server) { Set packageService = server.GetPackageService() @@ -3136,7 +3138,7 @@ ClassMethod EnableIPM(ByRef pCommandInfo) Set ipmRef.Name = $$$IPMModuleName If (targetVersion = "latest") { // convert latest to semantic version so that it can be undestood by ModuleInfo class - Set server = ##class(%IPM.Repo.Remote.Definition).DeploymentServerOpen(1,,.sc) + Set server = ##class(%IPM.Repo.Remote.Definition).GetOne(remoteName, .sc) $$$ThrowOnError(sc) If $IsObject(server) { Set targetVersion = server.GetPackageService().GetLatestModuleVersion($$$IPMModuleName) diff --git a/src/cls/IPM/Repo/Definition.cls b/src/cls/IPM/Repo/Definition.cls index 3d32c0a6..b36265d7 100644 --- a/src/cls/IPM/Repo/Definition.cls +++ b/src/cls/IPM/Repo/Definition.cls @@ -211,6 +211,31 @@ SELECT Name FROM %IPM_Repo.Definition ORDER BY %IPM_Repo.Definition_SortOrder(ID) DESC } +/// If a name is provided, return the repo of this type with the name +/// Otherwise, return the only repo of this type in the system +/// If there are multiple repos (or no repos) of this type, return an error +ClassMethod GetOne(name As %String = "", Output sc As %Status) As %IPM.Repo.Definition +{ + If $Get(name) '= "" { + Quit ..ServerDefinitionKeyOpen(name, , .sc) + } + Set fst = $PIECE($classname(), ".", 1, *-1) + Set scd = $PIECE($classname(), ".", *) + Set tablename = $Replace(fst, ".", "_")_"."_scd + Set query = "SELECT id FROM " _ tablename // should be safe from SQL injection, since $classname() is safe + Set rs = ##class(%SQL.Statement).%ExecDirect(, query) + $$$ThrowSQLIfError(rs.%SQLCODE, rs.%Message) + Set list = "" + While rs.%Next() { + Set list = list _ $lb(rs.%Get("id")) + } + If $ListLength(list) = 1 { + Quit ..%OpenId($ListGet(list, 1), , .sc) + } + Set sc = $$$ERROR($$$GeneralError, "Unable to find a unique repo of type " _ $CLASSNAME()) + Quit "" +} + Storage Default { From 511d1b96d6a7ba4d8c538b6e8d23814bb8e25934 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Mon, 6 Jan 2025 12:48:12 -0500 Subject: [PATCH 30/51] fix: test existence of /lib/ipm before running file query --- src/cls/IPM/Main.cls | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index 697a53e4..9b99deec 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -2996,23 +2996,25 @@ ClassMethod EnableIPM(ByRef pCommandInfo) Set sc = statement.%PrepareClassQuery("%File", "FileSet") $$$ThrowOnError(sc) // Valid IPM installation manifest should be of format: ipm-0.0.1.xml - Set resultSet = statement.%Execute(XMLDir, "ipm-*.xml") - If (resultSet.%SQLCODE < 0) { - $$$ThrowSQLIfError(resultSet.%SQLCODE,resultSet.%Message) - } - Kill ipmLocalArray // multi-dim array to store local ipm manifests; ipmLocalArray()= - Kill menuList // menu to let user choose which version of local ipm to install (if not in quiet mode and no version is specified) - While resultSet.%Next(.sc) { - $$$ThrowOnError(sc) - Set fileName = resultSet.%Get("Name") - If (resultSet.%Get("Type") = "F") { - // get the exact version string from filename - Set exactIPMVer = $Piece($Piece(fileName, "ipm-", 2, *), ".xml", 1, *-1) - Set ipmLocalArray(exactIPMVer) = fileName - Set menuList($Increment(menuList)) = exactIPMVer_" (local version)" + If ##class(%File).DirectoryExists(XMLDir) { + Set resultSet = statement.%Execute(XMLDir, "ipm-*.xml") + If (resultSet.%SQLCODE < 0) { + $$$ThrowSQLIfError(resultSet.%SQLCODE,resultSet.%Message) + } + Kill ipmLocalArray // multi-dim array to store local ipm manifests; ipmLocalArray()= + Kill menuList // menu to let user choose which version of local ipm to install (if not in quiet mode and no version is specified) + While resultSet.%Next(.sc) { + $$$ThrowOnError(sc) + Set fileName = resultSet.%Get("Name") + If (resultSet.%Get("Type") = "F") { + // get the exact version string from filename + Set exactIPMVer = $Piece($Piece(fileName, "ipm-", 2, *), ".xml", 1, *-1) + Set ipmLocalArray(exactIPMVer) = fileName + Set menuList($Increment(menuList)) = exactIPMVer_" (local version)" + } } + $$$ThrowOnError(sc) } - $$$ThrowOnError(sc) If ('$DATA(menuList) && localOnly) { $$$ThrowOnError($$$ERROR($$$GeneralError,"No ipm-.xml installer file is found locally in directory: "__XMLDir)) From b2d7f7aad7e00046c64d93ad520a245417a261ae Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Mon, 6 Jan 2025 13:28:02 -0500 Subject: [PATCH 31/51] refactor: use macros to get table name of class --- src/cls/IPM/Repo/Definition.cls | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cls/IPM/Repo/Definition.cls b/src/cls/IPM/Repo/Definition.cls index b36265d7..172d77f3 100644 --- a/src/cls/IPM/Repo/Definition.cls +++ b/src/cls/IPM/Repo/Definition.cls @@ -219,9 +219,7 @@ ClassMethod GetOne(name As %String = "", Output sc As %Status) As %IPM.Repo.Defi If $Get(name) '= "" { Quit ..ServerDefinitionKeyOpen(name, , .sc) } - Set fst = $PIECE($classname(), ".", 1, *-1) - Set scd = $PIECE($classname(), ".", *) - Set tablename = $Replace(fst, ".", "_")_"."_scd + Set tablename = $$$comClassKeyGet($classname(), $$$cCLASSsqlqualifiednameQ) Set query = "SELECT id FROM " _ tablename // should be safe from SQL injection, since $classname() is safe Set rs = ##class(%SQL.Statement).%ExecDirect(, query) $$$ThrowSQLIfError(rs.%SQLCODE, rs.%Message) From 3683bd03d8067305c27b035c2c1a96f3afb3f8f9 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Mon, 6 Jan 2025 13:42:00 -0500 Subject: [PATCH 32/51] chore: update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3c31708..c9604e65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased - 0.9.2+snapshot] ### Fixed +- #682 When enabling IPM in a namespace using local IPM caches, check for existence of `/lib/ipm/` beforing querying it. +- #682 Use more standard wording of mapping when enabling IPM - #681 Convert specified namespaces to upper case for `enable` and `unmap` commands. - #680 Always export static files (README.md, LICENSE, requirements.txt) if existent +### Changed +- #682 When downloading IPM via the `enable` command from a remote registry, allow user to pass in the registry name (or get the only existent one), instead of the deployment enabled registry. + ## [0.9.1] - 2024-12-18 ### Added From 6e8e96a216761e4e2301d48c0546093692c2710c Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Mon, 6 Jan 2025 14:27:32 -0500 Subject: [PATCH 33/51] feat: export changelog in addition to readme, license, requirements.txt --- CHANGELOG.md | 2 +- src/cls/IPM/Lifecycle/Base.cls | 1 + .../integration_tests/Test/PM/Integration/StaticFileExport.cls | 2 +- .../PM/Integration/_data/static-file-export-test/CHANGELOG.md | 1 + .../PM/Integration/_data/static-file-export-test/module.xml | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md index d3c31708..194b87aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased - 0.9.2+snapshot] ### Fixed - #681 Convert specified namespaces to upper case for `enable` and `unmap` commands. -- #680 Always export static files (README.md, LICENSE, requirements.txt) if existent +- #680, #683 Always export static files (README.md, LICENSE, requirements.txt, CHANGELOG.md) if existent ## [0.9.1] - 2024-12-18 diff --git a/src/cls/IPM/Lifecycle/Base.cls b/src/cls/IPM/Lifecycle/Base.cls index 0ef7ec56..c0b79868 100644 --- a/src/cls/IPM/Lifecycle/Base.cls +++ b/src/cls/IPM/Lifecycle/Base.cls @@ -1185,6 +1185,7 @@ Method %Export(ByRef pParams, ByRef pTargetDirectory As %String, Output pDepende /// Always keep these files Set staticFiles = $ListBuild( "readme.md", + "changelog.md", "license", "requirements.txt", ) diff --git a/tests/integration_tests/Test/PM/Integration/StaticFileExport.cls b/tests/integration_tests/Test/PM/Integration/StaticFileExport.cls index 382f613a..44e2ce34 100644 --- a/tests/integration_tests/Test/PM/Integration/StaticFileExport.cls +++ b/tests/integration_tests/Test/PM/Integration/StaticFileExport.cls @@ -15,7 +15,7 @@ Method TestWSGIApp() Set tSC = ##class(%IPM.Main).Shell("static-file-export-test package -DPath="_exportDir) Do $$$AssertStatusOK(tSC,"Exported to directory " _ exportDir _ " successfully.") Do $$$AssertTrue(##class(%File).DirectoryExists(exportDir)) - For file = "LICENSE","README.md","requirements.txt" { + For file = "LICENSE","README.md","requirements.txt","CHANGELOG.md" { Set tFile = ##class(%File).NormalizeFilename(file, exportDir) If '$$$AssertTrue(##class(%File).Exists(tFile)) { Do $$$LogMessage("File "_tFile_" does not exist.") diff --git a/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/CHANGELOG.md b/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/CHANGELOG.md new file mode 100644 index 00000000..fd4cc0b0 --- /dev/null +++ b/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/CHANGELOG.md @@ -0,0 +1 @@ +This is a changelog \ No newline at end of file diff --git a/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/module.xml b/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/module.xml index fb7010ba..e9a9bf1b 100644 --- a/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/module.xml +++ b/tests/integration_tests/Test/PM/Integration/_data/static-file-export-test/module.xml @@ -4,7 +4,7 @@ static-file-export-test 1.0.0 - Test whether static files (readme.md, licence, requirements.txt) are properly exported + Test whether static files (readme.md, changelog.md, licence, requirements.txt) are properly exported module Module installed successfully! From 760608d2109aa02bae0d80f61d5b36566df4dccf Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Mon, 6 Jan 2025 14:29:04 -0500 Subject: [PATCH 34/51] style: fix indentation using spaces --- src/cls/IPM/Lifecycle/Base.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cls/IPM/Lifecycle/Base.cls b/src/cls/IPM/Lifecycle/Base.cls index c0b79868..0f2e9c79 100644 --- a/src/cls/IPM/Lifecycle/Base.cls +++ b/src/cls/IPM/Lifecycle/Base.cls @@ -1185,7 +1185,7 @@ Method %Export(ByRef pParams, ByRef pTargetDirectory As %String, Output pDepende /// Always keep these files Set staticFiles = $ListBuild( "readme.md", - "changelog.md", + "changelog.md", "license", "requirements.txt", ) From 9b3fbe25175a4d377a70fefe3aeae97393f969bf Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Mon, 6 Jan 2025 15:40:25 -0500 Subject: [PATCH 35/51] fix: improve banner display in interactive zpm shell --- src/cls/IPM/Main.cls | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index 03a09ec4..62f23238 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -779,10 +779,15 @@ ClassMethod ShellInternal(pCommand As %String, Output pException As %Exception.A Set tOneCommand = 1 } do ##class(%IPM.Main).GetVersion("zpm",.out) + If $Get(out) = "" { + Set registryInfo = $$$FormattedLine($$$Cyan, "No registry configured") + } Else { + Set registryInfo = "Current registry "_$$$FormattedLine($$$Cyan, out) + } Set introMessageList = $ListBuild( "Welcome to the Package Manager Shell (ZPM). Version: "_$$$FormattedLine($$$Green, ..GetVersionModule("zpm")), "Enter q/quit to exit the shell. Enter ?/help to view available commands", - "Current registry "_$$$FormattedLine($$$Cyan,$g(out)) + registryInfo ) Set tInShell = 0 For { @@ -1204,11 +1209,12 @@ ClassMethod GetVersionModule(name, namespace = {$namespace}) { New $Namespace Set $Namespace=namespace - Do ..GetListModules(name,.list) - If $Data(list(name)) { - quit $ListGet(list(name),1) + Try { + Do ..GetListModules(,name,.list) + Return $ListGet(list(1), 2) + } Catch ex { + Return "" } - quit "" } /// @API.Method From 544ad619b9b02b3d066ef0a004b59cbf6012706e Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 7 Jan 2025 09:13:26 -0500 Subject: [PATCH 36/51] chore: add change log entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bff4411..4b36f587 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - #682 When downloading IPM via the `enable` command from a remote registry, allow user to pass in the registry name (or get the only existent one), instead of the deployment enabled registry. ### Fixed +- #684 Fixed banner display issues in interactive `zpm` shell. - #682 When enabling IPM in a namespace using local IPM caches, check for existence of `/lib/ipm/` beforing querying it. - #682 Use more standard wording of mapping when enabling IPM - #681 Convert specified namespaces to upper case for `enable` and `unmap` commands. From 4940f081173743daf377fee6189158e77452c32e Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 7 Jan 2025 09:17:43 -0500 Subject: [PATCH 37/51] ci: add a CI to check for changelog on PR (adapted from v0.7.x branch) --- .github/workflows/changelog.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/changelog.yml diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 00000000..53f8faf6 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,26 @@ +name: Changelog Check + +on: + pull_request: + branches: + - main + - v0.9.x + - v0.10.x + +jobs: + check_changelog: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Check for updated CHANGELOG.md + run: | + git fetch origin ${{ github.event.pull_request.base.ref }} + if git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD | grep -q 'CHANGELOG.md'; then + echo "CHANGELOG.md has been updated." + else + echo "CHANGELOG.md has not been updated." + exit 1 + fi \ No newline at end of file From 721aa1877eb332591c1f765701519a0445f3fae4 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 7 Jan 2025 10:21:58 -0500 Subject: [PATCH 38/51] ci: debug changelog check with rev-parse --- .github/workflows/changelog.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 53f8faf6..62b597f4 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -15,6 +15,13 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Debug git refs + run: | + echo HEAD + git rev-parse HEAD + echo origin/${{ github.event.pull_request.base.ref }} + git rev-parse origin/${{ github.event.pull_request.base.ref }} + - name: Check for updated CHANGELOG.md run: | git fetch origin ${{ github.event.pull_request.base.ref }} From b351f23af2c502d47006703bf2bcfcbc02554723 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 7 Jan 2025 10:28:54 -0500 Subject: [PATCH 39/51] ci: more debugging --- .github/workflows/changelog.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 62b597f4..dbdf638b 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -17,6 +17,7 @@ jobs: - name: Debug git refs run: | + git fetch origin ${{ github.event.pull_request.base.ref }} echo HEAD git rev-parse HEAD echo origin/${{ github.event.pull_request.base.ref }} From 7364bdf29511cd24b9e3b45f700db1969aa87c6f Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 7 Jan 2025 10:55:05 -0500 Subject: [PATCH 40/51] ci: more debugging --- .github/workflows/changelog.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index dbdf638b..e3326ab9 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -18,6 +18,7 @@ jobs: - name: Debug git refs run: | git fetch origin ${{ github.event.pull_request.base.ref }} + git log echo HEAD git rev-parse HEAD echo origin/${{ github.event.pull_request.base.ref }} From 4093aa361004ac742347f3b741750990c9db7334 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 7 Jan 2025 11:02:26 -0500 Subject: [PATCH 41/51] ci: even more debugging --- .github/workflows/changelog.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index e3326ab9..f6c96d05 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -19,6 +19,8 @@ jobs: run: | git fetch origin ${{ github.event.pull_request.base.ref }} git log + echo original HEAD + echo ${{ github.event.pull_request.head.sha }} echo HEAD git rev-parse HEAD echo origin/${{ github.event.pull_request.base.ref }} @@ -27,6 +29,12 @@ jobs: - name: Check for updated CHANGELOG.md run: | git fetch origin ${{ github.event.pull_request.base.ref }} + echo "diffing HEAD" + git diff HEAD + + echo "running git diff between HEAD and target" + git diff origin/${{ github.event.pull_request.base.ref }}...HEAD + if git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD | grep -q 'CHANGELOG.md'; then echo "CHANGELOG.md has been updated." else From 0a0fd7ea21a6e1ddbd5ab984d5d284deb70374e4 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 7 Jan 2025 11:07:26 -0500 Subject: [PATCH 42/51] debug --- .github/workflows/changelog.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index f6c96d05..24ff4a28 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -29,11 +29,10 @@ jobs: - name: Check for updated CHANGELOG.md run: | git fetch origin ${{ github.event.pull_request.base.ref }} - echo "diffing HEAD" - git diff HEAD - - echo "running git diff between HEAD and target" - git diff origin/${{ github.event.pull_request.base.ref }}...HEAD + echo "diffing HEAD and HEAD^1" + git diff HEAD HEAD^1 + echo "diffing HEAD and HEAD^2" + git diff HEAD HEAD^2 if git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD | grep -q 'CHANGELOG.md'; then echo "CHANGELOG.md has been updated." From efcbd7c508304f8d77b797aaa9b22df6770a8fc8 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 7 Jan 2025 13:43:40 -0500 Subject: [PATCH 43/51] ci: fetch all branches and tags during checkout --- .github/workflows/changelog.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 24ff4a28..e51017d5 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -13,7 +13,9 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Debug git refs run: | From d59605619a2c3237e9933fbd690e8de5d54863a3 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 7 Jan 2025 13:52:11 -0500 Subject: [PATCH 44/51] ci: remove debugging code --- .github/workflows/changelog.yml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index e51017d5..e955c23a 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -17,26 +17,11 @@ jobs: with: fetch-depth: 0 - - name: Debug git refs - run: | - git fetch origin ${{ github.event.pull_request.base.ref }} - git log - echo original HEAD - echo ${{ github.event.pull_request.head.sha }} - echo HEAD - git rev-parse HEAD - echo origin/${{ github.event.pull_request.base.ref }} - git rev-parse origin/${{ github.event.pull_request.base.ref }} - - name: Check for updated CHANGELOG.md run: | - git fetch origin ${{ github.event.pull_request.base.ref }} - echo "diffing HEAD and HEAD^1" - git diff HEAD HEAD^1 - echo "diffing HEAD and HEAD^2" - git diff HEAD HEAD^2 - - if git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD | grep -q 'CHANGELOG.md'; then + # actions/checkout@v4 will merge the feature branch into target branch, hence `HEAD` is not the feature head + # While it is probably okay to diff this HEAD against the target branch, we explicitly compare the feature head against the target for readability. + if git diff --name-only ${{ github.event.pull_request.head.sha }}...origin/${{ github.event.pull_request.base.ref }} | grep -q 'CHANGELOG.md'; then echo "CHANGELOG.md has been updated." else echo "CHANGELOG.md has not been updated." From f18a6cae12e55147b8a2d1ee139f3c1d3e8cce33 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 7 Jan 2025 13:57:08 -0500 Subject: [PATCH 45/51] ci: improve error output when CHANGELOG didn't change --- .github/workflows/changelog.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index e955c23a..a0652e99 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -21,9 +21,11 @@ jobs: run: | # actions/checkout@v4 will merge the feature branch into target branch, hence `HEAD` is not the feature head # While it is probably okay to diff this HEAD against the target branch, we explicitly compare the feature head against the target for readability. - if git diff --name-only ${{ github.event.pull_request.head.sha }}...origin/${{ github.event.pull_request.base.ref }} | grep -q 'CHANGELOG.md'; then + if git diff --name-only origin/${{ github.event.pull_request.base.ref }}...${{ github.event.pull_request.head.sha }} | grep -q 'CHANGELOG.md'; then echo "CHANGELOG.md has been updated." else - echo "CHANGELOG.md has not been updated." + echo -e "\033[31mERROR: CHANGELOG.md has NOT been updated\033[0m" + echo "BASE COMMIT: origin/${{ github.event.pull_request.base.sha }}" + echo "HEAD COMMIT: ${{ github.event.pull_request.head.sha }}" exit 1 fi \ No newline at end of file From 24dbd1b3f2a7b09092a15c2fbeb4c147bba5a783 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 7 Jan 2025 13:58:02 -0500 Subject: [PATCH 46/51] style: typo fix --- .github/workflows/changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index a0652e99..7554e74b 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -25,7 +25,7 @@ jobs: echo "CHANGELOG.md has been updated." else echo -e "\033[31mERROR: CHANGELOG.md has NOT been updated\033[0m" - echo "BASE COMMIT: origin/${{ github.event.pull_request.base.sha }}" + echo "BASE COMMIT: ${{ github.event.pull_request.base.sha }}" echo "HEAD COMMIT: ${{ github.event.pull_request.head.sha }}" exit 1 fi \ No newline at end of file From f5329b1c20ddbb7a272cd88f91c2a04bc20cc34c Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Wed, 8 Jan 2025 12:16:20 -0500 Subject: [PATCH 47/51] fix(ci): download legacy artifact from comm. registry instead of github --- .github/workflows/main.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 28e2dcbd..56265896 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -174,15 +174,11 @@ jobs: run: | curl http://localhost:52773/registry/packages/-/all | jq curl http://localhost:52773/registry/packages/zpm/ | jq - ASSET_NAME='zpm-0.7.4.xml' - ASSET_URL=`wget --header "Authorization: token ${GITHUB_TOKEN}" -qO- https://api.github.com/repos/intersystems/ipm/releases | jq -r ".[].assets[] | select(.name == \"${ASSET_NAME}\") | .browser_download_url"` - wget $ASSET_URL -O /tmp/zpm.xml CONTAINER=$(docker run --network zpm --rm -d ${{ steps.image.outputs.name }} ${{ steps.image.outputs.flags }}) - docker cp /tmp/zpm.xml $CONTAINER:/home/irisowner/zpm.xml docker cp tests/migration/v0.7-to-v0.9/. $CONTAINER:/tmp/test-package/ sleep 5; docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh docker exec -i $CONTAINER iris session iris -UUSER << EOF - set sc = ##class(%SYSTEM.OBJ).Load("/home/irisowner/zpm.xml", "ck") + s version="0.7.4" s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/"_version_"/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c") zpm "list":1 zpm "install dsw":1 zpm "repo -r -name registry -url ""http://registry:52773/registry/"" -username admin -password SYS":1 From fc6a542959d0b37a2ce9bb49d949a0f73927801d Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Wed, 8 Jan 2025 17:38:49 -0500 Subject: [PATCH 48/51] refactor: return status instead of boolean on `Publish` --- src/cls/IPM/Lifecycle/Base.cls | 2 +- src/cls/IPM/Repo/IPublishService.cls | 2 +- src/cls/IPM/Repo/Remote/PublishService.cls | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/cls/IPM/Lifecycle/Base.cls b/src/cls/IPM/Lifecycle/Base.cls index 0f2e9c79..38df90f8 100644 --- a/src/cls/IPM/Lifecycle/Base.cls +++ b/src/cls/IPM/Lifecycle/Base.cls @@ -1403,7 +1403,7 @@ Method %Publish(ByRef pParams) As %Status } - Do tPublishClient.PublishModule(tModule) + $$$ThrowOnError(tPublishClient.PublishModule(tModule)) // May need to update the version of the currently-installed module. diff --git a/src/cls/IPM/Repo/IPublishService.cls b/src/cls/IPM/Repo/IPublishService.cls index e2e0a384..acd14e69 100644 --- a/src/cls/IPM/Repo/IPublishService.cls +++ b/src/cls/IPM/Repo/IPublishService.cls @@ -1,7 +1,7 @@ Class %IPM.Repo.IPublishService [ Abstract ] { -Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean [ Abstract ] +Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Status [ Abstract ] { } diff --git a/src/cls/IPM/Repo/Remote/PublishService.cls b/src/cls/IPM/Repo/Remote/PublishService.cls index 7522ed2e..70375246 100644 --- a/src/cls/IPM/Repo/Remote/PublishService.cls +++ b/src/cls/IPM/Repo/Remote/PublishService.cls @@ -1,12 +1,17 @@ Class %IPM.Repo.Remote.PublishService Extends (%IPM.Repo.Remote.PackageService, %IPM.Repo.IPublishService) { -Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean +Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Status { - Quit ..Publish(pModule) + Try { + Do ..Publish(pModule) + } Catch Ex { + Return Ex.AsStatus() + } + Return $$$OK } -Method Publish(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean +Method Publish(pModule As %IPM.Repo.Remote.ModuleInfo) { If ((..Username="") || (..Password="")) && (..Token="") { $$$ThrowStatus($$$ERROR($$$GeneralError, "Publishing module, authorization required.")) @@ -28,7 +33,6 @@ Method Publish(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean $$$ThrowStatus($$$ERROR($$$GeneralError, tMessage)) } } - Return 1 } Method CheckUnpublishEnabled(packageName As %String, packageVersion As %String) As %Boolean From 75e9b5ca9a680235865a7e917d530729f80b631c Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Wed, 8 Jan 2025 17:45:04 -0500 Subject: [PATCH 49/51] chore: update change log This change doesn't affect any functionality in v0.9, but will matter in v0.10 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b36f587..f0021f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - #678 Only update comment-flagged part of the language extension, allowing users to keep their custom code when upgrading - #680, #683 Always export static files (README.md, LICENSE, requirements.txt, CHANGELOG.md) if existent +### Security +- #697 When publishing modules, will get an status with error message (instead of just a boolean) in case of failures. + ## [0.9.1] - 2024-12-18 ### Added From 46a3efb41b16677291dee313dd07805c0ca696b7 Mon Sep 17 00:00:00 2001 From: "Shuheng Liu (InterSystems)" <155992272+isc-shuliu@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:51:11 -0500 Subject: [PATCH 50/51] fix(ci): fix a bug in ci where $system in heredoc is expanded --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 56265896..88209da1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -177,7 +177,7 @@ jobs: CONTAINER=$(docker run --network zpm --rm -d ${{ steps.image.outputs.name }} ${{ steps.image.outputs.flags }}) docker cp tests/migration/v0.7-to-v0.9/. $CONTAINER:/tmp/test-package/ sleep 5; docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh - docker exec -i $CONTAINER iris session iris -UUSER << EOF + docker exec -i $CONTAINER iris session iris -UUSER << 'EOF' s version="0.7.4" s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/"_version_"/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c") zpm "list":1 zpm "install dsw":1 From 4982cc650bfef8577a3a18d9e959b551c2c73ff7 Mon Sep 17 00:00:00 2001 From: "Shuheng Liu (InterSystems)" <155992272+isc-shuliu@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:52:08 -0500 Subject: [PATCH 51/51] chore: update CHANGELOG.md added a dummy new line to make CI pass on PR --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0021f78..808c9c3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,3 +94,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated - #593 CSPApplication is deprecated in favor of WebApplication. User will be warned when installing a package containing CSPApplication. +