| 123 |
ghuddy |
1 |
<%
|
|
|
2 |
'=====================================================
|
|
|
3 |
' COMMON MAKE RELEASE BUTTON SUBs
|
|
|
4 |
'=====================================================
|
|
|
5 |
'
|
|
|
6 |
' Conventions within this code
|
|
|
7 |
'
|
|
|
8 |
' 1) Where a paramter list contains both RTAG_ID and PV_ID, the RTAG_ID will precede the PV_ID parameter
|
|
|
9 |
' 2) Functions/Subs that are not used externally, are name decorated PRIVATE_
|
|
|
10 |
' 3) Functions/Subs that are used extennally, are name decorated PUBLIC_
|
|
|
11 |
'
|
|
|
12 |
'
|
|
|
13 |
'
|
|
|
14 |
%>
|
|
|
15 |
<%
|
|
|
16 |
Dim AutoBuildPermissionDenied
|
|
|
17 |
Dim ManualBuildPermissionDenied
|
| 129 |
ghuddy |
18 |
Dim RaiseWIPExists
|
| 123 |
ghuddy |
19 |
|
|
|
20 |
AutoBuildPermissionDenied = FALSE
|
|
|
21 |
ManualBuildPermissionDenied = FALSE
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
25 |
' This is the pattern for approval determination. If the release is in open mode, permission is given. If the release is
|
|
|
26 |
' in restrictive/ccb mode, permission is given dependent on the accessControlObjectName being granted for the user.
|
|
|
27 |
'
|
|
|
28 |
Function PRIVATE_Is_Allowed_To(NNrtag_id, accessControlObjectName)
|
|
|
29 |
Dim ReleaseMode
|
|
|
30 |
|
|
|
31 |
ReleaseMode = GetReleaseMode ( NNrtag_id )
|
|
|
32 |
|
|
|
33 |
PRIVATE_Is_Allowed_To = FALSE
|
|
|
34 |
|
|
|
35 |
If ReleaseMode <> enumDB_RELEASE_IN_CLOSED_MODE AND ReleaseMode <> enumDB_RELEASE_IN_ARCHIVE_MODE Then
|
|
|
36 |
If ( ReleaseMode = enumDB_RELEASE_IN_OPEN_MODE ) Then
|
|
|
37 |
PRIVATE_Is_Allowed_To = TRUE
|
|
|
38 |
Else
|
|
|
39 |
If objAccessControl.IsActive(accessControlObjectName) Then
|
|
|
40 |
PRIVATE_Is_Allowed_To = TRUE
|
|
|
41 |
End If
|
|
|
42 |
End If
|
|
|
43 |
End If
|
|
|
44 |
End Function
|
|
|
45 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
46 |
Function PRIVATE_Is_Allowed_To_Approve_Merge(NNrtag_id)
|
|
|
47 |
|
|
|
48 |
PRIVATE_Is_Allowed_To_Approve_Merge = PRIVATE_Is_Allowed_To(NNrtag_id, "ApproveForAutoBuild") _
|
|
|
49 |
OR PRIVATE_Is_Allowed_To(NNrtag_id, "ApproveForManualBuild")
|
|
|
50 |
End Function
|
|
|
51 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
52 |
Function PRIVATE_Is_Allowed_To_Approve_ManualBuild(NNrtag_id)
|
|
|
53 |
|
|
|
54 |
PRIVATE_Is_Allowed_To_Approve_ManualBuild = PRIVATE_Is_Allowed_To(NNrtag_id, "ApproveForManualBuild")
|
|
|
55 |
End Function
|
|
|
56 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
57 |
Function PRIVATE_Is_Allowed_To_Approve_AutoBuild(NNrtag_id)
|
|
|
58 |
|
|
|
59 |
PRIVATE_Is_Allowed_To_Approve_AutoBuild = PRIVATE_Is_Allowed_To(NNrtag_id, "ApproveForAutoBuild")
|
|
|
60 |
End Function
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
'=============================================================================================================================
|
|
|
64 |
' APPROVING PENDING MERGE OPERATIONS - Used from _approve_merge.asp as well as from within this file itself
|
|
|
65 |
'
|
|
|
66 |
' All functions in this section originally came from _approve_merge.asp and were placed here to support their use in more
|
|
|
67 |
' than the original singular context. Being relocated here allows them to be used in the additional "Bulk Release" context.
|
|
|
68 |
'=============================================================================================================================
|
|
|
69 |
|
|
|
70 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
71 |
' USED to approve a pending merge operation. Used internally by the bulk release operation
|
|
|
72 |
Sub PRIVATE_ApproveMerge ( NNrtag_id, NNpv_id )
|
|
|
73 |
On Error Resume Next
|
|
|
74 |
objEH.ErrorRedirect = TRUE
|
|
|
75 |
|
|
|
76 |
OraDatabase.Parameters.Add "PV_ID", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
77 |
OraDatabase.Parameters.Add "RTAG_ID", NNrtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
78 |
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
79 |
|
|
|
80 |
objEH.TryORA ( OraSession )
|
|
|
81 |
|
|
|
82 |
OraDatabase.ExecuteSQL _
|
|
|
83 |
"BEGIN "&_
|
|
|
84 |
" PK_ENVIRONMENT.APPROVE_MERGE ( :PV_ID, :RTAG_ID, :USER_ID );"&_
|
|
|
85 |
"END; "
|
|
|
86 |
|
|
|
87 |
objEH.CatchORA ( OraSession )
|
|
|
88 |
|
|
|
89 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
90 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
91 |
OraDatabase.Parameters.Remove "USER_ID"
|
|
|
92 |
End Sub
|
|
|
93 |
|
|
|
94 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
95 |
' USED to approve a pending merge operation. Used externally from the _approve_merge.asp file, loaded when the btnApproveMerge
|
|
|
96 |
' action button is pressed.
|
|
|
97 |
Sub PUBLIC_ApproveMerge ( NNrtag_id, NNpv_id )
|
|
|
98 |
' validate before carrying out the merge
|
|
|
99 |
If PRIVATE_Is_A_Valid_Pending_Merge(NNrtag_id, NNpv_id, "A") OR PRIVATE_Is_A_Valid_Pending_Merge(NNrtag_id, NNpv_id, "S") Then
|
|
|
100 |
If PRIVATE_Is_Allowed_To_Approve_Merge(NNrtag_id) Then
|
|
|
101 |
Call PRIVATE_ApproveMerge(parRtag_id, NNpv_id)
|
|
|
102 |
End If
|
|
|
103 |
End If
|
|
|
104 |
End Sub
|
|
|
105 |
|
|
|
106 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
107 |
' USED to validate an attempt to approve a pending merge operation
|
|
|
108 |
Function PRIVATE_Is_A_Valid_Pending_Merge(NNrtag_id, NNpv_id, op)
|
|
|
109 |
Dim rsQry
|
|
|
110 |
|
|
|
111 |
OraDatabase.Parameters.Add "PV_ID", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
112 |
OraDatabase.Parameters.Add "RTAG_ID", NNrtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
113 |
|
|
|
114 |
Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("PlannedPackageVersionDetails.sql"), cint(0))
|
|
|
115 |
|
|
|
116 |
If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
|
|
|
117 |
' Does the actual operation field in the database match that specified as a parameter?
|
|
|
118 |
If (rsQry.Fields("operation") = op) Then
|
|
|
119 |
PRIVATE_Is_A_Valid_Pending_Merge = TRUE
|
|
|
120 |
Else
|
|
|
121 |
PRIVATE_Is_A_Valid_Pending_Merge = FALSE
|
|
|
122 |
End If
|
|
|
123 |
Else
|
|
|
124 |
PRIVATE_Is_A_Valid_Pending_Merge = FALSE
|
|
|
125 |
End If
|
|
|
126 |
|
|
|
127 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
128 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
129 |
|
|
|
130 |
rsQry.Close()
|
|
|
131 |
Set rsQry = Nothing
|
|
|
132 |
End Function
|
|
|
133 |
|
|
|
134 |
|
|
|
135 |
'=============================================================================================================================
|
|
|
136 |
' APPROVING MANUAL BUILD PENDING VERSIONS - Used from _make_released.asp as well as from within this file itself
|
|
|
137 |
'
|
|
|
138 |
' All functions in this section originally came from _make_released.asp and were placed here to support their use in more
|
|
|
139 |
' than the original singular context. Being relocated here allows them to be used in the additional "Bulk Release" context.
|
|
|
140 |
'=============================================================================================================================
|
|
|
141 |
|
|
|
142 |
|
|
|
143 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
144 |
' This function came from _make_released.asp and is very similar to the PRIVATE_NotifyInterestAutoBuild, except the subject/body
|
|
|
145 |
' text is different. Unlike its auto-build counterpart, this one is called during the process of making a manual build release
|
|
|
146 |
' official.
|
|
|
147 |
' One question arises... can we not harmonize the email notification code somewhat, between manual and autobuild releases?
|
|
|
148 |
'
|
|
|
149 |
' Currently, the function is called internally as part of the bulk release operation, and from _generate_release_notes.asp,
|
|
|
150 |
' loaded by _make_released.asp which in turn is loaded when a user presses the btnMakeReleased action button for manual
|
|
|
151 |
' built pending versions.
|
|
|
152 |
Sub PUBLIC_NotifyInterestManualBuild( NNrtag_id, NNpv_id )
|
|
|
153 |
Err.Clear
|
|
|
154 |
On Error Resume Next
|
|
|
155 |
Dim Query_String, rsQry, myMail
|
|
|
156 |
|
|
|
157 |
Query_String = _
|
|
|
158 |
" SELECT * FROM PACKAGE_INTEREST PI, PACKAGES PKG, PACKAGE_VERSIONS PV, USERS U,"&_
|
|
|
159 |
" RELEASE_TAGS RT, PROJECTS PRJ WHERE PKG.PKG_ID = PI.PKG_ID AND "&_
|
|
|
160 |
" RT.RTAG_ID = "& NNrtag_id &""&_
|
|
|
161 |
" AND PV.PV_ID = "& NNpv_id &" AND PV.PKG_ID = PKG.PKG_ID AND "&_
|
|
|
162 |
" PRJ.PROJ_ID = RT.PROJ_ID AND PRJ.PROJ_ID = PI.PROJ_ID AND U.USER_ID = PI.USER_ID"
|
|
|
163 |
|
|
|
164 |
Set rsQry = OraDatabase.DbCreateDynaset( Query_String , cint(0) )
|
|
|
165 |
|
|
|
166 |
If rsQry.RecordCount <> "" Then
|
|
|
167 |
While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
|
| 125 |
ghuddy |
168 |
If rsQry("user_email") <> "" Then
|
|
|
169 |
Set myMail=Server.CreateObject("Persits.MailSender")
|
| 123 |
ghuddy |
170 |
myMail.Host = SMTP_HOST
|
|
|
171 |
myMail.Subject="Version "& rsQry("pkg_version") &" of Package "& rsQry("pkg_name") &" in Project " & rsQry("proj_name") &" on Release Branch " & rsQry("rtag_name") &" has been released."
|
|
|
172 |
myMail.Body = "You have received this email as a result of your interest in this package. If you do not wish to receive further emails then remove your package interest from the notifications area in Release Manager."
|
|
|
173 |
myMail.From=ADMIN_EMAIL
|
|
|
174 |
myMail.AddAddress rsQry("user_email")
|
|
|
175 |
myMail.Send
|
|
|
176 |
set myMail=nothing
|
|
|
177 |
End If
|
|
|
178 |
rsQry.MoveNext
|
|
|
179 |
Wend
|
|
|
180 |
|
|
|
181 |
End If
|
|
|
182 |
|
|
|
183 |
rsQry.Close()
|
|
|
184 |
set rsQry = nothing
|
|
|
185 |
End Sub
|
|
|
186 |
|
|
|
187 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
188 |
' Currently, this function is called internally as part of the bulk release operation, and from _generate_release_notes.asp,
|
|
|
189 |
' loaded by _make_released.asp which in turn is loaded when a user presses the btnMakeReleased action button for manual
|
|
|
190 |
' built pending versions. It initiates the execution of the windows script file that performs additional database updates
|
|
|
191 |
' that are needed to make official a package version that has already been built and published into dpkg_archive. This includes
|
|
|
192 |
' collecting info on all files that were published to dpkg_archive, and inserting that info into the RELEASED_COMPONENTS table.
|
| 129 |
ghuddy |
193 |
Function PUBLIC_Run_onMakeOfficial ( nRtag_id, nPv_id )
|
| 123 |
ghuddy |
194 |
|
|
|
195 |
Dim objWSH, proj_id, Qry, sRtagName
|
|
|
196 |
|
| 129 |
ghuddy |
197 |
PUBLIC_Run_onMakeOfficial = FALSE
|
|
|
198 |
|
|
|
199 |
On Error Resume Next
|
|
|
200 |
|
|
|
201 |
objEH.TryORA ( OraSession )
|
|
|
202 |
|
| 123 |
ghuddy |
203 |
OraDatabase.ExecuteSQL " UPDATE package_versions "&_
|
|
|
204 |
" SET release_notes_info = '"& enum_RELEASE_NOTES_GENERATING &"'"&_
|
|
|
205 |
" WHERE pv_id = "& nPv_id
|
|
|
206 |
|
| 129 |
ghuddy |
207 |
objEH.CatchORA ( OraSession )
|
| 123 |
ghuddy |
208 |
|
| 129 |
ghuddy |
209 |
If objEH.LastOraFailed = FALSE Then
|
| 123 |
ghuddy |
210 |
|
| 129 |
ghuddy |
211 |
Set objWSH = Server.CreateObject("WScript.Shell")
|
|
|
212 |
'Used for getting the package name and package version
|
|
|
213 |
OraDatabase.Parameters.Add "RTAG_ID", nRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
| 123 |
ghuddy |
214 |
|
| 129 |
ghuddy |
215 |
Set Qry = OraDatabase.DbCreateDynaset( "SELECT * FROM RELEASE_TAGS WHERE RTAG_ID = :RTAG_ID", 0 )
|
| 123 |
ghuddy |
216 |
|
| 129 |
ghuddy |
217 |
proj_id = Qry("proj_id")
|
|
|
218 |
sRtagName = UCase( Qry("rtag_name") )
|
| 123 |
ghuddy |
219 |
|
| 129 |
ghuddy |
220 |
Qry.Close()
|
|
|
221 |
Set Qry = Nothing
|
| 123 |
ghuddy |
222 |
|
| 129 |
ghuddy |
223 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
| 123 |
ghuddy |
224 |
|
| 129 |
ghuddy |
225 |
'If proj_id = 281 Or proj_id = 221 Then
|
|
|
226 |
' objWSH.Run "cmd.exe /c cscript.exe //B //NoLogo "& rootPath & SCRIPTS_FOLDER_STEP &"\on_Make_Official.wsf //job:GetComponents //job:GenerateReleaseNotes //job:PostRun "&_
|
|
|
227 |
' "/pv_id:"& nPv_id , _
|
|
|
228 |
' 0, False
|
|
|
229 |
'Else
|
|
|
230 |
objWSH.Run "cmd.exe /c cscript.exe //B //NoLogo "& rootPath & SCRIPTS_FOLDER &"\on_Make_Official.wsf //job:GetComponents //job:GenerateReleaseNotes //job:PostRun "&_
|
|
|
231 |
"/pv_id:"& nPv_id & " /proj_id:"& proj_id &" /rtag_name:"""&sRtagName&"", _
|
|
|
232 |
0, False
|
|
|
233 |
'End If
|
|
|
234 |
Set objWSH = nothing
|
| 123 |
ghuddy |
235 |
|
| 129 |
ghuddy |
236 |
PUBLIC_Run_onMakeOfficial = TRUE
|
|
|
237 |
End If
|
|
|
238 |
|
|
|
239 |
End Function
|
| 123 |
ghuddy |
240 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
241 |
' This sub is used from _make_released.asp, loaded when a user presses the btnMakeReleased action button, as well as from
|
|
|
242 |
' internally within this file as part of the bulk release operation.
|
|
|
243 |
' This function basically removes the PV_ID entry from the WIP/PLANNED table, and adds it to the RELEASE_CONTENT table.
|
| 129 |
ghuddy |
244 |
Function PUBLIC_MakeRelease ( NNrtag_id, NNpv_id )
|
| 123 |
ghuddy |
245 |
|
|
|
246 |
On Error Resume Next
|
|
|
247 |
objEH.ErrorRedirect = TRUE
|
|
|
248 |
|
|
|
249 |
OraDatabase.Parameters.Add "PV_ID", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
250 |
OraDatabase.Parameters.Add "RTAG_ID", NNrtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
251 |
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
252 |
|
|
|
253 |
objEH.TryORA ( OraSession )
|
|
|
254 |
|
|
|
255 |
OraDatabase.ExecuteSQL _
|
|
|
256 |
"BEGIN "&_
|
|
|
257 |
" PK_ENVIRONMENT.MAKE_RELEASE ( :PV_ID, :RTAG_ID, :USER_ID );"&_
|
|
|
258 |
"END; "
|
|
|
259 |
|
|
|
260 |
objEH.CatchORA ( OraSession )
|
|
|
261 |
|
|
|
262 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
263 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
264 |
OraDatabase.Parameters.Remove "USER_ID"
|
|
|
265 |
|
| 129 |
ghuddy |
266 |
' return TRUE if operation was successful, else FALSE
|
|
|
267 |
If objEH.LastOraFailed Then
|
|
|
268 |
PUBLIC_MakeRelease = FALSE
|
|
|
269 |
Else
|
|
|
270 |
PUBLIC_MakeRelease = TRUE
|
|
|
271 |
End If
|
| 123 |
ghuddy |
272 |
|
| 129 |
ghuddy |
273 |
End Function
|
|
|
274 |
|
|
|
275 |
|
| 123 |
ghuddy |
276 |
'=============================================================================================================================
|
|
|
277 |
' APPROVING AUTO/MANUAL BUILD PENDING VERSIONS - Used from _make_approved.asp as well as from within this file itself
|
|
|
278 |
'
|
|
|
279 |
' All functions in this section originally came from _make_approved.asp and were placed here to support their use in more
|
|
|
280 |
' than the original singular context. Being relocated here allows them to be used in the additional "Bulk Release" context.
|
|
|
281 |
'=============================================================================================================================
|
|
|
282 |
|
|
|
283 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
284 |
Function PRIVATE_Get_CQ_Issues ( SSsql, OOrsCQ )
|
|
|
285 |
'On Error Resume Next
|
|
|
286 |
OOrsCQ.ActiveConnection = CQ_conn
|
|
|
287 |
OOrsCQ.Source = SSsql
|
|
|
288 |
OOrsCQ.CursorType = 0
|
|
|
289 |
OOrsCQ.CursorLocation = 2
|
|
|
290 |
OOrsCQ.LockType = 3
|
|
|
291 |
OOrsCQ.Open()
|
|
|
292 |
PRIVATE_Get_CQ_Issues = Err.Number
|
|
|
293 |
End Function
|
|
|
294 |
'------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
295 |
' Currently, this function does not seem to be used. The call to it was commented out in the _make_approved.asp file from where it was
|
|
|
296 |
' originally called from.
|
|
|
297 |
'
|
|
|
298 |
Sub PRIVATE_NotifyInterestAutoBuild( NNrtag_id, NNpv_id )
|
|
|
299 |
On Error Resume Next
|
|
|
300 |
Dim Query_String, rsQry, myMail
|
|
|
301 |
|
|
|
302 |
Query_String = _
|
|
|
303 |
" SELECT * FROM PACKAGE_INTEREST PI, PACKAGES PKG, PACKAGE_VERSIONS PV, USERS U,"&_
|
|
|
304 |
" RELEASE_TAGS RT, PROJECTS PRJ WHERE PKG.PKG_ID = PI.PKG_ID AND "&_
|
|
|
305 |
" RT.RTAG_ID = "& NNrtag_id &""&_
|
|
|
306 |
" AND PV.PV_ID = "& NNpv_id &" AND PV.PKG_ID = PKG.PKG_ID AND "&_
|
|
|
307 |
" PRJ.PROJ_ID = RT.PROJ_ID AND PRJ.PROJ_ID = PI.PROJ_ID AND U.USER_ID = PI.USER_ID"
|
|
|
308 |
|
|
|
309 |
Set rsQry = OraDatabase.DbCreateDynaset( Query_String , cint(0) )
|
|
|
310 |
|
|
|
311 |
If rsQry.RecordCount <> "" Then
|
|
|
312 |
While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
|
| 125 |
ghuddy |
313 |
If rsQry("user_email") <> "" Then
|
|
|
314 |
Set myMail=Server.CreateObject("Persits.MailSender")
|
|
|
315 |
myMail.Host = SMTP_HOST
|
|
|
316 |
myMail.Subject="New Version of Package "& rsQry("pkg_name") &" in Project " & rsQry("proj_name") &" on Release Branch " & rsQry("rtag_name") &" would be autobuild soon."
|
|
|
317 |
myMail.From=ADMIN_EMAIL
|
|
|
318 |
myMail.AddAddress rsQry("user_email")
|
|
|
319 |
myMail.Send
|
|
|
320 |
set myMail=nothing
|
|
|
321 |
End If
|
| 123 |
ghuddy |
322 |
rsQry.MoveNext
|
|
|
323 |
Wend
|
|
|
324 |
End If
|
|
|
325 |
|
|
|
326 |
rsQry.Close()
|
|
|
327 |
set rsQry = nothing
|
|
|
328 |
End Sub
|
|
|
329 |
'-------------------------------------------------------------------------------------
|
|
|
330 |
Sub PRIVATE_Get_Package_Issues(NNpv_id, SSsql)
|
|
|
331 |
Dim sqlstr, rsTemp, DEVIiss, TDSEiss, VT5DMiss, VTSUPiss
|
|
|
332 |
|
|
|
333 |
sqlstr = "SELECT iss_db, iss_id, iss_state, notes FROM CQ_ISSUES WHERE pv_id="& NNpv_id &" AND iss_state = 1"
|
|
|
334 |
|
|
|
335 |
Set rsTemp = OraDatabase.DbCreateDynaset( sqlstr, cint(0))
|
|
|
336 |
|
|
|
337 |
DEVIiss = "-1"
|
|
|
338 |
TDSEiss = "-1"
|
|
|
339 |
VT5DMiss = "-1"
|
|
|
340 |
VTSUPiss = "-1"
|
|
|
341 |
|
|
|
342 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
343 |
If CInt(rsTemp("iss_db")) = CInt(enumCLEARQUEST_DEVI_ID) Then
|
|
|
344 |
DEVIiss = DEVIiss &","& rsTemp("iss_id")
|
|
|
345 |
ElseIf CInt(rsTemp("iss_db")) = CInt(enumCLEARQUEST_TDSE_ID) Then
|
|
|
346 |
TDSEiss = TDSEiss &","& rsTemp("iss_id")
|
|
|
347 |
ElseIf CInt(rsTemp("iss_db")) = CInt(enumCLEARQUEST_VT5DM_ID) Then
|
|
|
348 |
VT5DMiss = VT5DMiss &","& rsTemp("iss_id")
|
|
|
349 |
ElseIf CInt(rsTemp("iss_db")) = CInt(enumCLEARQUEST_VTSUP_ID) Then
|
|
|
350 |
VTSUPiss = VTSUPiss &","& rsTemp("iss_id")
|
|
|
351 |
End If
|
|
|
352 |
|
|
|
353 |
rsTemp.MoveNext
|
|
|
354 |
WEnd
|
|
|
355 |
|
|
|
356 |
' Construct SQL statement for CQ database
|
|
|
357 |
If Len(DEVIiss) <> 1 OR Len(TDSEiss) <> 1 Then
|
|
|
358 |
SSsql = ReadFile( rootPath & "queries\cq_issues.sql" )
|
|
|
359 |
SSsql = Replace( SSsql, "/*enumCLEARQUEST_DEVI_ID*/", enumCLEARQUEST_DEVI_ID)
|
|
|
360 |
SSsql = Replace( SSsql, "/*enumCLEARQUEST_TDSE_ID*/", enumCLEARQUEST_TDSE_ID)
|
|
|
361 |
SSsql = Replace( SSsql, "/*enumCLEARQUEST_VT5DM_ID*/", enumCLEARQUEST_VT5DM_ID)
|
|
|
362 |
SSsql = Replace( SSsql, "/*enumCLEARQUEST_VTSUP_ID*/", enumCLEARQUEST_VTSUP_ID)
|
|
|
363 |
SSsql = Replace( SSsql, "/*DEVIiss*/", DEVIiss)
|
|
|
364 |
SSsql = Replace( SSsql, "/*TDSEiss*/", TDSEiss)
|
|
|
365 |
SSsql = Replace( SSsql, "/*VT5DMiss*/", VT5DMiss)
|
|
|
366 |
SSsql = Replace( SSsql, "/*VTSUPiss*/", VTSUPiss)
|
|
|
367 |
End If
|
|
|
368 |
|
|
|
369 |
rsTemp.Close
|
|
|
370 |
Set rsTemp = nothing
|
|
|
371 |
|
|
|
372 |
End Sub
|
|
|
373 |
'-------------------------------------------------------------------------------------
|
| 129 |
ghuddy |
374 |
Function PRIVATE_MakeApproved (NNrtag_id, NNpv_id)
|
| 123 |
ghuddy |
375 |
|
|
|
376 |
OraDatabase.Parameters.Add "PV_ID", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
377 |
OraDatabase.Parameters.Add "RTAG_ID", NNrtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
378 |
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
379 |
|
| 129 |
ghuddy |
380 |
objEH.TryORA ( OraSession )
|
|
|
381 |
On Error Resume Next
|
| 123 |
ghuddy |
382 |
|
|
|
383 |
OraDatabase.ExecuteSQL _
|
|
|
384 |
"BEGIN "&_
|
|
|
385 |
" PK_ENVIRONMENT.MAKE_APPROVED ( :PV_ID, :RTAG_ID, :USER_ID ); "&_
|
|
|
386 |
"END; "
|
|
|
387 |
|
| 129 |
ghuddy |
388 |
objEH.CatchORA ( OraSession )
|
| 123 |
ghuddy |
389 |
|
|
|
390 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
391 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
392 |
OraDatabase.Parameters.Remove "USER_ID"
|
|
|
393 |
|
| 129 |
ghuddy |
394 |
' return TRUE if operation was successful, else FALSE
|
|
|
395 |
If objEH.LastOraFailed Then
|
|
|
396 |
PRIVATE_MakeApproved = FALSE
|
|
|
397 |
Else
|
|
|
398 |
PRIVATE_MakeApproved = TRUE
|
|
|
399 |
End If
|
| 123 |
ghuddy |
400 |
|
|
|
401 |
End Function
|
|
|
402 |
'-------------------------------------------------------------------------------------
|
|
|
403 |
' This function is called from _make_approved.asp, which is loaded when the btnApprovePackage
|
|
|
404 |
' action button is pressed. It is also called as part of the bulk release operation.
|
| 129 |
ghuddy |
405 |
Function PUBLIC_ApproveRelease(NNrtag_id, NNpv_id, ByRef retParameters, isBulk)
|
| 123 |
ghuddy |
406 |
|
|
|
407 |
Dim retERRmsg
|
|
|
408 |
Dim retALRTmsg
|
|
|
409 |
Dim pkgType
|
|
|
410 |
|
|
|
411 |
retParameters = ""
|
|
|
412 |
pkgType = 0
|
|
|
413 |
|
|
|
414 |
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
|
|
|
415 |
|
|
|
416 |
' default return value
|
|
|
417 |
PUBLIC_ApproveRelease = FALSE
|
|
|
418 |
|
|
|
419 |
If ( NNrtag_id <> "") AND (NNpv_id <> "") Then
|
|
|
420 |
|
| 129 |
ghuddy |
421 |
'-- Get Package details
|
|
|
422 |
Call Get_Pkg_Info ( NNpv_id, NNrtag_id )
|
| 123 |
ghuddy |
423 |
|
| 129 |
ghuddy |
424 |
If pkgInfoHash.Item("build_type") = "A" Then
|
|
|
425 |
'Check If There Already Exists A WIP Instance Of The Package In The Release
|
|
|
426 |
If Check_Package_WIP_Already_Exists(NNrtag_id, NNpv_id) > 0 Then
|
|
|
427 |
RaiseWIPExists = TRUE
|
|
|
428 |
End If
|
| 123 |
ghuddy |
429 |
|
| 129 |
ghuddy |
430 |
If PRIVATE_Is_Allowed_To_Approve_AutoBuild(NNrtag_id) Then
|
|
|
431 |
'-- Approve Automatic-build package
|
|
|
432 |
Call CheckRequirementsForMakeApproved ( NNpv_id, NNrtag_id, pkgType, retERRmsg, retALRTmsg, retParameters )
|
|
|
433 |
If IsNull(retERRmsg) Then
|
|
|
434 |
Dim EmailBody
|
| 123 |
ghuddy |
435 |
|
| 129 |
ghuddy |
436 |
If PRIVATE_MakeApproved (NNrtag_id, NNpv_id) = TRUE Then
|
| 123 |
ghuddy |
437 |
|
| 129 |
ghuddy |
438 |
If ( RaiseWIPExists = TRUE ) AND ( isBulk = FALSE ) Then
|
|
|
439 |
Call RaiseMsg ( enum_MSG_PACKAGE_WIP_EXISTS&"?rtag_id="& NNrtag_id & "&pv_id="& NNpv_id & "", NNpv_id )
|
|
|
440 |
' RaiseMsg redirects loaded web page, so no return
|
|
|
441 |
' Deal with BulkMakeRelease elsewhere
|
|
|
442 |
End If
|
| 123 |
ghuddy |
443 |
' indicate success
|
|
|
444 |
PUBLIC_ApproveRelease = TRUE
|
| 129 |
ghuddy |
445 |
End If
|
|
|
446 |
Else
|
|
|
447 |
Call RaiseMsg ( Eval(retERRmsg), NNrtag_id & "|" & NNpv_id & "|" & retParameters & "|" & "N" )
|
|
|
448 |
End If
|
|
|
449 |
Else
|
|
|
450 |
' Indicate an auto-build permission problem was detected in the global variable.
|
|
|
451 |
' This is only used within the context of a bulk release.
|
|
|
452 |
AutoBuildPermissionDenied = TRUE
|
|
|
453 |
End If
|
|
|
454 |
Else
|
|
|
455 |
If PRIVATE_Is_Allowed_To_Approve_ManualBuild(NNrtag_id) Then
|
|
|
456 |
'-- Approve a Manual Build Release
|
|
|
457 |
Call CheckRequirementsForMakeRelease ( NNpv_id, NNrtag_id, pkgType, retERRmsg, retALRTmsg, retParameters )
|
|
|
458 |
If IsNull(retERRmsg) Then
|
| 123 |
ghuddy |
459 |
|
| 129 |
ghuddy |
460 |
If PUBLIC_MakeRelease ( NNrtag_id, NNpv_id ) = TRUE Then
|
|
|
461 |
' If all went well, initiate the generation of release notes, and email any interested parties
|
|
|
462 |
If PUBLIC_Run_onMakeOfficial ( NNrtag_id, NNpv_id ) = TRUE Then
|
|
|
463 |
Call PUBLIC_NotifyInterestManualBuild( NNrtag_id, NNpv_id )
|
| 123 |
ghuddy |
464 |
|
| 129 |
ghuddy |
465 |
' indicate success
|
|
|
466 |
PUBLIC_ApproveRelease = TRUE
|
|
|
467 |
End If
|
|
|
468 |
End If
|
|
|
469 |
Else
|
|
|
470 |
Call RaiseMsg ( Eval(retERRmsg), NNrtag_id & "|" & NNpv_id & "|" & retParameters & "|" & "N" )
|
|
|
471 |
End If
|
|
|
472 |
Else
|
|
|
473 |
' Indicate a manual-build permission problem was detected in the global variable
|
|
|
474 |
' This is only used within the context of a bulk release.
|
|
|
475 |
ManualBuildPermissionDenied = TRUE
|
|
|
476 |
End If
|
|
|
477 |
End If
|
| 123 |
ghuddy |
478 |
End If
|
|
|
479 |
End Function
|
|
|
480 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
481 |
|
|
|
482 |
|
|
|
483 |
'=============================================================================================================================
|
|
|
484 |
' MAKING A BULK RELEASE from a list of PV_IDs for a specified release
|
|
|
485 |
'
|
|
|
486 |
' This section contains the new "Bulk Release' code. This function is tied to the use of the make bulk release button.
|
|
|
487 |
'
|
|
|
488 |
'=============================================================================================================================
|
|
|
489 |
|
|
|
490 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
491 |
' This public function is called from the make_bulk_release.asp file, loaded when a user presses the Make Bulk Release
|
|
|
492 |
' button when viewing items on the Pending Tab of a release area.
|
|
|
493 |
'
|
|
|
494 |
' The function processes a list of PV_ID's that cam from the pending tab of a release, formed from each item whose checkbox
|
|
|
495 |
' was checked. There are 3 different types of item to deal with, and this function will deal with them in the order shown
|
|
|
496 |
' below:
|
|
|
497 |
' 1) Subtractive merge operations
|
|
|
498 |
' 2) Additive merge operations
|
|
|
499 |
' 3) Manual/Auto build items
|
|
|
500 |
'
|
|
|
501 |
' This order was chosen by design to ensure that in the end effect upon a release, the manual and auto build items
|
|
|
502 |
' take precedence over merge candidates. This occurs naturally if we process manual/auto build items last.
|
|
|
503 |
'
|
|
|
504 |
' Parameters:
|
|
|
505 |
' NNrtag_id The release area
|
|
|
506 |
' NN_pv_id_list A list of PV_IDs representing pending items to be approved for release or merge.
|
|
|
507 |
'
|
|
|
508 |
Sub PUBLIC_MakeBulkRelease (NNrtag_id, NN_pv_id_list)
|
|
|
509 |
Dim initialList ' holds all items
|
|
|
510 |
Dim remainingList1() ' To hold additive merge items
|
|
|
511 |
Dim remainingList2() ' To hold auto/manual build items
|
|
|
512 |
Dim len_remainingList
|
|
|
513 |
Dim pvId
|
|
|
514 |
Dim retParameters
|
|
|
515 |
Dim allowedToApproveMerge
|
|
|
516 |
|
|
|
517 |
' determine in advance if user is allowed to approve merges
|
|
|
518 |
allowedToApproveMerge = PRIVATE_Is_Allowed_To_Approve_Merge(NNrtag_id)
|
|
|
519 |
|
|
|
520 |
' ready the remaining list index to extract additive merges and manual/auto build items
|
|
|
521 |
len_remainingList = 0
|
|
|
522 |
|
|
|
523 |
AutoBuildPermissionDenied = FALSE
|
|
|
524 |
ManualBuildPermissionDenied = FALSE
|
|
|
525 |
|
|
|
526 |
' Remove any spaces and split the pv_id list into a string array
|
|
|
527 |
initialList = Split ( Replace(NN_pv_id_list, " ", "" ), "," )
|
|
|
528 |
|
|
|
529 |
' Process each subtractive merge item in the string array.
|
|
|
530 |
' We do these first to cleanup the release somewhat before we start adding new stuff in
|
|
|
531 |
For Each pvId In initialList
|
|
|
532 |
If IsNumeric(pvId) Then
|
|
|
533 |
' Test to see if this PV_ID represents a pending SUBTRACTIVE merge operation, and proceed with it if permissions allow
|
|
|
534 |
If PRIVATE_Is_A_Valid_Pending_Merge(NNrtag_id, pvId, "S") Then
|
|
|
535 |
If allowedToApproveMerge Then
|
|
|
536 |
Call PRIVATE_ApproveMerge(NNrtag_id, pvId)
|
|
|
537 |
Else
|
|
|
538 |
AutoBuildPermissionDenied = TRUE
|
|
|
539 |
ManualBuildPermissionDenied = TRUE
|
|
|
540 |
End If
|
|
|
541 |
Else
|
|
|
542 |
' add item to the remaining list for the next loop to process
|
|
|
543 |
len_remainingList = len_remainingList + 1
|
|
|
544 |
ReDim Preserve remainingList1(len_remainingList)
|
|
|
545 |
remainingList1(len_remainingList - 1) = pvId
|
|
|
546 |
End If
|
|
|
547 |
End If
|
|
|
548 |
Next
|
|
|
549 |
|
|
|
550 |
' ready the remaining list index to extract manual/auto build items
|
|
|
551 |
len_remainingList = 0
|
|
|
552 |
|
|
|
553 |
' Now process each additive merge item in the string array
|
|
|
554 |
' We do these before finally processing any auto/manual build items so that the latter take precedence in their eventual
|
|
|
555 |
' effect upon the release.
|
|
|
556 |
For Each pvId In remainingList1
|
|
|
557 |
' Test to see if this PV_ID represents a pending ADDITIVE merge operation, and proceed with it if permissions allow
|
|
|
558 |
If PRIVATE_Is_A_Valid_Pending_Merge(NNrtag_id, pvId, "A") Then
|
|
|
559 |
If allowedToApproveMerge Then
|
|
|
560 |
Call PRIVATE_ApproveMerge(NNrtag_id, pvId)
|
|
|
561 |
Else
|
|
|
562 |
AutoBuildPermissionDenied = TRUE
|
|
|
563 |
ManualBuildPermissionDenied = TRUE
|
|
|
564 |
End If
|
|
|
565 |
Else
|
|
|
566 |
' add item to the remaining list for the next loop to process
|
|
|
567 |
len_remainingList = len_remainingList + 1
|
|
|
568 |
ReDim Preserve remainingList2(len_remainingList)
|
|
|
569 |
remainingList2(len_remainingList - 1) = pvId
|
|
|
570 |
End If
|
|
|
571 |
Next
|
|
|
572 |
|
|
|
573 |
' Now process each new Auto/Manaul build item in the string array
|
| 129 |
ghuddy |
574 |
RaiseWIPExists = FALSE
|
| 123 |
ghuddy |
575 |
For Each pvId In remainingList2
|
| 129 |
ghuddy |
576 |
Call PUBLIC_ApproveRelease(NNrtag_id, pvId, retParameters, TRUE)
|
| 123 |
ghuddy |
577 |
Next
|
| 129 |
ghuddy |
578 |
If ( RaiseWIPExists = TRUE ) Then
|
|
|
579 |
Call RaiseMsg ( enum_MSG_PACKAGE_WIP_EXISTS&"?rtag_id="& NNrtag_id & "&pv_id="& pvId & "", pvId )
|
|
|
580 |
' RaiseMsg redirects loaded web page, so no return
|
|
|
581 |
End If
|
| 123 |
ghuddy |
582 |
|
|
|
583 |
|
|
|
584 |
' If any items were not approved for release due to permission errors, issue an alert to the user
|
|
|
585 |
If AutoBuildPermissionDenied = TRUE OR ManualBuildPermissionDenied = TRUE Then
|
|
|
586 |
Call RaiseMsg( enum_MSG_ERROR, "One of more items could not be approved due to missing permissions (either ApproveForAutoBuild or ApproveForManualBuild).<p>"_
|
|
|
587 |
& "NOTE : All items that could be approved, have been.</p>" )
|
|
|
588 |
End If
|
|
|
589 |
|
|
|
590 |
End Sub
|
|
|
591 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
592 |
|
|
|
593 |
|
|
|
594 |
|
|
|
595 |
|
|
|
596 |
%>
|