<%@LANGUAGE="VBSCRIPT"%> <% '===================================================== ' ' Build Status Information ' '===================================================== %> <% Option explicit ' Good idea to set when using redirect Response.Expires = 0 ' always load the page, dont store %> <% '------------ ACCESS CONTROL ------------------ %> <% '------------ Scripts -------------------------- %> <% '------------ Variable Definition ------------- Dim rsQry Dim parRtagId Dim query_string Dim rcon_id Dim canControl '------------ Constants Declaration ----------- '------------ Variable Init ------------------- parRtagId = Request("rtag_id") objPMod.PersistInQryString("rtag_id") canControl = canActionControlInProject("BuildControl") '---------------------------------------------- Sub IncludePackages() On Error Resume Next objEH.ErrorRedirect = TRUE OraDatabase.Parameters.Add "PV_ID_LIST", Request("pv_id_list"), ORAPARM_INPUT, ORATYPE_VARCHAR2 OraDatabase.Parameters.Add "RTAG_ID", parRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER objEH.TryORA ( OraSession ) OraDatabase.ExecuteSQL "BEGIN Ripple_Package( :PV_ID_LIST, :RTAG_ID, :USER_ID ); END;" objEH.CatchORA ( OraSession ) OraDatabase.Parameters.Remove "PV_ID_LIST" OraDatabase.Parameters.Remove "RTAG_ID" OraDatabase.Parameters.Remove "USER_ID" End Sub '-------------------------------------------------------------------------------------------------------------------------- '------------ RUN BEFORE PAGE RENDER ---------- '---------------------------------------------------- ' --- RUN onPostBack --- If Request("action") <> "" AND objAccessControl.UserLogedIn Then If objEH.Finally Then If Request("action") = "include" Then Call IncludePackages () ' Redirect to the current page so that a refesh will not ' cause a form re-submit. Call Destroy_All_Objects Response.Redirect(ScriptName & "?rtag_id=" & parRtagId) Else Call OpenInWindow ( "dependencies.asp?rtag_id="& parRtagId ) End If End If End If '---------------------------------------------- Sub ShowBuildStatus objFormComponent.FormName = "FormName" objFormComponent.Action = ScriptName &"?rtag_id="& parRtagId Call objFormComponent.FormStart() %>
BUILD STATUS INFORMATION
<% query_string = " select pkg.pkg_name, pv.pkg_version, pv.pv_id, dnr.rtag_id, dnr.root_cause, dnr.root_file, pv.pv_description, dnr.root_pv_id"&_ " from do_not_ripple dnr, package_versions pv, packages pkg"&_ " where dnr.rtag_id = "& parRtagId &_ " and pv.pv_id = dnr.pv_id"&_ " and pkg.pkg_id = pv.pkg_id"&_ " and nvl(dnr.root_pv_id, -1) < 0 " &_ " order by pkg_name" Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT ) '--- Render rows --- Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF) Dim rowClass Dim rowData ' ' Manually excluded packages have no root_cause or root_file or root_pv_id ' ' root_file, if supplied, indicates a build failure log file exists ' this should always prevail over the textual root_cause ' If (IsNull(rsQry("root_file")) AND IsNull(rsQry("root_cause"))) Then rowData = "Manually Excluded" rowClass = "manualCause" ElseIf IsNull(rsQry("root_file")) Then rowData = rsQry("root_cause") If InStr(rowData, "no build env") Then rowClass = "rootNoEnv" Else rowClass = "rootCause" End If Else rowClass = "rootFile" rowData = "" &_ "Build Failure Log File" End If Dim checkBoxData, checkBoxClass If NiceInt(rsQry("root_pv_id"), -1) = -1 Then checkBoxData = "" checkBoxClass = "directInclude" Else checkBoxData = "disabled" checkBoxClass = "" End If %> <% rsQry.MoveNext Loop query_string = " select pv.pv_id, pkg.pkg_name, pv.pkg_version, qkg.pkg_name, dnr.rtag_id, pv.pv_description"&_ " from do_not_ripple dnr, package_versions pv, package_versions qv, packages pkg, packages qkg"&_ " where dnr.rtag_id = "& parRtagId &_ " and pv.pv_id = dnr.pv_id"&_ " and pkg.pkg_id = pv.pkg_id"&_ " and qv.pv_id = dnr.root_pv_id"&_ " and qkg.pkg_id = qv.pkg_id"&_ " and nvl(dnr.root_pv_id, -1) > 0"&_ " order by pkg.pkg_name" Dim rsQry2 Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT ) ' -- DISPLAY INDIRECTLY EXCLUDED PACKAGES '--- Render rows --- If rsQry2.recordCount > 0 Then %> <% End If Do While (NOT rsQry2.BOF) AND (NOT rsQry2.EOF)%> <% rsQry2.MoveNext Loop%>
Packages Excluded From Build
Show Manual Exclusions Config Errors Env Errors Build Errors Indirect Exclusions
Directly Package Version Root Cause
"> " name="pv_id_list" <%=checkBoxData%>> &rtag_id=<%=rsQry("rtag_id")%>" title="<%=rsQry("pv_description")%>"><%=rsQry("pkg_name")%> <%=rsQry("pkg_version")%> <%=rowData%>
Indirectly Package Version Root Cause Package
<%=rsQry2(1)%> <%=rsQry2(2)%> » <%=rsQry2(3)%>
0, "", " disabled ")%> type="checkbox" title="Toggle all visible directly excluded packages"> <% Response.Write(objFormComponent.SubmitButton ( "Include", "name='IncludeSubmit' id='IncludeSubmit' class='form_btn' disabled style='color:silver' onClick=""return vixConfirm('Are you sure you want to include these packages for building?',{title:'Include Packages', post : 'FormName'})""" )) %>
<%Response.Write(objPMod.ComposeHiddenTags())%> <%Call objFormComponent.FormEnd()%> <% rsQry.Close() Set rsQry = nothing rsQry2.Close() Set rsQry2 = nothing End Sub '------------------------------------------------- ' Sub ShowDaemonStatus %>

