From 6c33880ec61a18c3bfd3418abe19e48ac1fcbf26 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Mon, 26 Mar 2018 23:53:53 +1000 Subject: [PATCH 01/39] export deepsee artefacts now supported --- cls/sc/code.cls | 51 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/cls/sc/code.cls b/cls/sc/code.cls index fe7ec92..2bae178 100644 --- a/cls/sc/code.cls +++ b/cls/sc/code.cls @@ -15,13 +15,6 @@ ClassMethod export(generated = 0, system = 0, percent = 0, mapped = 0, mask = "" #define isPercented(%code) ("%" = $e(%code)) #define isMapped(%code) ##class(%RoutineMgr).IsMapped( %code ) #define log w !, code, " -> ", $piece(filename,..workdir(),2), " " - - #define mkdir(%filename) ##continue - s path = ##class(%File).GetDirectory( %filename ) ##continue - if '##class(%File).DirectoryExists( path ) { ##continue - s sc = ##class(%File).CreateDirectoryChain( path ) ##continue - w !, "mkdir ", path, " ", sc ##continue - } w "#; Exporting to ", ..workdir(),! #; classes @@ -38,7 +31,7 @@ ClassMethod export(generated = 0, system = 0, percent = 0, mapped = 0, mask = "" if ( '$find( code, mask ) ) continue s filename = ..filename( code ) - $$$mkdir( filename ) + do ..mkdir( filename ) $$$log $$$export( code, filename ) @@ -59,7 +52,7 @@ ClassMethod export(generated = 0, system = 0, percent = 0, mapped = 0, mask = "" if ( '$find( code, mask ) ) continue s filename = ..filename( code ) - $$$mkdir( filename ) + do ..mkdir( filename ) $$$log $$$export( code, filename ) @@ -80,7 +73,7 @@ ClassMethod export(generated = 0, system = 0, percent = 0, mapped = 0, mask = "" if ( '$find($zcvt(documentName,"l"), mask ) ) continue if ($L(code,"$TRASH")>1) continue - $$$mkdir( filename ) + do ..mkdir( filename ) if dfi{ $$$log @@ -94,6 +87,9 @@ ClassMethod export(generated = 0, system = 0, percent = 0, mapped = 0, mask = "" } s rs="" + #;DeepSee artefacts + do ..exportDeepSeeArtefacts() + w !,!, "#; Exported to ", ..workdir() Q 1 @@ -157,6 +153,26 @@ ClassMethod import(filemask = "*.xml;*.cls;*.mac;*.int;*.inc;*.dfi", qspec = "ck Q sc } +ClassMethod exportDeepSeeArtefacts() As %Status +{ + set sc = $$$OK + set artefacts = $listbuild("DeepSee.Variables","DeepSee.TermList","DeepSee.CalcMbrs") + + for i=1:1:$listlength(artefacts) + { + set artefact = $list(artefacts,i) + continue:$data(@("^"_artefact))=0 + + set artefact = artefact_".GBL" + set filename = ..filename(artefact) + do ..mkdir(filename) + + set sc = ..fixXMLLine(artefact, filename_".xml") + } + + return sc +} + ClassMethod patch(filename = "", commitFrom = "", commitTo = "") As %Status { s gln = ..gln() @@ -333,11 +349,12 @@ ClassMethod filename(code) s $p(filename,".",*)=ext //B:code="DPRep.Rest.JSON.cls" "L" #; for *.cls Package.Subpackage.ClassName.cls -> Folder/Subfolder/ClassName.cls - if ext ="cls" { + if (ext="cls") || (ext="gbl") { s dirs = $piece( code, ".",1, *-2 ), dirs = $translate( dirs, ".", "/" ) s relpath = dirs _ "/" _ $piece( code, ".", *-1, * ) ; s filename = ##class(%File).NormalizeFilename( relpath, wd ) } + Q filename } @@ -443,5 +460,17 @@ ClassMethod fixDashIntoName() k rs } +ClassMethod mkdir(filename As %String) As %Status +{ + s sc = $$$OK + s path = ##class(%File).GetDirectory(filename) + if '##class(%File).DirectoryExists(path) + { + s sc = ##class(%File).CreateDirectoryChain(path) + w !, "mkdir ", path, " ", sc + } + return sc +} + } From 08b466b6cef5412cd55e66950913ed3913edda1c Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Tue, 27 Mar 2018 01:22:58 +1000 Subject: [PATCH 02/39] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 43f2811..e4ea48c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# cache-udl +# ISC-DEV-IO Export/Import sources in UDL format for [ISC Caché 2016.2](http://www.intersystems.com/our-products/cache/cache-overview/) # Installation From 4db3b485cf3231eda9a5420b6145129729313271 Mon Sep 17 00:00:00 2001 From: Evgeny Shvarov Date: Sat, 31 Mar 2018 11:15:59 +0300 Subject: [PATCH 03/39] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e4ea48c..4a345b4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# ISC-DEV-IO -Export/Import sources in UDL format for [ISC Caché 2016.2](http://www.intersystems.com/our-products/cache/cache-overview/) +# ISC-DEV +Export/Import source code (classes, macro, routines) and DeepSee artefacts(pivots, dashboards) from and to InterSystems Data Platform products(Caché, Ensemble, IRIS). Support versions from 2016.2 # Installation Download code and run From 4dbbd122bfee597391605901b1d41daa823da824 Mon Sep 17 00:00:00 2001 From: Evgeny Shvarov Date: Sat, 31 Mar 2018 11:25:35 +0300 Subject: [PATCH 04/39] Update README.md --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4a345b4..e601ab0 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # ISC-DEV -Export/Import source code (classes, macro, routines) and DeepSee artefacts(pivots, dashboards) from and to InterSystems Data Platform products(Caché, Ensemble, IRIS). Support versions from 2016.2 +Export/Import source code (classes, macro, routines) and DeepSee artefacts(pivots, dashboards, termlists, pivot variables, shared measures) from and to InterSystems Data Platform products(Caché, Ensemble, IRIS). Support versions from 2016.2 # Installation Download code and run ``` -set dir="/dir/cache-udl -do $System.OBJ.ImportDir(dir,"*.xml;*.cls;*.mac;*.int;*.inc;*.dfi","ck",,1) +set dir="/your_download_dir/isc-dev +do $System.OBJ.ImportDir(dir,"*.xml;*.cls;*.mac;*.int;*.inc;*.dfi","cuk",,1) ``` or import the [release](https://github.com/intersystems-ru/cache-udl/releases) to the namespace. @@ -31,10 +31,16 @@ NS> d ##class(sc.code).import() Introduce isc.json file in the source root directory with settings for the code mask, for the name of the project and for get the patch form local git or GitHub. e.g. ``` -"git": 0 - files diff from local git +"git": 0 - files diff from local git (default) "git": 1 - files diff from GitHub +use below params in case of "git" : 1 +"owner": - name of the github e.g. intersystems-community +"repository": - name of the repo e.g. dc-analytics + "user": - user and password for private github repo + "password": ``` + ``` isc.json "compileList": "Classes*.INC,classes*.CLS,*.DFI", @@ -65,6 +71,9 @@ NS> s commitTo = 5 NS> d ##class(sc.code).patch(filename,commitFrom,commitTo) ``` +## Known issues +Be careful with import termlists, pivot variables and shared measures. In current implementation imported artefacts replace those you have in the target namespace. It happens because the utility uses standard global import for globals in XML with $System.OBJ.Import which kills the global first and imports the new one. + From dc53d39903f2a59bdb5d0e5857c94305d7d5ab73 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Mon, 2 Apr 2018 22:44:03 +1000 Subject: [PATCH 05/39] move sc to dev, add deepsee class for check source data --- cls/{sc => dev}/code.cls | 6 +-- cls/dev/deepsee.cls | 70 +++++++++++++++++++++++++++++++ cls/{sc => dev}/diff/gitHub.cls | 4 +- cls/{sc => dev}/diff/gitLocal.cls | 2 +- cls/{sc => dev}/diff/utils.cls | 2 +- 5 files changed, 77 insertions(+), 7 deletions(-) rename cls/{sc => dev}/code.cls (98%) create mode 100644 cls/dev/deepsee.cls rename cls/{sc => dev}/diff/gitHub.cls (98%) rename cls/{sc => dev}/diff/gitLocal.cls (99%) rename cls/{sc => dev}/diff/utils.cls (98%) diff --git a/cls/sc/code.cls b/cls/dev/code.cls similarity index 98% rename from cls/sc/code.cls rename to cls/dev/code.cls index 2bae178..8b4aeba 100644 --- a/cls/sc/code.cls +++ b/cls/dev/code.cls @@ -1,7 +1,7 @@ /// Export different types of modules in different subfolders in UDL (plain) format /// test.dfi -> /dfi/test.dfi /// testpkg.test.cls -> /cls/testpkg/test.cls -Class sc.code [ Abstract ] +Class dev.code [ Abstract ] { /// export all available code @@ -181,7 +181,7 @@ ClassMethod patch(filename = "", commitFrom = "", commitTo = "") As %Status set:commitTo="" commitTo=1 if (git = 0) { set:(commitFrom="")||(commitFrom=1) commitFrom=0 - set sc = ##class(sc.diff.gitLocal).buildDiff(..workdir(), "HEAD~"_commitTo, "HEAD~"_commitFrom, .items) + set sc = ##class(dev.diff.gitLocal).buildDiff(..workdir(), "HEAD~"_commitTo, "HEAD~"_commitFrom, .items) return:$$$ISERR(sc) sc }elseif(git = 1) { set owner = @gln@("owner") @@ -190,7 +190,7 @@ ClassMethod patch(filename = "", commitFrom = "", commitTo = "") As %Status set password = @gln@("password") set:commitFrom="" commitFrom=1 - set sc = ##class(sc.diff.gitHub).Get(.items, owner, repository, user, password, commitFrom, commitTo) + set sc = ##class(dev.diff.gitHub).Get(.items, owner, repository, user, password, commitFrom, commitTo) return:$$$ISERR(sc) sc } diff --git a/cls/dev/deepsee.cls b/cls/dev/deepsee.cls new file mode 100644 index 0000000..f8d5ef4 --- /dev/null +++ b/cls/dev/deepsee.cls @@ -0,0 +1,70 @@ +Class dev.deepsee +{ + +ClassMethod checkDataSource(onlyerror As %Boolean = 1) +{ + set sc = $$$OK + &sql(DECLARE C1 CURSOR FOR SELECT ID into :id FROM %DeepSee_Dashboard.Definition) + &sql(OPEN C1) + &sql(FETCH C1) + WHILE (SQLCODE = 0) + { + set dashbord = ##class(%DeepSee.Dashboard.Definition).%OpenId(id) + + + set widgets = dashbord.widgets + for i=1:1:widgets.Count() + { + set widget = widgets.GetAt(i) + set pivotName = widget.dataSource + set sc = ..getMdx(pivotName, .MDX) + set sc = ..checkPivot(MDX) + + continue:sc&&onlyerror + + w:i=1 dashbord.name,! + w " pivot: ",pivotName," status: "_$select(sc'=1:$System.Status.GetErrorText(sc),1:"OK"),! + } + &sql(FETCH C1) + } + &sql(CLOSE C1) +} + +ClassMethod checkPivot(MDX As %String) As %Status +{ + set sc = $$$OK + set rs = ##class(%DeepSee.ResultSet).%New() + + set sc = rs.%PrepareMDX(MDX) + return:$$$ISERR(sc) sc + + set sc = rs.%ExecuteAsynch() + return:$$$ISERR(sc) sc + + return sc +} + +ClassMethod getMdx(pPivotName As %String, Output MDX) As %Status +{ + #dim tPivot As %DeepSee.Dashboard.Pivot + #dim tPivotTable As %DeepSee.Component.pivotTable + set MDX = "" + + set tPivot = ##class(%DeepSee.UserLibrary.Utils).%OpenFolderItem(pPivotName,.sc) + return:'$IsObject(tPivot) $$$OK + return:$$$ISERR(sc) sc + + set tPivotTable = ##class(%DeepSee.Component.pivotTable).%New() + set sc = tPivot.%CopyToComponent(tPivotTable) + return:$$$ISERR(sc) sc + + set rs = tPivotTable.%CreateResultSet(.sc,,,,.MDX) // returns tQueryText - mdx without filters + return:$$$ISERR(sc) sc + + set MDX = $TR(MDX,$C(10),"") + + return sc +} + +} + diff --git a/cls/sc/diff/gitHub.cls b/cls/dev/diff/gitHub.cls similarity index 98% rename from cls/sc/diff/gitHub.cls rename to cls/dev/diff/gitHub.cls index 48f28c4..4b55178 100644 --- a/cls/sc/diff/gitHub.cls +++ b/cls/dev/diff/gitHub.cls @@ -1,4 +1,4 @@ -Class sc.diff.gitHub +Class dev.diff.gitHub { ClassMethod Get(Output items, Owner As %String = "", Repository As %String = "", Username As %String = "clminstaller", Password As %String = "clminstaller2016", CommitFrom As %Integer = "", CommitTo As %Integer = "") As %Status @@ -66,7 +66,7 @@ ClassMethod GetFileNameForReleaseBySHAs(Request As %Net.HttpRequest, SHAsList, O set fileName = files.GetAt(j).%data("filename") set:$L(fileName,".xml")'=1 fileName = $extract(fileName,1,*-4) continue:..IsCacheFile(fileName)=0 - do ##class(sc.diff.utils).ToCacheName(.fileName) + do ##class(dev.diff.utils).ToCacheName(.fileName) set filesForRelease(fileName) = "" } } diff --git a/cls/sc/diff/gitLocal.cls b/cls/dev/diff/gitLocal.cls similarity index 99% rename from cls/sc/diff/gitLocal.cls rename to cls/dev/diff/gitLocal.cls index 2bfe22b..2371c93 100644 --- a/cls/sc/diff/gitLocal.cls +++ b/cls/dev/diff/gitLocal.cls @@ -1,4 +1,4 @@ -Class sc.diff.gitLocal +Class dev.diff.gitLocal { /// Get diff between two points in repository diff --git a/cls/sc/diff/utils.cls b/cls/dev/diff/utils.cls similarity index 98% rename from cls/sc/diff/utils.cls rename to cls/dev/diff/utils.cls index 58e49f8..75af3eb 100644 --- a/cls/sc/diff/utils.cls +++ b/cls/dev/diff/utils.cls @@ -1,4 +1,4 @@ -Class sc.diff.utils +Class dev.diff.utils { Parameter TRACKEDEXT As List = {$lb("xml", "cls", "csp", "csr", "mac", "int", "bas", "inc", "gbl", "prj", "obj", "pkg", "gof", "dfi", "pivot", "dashboard")}; From a05de72d469861d177463edb2948b9195b1bbe89 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Mon, 2 Apr 2018 22:51:08 +1000 Subject: [PATCH 06/39] move sc to dev --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e601ab0..300851c 100644 --- a/README.md +++ b/README.md @@ -16,15 +16,15 @@ Map sc package to %All namespace to make it visible in any namespace. ## Setup working directory ( optional ) ``` -NS> w ##class(sc.code).workdir("/path/to/your/working/directory/") +NS> w ##class(dev.code).workdir("/path/to/your/working/directory/") ``` ## Export to working directory: ``` -NS> d ##class(sc.code).export() +NS> d ##class(dev.code).export() ``` ## Import: ``` -NS> d ##class(sc.code).import() +NS> d ##class(dev.code).import() ``` ## Compile, Release and Patch: @@ -53,22 +53,22 @@ isc.json ``` Run init method to initialize project settings: ``` -NS> d ##class(sc.code).init() +NS> d ##class(dev.code).init() ``` Then run release to export all the classes in comileList into one "myproject.xml" release file. It will export it into the default for current Namespace directory. ``` -NS> d ##class(sc.code).release() +NS> d ##class(dev.code).release() ``` Or compile it whenever you want to compile all the proejct related resources. ``` -NS> d ##class(sc.code).compile() +NS> d ##class(dev.code).compile() ``` Get last changes from github or local git. Run patch to export the classes in comileList into one "patch.xml" patch file. It will export it into the default for current Namespace directory or you can choose where export. By default, makes a patch from the last commit if you do not specify `commitFrom` and `commitTo` e.g. ``` NS> s filename = "c:\patch.xml" NS> s commitFrom = 1 NS> s commitTo = 5 -NS> d ##class(sc.code).patch(filename,commitFrom,commitTo) +NS> d ##class(dev.code).patch(filename,commitFrom,commitTo) ``` ## Known issues From 6d773426a095c0fd5f9c5b09864e34750ae37638 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Mon, 2 Apr 2018 23:52:42 +1000 Subject: [PATCH 07/39] bug fixed --- cls/dev/deepsee.cls | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cls/dev/deepsee.cls b/cls/dev/deepsee.cls index f8d5ef4..e2420a7 100644 --- a/cls/dev/deepsee.cls +++ b/cls/dev/deepsee.cls @@ -9,21 +9,22 @@ ClassMethod checkDataSource(onlyerror As %Boolean = 1) &sql(FETCH C1) WHILE (SQLCODE = 0) { + set flag = 1 set dashbord = ##class(%DeepSee.Dashboard.Definition).%OpenId(id) - - set widgets = dashbord.widgets + for i=1:1:widgets.Count() { set widget = widgets.GetAt(i) set pivotName = widget.dataSource - set sc = ..getMdx(pivotName, .MDX) - set sc = ..checkPivot(MDX) + set sc = ..GetMdx(pivotName, .MDX) + set sc = ..CheckPivot(MDX) continue:sc&&onlyerror - w:i=1 dashbord.name,! + w:flag=1 dashbord.name,! w " pivot: ",pivotName," status: "_$select(sc'=1:$System.Status.GetErrorText(sc),1:"OK"),! + set flag = 0 } &sql(FETCH C1) } From 43e08462e8f0ebba0ff510e2834f94ae2717eb79 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Mon, 2 Apr 2018 23:55:47 +1000 Subject: [PATCH 08/39] Update deepsee.cls --- cls/dev/deepsee.cls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cls/dev/deepsee.cls b/cls/dev/deepsee.cls index e2420a7..4b0f419 100644 --- a/cls/dev/deepsee.cls +++ b/cls/dev/deepsee.cls @@ -17,8 +17,8 @@ ClassMethod checkDataSource(onlyerror As %Boolean = 1) { set widget = widgets.GetAt(i) set pivotName = widget.dataSource - set sc = ..GetMdx(pivotName, .MDX) - set sc = ..CheckPivot(MDX) + set sc = ..getMdx(pivotName, .MDX) + set sc = ..checkPivot(MDX) continue:sc&&onlyerror From 7abd1b0d96ea08e4aae0dc8ce802eb121b0f50e5 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Fri, 13 Apr 2018 21:13:03 +1000 Subject: [PATCH 09/39] set default setting git = 0, move package name sc to dev --- cls/dev/code.cls | 2 +- cls/dev/diff/gitLocal.cls | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cls/dev/code.cls b/cls/dev/code.cls index 8b4aeba..3ed134b 100644 --- a/cls/dev/code.cls +++ b/cls/dev/code.cls @@ -284,7 +284,7 @@ ClassMethod init(confile = "isc.json") s @gln@("repository")=conf.repository s @gln@("user")=conf.user s @gln@("password")=conf.password - s @gln@("git")=conf.git + s @gln@("git")=$select($data(conf.git):conf.git, 1:0) w "compileList="_conf.compileList,! w "projectName="_conf.projectName,! diff --git a/cls/dev/diff/gitLocal.cls b/cls/dev/diff/gitLocal.cls index 2371c93..b9eb776 100644 --- a/cls/dev/diff/gitLocal.cls +++ b/cls/dev/diff/gitLocal.cls @@ -26,17 +26,17 @@ ClassMethod buildDiff(repo As %String, sha1 As %String, sha2 As %String, Output set element = $piece(diffRaw, $c(10), i) set status = $e($piece(element, $c(9))) set file = $piece(element, $c(9), 2) - + zw file if ($l(file,"src/") < 2) continue - set isRelevantFile = ##class(sc.diff.utils).isRelevantFile(file) + set isRelevantFile = ##class(dev.diff.utils).isRelevantFile(file) if ((element="") || ('isRelevantFile)) continue if $length(element, $c(9))=2 { if ((status="M") || (status="U")) || (status="A") { - do ##class(sc.diff.utils).ToCacheName(.file) + do ##class(dev.diff.utils).ToCacheName(.file) set items(file) = "" } }elseif $length(element, $c(9))=3 @@ -45,7 +45,7 @@ ClassMethod buildDiff(repo As %String, sha1 As %String, sha2 As %String, Output if ($l(file,"src/") < 2) continue if ((status="C") || (status="R")) { - do ##class(sc.diff.utils).ToCacheName(.newFile) + do ##class(dev.diff.utils).ToCacheName(.newFile) set items(file) = "" } } From e1a0373d6d400c84699565f96e0776915360ab1f Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Fri, 13 Apr 2018 22:15:21 +1000 Subject: [PATCH 10/39] Update gitLocal.cls --- cls/dev/diff/gitLocal.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cls/dev/diff/gitLocal.cls b/cls/dev/diff/gitLocal.cls index b9eb776..a49dc85 100644 --- a/cls/dev/diff/gitLocal.cls +++ b/cls/dev/diff/gitLocal.cls @@ -26,7 +26,7 @@ ClassMethod buildDiff(repo As %String, sha1 As %String, sha2 As %String, Output set element = $piece(diffRaw, $c(10), i) set status = $e($piece(element, $c(9))) set file = $piece(element, $c(9), 2) - zw file + if ($l(file,"src/") < 2) continue set isRelevantFile = ##class(dev.diff.utils).isRelevantFile(file) From 7d1aafbbffc39d6c0947494f5e1e70220e3812b8 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Wed, 25 Apr 2018 23:58:24 +1000 Subject: [PATCH 11/39] set setting git=0 --- cls/dev/code.cls | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cls/dev/code.cls b/cls/dev/code.cls index 3ed134b..de77aec 100644 --- a/cls/dev/code.cls +++ b/cls/dev/code.cls @@ -297,6 +297,12 @@ ClassMethod init(confile = "isc.json") quit $$$OK } +ClassMethod initDefaultValue() [ CodeMode = objectgenerator ] +{ + s gln = "^"_%class.Name + s @gln@("git")=0 +} + /// export release file for list and project settings ClassMethod release() { From f4eb2c765707dc1691446ebfca34ddcfd6d2bcb9 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Sat, 5 May 2018 01:35:42 +1000 Subject: [PATCH 12/39] patch bug fixed --- cls/dev/diff/gitLocal.cls | 9 ++++++--- cls/dev/diff/utils.cls | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/cls/dev/diff/gitLocal.cls b/cls/dev/diff/gitLocal.cls index a49dc85..f552be8 100644 --- a/cls/dev/diff/gitLocal.cls +++ b/cls/dev/diff/gitLocal.cls @@ -21,13 +21,16 @@ ClassMethod buildDiff(repo As %String, sha1 As %String, sha2 As %String, Output $$$TOE(sc, ..execute($$$FormatText("git diff --name-status %1 %2 > %3 2>&3", sha1, sha2, tempFile))) $$$TOE(sc, ..fileToString(tempFile, .diffRaw)) + set workdir = ##class(dev.code).workdir() + set path = ##class(dev.diff.utils).getLocalGitPathByWorkdir(workdir) + for i=1:1:$length(diffRaw, $c(10)) { set element = $piece(diffRaw, $c(10), i) set status = $e($piece(element, $c(9))) set file = $piece(element, $c(9), 2) - - if ($l(file,"src/") < 2) continue + + if ($l(file, path) < 2) continue set isRelevantFile = ##class(dev.diff.utils).isRelevantFile(file) if ((element="") || ('isRelevantFile)) continue @@ -42,7 +45,7 @@ ClassMethod buildDiff(repo As %String, sha1 As %String, sha2 As %String, Output }elseif $length(element, $c(9))=3 { set file = $piece(element, $c(9), 3) - if ($l(file,"src/") < 2) continue + if ($l(file, path) < 2) continue if ((status="C") || (status="R")) { do ##class(dev.diff.utils).ToCacheName(.newFile) diff --git a/cls/dev/diff/utils.cls b/cls/dev/diff/utils.cls index 75af3eb..01c9919 100644 --- a/cls/dev/diff/utils.cls +++ b/cls/dev/diff/utils.cls @@ -32,5 +32,26 @@ ClassMethod getExtension(ByRef filename) } } +ClassMethod getLocalGitPathByWorkdir(workdir As %String) As %String +{ + set path = "" + if ($L(workdir,"/") > 1) { + if ($P(workdir,"/",*) = "") { + set path = $P(workdir,"/",*-1) + }else { + set path = $P(workdir,"/",*) + } + + }else { + if ($P(workdir,"\",*) = "") { + set path = $P(workdir,"\",*-1) + }else { + set path = $P(workdir,"\",*) + } + } + + return path_"/" +} + } From 5f4d049eaba854ad8860ea86c2f6761677688d5f Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Tue, 8 May 2018 21:50:08 +1000 Subject: [PATCH 13/39] patch bug fixed --- cls/dev/diff/gitLocal.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cls/dev/diff/gitLocal.cls b/cls/dev/diff/gitLocal.cls index f552be8..bcc4390 100644 --- a/cls/dev/diff/gitLocal.cls +++ b/cls/dev/diff/gitLocal.cls @@ -18,7 +18,7 @@ ClassMethod buildDiff(repo As %String, sha1 As %String, sha2 As %String, Output { $$$TOE(sc, ..createFile(.tempFile)) do $system.Process.CurrentDirectory(repo) - $$$TOE(sc, ..execute($$$FormatText("git diff --name-status %1 %2 > %3 2>&3", sha1, sha2, tempFile))) + $$$TOE(sc, ..execute($$$FormatText("git diff --name-status %1 %2 > %3 2>&1", sha1, sha2, tempFile))) $$$TOE(sc, ..fileToString(tempFile, .diffRaw)) set workdir = ##class(dev.code).workdir() From 48de94ffb05e4effab344db6c83be32136471892 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Sun, 10 Jun 2018 19:49:54 +1000 Subject: [PATCH 14/39] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 300851c..0cee632 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # ISC-DEV + +[![Gitter](https://img.shields.io/badge/chat-on%20telegram-blue.svg)](https://t.me/joinchat/FoZ4MxGETT0_VsVglVl0DA) + Export/Import source code (classes, macro, routines) and DeepSee artefacts(pivots, dashboards, termlists, pivot variables, shared measures) from and to InterSystems Data Platform products(Caché, Ensemble, IRIS). Support versions from 2016.2 # Installation From 6bbc7f85cdacebf832140bf5dac4344144e8d3d3 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Wed, 11 Jul 2018 18:24:20 +1000 Subject: [PATCH 15/39] export gbl bug fixed --- cls/dev/code.cls | 2 +- cls/dev/diff/utils.cls | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cls/dev/code.cls b/cls/dev/code.cls index de77aec..a0a3913 100644 --- a/cls/dev/code.cls +++ b/cls/dev/code.cls @@ -284,7 +284,7 @@ ClassMethod init(confile = "isc.json") s @gln@("repository")=conf.repository s @gln@("user")=conf.user s @gln@("password")=conf.password - s @gln@("git")=$select($data(conf.git):conf.git, 1:0) + s @gln@("git")=conf.git w "compileList="_conf.compileList,! w "projectName="_conf.projectName,! diff --git a/cls/dev/diff/utils.cls b/cls/dev/diff/utils.cls index 01c9919..6f7aba7 100644 --- a/cls/dev/diff/utils.cls +++ b/cls/dev/diff/utils.cls @@ -29,6 +29,8 @@ ClassMethod getExtension(ByRef filename) set filename = $extract(filename,1,*-4)_".DFI" }elseif ($L(filename,"cls/") > 1) { set filename = $extract(filename,1,*-4)_".CLS" + }elseif ($L(filename,"gbl/") > 1) { + set filename = $p($extract(filename,1,*-4)_".GBL","gbl/",2) } } From 9815afad4f95a3dea958b36e4a662315101038e5 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Wed, 11 Jul 2018 19:39:50 +1000 Subject: [PATCH 16/39] bug fixed, add version parameter --- cls/dev/code.cls | 2 ++ cls/dev/diff/utils.cls | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cls/dev/code.cls b/cls/dev/code.cls index a0a3913..3476a9c 100644 --- a/cls/dev/code.cls +++ b/cls/dev/code.cls @@ -4,6 +4,8 @@ Class dev.code [ Abstract ] { +Parameter version = "1.1.0"; + /// export all available code ClassMethod export(generated = 0, system = 0, percent = 0, mapped = 0, mask = "", dfi = 0) { diff --git a/cls/dev/diff/utils.cls b/cls/dev/diff/utils.cls index 6f7aba7..ee83807 100644 --- a/cls/dev/diff/utils.cls +++ b/cls/dev/diff/utils.cls @@ -5,7 +5,7 @@ Parameter TRACKEDEXT As List = {$lb("xml", "cls", "csp", "csr", "mac", "int", "b ClassMethod ToCacheName(ByRef filename) { - do:$L(filename,".xml")>1 ..getExtension(.filename) + do:$L($zcvt(filename,"L"),".xml")>1 ..getExtension(.filename) set str = $Select( $L(filename,"cls/")>1:$Replace($P(filename,"cls/",2),"/","."), $L(filename,"csp/")>1:$Replace($P(filename,"csp/",2),"/","."), From bbab3ecf54c422afe58726b49198e678755f27cc Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Wed, 11 Jul 2018 19:45:55 +1000 Subject: [PATCH 17/39] "add version" fix --- cls/dev/code.cls | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cls/dev/code.cls b/cls/dev/code.cls index 3476a9c..5a82a2c 100644 --- a/cls/dev/code.cls +++ b/cls/dev/code.cls @@ -480,5 +480,10 @@ ClassMethod mkdir(filename As %String) As %Status return sc } +ClassMethod getVersion() [ CodeMode = expression ] +{ +"Version: "_..#version +} + } From a0431d3df8749da4375fdaf0e1ae0f998ab96913 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Wed, 11 Jul 2018 21:10:02 +1000 Subject: [PATCH 18/39] bug fixed --- cls/dev/diff/utils.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cls/dev/diff/utils.cls b/cls/dev/diff/utils.cls index ee83807..2fe1881 100644 --- a/cls/dev/diff/utils.cls +++ b/cls/dev/diff/utils.cls @@ -30,7 +30,7 @@ ClassMethod getExtension(ByRef filename) }elseif ($L(filename,"cls/") > 1) { set filename = $extract(filename,1,*-4)_".CLS" }elseif ($L(filename,"gbl/") > 1) { - set filename = $p($extract(filename,1,*-4)_".GBL","gbl/",2) + set filename = $p($extract(filename,1,*-4),"gbl/",2) } } From 41384bce62a11dfc0ce429322f3f1f1ff305b0f1 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Thu, 19 Jul 2018 14:38:42 +1000 Subject: [PATCH 19/39] The patch export occurs in the default directory --- cls/dev/diff/gitLocal.cls | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cls/dev/diff/gitLocal.cls b/cls/dev/diff/gitLocal.cls index bcc4390..36e2fd7 100644 --- a/cls/dev/diff/gitLocal.cls +++ b/cls/dev/diff/gitLocal.cls @@ -17,6 +17,7 @@ Class dev.diff.gitLocal ClassMethod buildDiff(repo As %String, sha1 As %String, sha2 As %String, Output items) As %Status { $$$TOE(sc, ..createFile(.tempFile)) + set oldDirectory = $system.Process.CurrentDirectory() do $system.Process.CurrentDirectory(repo) $$$TOE(sc, ..execute($$$FormatText("git diff --name-status %1 %2 > %3 2>&1", sha1, sha2, tempFile))) $$$TOE(sc, ..fileToString(tempFile, .diffRaw)) @@ -53,6 +54,7 @@ ClassMethod buildDiff(repo As %String, sha1 As %String, sha2 As %String, Output } } } + do $system.Process.CurrentDirectory(oldDirectory) return sc } From 6d840575472e3dfd097a398b8b4d149ce2b51e1a Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Tue, 31 Jul 2018 22:50:14 +1000 Subject: [PATCH 20/39] [ADD] automatic configuration with isc.json --- cls/dev/code.cls | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/cls/dev/code.cls b/cls/dev/code.cls index 5a82a2c..d35389c 100644 --- a/cls/dev/code.cls +++ b/cls/dev/code.cls @@ -260,7 +260,10 @@ ClassMethod setIgnore(ByRef filtermask) /// get or set working directory for export/import source ClassMethod workdir(workdir) { - s gln = ..gln() s:$d(workdir) @gln = workdir + set:$d(workdir) workdir = ##class(%File).NormalizeDirectory(workdir) + s gln = ..gln() + s:$d(workdir) @gln = workdir + ///zu(12) namespace directory by default #define nsdir $zu(12,"") Q $g(@gln, $$$nsdir) @@ -272,13 +275,17 @@ ClassMethod gln() [ CodeMode = expression, Private ] "^"_$classname() } -ClassMethod init(confile = "isc.json") +ClassMethod init(confile = "isc.json") [ CodeMode = objectgenerator ] { - set stream=##class(%Stream.FileCharacter).%New() - set sc=stream.LinkToFile(..workdir()_"/"_confile) + s:$g(confile)="" confile = "isc.json" + q:..workdir()="" + q:'##class(%File).Exists(..workdir()_confile) $$$OK + + s stream=##class(%Stream.FileCharacter).%New() + s sc=stream.LinkToFile(..workdir()_confile) s conf={}.%FromJSON(stream.Read($$$MaxCacheInt)) - s gln=..gln() + s gln = "^"_%class.Name s @gln@("compileList")=conf.compileList s @gln@("projectName")=conf.projectName @@ -287,6 +294,7 @@ ClassMethod init(confile = "isc.json") s @gln@("user")=conf.user s @gln@("password")=conf.password s @gln@("git")=conf.git + s:@gln@("git")="" @gln@("git")=0 w "compileList="_conf.compileList,! w "projectName="_conf.projectName,! @@ -299,12 +307,6 @@ ClassMethod init(confile = "isc.json") quit $$$OK } -ClassMethod initDefaultValue() [ CodeMode = objectgenerator ] -{ - s gln = "^"_%class.Name - s @gln@("git")=0 -} - /// export release file for list and project settings ClassMethod release() { From bd70e2fd2d9d1dfc2b1e1ad526dc7a98c90eed10 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Tue, 11 Sep 2018 13:01:58 +1000 Subject: [PATCH 21/39] filename bug fixed --- cls/dev/diff/gitLocal.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cls/dev/diff/gitLocal.cls b/cls/dev/diff/gitLocal.cls index 36e2fd7..4df6a54 100644 --- a/cls/dev/diff/gitLocal.cls +++ b/cls/dev/diff/gitLocal.cls @@ -49,7 +49,7 @@ ClassMethod buildDiff(repo As %String, sha1 As %String, sha2 As %String, Output if ($l(file, path) < 2) continue if ((status="C") || (status="R")) { - do ##class(dev.diff.utils).ToCacheName(.newFile) + do ##class(dev.diff.utils).ToCacheName(.file) set items(file) = "" } } From 46d217a3bcde4b8851b769e6664aa2b87d37aedf Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Tue, 2 Oct 2018 22:29:08 +0900 Subject: [PATCH 22/39] isc.json example was added --- isc.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 isc.json diff --git a/isc.json b/isc.json new file mode 100644 index 0000000..99f8aa5 --- /dev/null +++ b/isc.json @@ -0,0 +1,5 @@ +{ + "compileList": "dev*.CLS", + "projectName": "dev", + "git": 0 +} \ No newline at end of file From 13ca0fbbad99d282157929da52767dbd41ae1c42 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Tue, 2 Oct 2018 22:29:41 +0900 Subject: [PATCH 23/39] import bug was fixed --- cls/dev/code.cls | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cls/dev/code.cls b/cls/dev/code.cls index d35389c..d2fa420 100644 --- a/cls/dev/code.cls +++ b/cls/dev/code.cls @@ -275,17 +275,16 @@ ClassMethod gln() [ CodeMode = expression, Private ] "^"_$classname() } -ClassMethod init(confile = "isc.json") [ CodeMode = objectgenerator ] +ClassMethod init(confile = "isc.json") { - s:$g(confile)="" confile = "isc.json" - q:..workdir()="" - q:'##class(%File).Exists(..workdir()_confile) $$$OK + q:..workdir()="" "workdir is empty" + q:'##class(%File).Exists(..workdir()_confile) "configuration file: "_confile_" not found in "_..workdir() s stream=##class(%Stream.FileCharacter).%New() s sc=stream.LinkToFile(..workdir()_confile) s conf={}.%FromJSON(stream.Read($$$MaxCacheInt)) - s gln = "^"_%class.Name + s gln = "^dev.code" s @gln@("compileList")=conf.compileList s @gln@("projectName")=conf.projectName From b6a169c6e8f0f7047fee3d817e19da32798ed77e Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Fri, 14 Dec 2018 00:51:53 +1000 Subject: [PATCH 24/39] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0cee632..82e30da 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Run init method to initialize project settings: ``` NS> d ##class(dev.code).init() ``` -Then run release to export all the classes in comileList into one "myproject.xml" release file. It will export it into the default for current Namespace directory. +Then run release to export all the classes in compileList into one "myproject.xml" release file. It will export it into the default for current Namespace directory. ``` NS> d ##class(dev.code).release() ``` @@ -66,7 +66,7 @@ Or compile it whenever you want to compile all the proejct related resources. ``` NS> d ##class(dev.code).compile() ``` -Get last changes from github or local git. Run patch to export the classes in comileList into one "patch.xml" patch file. It will export it into the default for current Namespace directory or you can choose where export. By default, makes a patch from the last commit if you do not specify `commitFrom` and `commitTo` e.g. +Get last changes from github or local git. Run patch to export the classes in compileList into one "patch.xml" patch file. It will export it into the default for current Namespace directory or you can choose where export. By default, makes a patch from the last commit if you do not specify `commitFrom` and `commitTo` e.g. ``` NS> s filename = "c:\patch.xml" NS> s commitFrom = 1 From 9f80ee65346f8822ac95e4e9b52692ff9549780f Mon Sep 17 00:00:00 2001 From: Evgeny Shvarov Date: Sat, 9 Feb 2019 12:13:47 -0500 Subject: [PATCH 25/39] changes for the development with docker container --- Dockerfile | 20 ++++++++++++++++++++ Installer.cls | 29 +++++++++++++++++++++++++++++ docker-compose.yml | 9 +++++++++ 3 files changed, 58 insertions(+) create mode 100644 Dockerfile create mode 100644 Installer.cls create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e3c65d3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM intersystems/iris:2019.1.0S.111.0 + +WORKDIR /opt/app + +COPY ./Installer.cls ./ +COPY ./cls/ ./src/ + +RUN iris start $ISC_PACKAGE_INSTANCENAME quietly EmergencyId=sys,sys && \ + /bin/echo -e "sys\nsys\n" \ + " Do ##class(Security.Users).UnExpireUserPasswords(\"*\")\n" \ + " Do ##class(Security.Users).AddRoles(\"admin\", \"%ALL\")\n" \ + " Do \$system.OBJ.Load(\"/opt/app/Installer.cls\",\"ck\")\n" \ + " Set sc = ##class(App.Installer).setup(, 3)\n" \ + " If 'sc do \$zu(4, \$JOB, 1)\n" \ + " halt" \ + | iris session $ISC_PACKAGE_INSTANCENAME && \ + /bin/echo -e "sys\nsys\n" \ + | iris stop $ISC_PACKAGE_INSTANCENAME quietly + +CMD [ "-l", "/usr/irissys/mgr/messages.log" ] \ No newline at end of file diff --git a/Installer.cls b/Installer.cls new file mode 100644 index 0000000..c484965 --- /dev/null +++ b/Installer.cls @@ -0,0 +1,29 @@ +Class App.Installer +{ + +XData MyInstall [ XMLNamespace = INSTALLER ] +{ + + + + + + + + + + + + + + + + + +} + +ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 3, pInstaller As %Installer.Installer, pLogger As %Installer.AbstractLogger) As %Status [ CodeMode = objectgenerator, Internal ] +{ + Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "MyInstall") +} +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8aab7e5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '2.4' +services: + iris: + build: . + restart: always + ports: + - 52773:52773 + volumes: + - ~/iris.key:/usr/irissys/mgr/iris.key \ No newline at end of file From c57ea5e47b15c6301f23746edac3d4cd2edf6354 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Tue, 19 Mar 2019 10:46:20 +0900 Subject: [PATCH 26/39] version was updated --- cls/dev/code.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cls/dev/code.cls b/cls/dev/code.cls index d2fa420..9362034 100644 --- a/cls/dev/code.cls +++ b/cls/dev/code.cls @@ -4,7 +4,7 @@ Class dev.code [ Abstract ] { -Parameter version = "1.1.0"; +Parameter version = "1.1.0.2"; /// export all available code ClassMethod export(generated = 0, system = 0, percent = 0, mapped = 0, mask = "", dfi = 0) From ad0bdd0c402f4a410b0ca1e9c5ad5390afe75b8f Mon Sep 17 00:00:00 2001 From: Evgeny Shvarov Date: Sun, 31 Mar 2019 21:37:10 +0300 Subject: [PATCH 27/39] docker ignore added --- .dockerignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6a3e68d --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +**/.DS_Store \ No newline at end of file From 4155ffa2ce3e94a1ded83f9532d3d6e717536e27 Mon Sep 17 00:00:00 2001 From: evgeny Date: Sat, 13 Apr 2019 18:44:23 +0300 Subject: [PATCH 28/39] dockerisation with community edition --- Dockerfile | 4 +++- Dockerfile-CE | 20 ++++++++++++++++++++ cls/dev/diff/utils.cls | 1 - 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 Dockerfile-CE diff --git a/Dockerfile b/Dockerfile index e3c65d3..a666276 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM intersystems/iris:2019.1.0S.111.0 +ARG IMAGE=intersystems/iris:2019.1.0S.111.0 +ARG IMAGE=store/intersystems/iris:2019.1.0.510.0-community +FROM $IMAGE WORKDIR /opt/app diff --git a/Dockerfile-CE b/Dockerfile-CE new file mode 100644 index 0000000..bf78a72 --- /dev/null +++ b/Dockerfile-CE @@ -0,0 +1,20 @@ +FROM store/intersystems/iris:2019.1.0.510.0-community + +WORKDIR /opt/app + +COPY ./Installer.cls ./ +COPY ./cls/ ./src/ + +RUN iris start $ISC_PACKAGE_INSTANCENAME quietly EmergencyId=sys,sys && \ + /bin/echo -e "sys\nsys\n" \ + " Do ##class(Security.Users).UnExpireUserPasswords(\"*\")\n" \ + " Do ##class(Security.Users).AddRoles(\"admin\", \"%ALL\")\n" \ + " Do \$system.OBJ.Load(\"/opt/app/Installer.cls\",\"ck\")\n" \ + " Set sc = ##class(App.Installer).setup(, 3)\n" \ + " If 'sc do \$zu(4, \$JOB, 1)\n" \ + " halt" \ + | iris session $ISC_PACKAGE_INSTANCENAME && \ + /bin/echo -e "sys\nsys\n" \ + | iris stop $ISC_PACKAGE_INSTANCENAME quietly + +CMD [ "-l", "/usr/irissys/mgr/messages.log" ] \ No newline at end of file diff --git a/cls/dev/diff/utils.cls b/cls/dev/diff/utils.cls index 2fe1881..6413ae0 100644 --- a/cls/dev/diff/utils.cls +++ b/cls/dev/diff/utils.cls @@ -56,4 +56,3 @@ ClassMethod getLocalGitPathByWorkdir(workdir As %String) As %String } } - From 85d80624831fa454354f93cf0a5a5123d704f33e Mon Sep 17 00:00:00 2001 From: evgeny Date: Sat, 13 Apr 2019 18:45:07 +0300 Subject: [PATCH 29/39] no need in extra docker file --- Dockerfile-CE | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 Dockerfile-CE diff --git a/Dockerfile-CE b/Dockerfile-CE deleted file mode 100644 index bf78a72..0000000 --- a/Dockerfile-CE +++ /dev/null @@ -1,20 +0,0 @@ -FROM store/intersystems/iris:2019.1.0.510.0-community - -WORKDIR /opt/app - -COPY ./Installer.cls ./ -COPY ./cls/ ./src/ - -RUN iris start $ISC_PACKAGE_INSTANCENAME quietly EmergencyId=sys,sys && \ - /bin/echo -e "sys\nsys\n" \ - " Do ##class(Security.Users).UnExpireUserPasswords(\"*\")\n" \ - " Do ##class(Security.Users).AddRoles(\"admin\", \"%ALL\")\n" \ - " Do \$system.OBJ.Load(\"/opt/app/Installer.cls\",\"ck\")\n" \ - " Set sc = ##class(App.Installer).setup(, 3)\n" \ - " If 'sc do \$zu(4, \$JOB, 1)\n" \ - " halt" \ - | iris session $ISC_PACKAGE_INSTANCENAME && \ - /bin/echo -e "sys\nsys\n" \ - | iris stop $ISC_PACKAGE_INSTANCENAME quietly - -CMD [ "-l", "/usr/irissys/mgr/messages.log" ] \ No newline at end of file From 04950b99c6dcbc1f788af5569ed4d0d9ee586fbe Mon Sep 17 00:00:00 2001 From: Dmitry Maslennikov Date: Wed, 24 Apr 2019 15:46:23 +0300 Subject: [PATCH 30/39] zpm support --- module.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 module.xml diff --git a/module.xml b/module.xml new file mode 100644 index 0000000..91b1f12 --- /dev/null +++ b/module.xml @@ -0,0 +1,11 @@ + + + + + isc-dev + 1.1.0 + module + + + + From cb4699c295fcf2d6f12f4d216b9f3416035c63a4 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Thu, 25 Apr 2019 16:17:52 +0900 Subject: [PATCH 31/39] export only dfi files was added --- cls/dev/code.cls | 13 ++++++++++--- cls/dev/diff/utils.cls | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cls/dev/code.cls b/cls/dev/code.cls index 9362034..bc1232d 100644 --- a/cls/dev/code.cls +++ b/cls/dev/code.cls @@ -63,6 +63,15 @@ ClassMethod export(generated = 0, system = 0, percent = 0, mapped = 0, mask = "" #; dfi + do ..exportDFI(dfi) + + w !,!, "#; Exported to ", ..workdir() + + Q 1 +} + +ClassMethod exportDFI(dfi = 0) As %Status +{ do ..fixDashIntoName() #define export(%code,%file) s sc = ##class(%DeepSee.UserLibrary.Utils).%Export( %code, %file, 0 ) @@ -92,9 +101,7 @@ ClassMethod export(generated = 0, system = 0, percent = 0, mapped = 0, mask = "" #;DeepSee artefacts do ..exportDeepSeeArtefacts() - w !,!, "#; Exported to ", ..workdir() - - Q 1 + return $$$OK } /// import all from workdir diff --git a/cls/dev/diff/utils.cls b/cls/dev/diff/utils.cls index 6413ae0..002603d 100644 --- a/cls/dev/diff/utils.cls +++ b/cls/dev/diff/utils.cls @@ -5,6 +5,7 @@ Parameter TRACKEDEXT As List = {$lb("xml", "cls", "csp", "csr", "mac", "int", "b ClassMethod ToCacheName(ByRef filename) { + if $get(filename)="" break do:$L($zcvt(filename,"L"),".xml")>1 ..getExtension(.filename) set str = $Select( $L(filename,"cls/")>1:$Replace($P(filename,"cls/",2),"/","."), @@ -56,3 +57,4 @@ ClassMethod getLocalGitPathByWorkdir(workdir As %String) As %String } } + From 6bf6f5b4dc39442ce26f761f4f17f0e80671fd27 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Fri, 26 Apr 2019 17:11:00 +1000 Subject: [PATCH 32/39] bug was fixed --- cls/dev/code.cls | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/cls/dev/code.cls b/cls/dev/code.cls index bc1232d..aa7f8b5 100644 --- a/cls/dev/code.cls +++ b/cls/dev/code.cls @@ -7,9 +7,9 @@ Class dev.code [ Abstract ] Parameter version = "1.1.0.2"; /// export all available code -ClassMethod export(generated = 0, system = 0, percent = 0, mapped = 0, mask = "", dfi = 0) +ClassMethod export(mask = "", generated = 0, system = 0, percent = 0, mapped = 0, dfi = 0) { - + #define export(%code, %file) s sc = $system.OBJ.ExportUDL(%code, %file,"/diffexport") ##continue w:sc "Ok" d:'sc $system.OBJ.DisplayError(sc) @@ -63,15 +63,6 @@ ClassMethod export(generated = 0, system = 0, percent = 0, mapped = 0, mask = "" #; dfi - do ..exportDFI(dfi) - - w !,!, "#; Exported to ", ..workdir() - - Q 1 -} - -ClassMethod exportDFI(dfi = 0) As %Status -{ do ..fixDashIntoName() #define export(%code,%file) s sc = ##class(%DeepSee.UserLibrary.Utils).%Export( %code, %file, 0 ) @@ -86,6 +77,11 @@ ClassMethod exportDFI(dfi = 0) As %Status if ($L(code,"$TRASH")>1) continue do ..mkdir( filename ) + if ( 'generated && $$$isGenerated( code ) ) continue + if ( 'percent && $$$isPercented( code ) ) continue + if ( 'mapped && $$$isMapped( code ) ) continue + if ( '$find( code, mask ) ) continue + if dfi{ $$$log $$$export( code, filename) @@ -101,7 +97,9 @@ ClassMethod exportDFI(dfi = 0) As %Status #;DeepSee artefacts do ..exportDeepSeeArtefacts() - return $$$OK + w !,!, "#; Exported to ", ..workdir() + + Q 1 } /// import all from workdir From a92263b743079b9c2a7071ff0aa50072fa337848 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Mon, 29 Apr 2019 15:21:28 +1000 Subject: [PATCH 33/39] bug was fixed --- cls/dev/code.cls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cls/dev/code.cls b/cls/dev/code.cls index aa7f8b5..4a7a8a6 100644 --- a/cls/dev/code.cls +++ b/cls/dev/code.cls @@ -73,14 +73,14 @@ ClassMethod export(mask = "", generated = 0, system = 0, percent = 0, mapped = 0 set filename = ..filename( code_".dfi" ) set documentName = rs.documentName - if ( '$find($zcvt(documentName,"l"), mask ) ) continue + //if ( '$find($zcvt(documentName,"l"), $zcvt(mask,"l") ) ) continue if ($L(code,"$TRASH")>1) continue do ..mkdir( filename ) if ( 'generated && $$$isGenerated( code ) ) continue if ( 'percent && $$$isPercented( code ) ) continue if ( 'mapped && $$$isMapped( code ) ) continue - if ( '$find( code, mask ) ) continue + if ( '$find($zcvt(documentName,"l"), $zcvt(mask,"l") ) ) continue if dfi{ $$$log From 0ebe36bc9725c8e1d70862aff505bf22c9aa2777 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Mon, 29 Apr 2019 17:35:25 +1000 Subject: [PATCH 34/39] masks bug was fixed --- cls/dev/code.cls | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/cls/dev/code.cls b/cls/dev/code.cls index 4a7a8a6..d17a2bd 100644 --- a/cls/dev/code.cls +++ b/cls/dev/code.cls @@ -4,12 +4,11 @@ Class dev.code [ Abstract ] { -Parameter version = "1.1.0.2"; +Parameter version = "1.1.0.4"; /// export all available code ClassMethod export(mask = "", generated = 0, system = 0, percent = 0, mapped = 0, dfi = 0) { - #define export(%code, %file) s sc = $system.OBJ.ExportUDL(%code, %file,"/diffexport") ##continue w:sc "Ok" d:'sc $system.OBJ.DisplayError(sc) @@ -30,7 +29,7 @@ ClassMethod export(mask = "", generated = 0, system = 0, percent = 0, mapped = 0 if ( 'generated && $$$isGenerated( code ) ) continue if ( 'percent && $$$isPercented( code ) ) continue if ( 'mapped && $$$isMapped( code ) ) continue - if ( '$find( code, mask ) ) continue + if ( '..checkMasks( code, mask ) ) continue s filename = ..filename( code ) do ..mkdir( filename ) @@ -51,7 +50,7 @@ ClassMethod export(mask = "", generated = 0, system = 0, percent = 0, mapped = 0 if ( 'generated && $$$isGenerated( code ) ) continue if ( 'percent && $$$isPercented( code ) ) continue if ( 'mapped && $$$isMapped( code ) ) continue - if ( '$find( code, mask ) ) continue + if ( '..checkMasks( code, mask ) ) continue s filename = ..filename( code ) do ..mkdir( filename ) @@ -73,14 +72,14 @@ ClassMethod export(mask = "", generated = 0, system = 0, percent = 0, mapped = 0 set filename = ..filename( code_".dfi" ) set documentName = rs.documentName - //if ( '$find($zcvt(documentName,"l"), $zcvt(mask,"l") ) ) continue if ($L(code,"$TRASH")>1) continue - do ..mkdir( filename ) if ( 'generated && $$$isGenerated( code ) ) continue if ( 'percent && $$$isPercented( code ) ) continue if ( 'mapped && $$$isMapped( code ) ) continue - if ( '$find($zcvt(documentName,"l"), $zcvt(mask,"l") ) ) continue + if ( '..checkMasks(documentName, mask) ) continue + + do ..mkdir( filename ) if dfi{ $$$log @@ -491,5 +490,36 @@ ClassMethod getVersion() [ CodeMode = expression ] "Version: "_..#version } +ClassMethod checkMasks(name As %String, masks As %String) As %Boolean +{ + return:masks="" 1 + return:name="" 0 + + set name = $zcvt(name,"l") + set masks = $zcvt(masks,"l") + + for i=1:1:$l(masks,",") + { + set pattern = "^" + set mask = $p(masks, ",", i) + + for index=1:1:$l(mask) + { + set char = $e(mask, index) + set pattern = pattern _ $case(char, + ".":"\.", + "?":".", + "*":".*", + :char + ) + } + set pattern = pattern _ "$|" + } + set pattern = $e(pattern,1,*-1) + set matcher=##class(%Regex.Matcher).%New(pattern, name) + do matcher.Locate() + return $select(matcher.Group="":0, 1:1) +} + } From ce847a909e91b904aac1638c1e72e16d0330e795 Mon Sep 17 00:00:00 2001 From: Gevorg Arutiunian Date: Sat, 4 May 2019 03:19:35 +1000 Subject: [PATCH 35/39] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 82e30da..1c2b3a5 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,13 @@ NS> d ##class(dev.code).patch(filename,commitFrom,commitTo) ## Known issues Be careful with import termlists, pivot variables and shared measures. In current implementation imported artefacts replace those you have in the target namespace. It happens because the utility uses standard global import for globals in XML with $System.OBJ.Import which kills the global first and imports the new one. +#### If after using the export command, git treats unaltered files as modified, the problem may be in the following: +- When moving sources from one OS to another (f.e. from win to mac), the end of the line character was not taken into account. To fix this, you need to specify git to make the end of line character look the same. + solution: ```git config --global core.autocrlf input``` +- File access rights have been changed. In this case, you will need to specify that you do not want to track these changes. + + solution: ```git config core.filemode false``` From 260f20cfc41c4e2c1aa7c6ca77928fce1754510b Mon Sep 17 00:00:00 2001 From: Evgeny Shvarov Date: Sun, 12 May 2019 12:55:10 +0300 Subject: [PATCH 36/39] Changed the version in a module.xml for ZPM update --- module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module.xml b/module.xml index 91b1f12..830625b 100644 --- a/module.xml +++ b/module.xml @@ -3,7 +3,7 @@ isc-dev - 1.1.0 + 1.2.0 module From 590cfe557b058d6f1fcc430b3c7ffc43bbebe1d1 Mon Sep 17 00:00:00 2001 From: Evgeny Shvarov Date: Sun, 12 May 2019 13:38:23 +0300 Subject: [PATCH 37/39] added zpm support --- Dockerfile | 14 +++++++++++++- docker-compose.yml | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a666276..c3f0b7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ARG IMAGE=intersystems/iris:2019.1.0S.111.0 -ARG IMAGE=store/intersystems/iris:2019.1.0.510.0-community +ARG IMAGE=store/intersystems/iris:2019.1.0.511.0-community FROM $IMAGE WORKDIR /opt/app @@ -7,10 +7,22 @@ WORKDIR /opt/app COPY ./Installer.cls ./ COPY ./cls/ ./src/ +# download ZPM +RUN mkdir -p /tmp/deps \ + + && cd /tmp/deps \ + + && wget -q https://pm.community.intersystems.com/packages/zpm/latest/installer -O zpm.xml + + RUN iris start $ISC_PACKAGE_INSTANCENAME quietly EmergencyId=sys,sys && \ /bin/echo -e "sys\nsys\n" \ " Do ##class(Security.Users).UnExpireUserPasswords(\"*\")\n" \ " Do ##class(Security.Users).AddRoles(\"admin\", \"%ALL\")\n" \ + " do ##class(Security.System).Get(,.p)\n" \ + " set p(\"AutheEnabled\")=\$zb(p(\"AutheEnabled\"),16,7)\n" \ + " do ##class(Security.System).Modify(,.p)\n" \ + " Do \$system.OBJ.Load(\"/tmp/deps/zpm.xml\", \"ck\")" \ " Do \$system.OBJ.Load(\"/opt/app/Installer.cls\",\"ck\")\n" \ " Set sc = ##class(App.Installer).setup(, 3)\n" \ " If 'sc do \$zu(4, \$JOB, 1)\n" \ diff --git a/docker-compose.yml b/docker-compose.yml index 8aab7e5..eada850 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,4 +6,5 @@ services: ports: - 52773:52773 volumes: - - ~/iris.key:/usr/irissys/mgr/iris.key \ No newline at end of file + - ~/iris.key:/usr/irissys/mgr/iris.key + - .:/opt \ No newline at end of file From 314a8a64d8976575144a989405476f7e7465ff35 Mon Sep 17 00:00:00 2001 From: Evgeny Shvarov Date: Sun, 12 May 2019 13:41:04 +0300 Subject: [PATCH 38/39] how to update the package --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 1c2b3a5..57a3b7f 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,19 @@ Be careful with import termlists, pivot variables and shared measures. In curren solution: ```git config core.filemode false``` +## Development + +To update the module in ZPM do the following: +USER> zpm +zpm: USER>load /opt +zpm: USER>repo -n registry -user USER -pass PASSWORD +1) Filesystem +2) Local Cache +3) Remote Repository + +Which sort of repository do you wish to configure? 3 +zpm: USER>module-action isc-dev publish + From 682c748a9cfb9dde64c46fde1cca2b14d9f2fcd4 Mon Sep 17 00:00:00 2001 From: Tom Louie Date: Tue, 17 Sep 2019 08:53:17 -0400 Subject: [PATCH 39/39] Update README.md Fixed typos, trying out commits to my repo --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 57a3b7f..a2da1dd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Gitter](https://img.shields.io/badge/chat-on%20telegram-blue.svg)](https://t.me/joinchat/FoZ4MxGETT0_VsVglVl0DA) -Export/Import source code (classes, macro, routines) and DeepSee artefacts(pivots, dashboards, termlists, pivot variables, shared measures) from and to InterSystems Data Platform products(Caché, Ensemble, IRIS). Support versions from 2016.2 +Export/Import source code (classes, macro, routines) and DeepSee artifacts (pivots, dashboards, termlists, pivot variables, shared measures) from and to InterSystems Data Platform products (Caché, Ensemble, IRIS). Support versions from 2016.2. # Installation Download code and run @@ -13,7 +13,7 @@ do $System.OBJ.ImportDir(dir,"*.xml;*.cls;*.mac;*.int;*.inc;*.dfi","cuk",,1) or import the [release](https://github.com/intersystems-ru/cache-udl/releases) to the namespace. -Map sc package to %All namespace to make it visible in any namespace. +Map the sc package to the %All namespace to make it visible in any namespace. # Usage @@ -58,15 +58,15 @@ Run init method to initialize project settings: ``` NS> d ##class(dev.code).init() ``` -Then run release to export all the classes in compileList into one "myproject.xml" release file. It will export it into the default for current Namespace directory. +Then run release() to export all the classes in compileList into one "myproject.xml" release file. It will export it into the default directory for the current Namespace. ``` NS> d ##class(dev.code).release() ``` -Or compile it whenever you want to compile all the proejct related resources. +Or compile it whenever you want to compile all the project related resources. ``` NS> d ##class(dev.code).compile() ``` -Get last changes from github or local git. Run patch to export the classes in compileList into one "patch.xml" patch file. It will export it into the default for current Namespace directory or you can choose where export. By default, makes a patch from the last commit if you do not specify `commitFrom` and `commitTo` e.g. +Get the latest changes from github or local git. Run patch() to export the classes in compileList into one "patch.xml" patch file. It will export it into the default directory for the current Namespace or you can choose the export dir. By default, it makes a patch from the last commit if you do not specify `commitFrom` and `commitTo` e.g. ``` NS> s filename = "c:\patch.xml" NS> s commitFrom = 1 @@ -75,10 +75,10 @@ NS> d ##class(dev.code).patch(filename,commitFrom,commitTo) ``` ## Known issues -Be careful with import termlists, pivot variables and shared measures. In current implementation imported artefacts replace those you have in the target namespace. It happens because the utility uses standard global import for globals in XML with $System.OBJ.Import which kills the global first and imports the new one. +Be careful with import termlists, pivot variables and shared measures. In the current implementation, imported artifacts replace those you have in the target namespace. It happens because the utility uses standard global import for globals in XML with $System.OBJ.Import which kills the global first and imports the new one. #### If after using the export command, git treats unaltered files as modified, the problem may be in the following: -- When moving sources from one OS to another (f.e. from win to mac), the end of the line character was not taken into account. To fix this, you need to specify git to make the end of line character look the same. +- When moving sources from one OS to another (e.g., from win to mac), the end of the line character was not taken into account. To fix this, you need to specify git to make the end of line character look the same. solution: ```git config --global core.autocrlf input``` - File access rights have been changed. In this case, you will need to specify that you do not want to track these changes.