1- <?xml version =" 1.0" encoding =" UTF-8" ?>
2- <Export generator =" Cache" version =" 25" >
3- <Class name =" isc.git.GitLab" >
4- <TimeCreated >64700,73518.498808</TimeCreated >
5-
6- <Method name =" getDir" >
7- <ClassMethod >1</ClassMethod >
8- <CodeMode >expression</CodeMode >
9- <Implementation ><![CDATA[ ##class(%File).NormalizeDirectory($system.Util.GetEnviron("CI_PROJECT_DIR"))
10- ]]> </Implementation >
11- </Method >
12-
13- <Method name =" getCommit" >
14- <Description >
15- For CI build - get current commit</Description >
16- <ClassMethod >1</ClassMethod >
17- <CodeMode >expression</CodeMode >
18- <Implementation ><![CDATA[ $system.Util.GetEnviron("CI_COMMIT_SHA")
19- ]]> </Implementation >
20- </Method >
21-
22- <Method name =" load" >
23- <Description >
24- Do a full load
25- do ##class(isc.git.GitLab).load()</Description >
26- <ClassMethod >1</ClassMethod >
27- <Implementation ><![CDATA[
1+ Class isc .git .GitLab
2+ {
3+
4+ ClassMethod getDir () [ CodeMode = expression ]
5+ {
6+ ##class (%File ).NormalizeDirectory ($system .Util .GetEnviron (" CI_PROJECT_DIR" ))
7+ }
8+
9+ /// For CI build - get current commit
10+ ClassMethod getCommit () [ CodeMode = expression ]
11+ {
12+ $system .Util .GetEnviron (" CI_COMMIT_SHA" )
13+ }
14+
15+ /// Do a full load
16+ /// do ##class(isc.git.GitLab).load()
17+ ClassMethod load ()
18+ {
2819 try {
2920 set dir = ..getDir ()
3021 do ..log (" Importing dir " _ dir )
@@ -40,15 +31,12 @@ do ##class(isc.git.GitLab).load()</Description>
4031 write !,$System .Status .GetErrorText (ex .AsStatus ()),!
4132 do $system .Process .Terminate (, 1 )
4233 }
43- ]]> </Implementation >
44- </Method >
34+ }
4535
46- <Method name =" loadDiff" >
47- <Description >
48- Do a diff load
49- do ##class(isc.git.GitLab).loadDiff()</Description >
50- <ClassMethod >1</ClassMethod >
51- <Implementation ><![CDATA[
36+ /// Do a diff load
37+ /// do ##class(isc.git.GitLab).loadDiff()
38+ ClassMethod loadDiff ()
39+ {
5240 try {
5341 #dim sc ,sc1 As %Status = $$$OK
5442 set oldCommit = ##class (isc.git.Settings ).getSetting (" commit" )
@@ -98,27 +86,22 @@ do ##class(isc.git.GitLab).loadDiff()</Description>
9886 do ..logException (ex )
9987 do $system .Process .Terminate (, 1 )
10088 }
101- ]]> </Implementation >
102- </Method >
89+ }
10390
104- <Method name =" init" >
105- <ClassMethod >1</ClassMethod >
106- <Implementation ><![CDATA[
91+ ClassMethod init ()
92+ {
10793 set init = ##class (isc.git.Settings ).getSetting (" init" )
10894 if (init '=" " ) {
10995 do ..log (" Running init code: " _ init )
11096 do $classmethod ($p (init , " :" ), $p (init , " :" , 2 ))
11197 } else {
11298 do ..log (" No init code" )
11399 }
114- ]]> </Implementation >
115- </Method >
100+ }
116101
117- <Method name =" test" >
118- <Description >
119- do ##class(isc.git.GitLab).test()</Description >
120- <ClassMethod >1</ClassMethod >
121- <Implementation ><![CDATA[
102+ /// do ##class(isc.git.GitLab).test()
103+ ClassMethod test ()
104+ {
122105 try {
123106 set tests = ##class (isc.git.Settings ).getSetting (" tests" )
124107 if (tests '=" " ) {
@@ -134,14 +117,11 @@ do ##class(isc.git.GitLab).test()</Description>
134117 do ..logException (ex )
135118 do $system .Process .Terminate (, 1 )
136119 }
137- ]]> </Implementation >
138- </Method >
120+ }
139121
140- <Method name =" package" >
141- <Description >
142- do ##class(GitLab.Main).package()</Description >
143- <ClassMethod >1</ClassMethod >
144- <Implementation ><![CDATA[
122+ /// do ##class(GitLab.Main).package()
123+ ClassMethod package ()
124+ {
145125 try {
146126 set dir = ..getDir ()
147127 // TODO
@@ -152,12 +132,10 @@ do ##class(GitLab.Main).package()</Description>
152132 do ..logException (ex )
153133 do $system .Process .Terminate (, 1 )
154134 }
155- ]]> </Implementation >
156- </Method >
135+ }
157136
158- <Method name =" writeTestHTML" >
159- <ClassMethod >1</ClassMethod >
160- <Implementation ><![CDATA[
137+ ClassMethod writeTestHTML ()
138+ {
161139 set text = ##class (%Dictionary.XDataDefinition ).IDKEYOpen ($classname (), " html" ).Data .Read ()
162140 set text = $replace (text , " !!!" , ..getURL ())
163141
@@ -166,49 +144,38 @@ do ##class(GitLab.Main).package()</Description>
166144 do file .LinkToFile (name )
167145 do file .Write (text )
168146 quit file .%Save ()
169- ]]> </Implementation >
170- </Method >
147+ }
171148
172- <Method name =" getURL" >
173- <ClassMethod >1</ClassMethod >
174- <Implementation ><![CDATA[
149+ ClassMethod getURL ()
150+ {
175151 set url = ##class (isc.git.Settings ).getSetting (" url" )
176152 set url = url _ $system .CSP .GetDefaultApp (" %SYS" )
177153 set url = url _" /%25UnitTest.Portal.Indices.cls?Index=" _ $g (^UnitTest .Result , 1 ) _ " &$NAMESPACE=" _ $zconvert ($namespace ," O" ," URL" )
178154 quit url
179- ]]> </Implementation >
180- </Method >
155+ }
181156
182- <Method name =" getExtWildcard" >
183- <Description >
184- Get extensions as wildcard for import</Description >
185- <ClassMethod >1</ClassMethod >
186- <ReturnType >%String</ReturnType >
187- <Implementation ><![CDATA[
157+ /// Get extensions as wildcard for import
158+ ClassMethod getExtWildcard () As %String
159+ {
188160 set extList = ##class (isc.git.Settings ).getSetting (" ext" )
189161 set ext = " *." _ $lts (##class (isc.git.Settings ).getSetting (" ext" ), " ;*." )
190162 quit ext
191- ]]> </Implementation >
192- </Method >
163+ }
193164
194- <Method name =" isLastTestOk" >
195- <Description >
196- w ##class(GitLab.Main).isLastTestOk()</Description >
197- <ClassMethod >1</ClassMethod >
198- <ReturnType >%Boolean</ReturnType >
199- <Implementation ><![CDATA[
165+ /// w ##class(GitLab.Main).isLastTestOk()
166+ ClassMethod isLastTestOk () As %Boolean
167+ {
200168 set in = ##class (%UnitTest.Result.TestInstance ).%OpenId (^UnitTest .Result )
201169 for i =1 :1 :in .TestSuites .Count () {
202170 #dim suite As %UnitTest.Result.TestSuite
203171 set suite = in .TestSuites .GetAt (i )
204172 return :suite .Status =0 $$$NO
205173 }
206174 quit $$$YES
207- ]]> </Implementation >
208- </Method >
175+ }
209176
210- < XData name = " html" >
211- < Data > <![CDATA[
177+ XData html
178+ {
212179<html lang =" en-US" >
213180<head >
214181<meta charset =" UTF-8" />
@@ -221,14 +188,10 @@ window.location.href = "!!!"
221188If you are not redirected automatically , follow this <a href ='!!!'>link to tests </a >.
222189</body >
223190</html >
224- ]]> </Data >
225- </XData >
191+ }
226192
227- <Method name =" logVar" >
228- <ClassMethod >1</ClassMethod >
229- <FormalSpec >var="",name:%String=""</FormalSpec >
230- <ReturnType >%String</ReturnType >
231- <Implementation ><![CDATA[
193+ ClassMethod logVar (var = " " , name As %String = " " ) As %String
194+ {
232195 do ..log (" Variable " _ name )
233196 zw var
234197 /*if $isObject(var) {
@@ -238,28 +201,22 @@ If you are not redirected automatically, follow this <a href='!!!'>link to tests
238201 } else {
239202 write var
240203 }*/
241- ]]> </Implementation >
242- </Method >
204+ }
205+
206+ ClassMethod logException (ex As %Exception .AbstractException )
207+ {
208+ do ..logStatus (ex .AsStatus ())
209+ }
210+
211+ ClassMethod logStatus (sc As %Status )
212+ {
213+ do ..log ($System .Status .GetErrorText (sc ))
214+ }
243215
244- <Method name =" logException" >
245- <ClassMethod >1</ClassMethod >
246- <FormalSpec >ex:%Exception.AbstractException</FormalSpec >
247- <Implementation ><![CDATA[ do ..logStatus(ex.AsStatus())
248- ]]> </Implementation >
249- </Method >
216+ ClassMethod log (msg As %String )
217+ {
218+ write !, $$$FormatText(" [%1] %2" , $zdatetime ($ztimestamp , 3 , 1 , 3 ), msg ), !
219+ }
250220
251- <Method name =" logStatus" >
252- <ClassMethod >1</ClassMethod >
253- <FormalSpec >sc:%Status</FormalSpec >
254- <Implementation ><![CDATA[ do ..log($System.Status.GetErrorText(sc))
255- ]]> </Implementation >
256- </Method >
221+ }
257222
258- <Method name =" log" >
259- <ClassMethod >1</ClassMethod >
260- <FormalSpec >msg:%String</FormalSpec >
261- <Implementation ><![CDATA[ write !, $$$FormatText("[%1] %2", $zdatetime($ztimestamp, 3, 1, 3), msg), !
262- ]]> </Implementation >
263- </Method >
264- </Class >
265- </Export >
0 commit comments