Subversion Repositories DevTools

Rev

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

Rev 7080 Rev 7081
Line 1027... Line 1027...
1027
                    // Use the basic plan
1027
                    // Use the basic plan
1028
                    mBuildOrder.addAll(basicPlan.planCollection);
1028
                    mBuildOrder.addAll(basicPlan.planCollection);
1029
                    
1029
                    
1030
                } else if ( !fullPlan.planCollection.isEmpty() ) {
1030
                } else if ( !fullPlan.planCollection.isEmpty() ) {
1031
                    // Use the full plan
1031
                    // Use the full plan
1032
                    mBuildOrder.addAll(basicPlan.planCollection);
1032
                    mBuildOrder.addAll(fullPlan.planCollection);
1033
                    
1033
                    
1034
                } else {
1034
                } else {
1035
                    // Do not have a plan
1035
                    // Do not have a plan
1036
                    // May have tests requests
1036
                    // May have tests requests
1037
                }
1037
                }
Line 1099... Line 1099...
1099
                    }
1099
                    }
1100
                }
1100
                }
1101
                
1101
                
1102
                //
1102
                //
1103
                //  Report packages that are indirectly excluded
1103
                //  Report packages that are indirectly excluded
1104
                //  ie: They will be built because one, or more, of there dependents is not buildable
1104
                //  ie: They will not be built because one, or more, of there dependents is not buildable
1105
                //
1105
                //
1106
                mLogger.debug("planBuildOrder process packages which are not ripple buildable");
1106
                mLogger.debug("planBuildOrder process packages which are not ripple buildable");
1107
 
1107
 
1108
                 for (ListIterator<BuildExclusion> it = mBuildExclusionCollection.listIterator(); it.hasNext(); )
1108
                 for (ListIterator<BuildExclusion> it = mBuildExclusionCollection.listIterator(); it.hasNext(); )
