Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
- Always set the remote as the upstream branch when pushing (#871)
- Fixed import of HL7 and LUT files added at the same time as their mappings (#864)
- Fixed issue where Git's interactive credential manager causes Git push/pull/fetch to hang (#235)
- Failed deployment of one interoperability production item no longer causes all other production items to fail (#886)

## [2.13.1] - 2025-09-16

Expand Down
6 changes: 5 additions & 1 deletion cls/SourceControl/Git/Production.cls
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,17 @@ ClassMethod ExportPTD(internalName As %String, nameMethod As %String) As %Status
Return sc
}

/// Imports a PTD into a produciton given an external name and produciton name
/// Imports a PTD into a production given an external name and produciton name
ClassMethod ImportPTD(externalName As %String, productionName As %String) As %Status
{
try {
set ^IRIS.Temp("sscProd",$job,"bypassLock") = 1
set rollbackFile = ##class(%File).TempFilename()
set sc = ##class(Ens.Deployment.Deploy).DeployCode(externalName,productionName,0,rollbackFile)
if $$$ISERR(sc) {
set sc2 = ##class(Ens.Deployment.Deploy).ClearDeploymentInProgressFlag()
if $$$ISERR(sc2) set sc = $$$ADDSC(sc, sc2)
}
do ##class(%File).Delete(rollbackFile)
kill ^IRIS.Temp("sscProd",$job,"bypassLock")
} catch err {
Expand Down
25 changes: 24 additions & 1 deletion test/UnitTest/SourceControl/Git/ProductionDecomposition.cls
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Method TestEditProduction()
do $System.OBJ.Delete(..#ProductionName)
$$$ThrowOnError(##class(SourceControl.Git.Utils).NewBranch("branch1"))
$$$ThrowOnError(##class(SourceControl.Git.Production).CreateProduction(..#ProductionName))
do ##class(%Studio.SourceControl.Interface).SourceControlCreate()
do ##class(%Studio.SourceControl.Interface).SourceControlCreate()
$$$ThrowOnError(##class(SourceControl.Git.Utils).AddToSourceControl(..#ProductionName_".cls"))

do $$$LogMessage("with production decomposition enabled, the production class should not be in source control.")
Expand Down Expand Up @@ -99,6 +99,29 @@ Method TestEditProduction()
do $$$AssertEquals(production.Items.GetAt(1).Settings.GetAt(1).Value, 61)
}

Method TestImportItemsWithError()
{
new %SourceControl
do $System.OBJ.Delete(..#ProductionName)
$$$ThrowOnError(##class(SourceControl.Git.Production).CreateProduction(..#ProductionName))
do ##class(Ens.Director).UpdateProduction()
do ##class(%Studio.SourceControl.Interface).SourceControlCreate()
$$$ThrowOnError(%SourceControl.OnBeforeSave(..#ProductionName_".cls"))
do ..ReplaceProductionDefinition("ProductionDefinition3")
do %SourceControl.OnAfterSave(..#ProductionName_".cls")
do $$$AssertTrue(##class(SourceControl.Git.Utils).IsInSourceControl("UnitTest.SampleProduction||ProductionSettings-UnitTest.SampleProduction.PTD"))
$$$ThrowOnError(##class(Ens.Deployment.Deploy).ClearDeploymentInProgressFlag())
// make one of the items fail
set filePath = ##class(SourceControl.Git.Utils).FullExternalName("UnitTest.SampleProduction||Settings-b|EnsLib.SOAP.GenericOperation.PTD")
set filestream = ##class(%Stream.FileCharacter).%OpenId(filePath,,.sc)
$$$ThrowOnError(filestream)
do filestream.Write("this will break the xml")
$$$ThrowOnError(filestream.%Save())
do $$$AssertStatusNotOK(##class(SourceControl.Git.Utils).ImportItem("UnitTest.SampleProduction||Settings-b|EnsLib.SOAP.GenericOperation.PTD"))
/// and this one should succeed, even though the previous one failed
do $$$AssertStatusOK(##class(SourceControl.Git.Utils).ImportItem("UnitTest.SampleProduction||Settings-a|Ens.Activity.Operation.Local.PTD"))
}

ClassMethod ReplaceProductionDefinition(pXDataName)
{
new %SourceControl
Expand Down
Loading