Subversion Repositories DevTools

Rev

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

Rev 129 Rev 143
Line 23... Line 23...
23
<!--#include file="_access_control_login.asp"-->
23
<!--#include file="_access_control_login.asp"-->
24
<!--#include file="_access_control_general.asp"-->
24
<!--#include file="_access_control_general.asp"-->
25
<!--#include file="_access_control_project.asp"-->
25
<!--#include file="_access_control_project.asp"-->
26
<%
26
<%
27
'------------ Variable Definition -------------
27
'------------ Variable Definition -------------
-
 
28
Dim isDLocked
28
'------------ Constants Declaration -----------
29
'------------ Constants Declaration -----------
29
'------------ Variable Init -------------------
30
'------------ Variable Init -------------------
30
'----------------------------------------------
31
'----------------------------------------------
31
%>
32
%>
32
<%
33
<%
Line 35... Line 36...
35
   Set objWSH = Server.CreateObject("WScript.Shell")
36
   Set objWSH = Server.CreateObject("WScript.Shell")
36
 
37
 
37
   objEH.TryORA ( OraSession )
38
   objEH.TryORA ( OraSession )
38
   On Error Resume Next
39
   On Error Resume Next
39
 
40
 
40
   OraDatabase.Parameters.Add "PV_ID",       Request("pv_id"),   ORAPARM_INPUT, ORATYPE_NUMBER
41
   OraDatabase.Parameters.Add "PV_ID",   Request("pv_id"),        ORAPARM_INPUT, ORATYPE_NUMBER
41
   OraDatabase.Parameters.Add "RTAG_ID",       Request("rtag_id"),   ORAPARM_INPUT, ORATYPE_NUMBER
42
   OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"),      ORAPARM_INPUT, ORATYPE_NUMBER
42
   OraDatabase.Parameters.Add "USER_ID",       objAccessControl.UserId,   ORAPARM_INPUT, ORATYPE_NUMBER
43
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
43
 
44
 
44
   OraDatabase.ExecuteSQL _
45
   OraDatabase.ExecuteSQL _
45
   "BEGIN "&_
46
   "BEGIN "&_
46
   " PK_ENVIRONMENT.MAKE_REJECT ( :PV_ID, :RTAG_ID, :USER_ID ); "&_
47
   " PK_ENVIRONMENT.MAKE_REJECT ( :PV_ID, :RTAG_ID, :USER_ID ); "&_
47
   "END; "
48
   "END; "
Line 57... Line 58...
57
                  "/pv_id:"& Request("pv_id") , _
58
                  "/pv_id:"& Request("pv_id") , _
58
                  0, FALSE
59
                  0, FALSE
59
   End If
60
   End If
60
 
61
 
61
End Sub
62
End Sub
-
 
63
 
-
 
64
Sub RejectAutobuild()
-
 
65
 
-
 
66
   OraDatabase.Parameters.Add "PV_ID",            Request("pv_id"),        ORAPARM_INPUT, ORATYPE_NUMBER
-
 
67
   OraDatabase.Parameters.Add "RTAG_ID",          Request("rtag_id"),      ORAPARM_INPUT, ORATYPE_NUMBER
-
 
68
   OraDatabase.Parameters.Add "USER_ID",          objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
-
 
69
   OraDatabase.Parameters.Add "ACTION_TYPE_NAME", "reject_package",        ORAPARM_INPUT, ORATYPE_VARCHAR2
-
 
70
   OraDatabase.Parameters.Add "DESCRIPTION",      "Rejected manually following autobuild failure", ORAPARM_INPUT, ORATYPE_VARCHAR2
-
 
71
 
-
 
72
   On Error Resume Next
-
 
73
   objEH.TryORA( OraSession )
-
 
74
 
-
 
75
   ' Move package back to work-in-progress table (changes dlocked to "R" in doing so)
-
 
76
   OraDatabase.ExecuteSQL _
-
 
77
   "BEGIN "&_
