Subversion Repositories DevTools

Rev

Rev 147 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 147 Rev 149
Line 28... Line 28...
28
 
28
 
29
      rsQry.Close
29
      rsQry.Close
30
      Set rsQry = nothing
30
      Set rsQry = nothing
31
   End If
31
   End If
32
End Function
32
End Function
-
 
33
 
-
 
34
'--------------------------------------------------------------------------------------------
-
 
35
' Assign the inout parameter to an array containing the list of all human readable op-code
-
 
36
' strings, in ascending op-code value order. This list will be used to form a drop-down list
-
 
37
' control on an html form
-
 
38
'--------------------------------------------------------------------------------------------
-
 
39
Sub GetDaemonInstructionOperationNameArray(nArray)
-
 
40
   ' append new op-codes to this list when they are invented
-
 
41
   nArray = array(OP_CODE_0_STR, _
-
 
42
                  OP_CODE_1_STR)
-
 
43
End Sub
-
 
44
 
33
'--------------------------------------------------------------------------------------------
45
'--------------------------------------------------------------------------------------------
34
' Convert a Daemon Instruction operation code into a meaningful string
46
' Convert a Daemon Instruction operation code into a meaningful string
-
 
47
' NOTE: could replace this with a global scripting dicitonary, but the code would be no clearer
-
 
48
' for doing so.
35
'--------------------------------------------------------------------------------------------
49
'--------------------------------------------------------------------------------------------
36
Function DaemonInstructionOperationName(nOpCode)
50
Function DaemonInstructionOperationName(nOpCode)
37
   Select Case nOpCode
51
   Select Case nOpCode
38
   Case OP_CODE_0_RIPPLE_BUILD_PACKAGE
52
   Case OP_CODE_0_RIPPLE_BUILD_PACKAGE
39
      DaemonInstructionOperationName = OP_CODE_0_STR
53
      DaemonInstructionOperationName = OP_CODE_0_STR
40
 
54
 
41
   'Case OP_CODE_1_GET_RELEASE_METRICS
55
   Case OP_CODE_1_TEST_BUILD_PACKAGE
42
   '   DaemonInstructionOperationName = OP_CODE_1_STR
56
      DaemonInstructionOperationName = OP_CODE_1_STR
43
 
57
 
44
   Case Else
58
   Case Else
45
      DaemonInstructionOperationName = "Undefined (" & nOpCode & ")"
59
      DaemonInstructionOperationName = "Undefined (" & nOpCode & ")"
46
   End Select
60
   End Select
47
End Function
61
End Function
-
 
62
 
-
 
63
'--------------------------------------------------------------------------------------------
-
 
64
' Convert a Daemon Instruction operation name into an op-code value
-
 
65
' NOTE: could replace this with a global scripting dicitonary, but the code would be no clearer
-
 
66
' for doing so.
-
 
67
'--------------------------------------------------------------------------------------------
-
 
68
Function DaemonInstructionOperationValue(nOpName)
-
 
69
   Select Case nOpName
-
 
70
   Case OP_CODE_0_STR
-
 
71
      DaemonInstructionOperationValue = OP_CODE_0_RIPPLE_BUILD_PACKAGE
-
 
72
 
-
 
73
   Case OP_CODE_1_STR
-
 
74
      DaemonInstructionOperationValue = OP_CODE_1_TEST_BUILD_PACKAGE
-
 
75
 
-
 
76
   Case Else
-
 
77
      DaemonInstructionOperationValue = ""
-
 
78
   End Select
-
 
79
End Function
-
 
80
 
-
 
81
'--------------------------------------------------------------------------------------------
-
 
82
' Determines if a daemon instruction op-code value indicates that a PV_ID is required to be
-
 
83
' specified for the instruction.
-
 
84
'--------------------------------------------------------------------------------------------
-
 
85
Function DaemonInstructionNeedsPV_ID(nOpCode)
-
 
86
   Select Case nOpCode
-
 
87
   Case OP_CODE_0_RIPPLE_BUILD_PACKAGE
-
 
88
      DaemonInstructionNeedsPV_ID = True
-
 
89
 
-
 
90
   Case OP_CODE_1_TEST_BUILD_PACKAGE
-
 
91
      DaemonInstructionNeedsPV_ID = True
-
 
92
 
-
 
93
   Case Else
-
 
94
      DaemonInstructionNeedsPV_ID = False
-
 
95
   End Select
-
 
96
End Function
-
 
97
 
-
 
98
'--------------------------------------------------------------------------------------------
-
 
99
' Determines if a daemon instruction op-code value indicates that a repeat value is required
-
 
100
' to be specified for the instruction.
-
 
101
'--------------------------------------------------------------------------------------------
-
 
102
Function DaemonInstructionNeedsRepeat(nOpCode)
-
 
103
   ' currently - no op-codes need a repeat value
-
 
104
   DaemonInstructionNeedsRepeat = False
-
 
105
End Function
-
 
106
 
