Skip to content

Commit 1f7dd47

Browse files
committed
fix: fixes and updates to embedded git config file
1 parent 6305cc4 commit 1f7dd47

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

cls/SourceControl/Git/Settings.cls

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ Method SaveWithSourceControl() As %Status
8686
set sc = $$$OK
8787
#dim %SourceControl As %Studio.SourceControl.Interface
8888
if '$isobject($get(%SourceControl)) {
89+
new %SourceControl
8990
do ##class(%Studio.SourceControl.Interface).SourceControlCreate($username)
9091
}
9192
set gitDir = ##class(%File).NormalizeDirectory(..namespaceTemp)_".git"
92-
set skipSourceControl = ('##class(%File).DirectoryExists(gitDir) &&
93-
(##class(%Studio.SourceControl.Interface).SourceControlClassGet() = ##class(SourceControl.Git.Extension).%ClassName(1)))
93+
set skipSourceControl = '##class(%File).DirectoryExists(gitDir)
9494
$$$QuitOnError(..%Save())
9595
set internalName = ##class(SourceControl.Git.Settings.Document).#INTERNALNAME
9696
set settingsDoc = ##class(SourceControl.Git.Settings.Document).%New(internalName)
@@ -104,7 +104,7 @@ Method SaveWithSourceControl() As %Status
104104
$$$QuitOnError(sc)
105105
}
106106
}
107-
if ($IsObject(%SourceControl)) {
107+
if ($IsObject($get(%SourceControl))) {
108108
$$$QuitOnError(%SourceControl.OnAfterSave(internalName))
109109
}
110110
}
@@ -223,6 +223,8 @@ Method ImportDynamicObject(pSettingsDyn As %DynamicObject)
223223
set ..Mappings(k1, k2) = v2.%Get("directory")
224224
if v2.%Get("noFolders") {
225225
set ..Mappings(k1, k2, "NoFolders") = 1
226+
} else {
227+
kill ..Mappings(k1, k2, "NoFolders")
226228
}
227229
}
228230
}

