Subversion Repositories DevTools

Rev

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

Rev 906 Rev 908
Line 212... Line 212...
212
        }
212
        }
213
      }
213
      }
214
      
214
      
215
      mReleaseManager.queryPackageVersions(this, mPackageCollection, mDaemon, mBaseline);
215
      mReleaseManager.queryPackageVersions(this, mPackageCollection, mDaemon, mBaseline);
216
      
216
      
-
 
217
      // must deal with test builds here as they may impact upon package attributes
-
 
218
      // eg dependency collection and build standard differences
-
 
219
      // this gives test builds preferential treatment
-
 
220
      if ( mDaemon )
-
 
221
      {
-
 
222
        // process test builds
-
 
223
        for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
-
 
224
        {
-
 
225
          Package p = it.next();
-
 
226
  
-
 
227
          if (p.mBuildFile == 0)
-
 
228
          {
-
 
229
            // package has yet to be processed
-
 
230
            if (  p.mTestBuildInstruction > 0 )
-
 
231
            {
-
 
232
              mLogger.info("planRelease package test build " + p.mName);
-
 
233
 
-
 
234
              // force patch for test build numbering
-
 
235
              p.mDirectlyPlanned = true;
-
 
236
              p.mChangeType.setPatch();
-
 
237
              p.mRequiresSourceControlInteraction = false;
-
 
238
              rippleIndirectlyPlanned(p);
-
 
239
              
-
 
240
              // put the mTestBuildAttributes to work
-
 
241
              p.mLabel = p.mTestBuildLabel;
-
 
242
              p.mLocation = p.mTestBuildLocation;
-
 
243
              p.setEmail();
-
 
244
              p.setDependencyCollection();
-
 
245
              p.setBuildStandardCollection();
-
 
246
            }
-
 
247
          }
-
 
248
        }
-
 
249
      }
-
 
250
      
217
      // set up mPackageDependencyCollection
251
      // set up mPackageDependencyCollection
218
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
252
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
219
      {
253
      {
220
        Package p = it.next();
254
        Package p = it.next();
221
         
255
         
Line 352... Line 386...
352
          
386
          
353
          for (Iterator<Package> it1 = mPackageCollection.iterator(); it1.hasNext(); )
387
          for (Iterator<Package> it1 = mPackageCollection.iterator(); it1.hasNext(); )
354
          {
388
          {
355
            Package p = it1.next();
389
            Package p = it1.next();
356
            
390
            
357
            // ensure only root cause build exclusions are excluded
391
            // ensure only root cause, non test build, build exclusions are excluded
358
            // mBuildExclusionCollection is at this point based on
392
            // mBuildExclusionCollection is at this point based on
359
            // relevant (direct and indirect) excluded pv's in the database
393
            // relevant (direct and indirect) excluded pv's in the database
360
            if ( be.compare(p.mId) && be.isARootCause() )
394
            if ( be.compare(p.mId) && be.isARootCause() && p.mTestBuildInstruction == 0 )
361
            {
395
            {
362
              // package is not reproducible, discard
396
              // package is not reproducible, discard
363
              rippleBuildExclude( p, p.mId, null, it, be );
397
              rippleBuildExclude( p, p.mId, null, it, be );
364
              p.mBuildFile = -3;
398
              p.mBuildFile = -3;
365
              mLogger.info("planRelease set mBuildFile to -3 for package " + p.mAlias );
399
              mLogger.info("planRelease set mBuildFile to -3 for package " + p.mAlias );
Line 448... Line 482...
448
                }
482
                }
449
              }
483
              }
450
            }
484
            }
451
          }
485
          }
452
        }
486
        }
-
 
487
        
-
 
488
        // process forced ripples
-
 
489
        for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
-
 
490
        {
-
 
491
          Package p = it.next();
-
 
492
  
-
 
493
          if (p.mBuildFile == 0)
-
 
494
          {
-
 
495
            // package has yet to be processed
-
 
496
            if ( p.mForcedRippleInstruction > 0 )
-
 
497
            {
-
 
498
              mLogger.info("planRelease package forced ripple " + p.mName);
-
 
499
              rippleIndirectlyPlanned(p);
-
 
500
            }
-
 
501
          }
-
 
502
        }
453
      }
503
      }
454
      else
504
      else
455
      {
505
      {
456
        // escrow reporting only     
506
        // escrow reporting only     
457
        for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
507
        for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
Line 657... Line 707...
657
                  rippleBuildExclude(p, p.mId, "Package has reached ripple field limitations", null, null);
707
                  rippleBuildExclude(p, p.mId, "Package has reached ripple field limitations", null, null);
658
                }
708
                }
659
                else
709
                else
660
                {
710
                {
661
                  buildFile = 2;
711
                  buildFile = 2;
-
 
712
                  
-
 
713
                  if ( p.mForcedRippleInstruction > 0 )
-
 
714
                  {
-
 
715
                    mReleaseManager.markDaemonInstCompleted( p.mForcedRippleInstruction );
-
 
716
                  }
-
 
717
                  
-
 
718
                  if ( p.mTestBuildInstruction > 0 )
-
 
719
                  {
-
 
720
                    mReleaseManager.markDaemonInstInProgress( p.mTestBuildInstruction );
-
 
721
                  }
662
                }
722
                }
