| 119 |
ghuddy |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
| 129 |
ghuddy |
4 |
' MAKE UNOFFICIAL
|
| 119 |
ghuddy |
5 |
' --- PROCESS FORM ---
|
|
|
6 |
'=====================================================
|
|
|
7 |
%>
|
|
|
8 |
<%
|
|
|
9 |
Option explicit
|
|
|
10 |
' Good idea to set when using redirect
|
| 129 |
ghuddy |
11 |
Response.Expires = 0 ' always load the page, dont store
|
| 119 |
ghuddy |
12 |
%>
|
|
|
13 |
|
|
|
14 |
<!--#include file="common/conf.asp"-->
|
|
|
15 |
<!--#include file="common/globals.asp"-->
|
|
|
16 |
<!--#include file="common/formating.asp"-->
|
|
|
17 |
<!--#include file="common/qstr.asp"-->
|
|
|
18 |
<!--#include file="common/common_subs.asp"-->
|
|
|
19 |
<!--#include file="common/common_dbedit.asp"-->
|
|
|
20 |
<%
|
|
|
21 |
'------------ ACCESS CONTROL ------------------
|
|
|
22 |
%>
|
|
|
23 |
<!--#include file="_access_control_login.asp"-->
|
|
|
24 |
<!--#include file="_access_control_general.asp"-->
|
|
|
25 |
<!--#include file="_access_control_project.asp"-->
|
|
|
26 |
<%
|
|
|
27 |
'------------ Variable Definition -------------
|
| 143 |
ghuddy |
28 |
Dim isDLocked
|
| 119 |
ghuddy |
29 |
'------------ Constants Declaration -----------
|
|
|
30 |
'------------ Variable Init -------------------
|
|
|
31 |
'----------------------------------------------
|
|
|
32 |
%>
|
|
|
33 |
<%
|
|
|
34 |
Sub MakeReject ()
|
| 129 |
ghuddy |
35 |
|
|
|
36 |
objEH.TryORA ( OraSession )
|
|
|
37 |
On Error Resume Next
|
|
|
38 |
|
| 143 |
ghuddy |
39 |
OraDatabase.Parameters.Add "PV_ID", Request("pv_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
40 |
OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
41 |
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
| 129 |
ghuddy |
42 |
|
|
|
43 |
OraDatabase.ExecuteSQL _
|
|
|
44 |
"BEGIN "&_
|
|
|
45 |
" PK_ENVIRONMENT.MAKE_REJECT ( :PV_ID, :RTAG_ID, :USER_ID ); "&_
|
|
|
46 |
"END; "
|
|
|
47 |
|
|
|
48 |
objEH.CatchORA ( OraSession )
|
|
|
49 |
|
|
|
50 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
51 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
52 |
OraDatabase.Parameters.Remove "USER_ID"
|
|
|
53 |
|
| 119 |
ghuddy |
54 |
End Sub
|
| 143 |
ghuddy |
55 |
|
|
|
56 |
Sub RejectAutobuild()
|
|
|
57 |
|
|
|
58 |
OraDatabase.Parameters.Add "PV_ID", Request("pv_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
59 |
OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
60 |
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
61 |
OraDatabase.Parameters.Add "ACTION_TYPE_NAME", "reject_package", ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
62 |
OraDatabase.Parameters.Add "DESCRIPTION", "Rejected manually following autobuild failure", ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
63 |
|
|
|
64 |
On Error Resume Next
|
|
|
65 |
objEH.TryORA( OraSession )
|
|
|
66 |
|
|
|
67 |
' Move package back to work-in-progress table (changes dlocked to "R" in doing so)
|
|
|
68 |
OraDatabase.ExecuteSQL _
|
|
|
69 |
"BEGIN "&_
|
|
|
70 |
" PK_ENVIRONMENT.MAKE_REJECT ( :PV_ID, :RTAG_ID, :USER_ID ); "&_
|
|
|
71 |
"END; "
|
|
|
72 |
|
|
|
73 |
If Err.Number = 0 Then
|
|
|
74 |
|
|
|
75 |
' Remove the entry from the do not ripple table but only if it is a direct exlusion entry caused by some build problem.
|
|
|
76 |
' This way, if user has deliberately excluded the package from the build (root_pv_id is null, root_cause is null
|
|
|
77 |
' and root_file is null) then it will remain exlcuded, as it will if there is some underlying package that has caused
|
|
|
78 |
' the exclusion.
|
|
|
79 |
OraDatabase.ExecuteSQL ("DELETE FROM do_not_ripple "&_
|
|
|
80 |
" WHERE pv_id = :PV_ID "&_
|
|
|
81 |
" AND rtag_id = :RTAG_ID "&_
|
|
|
82 |
" AND root_pv_id IS NULL"&_
|
|
|
83 |
" AND ((root_cause IS NOT NULL) OR (root_file IS NOT NULL))" )
|
|
|
84 |
|
|
|
85 |
If Err.Number = 0 Then
|
|
|
86 |
|
|
|
87 |
OraDatabase.ExecuteSQL ("BEGIN Log_Action ( :PV_ID, :ACTION_TYPE_NAME, :USER_ID, :DESCRIPTION ); END;")
|
|
|
88 |
|
|
|
89 |
End If
|
|
|
90 |
|
|
|
91 |
End If
|
|
|
92 |
|
|
|
93 |
objEH.CatchORA( OraSession )
|
|
|
94 |
|
|
|
95 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
96 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
97 |
OraDatabase.Parameters.Remove "USER_ID"
|
|
|
98 |
OraDatabase.Parameters.Remove "ACTION_TYPE_NAME"
|
|
|
99 |
OraDatabase.Parameters.Remove "DESCRIPTION"
|
|
|
100 |
|
|
|
101 |
End Sub
|
|
|
102 |
|
| 119 |
ghuddy |
103 |
%>
|
|
|
104 |
<%
|
|
|
105 |
'----------------------- MAIN LINE ---------------------------
|
|
|
106 |
|
| 143 |
ghuddy |
107 |
'--- Process submit ---
|
| 119 |
ghuddy |
108 |
If (Request("rtag_id") <> "") AND (Request("pv_id") <> "") Then
|
| 129 |
ghuddy |
109 |
|
|
|
110 |
|
| 143 |
ghuddy |
111 |
Call Get_Pkg_Short_Info( Request("pv_id"), NULL, NULL, NULL, NULL, NULL, isDLocked )
|
| 129 |
ghuddy |
112 |
|
| 143 |
ghuddy |
113 |
If isDLocked = "A" Then
|
|
|
114 |
'Do the reject operation - this execution path rejects an Approved package version back to Pending
|
|
|
115 |
|
|
|
116 |
'We can only do this operation if the build daemon is not going to be doing anything with the entry in
|
|
|
117 |
'the "package versions" table. We can only guarantee this if the Daemon has failed to build the package version
|
|
|
118 |
'and placed an entry for it in the "do not ripple" table, so check this.
|
|
|
119 |
If isInDoNotRippleTable( Request("rtag_id"), Request("pv_id") ) = TRUE Then
|
|
|
120 |
Call RejectAutobuild()
|
|
|
121 |
Else
|
|
|
122 |
Call RaiseMsg(enum_MSG_ERROR, "Cannot reject unless item is certain not to be examined concurrently by a build daemon during the reject operation. Wait for the build to fail.")
|
|
|
123 |
End If
|
|
|
124 |
Else
|
|
|
125 |
'Do the reject operation - this execution path rejects a Pending package version back to Work In Progress
|
|
|
126 |
Call MakeReject()
|
|
|
127 |
End If
|
|
|
128 |
|
|
|
129 |
|
|
|
130 |
|
| 5957 |
dpurdie |
131 |
Call Destroy_All_Objects
|
| 129 |
ghuddy |
132 |
If Request("rfile") <> "" Then
|
|
|
133 |
Response.Redirect ( Request("rfile") &"?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") )
|
|
|
134 |
Else
|
|
|
135 |
Response.Redirect ( "dependencies?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") )
|
|
|
136 |
End If
|
|
|
137 |
|
| 119 |
ghuddy |
138 |
Else
|
| 1376 |
dpurdie |
139 |
Response.write "Some mandatory parameters are missing!" & "<br>" 'TODO
|
| 4955 |
dpurdie |
140 |
Response.write QSTR_FullQuery
|
| 119 |
ghuddy |
141 |
End If
|
|
|
142 |
%>
|
|
|
143 |
<!-- DESTRUCTOR ------->
|
| 129 |
ghuddy |
144 |
<!--#include file="common/destructor.asp"-->
|