1109
                 {
1109
                 {
Line 1114... Line 1114...
1114
                         Package p = it1.next();
1114
                         Package p = it1.next();
1115
 
1115
 
1116
                         // ensure only root cause, non test build, build exclusions are excluded
1116
                         // ensure only root cause, non test build, build exclusions are excluded
1117
                         // mBuildExclusionCollection is at this point based on
1117
                         // mBuildExclusionCollection is at this point based on
1118
                         // relevant (direct and indirect) excluded pv's in the database
1118
                         // relevant (direct and indirect) excluded pv's in the database
-
 
1119
                         
1119
                         if ( be.compare(p.mId) && be.isARootCause() && p.mTestBuildInstruction == 0 && p.mForcedRippleInstruction == 0 )
1120
                         if ( be.compare(p.mId) && be.isARootCause() && p.mTestBuildInstruction == 0 && p.mForcedRippleInstruction == 0 )
1120
                         {
1121
                         {
1121
                             // package is not reproducible, discard it and its consumers
1122
                             // package is not reproducible, discard it and its consumers
1122
                             //
1123
                             //
1123
                             mLogger.info("Excluded Package {}, {}", p.mAlias, be.mRootCause);                                     
1124
                             mLogger.info("Excluded Package {}, {}", p.mAlias, be );                                     
1124
                             
1125
                             
1125
                             ArrayList<Package> toExclude = new ArrayList<Package>();
1126
                             ArrayList<Package> toExclude = new ArrayList<Package>();
1126
                             toExclude.addAll(usedByAnyPackages(p, mPackageCollection ));
1127
                             toExclude.addAll(usedByAnyPackages(p, mPackageCollection ));
1127
                             
1128
                             
1128
                             //  Process packages that we need to exclude indirectly
1129
                             //  Process packages that we need to exclude indirectly
1129
                             //
1130
                             //
1130
                             while ( ! toExclude.isEmpty())
1131
                             while ( ! toExclude.isEmpty())
1131
                             {
1132
                             {
1132
                                 Package pkg = toExclude.remove(0);
1133
                                 Package pkg = toExclude.remove(0);
1133
                                 
1134
                                 
1134
                                 // If this package has not been excluded ( for whatever reason), than add it
1135
                                 // If this package has not been excluded (for whatever reason), than add it
1135
                                 boolean found = false;
1136
                                 boolean found = false;
1136
                                 for (Iterator<BuildExclusion> it2 = mBuildExclusionCollection.iterator(); it2.hasNext(); )
1137
                                 for (Iterator<BuildExclusion> it2 = mBuildExclusionCollection.iterator(); it2.hasNext(); )
1137
                                 {
1138
                                 {
1138
                                     BuildExclusion buildExclusion = it2.next();
1139
                                     BuildExclusion buildExclusion = it2.next();
1139
                                     if (buildExclusion.compare(pkg.mId) )
1140
                                     if (buildExclusion.compare(pkg.mId) )
1140
                                     {
1141
                                     {
1141
                                         found = true;
1142
                                         found = true;
-
 
1143
                                         if  ( buildExclusion.isImported() )
-
 
1144
                                         {
-
 
1145
                                             // An exclusion for this package already exists
-
 
1146
                                             // If it was 'imported' from the database then 
-
 
1147
                                             // mark it as processed so that it will be persisted
-
 
1148
                                             //
-
 
1149
                                             // Otherwise it will be a new one
-
 
1150
                                             //
-
 
1151
                                             buildExclusion.setProcessed();
-
 
1152
                                         }
1142
                                         break;
1153
                                         break;
1143
                                     }
1154
                                     }
1144
                                 }
1155
                                 }
1145
                                 
1156
                                 
1146
                                 if (!found)
1157
                                 if (!found)
Line 1246... Line 1257...
1246
        //      First find packages to be directly excluded
1257
        //      First find packages to be directly excluded
1247
        ArrayList<Package>exclude = new ArrayList<Package>();
1258
        ArrayList<Package>exclude = new ArrayList<Package>();
1248
        for (Iterator<Package> it = packageCollection.iterator(); it.hasNext(); )
1259
        for (Iterator<Package> it = packageCollection.iterator(); it.hasNext(); )
1249
        {
1260
        {
1250
            Package p = it.next();
1261
            Package p = it.next();
1251
            if (p.mBuildFile < 0) {
1262
            if ( p.mBuildFile == -8 ) {
-
 
1263
 
-
 
1264
                //  Mark SDK or Pegged so that we don't build them, but can build their dependents
-
 
1265
                p.mProcessed = true;
-
 
1266
                p.mIsProcessed = true;
-
 
1267
                mLogger.error("SDK/Peg Exclude: {}", p);
-
 
1268
                
-
 
1269
            } else if (p.mBuildFile < 0 ) {
1252
                exclude.add(p);
1270
                exclude.add(p);
-
 
1271
                mLogger.error("Direct Exclude: {}", p);
-
 
1272
                
1253
            }
1273
            }
1254
        }
1274
        }
1255
        
1275
        
1256
        //  Exclude packages that have failed to be built
1276
        //  Exclude packages that have failed to be built
1257
        //      These are recorded in mBuildExclusionCollection
1277
        //      These are recorded in mBuildExclusionCollection
1258
        for (ListIterator<BuildExclusion> it = mBuildExclusionCollection.listIterator(); it.hasNext(); )
1278
        for (ListIterator<BuildExclusion> it = mBuildExclusionCollection.listIterator(); it.hasNext(); )
1259
        {
1279
        {
1260
            BuildExclusion be = it.next();
1280
            BuildExclusion be = it.next();
1261
            if (be.mRootCause == null && be.mRootId == -1 )
1281
            if ( be.isABuildError() )
1262
            {
1282
            {
1263
                for (Iterator<Package> it1 = packageCollection.iterator(); it1.hasNext(); )
1283
                for (Iterator<Package> it1 = packageCollection.iterator(); it1.hasNext(); )
1264
                {
1284
                {
1265
                    Package p = it1.next();
1285
                    Package p = it1.next();
1266
                    if (p.mId == be.mId) {
1286
                    if (p.mBuildFile >= 0 && p.mId == be.mId) {
1267
                        p.mBuildFile  = -3;
1287
                        p.mBuildFile  = -3;
1268
                        exclude.add(p);
1288
                        exclude.add(p);
1269
                        break;
1289
                        break;
1270
                    }
1290
                    }
1271
                }
1291
                }
Line 1278... Line 1298...
1278
        while( !exclude.isEmpty() )
1298
        while( !exclude.isEmpty() )
1279
        {
1299
        {
1280
            Package p = exclude.remove(0);
1300
            Package p = exclude.remove(0);
1281
            p.mProcessed = true;
1301
            p.mProcessed = true;
1282
            p.mIsProcessed = true;
1302
            p.mIsProcessed = true;
1283
            mLogger.info("planCollection package not buildable {}", p.mName);
1303
            mLogger.error("planCollection package not buildable {}", p.mName);
1284
            
1304
            
1285
            for (Iterator<Package> it1 = packageCollection.iterator(); it1.hasNext(); )
1305
            for (Iterator<Package> it1 = packageCollection.iterator(); it1.hasNext(); )
1286
            {
1306
            {
1287
                Package pkg = it1.next();
1307
                Package pkg = it1.next();
1288
                if (pkg.mProcessed) {
1308
                if (pkg.mProcessed) {
Line 1636... Line 1656...
1636
        }
1656
        }
1637
        return inRelease;
1657
        return inRelease;
1638
    }
1658
    }
1639
 
1659
 
1640
 
1660
 
1641
    /**reports what change in build exceptions happens as part of planRelease
1661
    /** Reports what change in build exceptions happens as part of planRelease
-
 
1662
     * 
-
 
1663
     *  There are three types of exceptions
-
 
1664
     *      PlanError - These may be removed, if the error was not seen in the last plan
-
 
1665
     *      BuildErrors - These we persist
-
 
1666
     *      IndirectErrors - Packages that depend on a Plan or Build errors
1642
     */
1667
     */
1643
    public void reportChange() throws SQLException, Exception
1668
    public void reportChange() throws SQLException, Exception
1644
    {
1669
    {
1645
        int counter = 0;
1670
        int counter = 0;
1646
        for (Iterator<BuildExclusion> it = mBuildExclusionCollection.iterator(); it.hasNext(); )
1671
        for (Iterator<BuildExclusion> it = mBuildExclusionCollection.iterator(); it.hasNext(); )
1647
        {
1672
        {
1648
            BuildExclusion buildExclusion = it.next();
1673
            BuildExclusion buildExclusion = it.next();
1649
 
1674
 
-
 
1675
            //  Skip 'Processed' entries
-
 
1676
            //  These will be the result of a PlanError that we have seen again
-
 
1677
            //
-
 
1678
            //  PlanErrors - Add/Remove as detected
-
 
1679
            //  BuildErrors - Persist. 
-
 
1680
            //  IndirectErrors - Add/Remove as detected
-
 
1681
            //  
-
 
1682
            
1650
            if ( !buildExclusion.isProcessed() )
1683
            if ( !buildExclusion.isABuildError() )
1651
            {
1684
            {
-
 
1685
                if ( !buildExclusion.isProcessed() )
-
 
1686
                {
1652
                if (buildExclusion.isImported() && ! buildExclusion.isARootCause() ) {
1687
                    if (buildExclusion.isImported() && !buildExclusion.isARootCause() ) {
1653
                    // Remove from the exclusion list
1688
                        // Remove from the exclusion list
1654
                    buildExclusion.includeToBuild(mReleaseManager, mBaseline);
1689
                        buildExclusion.includeToBuild(mReleaseManager, mBaseline);
1655
                    mLogger.error("reportChange remove unused exclusion: {}", buildExclusion.info());
1690
                        mLogger.error("reportChange remove unused exclusion: {}", buildExclusion );
1656
                } else {
1691
                    } else {
1657
                    // Exclude and notify
1692
                        // Exclude and notify
1658
                    buildExclusion.excludeFromBuild(mReleaseManager, mBaseline);
1693
                        buildExclusion.excludeFromBuild(mReleaseManager, mBaseline);
1659
                    buildExclusion.email(this, mPackageCollectionAll);
1694
                        buildExclusion.email(this, mPackageCollectionAll);
1660
                    counter++;
1695
                        counter++;
-
 
1696
                    }
1661
                }
1697
                }
1662
            }
1698
            }
1663
        }
1699
        }
1664
        mLogger.error("reportChange exclusion count: {}", counter);
1700
        mLogger.error("reportChange exclusion count: {}", counter);
1665
    }
1701
    }
Line 1803... Line 1839...
1803
        {
1839
        {
1804
            p.mBuildFile = reason;
1840
            p.mBuildFile = reason;
1805
            mLogger.info("rippleBuildExclude set mBuildFile to -5 for package {}", p.mAlias );
1841
            mLogger.info("rippleBuildExclude set mBuildFile to -5 for package {}", p.mAlias );
1806
            
1842
            
1807
            //  Scan the complete collection looking for a matching item
1843
            //  Scan the complete collection looking for a matching item
-
 
1844
            //  If found then assume that this error is a a PlanError that is still present
-
 
1845
            //      Mark it as Processed to indicate that its still present
1808
            //  If found, process it, else add it (unprocessed)
1846
            //  If found, process it, else add it (unprocessed)
1809
            boolean found = false;
1847
            boolean found = false;
1810
            for (Iterator<BuildExclusion> it = mBuildExclusionCollection.iterator(); it.hasNext(); )
1848
            for (Iterator<BuildExclusion> it = mBuildExclusionCollection.iterator(); it.hasNext(); )
1811
            {
1849
            {
1812
                BuildExclusion buildExclusion = it.next();
1850
                BuildExclusion buildExclusion = it.next();
Line 1819... Line 1857...
1819
                }
1857
                }
1820
            }
1858
            }
1821
 
1859
 
1822
            if (!found)
1860
            if (!found)
1823
            {
1861
            {
1824
                // Entry not found in the mBuildExclusionCollection
1862
                // Entry not found in the mBuildExclusionCollection. Its a new error
-
 
1863
                // 
1825
                // Mark all occurrences for this package as processed
1864
                // Mark all occurrences for this package as processed
1826
                // These will be superseded by a new build exclusion entry
1865
                // These will be superseded by a new build exclusion entry
1827
                for (Iterator<BuildExclusion> it = mBuildExclusionCollection.iterator(); it.hasNext(); )
1866
                for (Iterator<BuildExclusion> it = mBuildExclusionCollection.iterator(); it.hasNext(); )
1828
                {
1867
                {
1829
                    BuildExclusion buildExclusion = it.next();
1868
                    BuildExclusion buildExclusion = it.next();
Line 1832... Line 1871...
1832
                    {
1871
                    {
1833
                        buildExclusion.setProcessed();
1872
                        buildExclusion.setProcessed();
1834
                    }
1873
                    }
1835
                }
1874
                }
1836
 
1875
 
1837
                BuildExclusion buildExclusion = new BuildExclusion(p.mId, rootPvId, rootCause, p.mTestBuildInstruction);
-
 
1838
 
-
 
1839
                //
-
 
1840
                //  Add the new build exclusion to a list
1876
                //  Add the new build exclusion to a list
1841
                //    Either the default list or a user-specified list
1877
                BuildExclusion buildExclusion = new BuildExclusion(p.mId, rootPvId, rootCause, p.mTestBuildInstruction);
1842
                mBuildExclusionCollection.add(buildExclusion);
1878
                mBuildExclusionCollection.add(buildExclusion);
1843
            }
1879
            }
1844
        }
1880
        }
1845
 
1881
 
1846
        mLogger.info("rippleBuildExclude set {} {}", p.mAlias, p.mBuildFile);
1882
        mLogger.info("rippleBuildExclude set {} {}", p.mAlias, p.mBuildFile);
Line 1967... Line 2003...
1967
                // Insert build exclusion information
2003
                // Insert build exclusion information
1968
                xml.addComment("mBuildExclusionCollection");
2004
                xml.addComment("mBuildExclusionCollection");
1969
                for (Iterator<BuildExclusion> it = mBuildExclusionCollection.iterator(); it.hasNext(); )
2005
                for (Iterator<BuildExclusion> it = mBuildExclusionCollection.iterator(); it.hasNext(); )
1970
                {
2006
                {
1971
                    BuildExclusion buildExclusion = it.next();
2007
                    BuildExclusion buildExclusion = it.next();
1972
                    //if (!buildExclusion.isProcessed())
-
 
1973
                    {
2008
                    {
1974
                        xml.addComment(buildExclusion.info());
2009
                        xml.addComment(buildExclusion.toString());
1975
                    }
2010
                    }
1976
                }
2011
                }
1977
            }
2012
            }
1978
            
2013
            
1979
            // UTF Support (Also while trailing the changes)
2014
            // UTF Support (Also while trailing the changes)