Skip to content

Commit d1f85bb

Browse files
authored
Merge pull request #696 from intersystems/v0.10.x-fix-publish-doesnt-show-error
fix: fix a bug where errors during publication isn't shown
2 parents 1e46f1b + 0c60a37 commit d1f85bb

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,11 @@ jobs:
187187
run: |
188188
curl http://localhost:52773/registry/packages/-/all | jq
189189
curl http://localhost:52773/registry/packages/zpm/ | jq
190-
ASSET_NAME='zpm-0.7.4.xml'
191-
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"`
192-
wget $ASSET_URL -O /tmp/zpm.xml
193190
CONTAINER=$(docker run --network zpm --rm -d ${{ steps.image.outputs.name }} ${{ steps.image.outputs.flags }})
194-
docker cp /tmp/zpm.xml $CONTAINER:/home/irisowner/zpm.xml
195191
docker cp tests/migration/v0.7-to-v0.9/. $CONTAINER:/tmp/test-package/
196192
sleep 5; docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh
197193
docker exec -i $CONTAINER iris session iris -UUSER << EOF
198-
set sc = ##class(%SYSTEM.OBJ).Load("/home/irisowner/zpm.xml", "ck")
194+
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")
199195
zpm "list":1
200196
zpm "install dsw":1
201197
zpm "repo -r -name registry -url ""http://registry:52773/registry/"" -username admin -password SYS":1

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
### Fixed
2222
- #474: When loading a .tgz/.tar.gz package, automatically locate the top-most module.xml in case there is nested directory structure (e.g., GitHub releases)
2323
- #635: When calling the "package" command, the directory is now normalized to include trailing slash (or backslash).
24+
- #696: Fix a bug that caused error status to be ignored when publishing a module.
2425

2526
### Security
2627
-

src/cls/IPM/Lifecycle/Base.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ Method %Publish(ByRef pParams) As %Status
14071407
}
14081408

14091409

1410-
Do tPublishClient.PublishModule(tModule)
1410+
$$$ThrowOnError(tPublishClient.PublishModule(tModule))
14111411

14121412

14131413
// May need to update the version of the currently-installed module.

src/cls/IPM/Repo/IPublishService.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Class %IPM.Repo.IPublishService [ Abstract ]
22
{
33

4-
Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean [ Abstract ]
4+
Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Status [ Abstract ]
55
{
66
}
77

src/cls/IPM/Repo/Oras/PublishService.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Class %IPM.Repo.Oras.PublishService Extends (%IPM.Repo.Oras.PackageService, %IPM.Repo.IPublishService)
22
{
33

4-
Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean
4+
Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Status
55
{
66
Set status = $$$OK
77
Try {

src/cls/IPM/Repo/Remote/PublishService.cls

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
Class %IPM.Repo.Remote.PublishService Extends (%IPM.Repo.Remote.PackageService, %IPM.Repo.IPublishService)
22
{
33

4-
Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean
4+
Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Status
55
{
6-
Quit ..Publish(pModule)
6+
Try {
7+
Do ..Publish(pModule)
8+
} Catch Ex {
9+
Return Ex.AsStatus()
10+
}
11+
Return $$$OK
712
}
813

9-
Method Publish(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean
14+
Method Publish(pModule As %IPM.Repo.Remote.ModuleInfo)
1015
{
1116
If ((..Username="") || (..Password="")) && (..Token="") {
1217
$$$ThrowStatus($$$ERROR($$$GeneralError, "Publishing module, authorization required."))
@@ -28,7 +33,6 @@ Method Publish(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean
2833
$$$ThrowStatus($$$ERROR($$$GeneralError, tMessage))
2934
}
3035
}
31-
Return 1
3236
}
3337

3438
Method CheckUnpublishEnabled(packageName As %String, packageVersion As %String) As %Boolean

0 commit comments

Comments
 (0)