Skip to content

Commit a42df14

Browse files
authored
Merge branch 'main' into issue-660
2 parents fe469f4 + ea587ed commit a42df14

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111
- Fixed not showing warnings on Studio (#660)
12+
- Fixed business processes and rules not being added to source control automatically (#676)
13+
- Embedded Git commits settings when cloning empty repo to avert any issues
1214

1315
## [2.9.0] - 2025-01-09
1416

cls/SourceControl/Git/Extension.cls

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ Method UserAction(Type As %Integer, Name As %String, InternalName As %String, Se
5959
set filename = ##class(SourceControl.Git.Utils).FullExternalName(.InternalName)
6060
do ##class(SourceControl.Git.Change).GetUncommitted(filename,.tAction)
6161
do ..GetStatus(.InternalName, .isInSourceControl, .isEditable,.isCheckedOut,.userCheckedOut)
62+
63+
// Deal with Business Processes and Rules
64+
// Note: Business Processes and Rules do not have a 'new document' User Action, and thus must be added like this
65+
if (('isInSourceControl)) {
66+
do ..CheckBusinessProcessesAndRules(InternalName)
67+
}
68+
6269
if '$data(tAction) {
6370
set user = "", inNamespace = ""
6471
if 'isEditable || ##class(SourceControl.Git.Utils).Locked() {
@@ -371,6 +378,8 @@ Method OnAfterSave(InternalName As %String, Object As %RegisteredObject = {$$$NU
371378
$$$ThrowOnError(##class(SourceControl.Git.Change).SetUncommitted(filename, "edit", InternalName, $username, "", 1, "", "", 0))
372379
}
373380
}
381+
} else {
382+
do ..CheckBusinessProcessesAndRules(InternalName)
374383
}
375384
}
376385
} catch e {
@@ -535,4 +544,18 @@ Method CheckCommitterIdentity(Settings As SourceControl.Git.Settings, ByRef Acti
535544
return 0
536545
}
537546

547+
/// Deal with Business Processes and Rules
548+
Method CheckBusinessProcessesAndRules(InternalName As %String) As %Status
549+
{
550+
// Note: Business Processes and Rules are not added through normal user action processes because of upstream hook issues,
551+
// so we have to add them like this
552+
if (##class(SourceControl.Git.Utils).Type(InternalName) = "cls") {
553+
set name = $piece(InternalName,".CLS",1)
554+
set exists = ##class(%Dictionary.CompiledClass).%ExistsId(name)
555+
if (exists && ($classmethod(name,"%Extends","Ens.BusinessProcess") || $classmethod(name,"%Extends","Ens.Rule.Definition"))) {
556+
do ..AddToSourceControl(InternalName)
557+
}
558+
}
559+
}
560+
538561
}

cls/SourceControl/Git/Settings.cls

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,15 @@ Method OnAfterConfigure() As %Boolean
448448
$$$ThrowOnError(workMgr.WaitForComplete())
449449
// export settings file without committing
450450
$$$ThrowOnError(..SaveWithSourceControl())
451+
452+
// Empty repo breaks Embedded Git, commit the settings file
453+
do ##class(SourceControl.Git.Utils).RunGitCommandWithInput("log",,.errStream,.outStream)
454+
do errStream.Rewind()
455+
if (errStream.Read() [ "does not have any commits yet") {
456+
w !,"Cloned Empty Repository, committing initial source control settings",!
457+
$$$ThrowOnError(##class(SourceControl.Git.Utils).AddToSourceControl(##class(SourceControl.Git.Settings.Document).#INTERNALNAME))
458+
$$$ThrowOnError(##class(SourceControl.Git.Utils).Commit(##class(SourceControl.Git.Settings.Document).#INTERNALNAME,"initial commit"))
459+
}
451460
}
452461
}
453462
}
227 KB
Loading

docs/production-decomposition.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Production Decomposition
22
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

4+
5+
![Productions in Git](images/production-decomposition.png)
6+
47
## Enabling production decomposition
58
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.
69

0 commit comments

Comments
 (0)