Skip to content

Fix: Export All better handles missing items. #825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Import All now imports configuration file before everything else (#806)
- Fixed another instance of deletes showing as owned by undefined user (#812)
- Fix Revert not syncing files with IRIS (#789)
- Fix "Export All" stopping prematurely because a tracked item no longer exist in the namespace (#821)

## [2.12.2] - 2025-07-08

Expand Down
13 changes: 9 additions & 4 deletions cls/SourceControl/Git/Utils.cls
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ ClassMethod RemoveFromServerSideSourceControl(InternalName As %String) As %Statu

if $data(@..#Storage@("items", item)) {
kill @..#Storage@("items", item)
do ..RemoveRoutineTSH(item)
do ..RemoveFolderIfEmpty(..TempFolder())
} elseif (type = "cls") {
set tsc = ..MakeError(item _ " is not in SourceControl")
Expand Down Expand Up @@ -1567,7 +1568,7 @@ ClassMethod ImportRoutines(force As %Boolean = 0, pullEventClass As %String) As

#dim ec as %Status = ..ListItemsInFiles(.itemList, .err)
quit:'ec ec

// If there is a config file it must be imported before everything else.
if $Data(itemList(##class(SourceControl.Git.Settings.Document).#INTERNALNAME)) {
set sc = ##class(SourceControl.Git.Utils).ImportItem(##class(SourceControl.Git.Settings.Document).#INTERNALNAME, force)
Expand All @@ -1591,10 +1592,10 @@ ClassMethod ImportRoutines(force As %Boolean = 0, pullEventClass As %String) As
for {
set internalName = $order(itemList(internalName))
quit:internalName=""

// Don't import the config file a second time
continue:internalName=##class(SourceControl.Git.Settings.Document).#INTERNALNAME

set context = ##class(SourceControl.Git.PackageManagerContext).ForInternalName(internalName)
continue:context.Package'=refPackage
set doImport = ..IsRoutineOutdated(internalName) || force
Expand Down Expand Up @@ -1720,7 +1721,11 @@ ClassMethod ExportItem(InternalName As %String, expand As %Boolean = 1, force As
write !, "Production decomposition enabled, skipping export of production class"
set filename = ""
} else {
$$$QuitOnError($system.OBJ.ExportUDL(InternalName, filename,"-d/diff"))
set tSC = $SYSTEM.OBJ.ExportUDL(InternalName, filename,"-d/diff")
if $$$ISERR(tSC) {
write !?5, InternalName, " not found. Cleaning up source control."
do ..RemoveFromServerSideSourceControl(InternalName)
}
}
if (filename '= "") && ##class(%File).Exists(filename) {
set filenames($I(filenames)) = filename
Expand Down
Loading