663
              }
723
              }
664
              else
724
              else
665
              {
725
              {
666
                mLogger.info("planRelease package has future (downgraded) build requirement " + p.mName + " " + buildFile);              
726
                mLogger.info("planRelease package has future (downgraded) build requirement " + p.mName + " " + buildFile);              
Line 823... Line 883...
823
          } 
883
          } 
824
          
884
          
825
          buildFile++;
885
          buildFile++;
826
        }
886
        }
827
      } while( !allProcessed );
887
      } while( !allProcessed );
828
        
-
 
829
      if ( mDaemon )
-
 
830
      {
-
 
831
        // report what change in build exceptions happens as part of planRelease
-
 
832
        for (Iterator<BuildExclusion> it = mBuildExclusionCollection.iterator(); it.hasNext(); )
-
 
833
        {
-
 
834
          BuildExclusion buildExclusion = it.next();
-
 
835
          
-
 
836
          if ( !buildExclusion.isProcessed() )
-
 
837
          {
-
 
838
            // notify
-
 
839
            buildExclusion.excludeFromBuild(mReleaseManager, mBaseline);
-
 
840
            buildExclusion.email(mPackageCollection, mMailServer, mMailSender, mBaselineName);
-
 
841
          }
-
 
842
        }
-
 
843
      }
-
 
844
    }
888
    }
845
    finally
889
    finally
846
    {
890
    {
847
      // this block is executed regardless of what happens in the try block
891
      // this block is executed regardless of what happens in the try block
848
      // even if an exception is thrown
892
      // even if an exception is thrown
Line 863... Line 907...
863
    }
907
    }
864
 
908
 
865
    mLogger.warn("planRelease mDaemon " + mDaemon + " returned");
909
    mLogger.warn("planRelease mDaemon " + mDaemon + " returned");
866
  }
910
  }
867
 
911
 
-
 
912
  /**reports what change in build exceptions happens as part of planRelease
-
 
913
   */
-
 
914
  public void reportChange() throws SQLException, Exception
-
 
915
  {
-
 
916
    for (Iterator<BuildExclusion> it = mBuildExclusionCollection.iterator(); it.hasNext(); )
-
 
917
    {
-
 
918
      BuildExclusion buildExclusion = it.next();
-
 
919
      
-
 
920
      if ( !buildExclusion.isProcessed() )
-
 
921
      {
-
 
922
        // notify
-
 
923
        buildExclusion.excludeFromBuild(mReleaseManager, mBaseline);
-
 
924
        buildExclusion.email(mPackageCollection, mMailServer, mMailSender, mBaselineName, mReleaseManager);
-
 
925
      }
-
 
926
    }
-
 
927
  }
-
 
928
  
868
  /**returns first build file content
929
  /**returns first build file content
869
   * returns false if no build file content exists
930
   * returns false if no build file content exists
870
   */
931
   */
871
  public boolean getFirstBuildFileContent(MutableString content)
932
  public boolean getFirstBuildFileContent(MutableString content)
872
  {
933
  {
Line 939... Line 1000...
939
    }
1000
    }
940
  }
1001
  }
941
 
1002
 
942
  /**returns the Package with the matching mAlias or NULL_PACKAGE if no package has the mID
1003
  /**returns the Package with the matching mAlias or NULL_PACKAGE if no package has the mID
943
   */
1004
   */
944
  private Package findPackage(String alias)
1005
  public Package findPackage(String alias)
945
  {
1006
  {
946
    mLogger.debug("findPackage");
1007
    mLogger.debug("findPackage");
947
    Package retVal = ReleaseManager.NULL_PACKAGE;
1008
    Package retVal = ReleaseManager.NULL_PACKAGE;
948
 
1009
 
949
    for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
1010
    for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
Line 1003... Line 1064...
1003
            {
1064
            {
1004
              buildExclusion.process();
1065
              buildExclusion.process();
1005
            }
1066
            }
1006
          }
1067
          }
1007
          
1068
          
1008
          BuildExclusion buildExclusion = new BuildExclusion(p.mId, root_pv_id, root_cause);
1069
          BuildExclusion buildExclusion = new BuildExclusion(p.mId, root_pv_id, root_cause, p.mTestBuildInstruction);
1009
          
1070
          
1010
          if ( list == null )
1071
          if ( list == null )
1011
          {
1072
          {
1012
            mBuildExclusionCollection.add(buildExclusion);
1073
            mBuildExclusionCollection.add(buildExclusion);
1013
          }
1074
          }
Line 1017... Line 1078...
1017
            list.add(buildExclusion);
1078
            list.add(buildExclusion);
1018
          }
1079
          }
1019
        }
1080
        }
1020
      }
1081
      }
1021
 
1082
 
1022
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
1083
      // only ripple a test build failure through for non test builds
-
 
