Skip to content

Commit

Permalink
Merge pull request #696 from intersystems/v0.10.x-fix-publish-doesnt-…
Browse files Browse the repository at this point in the history
…show-error

fix: fix a bug where errors during publication isn't shown
  • Loading branch information
isc-shuliu authored Jan 9, 2025
2 parents 1e46f1b + 0c60a37 commit d1f85bb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- #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)
- #635: When calling the "package" command, the directory is now normalized to include trailing slash (or backslash).
- #696: Fix a bug that caused error status to be ignored when publishing a module.

### Security
-
Expand Down
2 changes: 1 addition & 1 deletion src/cls/IPM/Lifecycle/Base.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,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.
Expand Down
2 changes: 1 addition & 1 deletion src/cls/IPM/Repo/IPublishService.cls
Original file line number Diff line number Diff line change
@@ -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 ]
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/cls/IPM/Repo/Oras/PublishService.cls
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class %IPM.Repo.Oras.PublishService Extends (%IPM.Repo.Oras.PackageService, %IPM.Repo.IPublishService)
{

Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean
Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Status
{
Set status = $$$OK
Try {
Expand Down
12 changes: 8 additions & 4 deletions src/cls/IPM/Repo/Remote/PublishService.cls
Original file line number Diff line number Diff line change
@@ -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."))
Expand All @@ -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
Expand Down

0 comments on commit d1f85bb

Please sign in to comment.