Skip to content

Commit

Permalink
Merge branch 'main' into prod-decomp-unc
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-tleavitt authored Jan 31, 2025
2 parents cf07f64 + 37cacb5 commit fa57544
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- LoadProductionsFromDirectory method to help custom deployment scripts load decomposed productions from the repository (#670)
- Added ability to reset head / revert most recent commit (#586)
- Changes deployed through Git are now logged in a new table SourceControl_Git.DeploymentLog

### Fixed
- Fixed not showing warnings on Studio (#660)
Expand All @@ -19,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved performance of IDE editing and baselining of decomposed productions
- Fixed Discard / Stash not working on deletes (#688)
- Fixed errors deploying decomposed production changes on Windows network drives (#696)
- Improved performance of deploying changes to decomposed production items (#690)

## [2.9.0] - 2025-01-09

Expand Down
44 changes: 44 additions & 0 deletions cls/SourceControl/Git/DeploymentLog.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Class SourceControl.Git.DeploymentLog Extends %Persistent [ Owner = {%Developer} ]
{

Property Token As %String [ InitialExpression = {$System.Util.CreateGUID()} ];

Property StartTimestamp As %TimeStamp;

Property EndTimestamp As %TimeStamp;

Property HeadRevision As %String;

Property Status As %Status;

Storage Default
{
<Data name="DeploymentLogDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Token</Value>
</Value>
<Value name="3">
<Value>StartTimestamp</Value>
</Value>
<Value name="4">
<Value>EndTimestamp</Value>
</Value>
<Value name="5">
<Value>HeadRevision</Value>
</Value>
<Value name="6">
<Value>Status</Value>
</Value>
</Data>
<DataLocation>^SourceContro22B9.DeploymentLogD</DataLocation>
<DefaultData>DeploymentLogDefaultData</DefaultData>
<IdLocation>^SourceContro22B9.DeploymentLogD</IdLocation>
<IndexLocation>^SourceContro22B9.DeploymentLogI</IndexLocation>
<StreamLocation>^SourceContro22B9.DeploymentLogS</StreamLocation>
<Type>%Storage.Persistent</Type>
}

}
31 changes: 23 additions & 8 deletions cls/SourceControl/Git/PullEventHandler.cls
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,29 @@ Method OnPull() As %Status [ Abstract ]
/// <var>pullEventClass</var>: if defined, override the configured pull event class
ClassMethod ForModifications(ByRef files, pullEventClass As %String) As %Status
{
set event = $classmethod(
$select(
$data(pullEventClass)#2: pullEventClass,
1: ##class(SourceControl.Git.Utils).PullEventClass())
,"%New")
set event.LocalRoot = ##class(SourceControl.Git.Utils).TempFolder()
merge event.ModifiedFiles = files
quit event.OnPull()
set st = $$$OK
try {
set log = ##class(SourceControl.Git.DeploymentLog).%New()
set log.HeadRevision = ##class(SourceControl.Git.Utils).GetCurrentRevision()
set log.StartTimestamp = $zdatetime($ztimestamp,3)
set st = log.%Save()
quit:$$$ISERR(st)
set event = $classmethod(
$select(
$data(pullEventClass)#2: pullEventClass,
1: ##class(SourceControl.Git.Utils).PullEventClass())
,"%New")
set event.LocalRoot = ##class(SourceControl.Git.Utils).TempFolder()
merge event.ModifiedFiles = files
set st = event.OnPull()
set log.EndTimestamp = $zdatetime($ztimestamp,3)
set log.Status = st
set st = log.%Save()
quit:$$$ISERR(st)
} catch err {
set st = err.AsStatus()
}
quit st
}

/// <var>InternalName</var> may be a comma-delimited string or $ListBuild list
Expand Down
5 changes: 1 addition & 4 deletions cls/SourceControl/Git/Utils.cls
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ ClassMethod Exists(ByRef pFilename) As %Boolean
Return 0
}

/// Adds this item to the list of items that are tracked by source control
ClassMethod AddToServerSideSourceControl(InternalName As %String) As %Status
{
#dim i as %Integer
Expand All @@ -764,10 +765,6 @@ ClassMethod AddToServerSideSourceControl(InternalName As %String) As %Status
continue
}
set @..#Storage@("items", item) = ""
#dim sc as %Status = ..ImportItem(item, 1)
if 'sc {
set ec = $$$ADDSC(ec, sc)
}
}
quit ec
}
Expand Down

0 comments on commit fa57544

Please sign in to comment.