Subversion Repositories DevTools

Rev

Rev 7023 | Rev 7033 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7023 Rev 7032
Line 3980... Line 3980...
3980
                int rootPvId = rset.getInt("root_pv_id", -1);
3980
                int rootPvId = rset.getInt("root_pv_id", -1);
3981
                String rootCause = rset.getString("root_cause", null);
3981
                String rootCause = rset.getString("root_cause", null);
3982
 
3982
 
3983
                // force email notification by using a zero test build instruction
3983
                // force email notification by using a zero test build instruction
3984
                BuildExclusion buildExclusion = new BuildExclusion(pvId, rootPvId, rootCause, 0);
3984
                BuildExclusion buildExclusion = new BuildExclusion(pvId, rootPvId, rootCause, 0);
-
 
3985
                buildExclusion.setImported();
3985
                buildExclusionCollection.add(buildExclusion);
3986
                buildExclusionCollection.add(buildExclusion);
3986
            }
3987
            }
3987
 
3988
 
3988
            rset.close();
3989
            rset.close();
3989
            stmt.close();
3990
            stmt.close();
Line 3993... Line 3994...
3993
            handleSQLException(e, "");
3994
            handleSQLException(e, "");
3994
        }
3995
        }
3995
    }
3996
    }
3996
 
3997
 
3997
    /**
3998
    /**
3998
     * attempts to execute the Exclude_Indirect_From_Build stored procedure
3999
     * Execute the Exclude_Indirect_From_Build stored procedure
3999
     *  Note: Execute_Indirect_From_Build will delete matching do_not_ripple
4000
     *  Note: Execute_Indirect_From_Build will delete matching do_not_ripple
4000
     *        rows prior to an insertion - this is crucial!!
4001
     *        rows prior to an insertion - this is crucial!!
-
 
4002
     *        
-
 
4003
     * Note: The name 'Execute_Indirect_From_Build' is misleading as it appears to be used for both direct and indirect
-
 
4004
     *       exclusions.
-
 
4005
     * 
4001
     * @param hasConnection        IN True. Use existing connection and will not commit the operation
4006
     * @param hasConnection        IN True. Use existing connection and will not commit the operation
4002
     * @param packageVersionId     IN passed to Exclude_Indirect_From_Build
4007
     * @param packageVersionId     IN passed to Exclude_Indirect_From_Build
4003
     * @param packageVersion       IN passed to Exclude_Indirect_From_Build
4008
     * @param packageVersion       IN passed to Exclude_Indirect_From_Build
4004
     * @param rtagId               IN passed to Exclude_Indirect_From_Build
4009
     * @param rtagId               IN passed to Exclude_Indirect_From_Build
4005
     * @param rootPvId             IN passed to Exclude_Indirect_From_Build
4010
     * @param rootPvId             IN passed to Exclude_Indirect_From_Build
Line 4036... Line 4041...
4036
            {
4041
            {
4037
                if (!hasConnection)
4042
                if (!hasConnection)
4038
                    connect();
4043
                    connect();
4039
 
4044
 
4040
                boolean exist = false;
4045
                boolean exist = false;
-
 
4046
                boolean dbIsIndirect = false;
-
 
4047
                boolean entryIsIndirect = (rootPvId != null);
4041
 
4048
 
4042
                if ( !supercede )
4049
                if ( !supercede )
4043
                {
4050
                {
4044
                    // do not exclude a package already excluded ie let the first build failure count
4051
                    // do not exclude a package already excluded ie let the first build failure count
4045
                    // there is a window of opportunity here, but it is worth doing
4052
                    // there is a window of opportunity here, but it is worth doing
Line 4053... Line 4060...
4053
                    //      1 this query (run by a slave) indicates no build failure exists on this version
4060
                    //      1 this query (run by a slave) indicates no build failure exists on this version
4054
                    //      2 build failure is reported
4061
                    //      2 build failure is reported
4055
                    //      3 master build machine detects slave in state waiting
4062
                    //      3 master build machine detects slave in state waiting
4056
                    //      4 master daemon discovers slave did not deliver artifacts
4063
                    //      4 master daemon discovers slave did not deliver artifacts
4057
                    //      5 master daemon is prevented from overriding the build failure
4064
                    //      5 master daemon is prevented from overriding the build failure
-
 
4065
                    //
-
 
4066
                    // Another complication
-
 
4067
                    //  If this is a direct exclusion (rootPvid) is null and the entry in the table is an indirect exclusion
-
 
4068
                    //  then we should delete the indirect exclusion and replace it with a direct exclusion
-
 
4069
                    //
4058
                    CallableStatement stmt = mConnection.prepareCall("select pv_id from release_manager.do_not_ripple where pv_id=" + packageVersionId + "and rtag_id=" + rtagId);
4070
                    CallableStatement stmt = mConnection.prepareCall("select pv_id, root_pv_id from release_manager.do_not_ripple where pv_id=" + packageVersionId + "and rtag_id=" + rtagId);
4059
                    ResultSet rset = stmt.executeQuery();
4071
                    ResultSet rset = stmt.executeQuery();
4060
 
4072
 
4061
                    while( rset.next() )
4073
                    while( rset.next() )
4062
                    {
4074
                    {
4063
                        exist = true;
4075
                        exist = true;
-
 
4076
                        rset.getInt("root_pv_id");
-
 
4077
                        dbIsIndirect = ! rset.wasNull();
-
 
4078
                        
-
 
4079
                        // Override an indirect database entry with a direct exclusion
-
 
4080
                        if ( dbIsIndirect && ! entryIsIndirect ) {
-
 
4081
                            exist = false;
-
 
4082
                        }
-
 
4083
                        
4064
                        break;
4084
                        break;
4065
                    }
4085
                    }
4066
 
4086
 
4067
                    rset.close();
4087
                    rset.close();
4068
                    stmt.close();
4088
                    stmt.close();