From e5b48e9db8e5a23228a415285e25e1e271641ec3 Mon Sep 17 00:00:00 2001 From: isc-tleavitt <73311181+isc-tleavitt@users.noreply.github.com> Date: Tue, 30 Jan 2024 16:13:01 -0500 Subject: [PATCH] Changes to run properly in act Mounts don't seem to work properly in act, so copying files instead. Fix Default.Document resource processor to not force a category subdirectory --- .github/workflows/main.yml | 24 ++++++++++--------- .vscode/settings.json | 2 +- iris.script | 7 ++++-- src/cls/IPM/Main.cls | 5 +++- .../ResourceProcessor/Default/Document.cls | 6 +++-- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 92b5bbbd..a0d55c29 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -95,17 +95,17 @@ jobs: -e TEST_REGISTRY=http://registry:52773/registry/ \ -e TEST_REGISTRY_USER=admin \ -e TEST_REGISTRY_PASSWORD=SYS \ - -v `pwd`:/home/irisowner/zpm/ \ zpm ${{ steps.image.outputs.flags }} CONTAINER=`docker ps -lq` sleep 5; docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh + docker cp . $CONTAINER:/home/irisowner/zpm/ + echo `docker exec -i --workdir /home/irisowner/zpm/ $CONTAINER ls -rtl` /bin/echo -e '' \ 'zpm "list":1\n' \ - 'zpm "test zpm -v -only":1\n' \ - 'zpm "verify zpm -v -only":1' \ + 'zpm "test zpm -v -only"\n' \ + 'zpm "verify zpm -v -only"\n' \ 'halt\n' \ - | docker exec -i $CONTAINER iris session iris -U%SYS - docker logs $CONTAINER + | docker exec -i $CONTAINER iris session iris -UUSER docker stop $CONTAINER - name: Restart temporary registry timeout-minutes: 15 @@ -124,10 +124,10 @@ jobs: - name: Test and publish to temporary registry timeout-minutes: 15 run: | - docker run --network zpm -d --rm -v `pwd`:/home/irisowner/zpm/ zpm ${{ steps.image.outputs.flags }} \ - --log-driver=none -a stdin -a stdout -a stderr + docker run --network zpm -d --rm zpm ${{ steps.image.outputs.flags }} CONTAINER=`docker ps -lq` sleep 5; docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh + docker cp . $CONTAINER:/home/irisowner/zpm/ /bin/echo -e '' \ 'zpm "repo -r -name registry -url https://pm.community.intersystems.com/":1\n' \ 'zpm "repo -list":1\n' \ @@ -139,7 +139,7 @@ jobs: 'zpm "publish sslclient -v":1' \ 'zpm "search":1' \ 'halt\n' \ - | docker exec -i $CONTAINER iris session iris -U%SYS + | docker exec -i $CONTAINER iris session iris -UUSER docker logs $CONTAINER docker stop $CONTAINER # - name: Clean install current version and test new one. (Permitted to fail on 2023.1+) @@ -163,7 +163,7 @@ jobs: # 'zpm "list":1\n' \ # 'zpm "version":1\n' \ # 'halt\n' \ - # | docker exec -i $CONTAINER iris session iris -U%SYS + # | docker exec -i $CONTAINER iris session iris -UUSER # docker stop $CONTAINER - name: Clean install and test timeout-minutes: 15 @@ -191,6 +191,8 @@ jobs: - name: Stop temporary registry if: always() run: | + CONTAINER=`docker ps -lq` + docker stop $CONTAINER docker stop registry docker network rm zpm - uses: actions/upload-artifact@v3 @@ -240,7 +242,7 @@ jobs: run: | sed -i -E "s/(.*)<\/Version>/${VERSION}<\/Version>/" module.xml cat module.xml - docker run -d --rm -v `pwd`:/home/irisowner/zpm/ containers.intersystems.com/intersystems/${{ needs.prepare.outputs.main }} --check-caps false + docker run -d --rm -v $(pwd):/home/irisowner/zpm/ containers.intersystems.com/intersystems/${{ needs.prepare.outputs.main }} --check-caps false CONTAINER=`docker ps -lq` sleep 5; docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh /bin/echo -e '' \ @@ -249,7 +251,7 @@ jobs: 'zpm "repo -r -name registry -url ""https://pm.community.intersystems.com/"" -username ${{ secrets.REGISTRY_USERNAME }} -password ${{ secrets.REGISTRY_PASSWORD }}":1\n' \ 'zpm "publish zpm -v":1' \ 'halt\n' \ - | docker exec -i $CONTAINER iris session iris -U%SYS + | docker exec -i $CONTAINER iris session iris -UUSER docker stop $CONTAINER - name: Upload Public Release Asset uses: actions/upload-release-asset@v1 diff --git a/.vscode/settings.json b/.vscode/settings.json index 0c52d889..6b0c540f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,7 +5,7 @@ "host": "localhost", "username": "_system", "password": "SYS", - "ns": "%SYS" + "ns": "USER" }, "intersystems.testingManager.client.relativeTestRoot": "tests/unit_tests" } \ No newline at end of file diff --git a/iris.script b/iris.script index e0186071..7bd50301 100644 --- a/iris.script +++ b/iris.script @@ -1,6 +1,9 @@ zn "USER" do $System.OBJ.Load("/home/irisowner/zpm/Installer.cls","ck") do ##class(IPM.Installer).setup("/home/irisowner/zpm/",3) - do ##class(%IPM.Main).Shell("install vscode-per-namespace-settings") - set ^UnitTestRoot="/usr/irissys/.vscode/%SYS/UnitTestRoot" + zpm "repo -n registry -url repo -r -name registry -url https://pm.community.intersystems.com/" halt + + // Currently broken for %IPM due to differing default behavior for packages starting with % - vscode-per-namespace-settings passes through as-is, IPM expects to strip %. + do ##class(%IPM.Main).Shell("install vscode-per-namespace-settings") + set ^UnitTestRoot="/usr/irissys/.vscode/%SYS/UnitTestRoot" \ No newline at end of file diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index a4625f7a..8baac091 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -941,6 +941,10 @@ ClassMethod GetListModules(pNamespace As %String = {$Namespace}, pSearch As %Str Quit } } + If '$$$comClassDefined("%IPM.Storage.ModuleItem") { + // Don't error in namespaces without IPM enabled + Quit + } Set tArgs = 0 Set tQuery = "SELECT Name,VersionString,Description,ExternalName,DeveloperMode FROM %IPM_Storage.ModuleItem" Set pSearch = $ZStrip(pSearch, "<>WC") @@ -2973,4 +2977,3 @@ ClassMethod DisplayModules(ByRef pList, pNumbered As %Boolean = 0, pWithNamespac } } - diff --git a/src/cls/IPM/ResourceProcessor/Default/Document.cls b/src/cls/IPM/ResourceProcessor/Default/Document.cls index f754a516..332e8a2c 100644 --- a/src/cls/IPM/ResourceProcessor/Default/Document.cls +++ b/src/cls/IPM/ResourceProcessor/Default/Document.cls @@ -113,8 +113,10 @@ Method OnPhase(pPhase As %String, ByRef pParams, Output pResourceHandled As %Boo If (##class(%File).DirectoryExists(tResourceCatDirectory)) { Quit } - } - Set tResourceDirectory = tResourceCatDirectory + } + If ##class(%File).DirectoryExists(tResourceCatDirectory) { + Set tResourceDirectory = tResourceCatDirectory + } If tDeveloperMode && (..Extension '= "") && (tName '= "") { Set ^Sources(..Extension,tName_..#NAMEPOSTFIX) = tSourcesPrefix _ tResourceDirectory