Skip to content

Commit 0557e04

Browse files
committed
Merge branch 'main' into production-change-control
2 parents c876c9f + 72663dc commit 0557e04

File tree

8 files changed

+41
-10
lines changed

8 files changed

+41
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [2.5.0] - Unreleased
8+
## [2.5.0] - 2024-09-24
99

1010
### Added
1111
- New UI for the basic mode Sync (#415)
@@ -23,6 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- Pull event handler will attempt compile even if there are failures to load (#457)
2424
- Improved logging in preview and when errors occur via WebSocket commands (#467)
2525
- Fixed pull event handler handling of extremely long class names from diff (#467)
26+
- Fixed Git web UI prompt to update file list when file selected/unselected (#478)
27+
- Fixed folder settings in mappings to be saved and persist (#483)
28+
- Preview on the pull.csp page now shows commits from the correct branch (#490)
2629

2730
## [2.4.1] - 2024-08-02
2831

@@ -171,4 +174,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
171174
- #201: fix behavior with CSP files
172175

173176
## [2.0.1] - 2022-06-02
174-
- Last released version before CHANGELOG existed.
177+
- Last released version before CHANGELOG existed.

cls/SourceControl/Git/Utils.cls

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ ClassMethod NormalizeInternalName(ByRef name As %String, Output fromWebApp As %B
11521152
if (name [ "/") && (type = "csp") {
11531153
set cspFilename = $System.CSP.GetFileName(name)
11541154
if (cspFilename '= "") && (cspFilename [ ..TempFolder()) {
1155-
set name = ..NameToInternalName(cspFilename)
1155+
set name = ..NameToInternalName(cspFilename,,,,0)
11561156
set fromWebApp = 1
11571157
} else {
11581158
kill cspFilename
@@ -2265,7 +2265,7 @@ ClassMethod FileIsMapped(InternalName As %String) As %Boolean
22652265
NameToInternalName(name): given a Unix-style slash path relative to repo root,
22662266
returns the internal name for that file (e.g., cls/SourceControl/Git/Utils.cls -> SourceControl.Git.Utils.CLS)
22672267
*/
2268-
ClassMethod NameToInternalName(Name, IgnorePercent = 1, IgnoreNonexistent = 1, Verbose As %Boolean = 0) As %String
2268+
ClassMethod NameToInternalName(Name, IgnorePercent = 1, IgnoreNonexistent = 1, Verbose As %Boolean = 0, normalize As %Boolean = 1) As %String
22692269
{
22702270
set InternalName=""
22712271
set Deleted = 0
@@ -2284,7 +2284,7 @@ ClassMethod NameToInternalName(Name, IgnorePercent = 1, IgnoreNonexistent = 1, V
22842284
set InternalName = ##class(SourceControl.Git.File).ExternalNameToInternalName(Name)
22852285
if (InternalName '= "") && (context.IsInGitEnabledPackage) {
22862286
// Don't need mappings!
2287-
return ..NormalizeInternalName(InternalName)
2287+
return $select(normalize:..NormalizeInternalName(InternalName),1:InternalName)
22882288
}
22892289
} else {
22902290
// check for file in uncommitted queue
@@ -2427,7 +2427,7 @@ ClassMethod NameToInternalName(Name, IgnorePercent = 1, IgnoreNonexistent = 1, V
24272427
}
24282428
if ((IgnorePercent)&&($extract(InternalName)="%")) { set InternalName = "" } // don't return a result for % items if instructed to ignore them
24292429
if ((IgnoreNonexistent)&&('##class(%RoutineMgr).Exists(InternalName))&&('Deleted)) { set InternalName = "" } // only return item names which exist in the DB
2430-
quit ..NormalizeInternalName(InternalName)
2430+
return $select(normalize:..NormalizeInternalName(InternalName),1:InternalName)
24312431
}
24322432

24332433
ClassMethod OutputConfigureMessage()

cls/_zpkg/isc/sc/git/Socket.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ClassMethod Run()
1616
Write !,"Current branch: ",branchName
1717
Do ##class(SourceControl.Git.Utils).RunGitWithArgs(.errStream, .outStream, "fetch")
1818
Kill errStream, outStream
19-
Do ##class(SourceControl.Git.Utils).RunGitWithArgs(.errStream, .outStream, "log", "HEAD..origin", "--name-status")
19+
Do ##class(SourceControl.Git.Utils).RunGitWithArgs(.errStream, .outStream, "log", "HEAD..origin/"_branchName, "--name-status")
2020
Do ##class(SourceControl.Git.Utils).PrintStreams(errStream, outStream)
2121
If (outStream.Size = 0) && (errStream.Size = 0) {
2222
Write !,"Already up to date."

csp/gitprojectsettings.csp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,13 @@ function toggleNoFolders(e){
689689

690690
$('[id^=noFoldersSwitch]').click(toggleNoFolders);
691691

692+
// Check to persist state of no folder switches
693+
$('.mapping-input-group').children('.voca').each(function(){
694+
var currElement = $(this).children().children(".custom-control").children()[0]
695+
if(!$(currElement).hasClass("active")) {
696+
$(currElement).parent().siblings("#NoFolders")[0].value = "NoFolders";
697+
}
698+
});
692699
</script>
693700
</body>
694701
</html>

docs/testing.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# git-source-control Testing Plan
2+
3+
The following is a testing plan that should be followed prior to release of a new version.
4+
5+
- Using a IRIS user with %All permissions, run `##class(SourceControl.Git.API).Configure()` in a terminal on a fresh namespace. Terminal prompts should describe each setting. Create an SSH key and use it to clone a remote repository.
6+
- The following steps should be run with an IRIS user with %Developer role (not %All).
7+
- Use VS Code to create a new class. Use the Source Control menu to Import All from the repository. Check the output to confirm that the contents of the repository were imported and compiled.
8+
- Test changing Git project settings in a web browser and in Studio. Input labels and tooltips should describe each setting.
9+
- In Expert Mode, test:
10+
- Add a new item through Studio / VS Code. Use the Add option in the Source Control Menu. The item should show up in the Workspace view of the WebUI.
11+
- Stash the item in the WebUI. It should be deleted from IRIS. Pop it from the stash. It should be imported and compiled. Discard the item in the WebUI. It should be deleted from IRIS.
12+
- Add, delete, and modify some items in Studio / VS Code. Commit through the WebUI with a commit message and details. The commit should show with the expected commit message and differences in the branch view.
13+
- Select the branch in the branch view and click "Push Branch". It should successfully push changes to the remote repository.
14+
- Create a new local branch. Add a new item and commit it. Switch between the new branch and the old branch. The item should be added and deleted from IRIS. Test merging the new branch to the old branch in the web UI. The item should be added to IRIS.
15+
- Edit a file on the remote repository. Use the "Git Pull" link from the System Management Portal favorites to pull. The preview should show the change without actually pulling it or loading it into IRIS. Confirming should do the pull and load the change into IRIS.
16+
- Edit an item through Studio / VS Code. Log in with a different IRIS user and attempt to edit the same item. The edit should be prohibited. Open the WebUI. The workspace view should list that item and indicate that it is checked out by another user. Stash the item, then try to edit it again. This time the edit should succeed.
17+
- In Basic Mode, test:
18+
- Add, edit, and delete items through Studio / VS Code. Use the Sync option. All changes should be committed and pushed to the remote.
19+
- Add, edit, and delete items on the remote. Add, edit, and delete unrelated items through Studio/VSCode. All changes should be pulled, committed, and pushed.
20+
- Add an item to an interoperability production and sync. Check out a new feature branch. The item should no longer exist in the production. Set the previous branch as the remote merge branch. Sync. The new item should exist in the production.
21+
- Add an item to a production and sync. Check out a new feature branch. The item should no longer exist in the production. Set the previous branch as the remote merge branch. Add a new item to the production. Sync. The production should now have both new items, and the source control output should show it automatically resolved a conflict.

git-webui/release/share/git-webui/webui/js/git-webui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2641,7 +2641,7 @@ webui.NewChangedFilesView = function(workspaceView) {
26412641
}
26422642

26432643
if ($(element).hasClass("other-user") && (selectedItemsFromOtherUser.indexOf(fileName) > -1)) {
2644-
selectedItemsFromOtherUser.splice(selectedItems.indexOf(fileName), 1);
2644+
selectedItemsFromOtherUser.splice(selectedItemsFromOtherUser.indexOf(fileName), 1);
26452645
}
26462646
}
26472647
self.updateButtons();

git-webui/src/share/git-webui/webui/js/git-webui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2641,7 +2641,7 @@ webui.NewChangedFilesView = function(workspaceView) {
26412641
}
26422642

26432643
if ($(element).hasClass("other-user") && (selectedItemsFromOtherUser.indexOf(fileName) > -1)) {
2644-
selectedItemsFromOtherUser.splice(selectedItems.indexOf(fileName), 1);
2644+
selectedItemsFromOtherUser.splice(selectedItemsFromOtherUser.indexOf(fileName), 1);
26452645
}
26462646
}
26472647
self.updateButtons();

module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Document name="git-source-control.ZPM">
44
<Module>
55
<Name>git-source-control</Name>
6-
<Version>2.4.1</Version>
6+
<Version>2.5.0</Version>
77
<Description>Server-side source control extension for use of Git on InterSystems platforms</Description>
88
<Keywords>git source control studio vscode</Keywords>
99
<Packaging>module</Packaging>

0 commit comments

Comments
 (0)