DAEMON STATUS INFORMATION

Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>] [Refresh]
<% Dim bInactiveMachine : bInactiveMachine = false %> <% ' Get Build Information for this Release query_string = _ "SELECT rc.rcon_id, display_name, gbe_value, daemon_mode, NVL(ACTIVE, 'U') AS ACTIVE," &_ " rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) AS delta," &_ " pk.pkg_name, rl.current_pv_id, pv.build_time, TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) AS build_delta" &_ " FROM release_config rc," &_ " gbe_machtype gm," &_ " build_machine_config bm," &_ " run_level rl," &_ " packages pk," &_ " package_versions pv" &_ " WHERE rc.rtag_id = " & parRtagId &_ " AND gm.gbe_id = rc.gbe_id" &_ " AND rl.rcon_id(+) = rc.rcon_id" &_ " AND rc.bmcon_id =bm.bmcon_id(+)" &_ " AND pk.pkg_id(+) = rl.current_pkg_id_being_built" &_ " AND rl.current_pv_id = pv.pv_id(+)" &_ " ORDER BY bm.display_name, rc.rcon_id" Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT ) Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF) Dim pkgName Dim pkgPvid Dim pkgBuildTime Dim currentRunLevel Dim daemonState Dim delta Dim PkgBuildDelta Dim pkgId Dim bActive Dim estDuration Dim daemonMode Dim lastChange rcon_id = rsQry("rcon_id") ' = rsQry("display_name") ' = rsQry("gbe_value") daemonMode = rsQry("daemon_mode") bActive = rsQry("ACTIVE") daemonState = rsQry("pause") currentRunLevel = rsQry("current_run_level") pkgId = rsQry("current_pkg_id_being_built") delta = rsQry("delta") pkgName = rsQry("pkg_name") pkgPvid = rsQry("current_pv_id") pkgBuildTime = rsQry("build_time") PkgBuildDelta = rsQry("build_delta") lastChange = NULL estDuration = NULL If bActive = "N" Then bInactiveMachine = true If IsNull(daemonState) Then daemonState = 0 If daemonState = "2" Then pkgId = Null If IsNull(currentRunLevel) Then currentRunLevel = -1 If daemonMode = "M" AND not IsNull(pkgName) Then estDuration = pkgBuildTime & "[" & PkgBuildDelta & "]" If bActive <> "U" Then lastChange = PrettyDelta(delta, daemonState,pkgName ) ' --- Now render HTML for this release configuration --- %> <% rsQry.MoveNext Loop %> <% rsQry.Close() Set rsQry = nothing %>
Daemon Host Machine Type Mode Run Level Current Package Est Duration<%=Quick_Help("h_buildtime")%> Last Change<%=Quick_Help("h_lastchange")%> Control State
<%=rsQry("display_name")%> <%=rsQry("gbe_value")%> <%=Get_Daemon_Mode(daemonMode)%> <%=Get_Run_Level(currentRunLevel, IndefPause, daemonState, bActive)%> <%=Get_Package_Name(pkgName,parRtagId,pkgPvid, daemonState, bActive)%> <%=estDuration%> <%=lastChange%> <% If NOT IndefPause Then If bActive = "U" Then ElseIf bActive = "N" Then Call Action_Buttons ( "Daemon Unavailable" ) ElseIf daemonState = 0 Then Call Action_Buttons_State ( "Daemon Pause", canControl ) ElseIf daemonState = 1 Then Call Action_Buttons_State ( "Daemon Resume", canControl ) ElseIf daemonState = 2 Then Call Action_Buttons_State ( "Daemon Start", canControl ) Else Call Action_Buttons_State ( "Daemon Resume", canControl ) End If Else %>Unavailable<% End If %>
<%If CheckConfigErrors(parRtagId) OR bInactiveMachine Then%> Daemon configuration errors detected <%End If%> <% If (rsQry.RecordCount > 0) AND NOT IndefPause Then Call Action_Buttons_State ( "Daemon Control All", objAccessControl.UserLogedIn AND canControl ) Else %> <% End If %>
<% End Sub '------------------------------------------------- ' Sub ShowDaemonInstructions %>
DAEMON INSTRUCTIONS FOR THIS RELEASE
<% Dim PkgVersion Dim UserName Dim UserEmail Dim bInProgress Dim bIsOverdue Dim bIsReady Set rsQry = OraDatabase.DbCreateDynaset( "SELECT DAEMON_INSTRUCTIONS_ID,"&_ " OP_CODE,"&_ " RTAG_ID,"&_ " PV_ID,"&_ " SCHEDULED_DATETIME,"&_ " REPEAT_SECS,"&_ " ADDED_DATETIME,"&_ " USER_ID,"&_ " IN_PROGRESS,"&_ " (CASE WHEN SCHEDULED_DATETIME <= SYSDATE THEN 1 ELSE 0 END) AS READY,"&_ " (CASE WHEN (SCHEDULED_DATETIME + (1/144)) < SYSDATE THEN 1 ELSE 0 END) AS OVERDUE"&_ " FROM DAEMON_INSTRUCTIONS "&_ " WHERE RTAG_ID = "& parRtagId &_ " ORDER BY PV_ID, SCHEDULED_DATETIME, DAEMON_INSTRUCTIONS_ID", ORADYN_DEFAULT ) While (NOT rsQry.BOF) AND (NOT rsQry.EOF) If IsNull(rsQry("IN_PROGRESS")) OR rsQry("IN_PROGRESS") = "0" Then bInProgress = False Else bInProgress = True End If ' only flag as overdue if time threshold has been met but the daemon has not marked the instruction as being in progress. If rsQry("OVERDUE") AND NOT bInProgress Then bIsOverdue = True Else bIsOverdue = False End If If rsQry("READY") Then bIsReady = True Else bIsReady = False End If ' Get as much info about the package as we can Dim PkgId: PkgId = 0 Dim PkgName : PkgName = "N/A" If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then Call Get_Pkg_Short_Info(rsQry("PV_ID"), PkgId, PkgName, PkgVersion, NULL, NULL, NULL) End If %> <% rsQry.MoveNext() Wend rsQry.Close() Set rsQry = nothing %>
Operation Package Version Scheduled Time<%=Quick_Help("SchedTime")%> Repeat In Progress
<%=DaemonInstructionOperationName(rsQry("OP_CODE"))%> <%If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then%> <%=PkgName%> <%Else%> <%=PkgName%> <%End If%> <%=PkgVersion%> style=color:Red<%Elseif bIsReady Then%>style=color:Green<%End If%>><%=DisplayDateTime(rsQry("SCHEDULED_DATETIME"))%> <%=DaemonInstructionRepeatString(rsQry("OP_CODE"), rsQry("REPEAT_SECS"))%> <%If bInProgress Then%> YES <%Else%> NO <%End If%>
<% End Sub %> Release Manager
<%Call BuildMenuPane%> <%Call ShowBuildStatus%> <%Call ShowDaemonStatus%> <%Call ShowDaemonInstructions%>