48
'--------------------------------------------------------------------------------------------
107
'--------------------------------------------------------------------------------------------
49
' Convert a Repeat Seconds value into a meaningful string. This takes account of the
108
' Convert a Repeat Seconds value into a meaningful string. This takes account of the
50
' daemon instruction op-code too - a repeat seconds value is only relevant for certain
109
' daemon instruction op-code too - a repeat seconds value is only relevant for certain
51
' op-codes
110
' op-codes
52
'--------------------------------------------------------------------------------------------
111
'--------------------------------------------------------------------------------------------
53
Function DaemonInstructionRepeatString(nOpCode, nRepeatSecs)
112
Function DaemonInstructionRepeatString(nOpCode, nRepeatSecs)
54
   DaemonInstructionRepeatString = "N/A"
113
   DaemonInstructionRepeatString = "N/A"
55
 
114
 
56
   ' uncomment this when we are ready to introduce the "get release metrics" instruction
115
   ' uncomment this when we are ready to introduce the "get release metrics" instruction
57
   'Select Case nOpCode
116
   'Select Case nOpCode
58
   'Case OP_CODE_1_GET_RELEASE_METRICS
117
   'Case OP_CODE_?_GET_RELEASE_METRICS
59
   '   Select Case nRepeatSecs
118
   '   Select Case nRepeatSecs
60
   '   Case 86400
119
   '   Case 86400
61
   '      DaemonInstructionRepeatString = "24Hrs"
120
   '      DaemonInstructionRepeatString = "24Hrs"
62
   '   Case Else
121
   '   Case Else
63
   '      DaemonInstructionRepeatString = "NO"
122
   '      DaemonInstructionRepeatString = "NO"
Line 69... Line 128...
69
 
128
 
70
End Function
129
End Function
71
'--------------------------------------------------------------------------------------------
130
'--------------------------------------------------------------------------------------------
72
' Queries the database to get a comma-seperated list of op-codes for a given release, and
131
' Queries the database to get a comma-seperated list of op-codes for a given release, and
73
' converts them into a comma seperated list of operation names for display purposes
132
' converts them into a comma seperated list of operation names for display purposes
-
 
133
' This is used in _package_common.asp to provide visual indication to RM users that daemon
-
 
134
' instructions for the release have been created.
74
'--------------------------------------------------------------------------------------------
135
'--------------------------------------------------------------------------------------------
75
Function GetOpCodeListForRtagId( pretext, nRtag_id, posttext )
136
Function GetOpCodeListForRtagId( pretext, nRtag_id, posttext )
76
   Dim opCodeListString
137
   Dim opCodeListString
77
   Dim opCodeList
138
   Dim opCodeList
78
   Dim opCodeStr
139
   Dim opCodeStr
Line 107... Line 168...
107
   End If
168
   End If
108
End Function
169
End Function
109
'--------------------------------------------------------------------------------------------
170
'--------------------------------------------------------------------------------------------
110
' Queries the database to get a comma-seperated list of op-codes for a given release and package
171
' Queries the database to get a comma-seperated list of op-codes for a given release and package
111
' version, and converts them into a comma seperated list of operation names for display purposes
172
' version, and converts them into a comma seperated list of operation names for display purposes
-
 
173
' This is used in _package_common.asp to provide visual indication to RM users that daemon
-
 
174
' instructions for the release and package version have been created.
112
'--------------------------------------------------------------------------------------------
175
'--------------------------------------------------------------------------------------------
113
Function GetOpCodeListForRtagIdAndPvId( pretext, nRtag_id, nPv_id, posttext )
176
Function GetOpCodeListForRtagIdAndPvId( pretext, nRtag_id, nPv_id, posttext )
114
   Dim opCodeListString
177
   Dim opCodeListString
115
   Dim opCodeList
178
   Dim opCodeList
116
   Dim opCodeStr
179
   Dim opCodeStr
Line 167... Line 230...
167
   Else
230
   Else
168
      UserAllowedToResetInProgress = False
231
      UserAllowedToResetInProgress = False
169
   End If
232
   End If
170
End Function
233
End Function
171
 
234
 
-
 
235
'--------------------------------------------------------------------------------------------
-
 
236
' Daemon Instruction validation function
-
 
237
'--------------------------------------------------------------------------------------------
-
 
238
Function HandleValidateDaemonInstructionError(retERRmsg)
-
 
239
   Dim s
-
 
240
 
-
 
241
   s = ""
-
 
242
 
-
 
243
   HandleValidateDaemonInstructionError = True
-
 
244
 
-
 
245
   If NOT IsNull(retERRmsg) Then
-
 
246
      ' Re-interpret the error message that has been returned from the queries. We do this because normally,
-
 
247
      ' these errors are associated with individual message files but the messsages in those files are slightly
-
 
248
      ' inappropriate for the context of adding a daemon instruction so we will provide our own message display
-
 
249
      ' using the generic enum_WMSG_ERROR file with a bespoke error string.
-
 
250
      Select Case retERRmsg
-
 
251
      Case "enum_MSG_MISSING_DEPENDENCIES"
-
 
252
         s = "Some dependencies of this package are missing from a release."
-
 
253
      Case "enum_MSG_PACKAGE_INFORMATION_INCOMPLETE"