-
 
78
   " PK_ENVIRONMENT.MAKE_REJECT ( :PV_ID, :RTAG_ID, :USER_ID ); "&_
-
 
79
   "END; "
-
 
80
 
-
 
81
   If Err.Number = 0 Then
-
 
82
 
-
 
83
      ' Remove the entry from the do not ripple table but only if it is a direct exlusion entry caused by some build problem.
-
 
84
      ' This way, if user has deliberately excluded the package from the build (root_pv_id is null, root_cause is null
-
 
85
      ' and root_file is null) then it will remain exlcuded, as it will if there is some underlying package that has caused
-
 
86
      ' the exclusion.
-
 
87
      OraDatabase.ExecuteSQL ("DELETE FROM do_not_ripple "&_
-
 
88
                              "      WHERE pv_id   = :PV_ID "&_
-
 
89
                              "        AND rtag_id = :RTAG_ID "&_
-
 
90
                              "        AND root_pv_id IS NULL"&_
-
 
91
                              "        AND ((root_cause IS NOT NULL) OR (root_file IS NOT NULL))" )
-
 
92
 
-
 
93
      If Err.Number = 0 Then
-
 
94
 
-
 
95
         OraDatabase.ExecuteSQL ("BEGIN Log_Action ( :PV_ID, :ACTION_TYPE_NAME, :USER_ID, :DESCRIPTION ); END;")
-
 
96
 
-
 
97
      End If
-
 
98
 
-
 
99
   End If
-
 
100
 
-
 
101
   objEH.CatchORA( OraSession )
-
 
102
 
-
 
103
   OraDatabase.Parameters.Remove "PV_ID"
-
 
104
   OraDatabase.Parameters.Remove "RTAG_ID"
-
 
105
   OraDatabase.Parameters.Remove "USER_ID"
-
 
106
   OraDatabase.Parameters.Remove "ACTION_TYPE_NAME"
-
 
107
   OraDatabase.Parameters.Remove "DESCRIPTION"
-
 
108
 
-
 
109
End Sub
-
 
110
 
62
%>
111
%>
63
<%
112
<%
64
'-----------------------  MAIN LINE  ---------------------------
113
'-----------------------  MAIN LINE  ---------------------------
65
 
114
 
66
'--- Process submition ---
115
'--- Process submit ---
67
If (Request("rtag_id") <> "") AND (Request("pv_id") <> "")  Then
116
If (Request("rtag_id") <> "") AND (Request("pv_id") <> "")  Then
68
 
117
 
-
 
118
 
-
 
119
   Call Get_Pkg_Short_Info( Request("pv_id"), NULL, NULL, NULL, NULL, NULL, isDLocked )
-
 
120
 
69
   'COMPLETE THE REQUEST...
121
   If isDLocked = "A" Then
-
 
122
      'Do the reject operation - this execution path rejects an Approved package version back to Pending
-
 
123
 
-
 
124
      'We can only do this operation if the build daemon is not going to be doing anything with the entry in
-
 
125
      'the "package versions" table. We can only guarantee this if the Daemon has failed to build the package version
-
 
126
      'and placed an entry for it in the "do not ripple" table, so check this.
-
 
127
      If isInDoNotRippleTable( Request("rtag_id"), Request("pv_id") ) = TRUE Then
-
 
128
         Call RejectAutobuild()
-
 
129
      Else
-
 
130
         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.")
-
 
131
      End If
-
 
132
   Else
-
 
133
      'Do the reject operation - this execution path rejects a Pending package version back to Work In Progress
70
   Call MakeReject ( )
134
      Call MakeReject()
-
 
135
   End If
-
 
136
 
71
 
137
 
72
 
138
 
73
   If Request("rfile") <> "" Then
139
   If Request("rfile") <> "" Then
74
      Response.Redirect ( Request("rfile") &"?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") )
140
      Response.Redirect ( Request("rfile") &"?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") )
75
   Else
141
   Else