cls/SourceControl/Git/Settings/Document.cls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/// Custom studio document type for git-source-control settings that are controlled by a file
1+
/// Custom studio document type for Embedded Git settings that are controlled by a file
22
Class SourceControl.Git.Settings.Document Extends %Studio.AbstractDocument
33
{
44

55
Projection RegisterExtension As %Projection.StudioDocument(DocumentExtension = "GSC", DocumentNew = 0, DocumentType = "json");
66

7-
Parameter INTERNALNAME = "git-source-control.GSC";
7+
Parameter INTERNALNAME = "embedded-git-config.GSC";
88

9-
Parameter EXTERNALNAME = "git-source-control.json";
9+
Parameter EXTERNALNAME = "embedded-git-config.json";
1010

1111
/// Return 1 if the routine 'name' exists and 0 if it does not.
1212
ClassMethod Exists(name As %String) As %Boolean

docs/production-decomposition.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Production Decomposition
2-
Production Decomposition is a feature of git-source-control that allows multiple developers to edit the same IRIS Interoperability production in the same namespace. In the past, the production class has been an obstacle preventing organizations using multi-user development namespaces from adopting source control. Production Decomposition resolves this by representing the production as a directory of files for each production item that may be edited independently. An uncommitted change to the settings for a single item through the Interoperability Portal will block other users from editing that item while allowing changes to other items in the production.
2+
Production Decomposition is a feature of Embedded Git that allows multiple developers to edit the same IRIS Interoperability production in the same namespace. In the past, the production class has been an obstacle preventing organizations using multi-user development namespaces from adopting source control. Production Decomposition resolves this by representing the production as a directory of files for each production item that may be edited independently. An uncommitted change to the settings for a single item through the Interoperability Portal will block other users from editing that item while allowing changes to other items in the production.
33

44
## Enabling production decomposition
5-
The feature may be enabled by checking the "Decompose Productions" box in the Git Settings page. For deployment of changes to other environments through git to work properly, the value of this setting must match on all namespaces connected to this repository. To assist, settings are automatically exported into a `git-source-control.json` file at the root of the repository that may be committed and imported into other environments.
5+
The feature may be enabled by checking the "Decompose Productions" box in the Git Settings page. For deployment of changes to other environments through git to work properly, the value of this setting must match on all namespaces connected to this repository. To assist, settings are automatically exported into a `embedded-git-config.json` file at the root of the repository that may be committed and imported into other environments.
66

7-
If there are existing productions in the namespace, they should be migrated to the new decomposed format by running `do ##class(SourceControl.Git.API).BaselineProductions()`. You may then use the Git Web UI to view, commit, and push the corresponding changes. This method should be run in a single namespace and then deployed to other namespaces through normal git-source-control deployment mechanisms.
7+
If there are existing productions in the namespace, they should be migrated to the new decomposed format by running `do ##class(SourceControl.Git.API).BaselineProductions()`. You may then use the Git Web UI to view, commit, and push the corresponding changes. This method should be run in a single namespace and then deployed to other namespaces through normal Embedded Git deployment mechanisms.
88

99
## Editing productions in the IDE
1010
There are a couple of limitations related to editing a production class directly in an integrated development environment (Studio or VS Code).

test/UnitTest/SourceControl/Git/Settings.cls

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ Method TestSaveAndImportSettings()
6767
set settings.percentClassReplace = "_"
6868
set settings.decomposeProductions = 1
6969
$$$ThrowOnError(settings.SaveWithSourceControl())
70-
do $$$AssertStatusOK(##class(SourceControl.Git.Utils).AddToSourceControl("git-source-control.GSC"))
70+
do $$$AssertStatusOK(##class(SourceControl.Git.Utils).AddToSourceControl("embedded-git-config.GSC"))
7171
// settings file should be in source control
72-
do $$$AssertTrue(##class(SourceControl.Git.Utils).IsInSourceControl("git-source-control.GSC"))
73-
do $$$AssertEquals($replace(##class(SourceControl.Git.Utils).ExternalName("git-source-control.GSC"),"\","/"),"git-source-control.json")
72+
do $$$AssertTrue(##class(SourceControl.Git.Utils).IsInSourceControl("embedded-git-config.GSC"))
73+
do $$$AssertEquals($replace(##class(SourceControl.Git.Utils).ExternalName("embedded-git-config.GSC"),"\","/"),"embedded-git-config.json")
7474
// commit settings
75-
do $$$AssertStatusOK(##class(SourceControl.Git.Utils).Commit("git-source-control.GSC"))
75+
do $$$AssertStatusOK(##class(SourceControl.Git.Utils).Commit("embedded-git-config.GSC"))
7676
// settings should be in the global
7777
do $$$AssertEquals(^SYS("SourceControl","Git","settings","mappings","CLS","Foo"),"foo/")
7878
do $$$AssertEquals(^SYS("SourceControl","Git","settings","pullEventClass"),"SourceControl.Git.PullEventHandler.Default")
@@ -90,7 +90,7 @@ Method TestSaveAndImportSettings()
9090
do $$$AssertEquals(^SYS("SourceControl","Git","settings","percentClassReplace"),"x")
9191
do $$$AssertEquals(^SYS("SourceControl","Git","settings","decomposeProductions"),"0")
9292
// revert change to settings
93-
do $$$AssertStatusOK(##class(SourceControl.Git.Utils).Revert("git-source-control.GSC"))
93+
do $$$AssertStatusOK(##class(SourceControl.Git.Utils).Revert("embedded-git-config.GSC"))
9494
// old setting should be in the global
9595
do $$$AssertEquals(^SYS("SourceControl","Git","settings","mappings","CLS","Foo"),"foo/")
9696
do $$$AssertEquals(^SYS("SourceControl","Git","settings","pullEventClass"),"SourceControl.Git.PullEventHandler.Default")

0 commit comments

Comments
 (0)