-
 
254
         s = "Package information section on Release Notes tab is not fully complete."
-
 
255
      Case "enum_MSG_AUTOBUILD_PACKAGE_REQUIRES_BUILD_STD_AND_ENV"
-
 
256
         s = "Package must have a build standard and build environment."
-
 
257
      Case "enum_MSG_REASON_FOR_THIS_VERSION_NOT_SUPLIED"
-
 
258
         s = "A reason for this version must be supplied."
-
 
259
      Case "enum_MSG_UNIT_TESTS_NOT_SUPPLIED"
-
 
260
         s = "There are no unit tests supplied for this package."
-
 
261
      Case "enum_MSG_PACKAGE_CHANGETYPE_INCOMPLETE"
-
 
262
         s = "Package change type in Release Notes Tab is not defined."
-
 
263
      Case "enum_MSG_BROKEN_DEPENDENCIES_FOUND"
-
 
264
         s = "Some of the packages dependencies are broken. Fix them first before trying to add a daemon instruction to this package."
-
 
265
      Case "enum_MSG_UNOFFICIAL_DEPENDENCIES_FOUND"
-
 
266
         s = "Some dependencies of this package are still not released. Release them first before trying to add a daemon instruction to this package."
-
 
267
      Case Else
-
 
268
         s = "Correct any errors in the release notes, and try again."
-
 
269
      End Select
-
 
270
 
-
 
271
      ' redirect to an error
-
 
272
      CloseWindow
-
 
273
      Call RaiseMsgInParent ( enum_WMSG_ERROR, "Cannot add this daemon instruction<br><br>" & s)
-
 
274
 
-
 
275
      HandleValidateDaemonInstructionError = False
-
 
276
   End If
-
 
277
 
-
 
278
End Function
-
 
279
 
-
 
280
Function ValidateDaemonInstruction(nOpCode, nRtag_id, nPv_id)
-
 
281
   Dim retERRmsg
-
 
282
   Dim retALRTmsg
-
 
283
   Dim retParameters
-
 
284
   Dim pkgType
-
 
285
   Dim s
-
 
286
 
-
 
287
   s = ""
-
 
288
   pkgType = 0
-
 
289
 
-
 
290
   ValidateDaemonInstruction = True
-
 
291
 
-
 
292
   Select Case nOpCode
-
 
293
   Case OP_CODE_0_RIPPLE_BUILD_PACKAGE
-
 
294
      ' Note: cannot use CheckRequirementsForMakeApproved here because it fails on the change_type check. This seems
-
 
295
      ' to be because a daemon ripple build results in a new package version that has null in the change_type column
-
 
296
      ' so we cannot validate that column in the package_versions table.
-
 
297
 
-
 
298
      ' check missing dependencies, bad package info, missing build std/env, reason for version, unit test
-
 
299
      Call CheckRequirementsForMakePending ( nPv_id, nRtag_id, pkgType, retERRmsg, retALRTmsg, retParameters )
-
 
300
      If IsNull(retERRmsg) Then
-
 
301
         ' Check broken dependencies, missing dependencies, unofficial dependencies, bad package info, reason for version, unit test
-
 
302
         Call CheckRequirementsForMakeRelease( nPv_id, nRtag_id, pkgType, retERRmsg, retALRTmsg, retParameters )
-
 
303
      End If
-
 
304
      ValidateDaemonInstruction = HandleValidateDaemonInstructionError(retERRmsg)
-
 
305
 
-
 
306
   Case OP_CODE_1_TEST_BUILD_PACKAGE
-
 
307
      ' check missing dependencies, bad package info, missing build std/env, reason for version, unit test
-
 
308
      Call CheckRequirementsForMakePending ( nPv_id, nRtag_id, pkgType, retERRmsg, retALRTmsg, retParameters )
-
 
309
      If IsNull(retERRmsg) Then
-
 
310
         ' check change type
-
 
311
         Call CheckRequirementsForMakeApproved( nPv_id, nRtag_id, pkgType, retERRmsg, retALRTmsg, retParameters )
-
 
312
         If IsNull(retERRmsg) Then
-
 
313
            ' Check broken dependencies, missing dependencies, unofficial dependencies, bad package info, reason for version, unit test
-
 
314
            Call CheckRequirementsForMakeRelease( nPv_id, nRtag_id, pkgType, retERRmsg, retALRTmsg, retParameters )
-
 
315
         End If
-
 
316
      End If
-
 
317
      ValidateDaemonInstruction = HandleValidateDaemonInstructionError(retERRmsg)
-
 
318
 
-
 
319
   Case Else
-
 
320
      CloseWindow
-
 
321
      Call RaiseMsgInParent(enum_MSG_ERROR, "Attempt to add an unknown daemon instruction")
-
 
322
      ValidateDaemonInstruction = False
-
 
323
   End Select
-
 
324
End Function
-
 
325
 
-
 
326
 
-
 
327
'------------------------------------------------------------------------------------------------------------------------------------------
-
 
328
 
172
 
329
 
173
 
330
 
174
%>
331
%>