Skip to content

Commit 83f3955

Browse files
authored
Merge pull request #978 from intersystems/fix-deploy-ptd-loads-unrelated
fix: deploying production items no longer tries to load unrelated items
2 parents 1427a53 + 5fd665d commit 83f3955

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- Configure prompt no longer quits out with an unhelpful error if existing boolean settings are null (#962)
2424
- Branch names are now constrained to a reasonable set of allowed characters, fixing an issue where branch names with special characters were hidden without explanation (#914)
2525
- PTD documents that are not decomposed production items may now be added to source control (#965)
26+
- Fixed a bug where interop deployment manager would in some cases fail because it tried to load unrelated items from the repo (#977)
2627

2728
## [2.16.0] - 2026-03-06
2829

‎cls/SourceControl/Git/Production.cls‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ ClassMethod GetModifiedItemsAfterSave(internalName As %String, Output modifiedIt
335335
} else {
336336
// If editing/adding/deleting from Studio, VS Code, or Interop Editor UI, mark all items for edit then find adds/deletes
337337
if source = "IDE" {
338-
// only compile f editing from IDE
338+
// if editing from IDE, compile to populate the Ens_Config.Item tables, but do not trigger source control hooks.
339+
new %SourceControl
339340
$$$ThrowOnError($System.OBJ.Compile(productionName, "ck-d/multicompile=0"))
340341
}
341342
set productionConfig = ##class(Ens.Config.Production).%OpenId(productionName)

‎test/UnitTest/SourceControl/Git/ProductionDecomposition.cls‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,26 @@ Method TestImportItemsWithError()
122122
do $$$AssertStatusOK(##class(SourceControl.Git.Utils).ImportItem("UnitTest.SampleProduction||Settings-a|Ens.Activity.Operation.Local.PTD"))
123123
}
124124

125+
Method TestStrayUncommittedPTDDoesNotBreakSave()
126+
{
127+
new %SourceControl
128+
do $System.OBJ.Delete(..#ProductionName)
129+
$$$ThrowOnError(##class(SourceControl.Git.Production).CreateProduction(..#ProductionName))
130+
do ##class(%Studio.SourceControl.Interface).SourceControlCreate()
131+
132+
do $$$LogMessage("an unrelated non-class PTD left uncommitted in the queue")
133+
do ##class(Ens.Util.ProjectTextDocument).Delete("UnitTest.Git.Demo.PTD")
134+
$$$ThrowOnError(##class(Ens.Util.ProjectTextDocument).Create("plain text not loadable as a class","UnitTest.Git.Demo","stray PTD"))
135+
$$$ThrowOnError(##class(SourceControl.Git.Utils).AddToSourceControl("UnitTest.Git.Demo.PTD"))
136+
// intentionally not committed: it stays in the uncommitted queue that RefreshUncommitted walks
137+
set strayFile = ##class(SourceControl.Git.Utils).FullExternalName("UnitTest.Git.Demo.PTD")
138+
do $$$AssertTrue(##class(SourceControl.Git.Change).IsUncommitted(strayFile))
139+
140+
do $$$LogMessage("saving the decomposed production must succeed despite the stray PTD in the queue")
141+
$$$ThrowOnError(%SourceControl.OnBeforeSave(..#ProductionName_".cls"))
142+
do $$$AssertStatusOK(%SourceControl.OnAfterSave(..#ProductionName_".cls"))
143+
}
144+
125145
/// PTD documents that do not represent decomposed production items may be added to source control as .PTD files
126146
Method TestNonHostPTD()
127147
{

0 commit comments

Comments
 (0)