1084
      if ( p.mTestBuildInstruction == 0 )
1023
      {
1085
      {
1024
        Package pkg = it.next();
1086
        // non test build
1025
        
-
 
1026
        if ( pkg != p )
1087
        for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
1027
        {
1088
        {
1028
          for (Iterator<Package> it2 = pkg.mPackageDependencyCollection.iterator(); it2.hasNext(); )
1089
          Package pkg = it.next();
-
 
1090
          
-
 
1091
          if ( pkg != p )
1029
          {
1092
          {
1030
            Package dependency = it2.next();
1093
            for (Iterator<Package> it2 = pkg.mPackageDependencyCollection.iterator(); it2.hasNext(); )
1031
            
-
 
1032
            if ( dependency == p )
-
 
1033
            {
1094
            {
-
 
1095
              Package dependency = it2.next();
-
 
1096
              
-
 
1097
              if ( dependency == p )
-
 
1098
              {
1034
              rippleBuildExclude( pkg, root_pv_id, null, list, null );
1099
                rippleBuildExclude( pkg, root_pv_id, null, list, null );
1035
              break;
1100
                break;
-
 
1101
              }
1036
            }
1102
            }
1037
          }
1103
          }
1038
        }
1104
        }
1039
      }
1105
      }
1040
    }
1106
    }
Line 1123... Line 1189...
1123
          else
1189
          else
1124
          {
1190
          {
1125
            retVal += "false";
1191
            retVal += "false";
1126
          }
1192
          }
1127
            
1193
            
1128
          retVal += "\"/>" + lf;
1194
          retVal += "\"/>" + lf +
-
 
1195
          "<property name=\"abt_test_build_instruction\" value=\"" + p.mTestBuildInstruction + "\"/>" + lf;
1129
        }
1196
        }
1130
      }
1197
      }
1131
    }
1198
    }
1132
    else
1199
    else
1133
    {
1200
    {
Line 1223... Line 1290...
1223
        if ( bs.getWin32() )
1290
        if ( bs.getWin32() )
1224
        {
1291
        {
1225
          win32 = true;
1292
          win32 = true;
1226
        }
1293
        }
1227
 
1294
 
1228
        if ( !determinedBuildStandard && bs.getBuildStandard(!ReleaseManager.mUseDatabase).contains("<jats") )
1295
        if ( !determinedBuildStandard && bs.getBuildStandard(!ReleaseManager.mUseDatabase, true).contains("<jats") )
1229
        {
1296
        {
1230
          jats = true;
1297
          jats = true;
1231
          determinedBuildStandard = true;
1298
          determinedBuildStandard = true;
1232
        }
1299
        }
1233
      }
1300
      }
Line 1798... Line 1865...
1798
    {
1865
    {
1799
      BuildStandard bs = it.next();
1866
      BuildStandard bs = it.next();
1800
      
1867
      
1801
      if ( !filter )
1868
      if ( !filter )
1802
      {
1869
      {
1803
        String platform = bs.getPlatform(!ReleaseManager.mUseDatabase);
1870
        String platform = bs.getPlatform(!ReleaseManager.mUseDatabase, true);
1804
      
1871
      
1805
        if ( platform.length() > 0 )
1872
        if ( platform.length() > 0 )
1806
        {
1873
        {
1807
          platforms += platform + lf;
1874
          platforms += platform + lf;
1808
        }
1875
        }
1809
 
1876
 
1810
        String standard = bs.getBuildStandard(!ReleaseManager.mUseDatabase);
1877
        String standard = bs.getBuildStandard(!ReleaseManager.mUseDatabase, true);
1811
        
1878
        
1812
        if ( standard.length() > 0 )
1879
        if ( standard.length() > 0 )
1813
        {
1880
        {
1814
          standards += standard + lf;
1881
          standards += standard + lf;
1815
        }
1882
        }
1816
      }
1883
      }
1817
      else
1884
      else
1818
      {
1885
      {
1819
        if ( !bs.getBuildStandard(!ReleaseManager.mUseDatabase).contains("\"none\"") )
1886
        if ( !bs.getBuildStandard(!ReleaseManager.mUseDatabase, true).contains("\"none\"") )
1820
        {
1887
        {
1821
          String platform = bs.getPlatform(!ReleaseManager.mUseDatabase);
1888
          String platform = bs.getPlatform(!ReleaseManager.mUseDatabase, true);
1822
          
1889
          
1823
          if ( platform.length() > 0 )
1890
          if ( platform.length() > 0 )
1824
          {
1891
          {
1825
            platforms += platform + lf;
1892
            platforms += platform + lf;
1826
          }
1893
          }
1827
          
1894
          
1828
          String standard = bs.getBuildStandard(!ReleaseManager.mUseDatabase);
1895
          String standard = bs.getBuildStandard(!ReleaseManager.mUseDatabase, true);
1829
          
1896
          
1830
          if ( standard.length() > 0 )
1897
          if ( standard.length() > 0 )
1831
          {
1898
          {
1832
            standards += standard + lf;
1899
            standards += standard + lf;
1833
          }
1900
          }