Subversion Repositories DevTools

Rev

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

Rev 7082 Rev 7088
Line 392... Line 392...
392
                //        Remove the test build request from the database
392
                //        Remove the test build request from the database
393
                //        Send a warning email
393
                //        Send a warning email
394
                //
394
                //
395
                if(p.mIsPegged || p.mIsSdk)
395
                if(p.mIsPegged || p.mIsSdk)
396
                {
396
                {
397
                    // package has yet to be processed
-
 
398
                    if (  p.mTestBuildInstruction > 0 )
-
 
399
                    {
397
                    String reason;
400
                        mLogger.info("planRelease package test build {}", p.mName);
398
                    reason = (p.mIsPegged) ? "Pegged" : "SDK Based";
401
 
399
 
402
                    mLogger.error("planRelease Daemon Instruction (testBuild) of {} package deleted: {}", reason, p.mAlias);
400
                    mLogger.error("planRelease Daemon Instruction (testBuild) of {} package deleted: {}", reason, p.mAlias);
403
                    mReleaseManager.markDaemonInstCompleted( p.mTestBuildInstruction );
401
                    mReleaseManager.markDaemonInstCompleted( p.mTestBuildInstruction );
404
                    emailRejectedDaemonInstruction("Cannot 'Test Build' a " + reason + " package",p);
402
                    emailRejectedDaemonInstruction("Cannot 'Test Build' a " + reason + " package",p);
405
                }
403
                }
406
 
404
 
407
                            mLogger.error("planRelease Daemon Instruction of {} package deleted: {}", reason, p.mName);
-
 
408
                            mReleaseManager.markDaemonInstCompleted( p.mTestBuildInstruction );
-
 
409
                            emailRejectedDaemonInstruction("Cannot 'Test Build' a " + reason + " package",p);
-
 
410
                        }
-
 
411
 
-
 
412
                        // force patch for test build numbering
405
                // force patch for test build numbering
413
                        p.mDirectlyPlanned = true;
406
                p.mDirectlyPlanned = true;
414
                        p.mChangeType.setPatch();
407
                p.mChangeType.setPatch();
415
                        p.mRequiresSourceControlInteraction = false;
408
                p.mRequiresSourceControlInteraction = false;
416
                        p.mBuildReason = BuildReason.Test;
409
                p.mBuildReason = BuildReason.Test;
417
                        rippleIndirectlyPlanned(p);
410
                p.mIndirectlyPlanned = true;
418
 
-
 
419
                        // put the mTestBuildAttributes to work
-
 
420
                        p.mVcsTag = p.mTestBuildVcsTag;
-
 
421
                        p.mId = p.mTestBuildPvId;
-
 
422
                        p.setTestEmail();
-
 
423
                        p.setTestDependencyCollection();
-
 
424
                        p.setTestBuildStandardCollection();
-
 
425
                        p.mHasAutomatedUnitTests = p.mTestBuildHasAutomatedUnitTests;
-
 
426
                    }
-
 
427
                }
-
 
428
            }
411
            }
429
        }
412
        }
430
 
413
 
431
        // Set up mPackageDependencyCollection on each package
414
        // Set up mPackageDependencyCollection on each package
432
        //    Examine the dependencies by alias and convert this to a 'package' selected from the released package set
415
        //    Examine the dependencies by alias and convert this to a 'package' selected from the released package set
Line 461... Line 444...
461
                // Exclude the package
444
                // Exclude the package
462
                // max 50 chars
445
                // max 50 chars
463
                rippleBuildExclude(p, p.mId, "Package has circular dependency", -6);
446
                rippleBuildExclude(p, p.mId, "Package has circular dependency", -6);
464
 
447
 
465
                // take the package out of the build
448
                // take the package out of the build
466
                p.mBuildFile = -6;
-
 
467
                mLogger.info("planRelease set mBuildFile to -6 for package {}", p.mAlias );
-
 
468
                standardOut(mCircularDependency, p.mAlias, mCircularDependencyFlag);
449
                standardOut(mCircularDependency, p.mAlias, mCircularDependencyFlag);
469
                mCircularDependencyFlag = false;
450
                mCircularDependencyFlag = false;
470
            }
451
            }
471
        }
452
        }
472
 
453
 
Line 494... Line 475...
494
                Package dependency = findPackage(alias);
475
                Package dependency = findPackage(alias);
495
 
476
 
496
                if (dependency == ReleaseManager.NULL_PACKAGE)
477
                if (dependency == ReleaseManager.NULL_PACKAGE)
497
                {
478
                {
498
                    mLogger.info("planRelease dependency is not in the baseline {}", alias);
479
                    mLogger.info("planRelease dependency is not in the baseline {}", alias);
499
                    // exclude all dependent packages
480
                    // Exclude the package
500
                    // max 50 chars
481
                    // max 50 chars
501
                    rippleBuildExclude(p, p.mId, "Package build dependency not in the release", -4);
482
                    rippleBuildExclude(p, p.mId, "Package build dependency not in the release", -4);
502
 
483
 
503
                    // take the package out of the build
484
                    // take the package out of the build
504
                    p.mBuildFile = -4;
-
 
505
                    mLogger.info("planRelease set mBuildFile to -4 for package {}", p.mAlias );
-
 
506
                    standardOut(mNotInBaseline, p.mAlias, mNotInBaselineFlag);
485
                    standardOut(mNotInBaseline, p.mAlias, mNotInBaselineFlag);
507
                    mNotInBaselineFlag = false;
486
                    mNotInBaselineFlag = false;
508
                    break;
487
                    break;
509
                }
488
                }
510
            }
489
            }
Line 532... Line 511...
532
                // Does the package have a build standard. If not then we can't reproduce it.
511
                // Does the package have a build standard. If not then we can't reproduce it.
533
                // Escrow - Assume the package is provided
512
                // Escrow - Assume the package is provided
534
                // Daemon - Exclude this package, but not its consumers. If the package is available then we can use it.
513
                // Daemon - Exclude this package, but not its consumers. If the package is available then we can use it.
535
                if (!p.isReproducible())
514
                if (!p.isReproducible())
536
                {
515
                {
537
                    // for escrow build purposes, exclude all dependent package versions
-
 
538
                    mLogger.info("planRelease package not reproducible {}" ,p.mName);
516
                    mLogger.info("planRelease package not reproducible {}" ,p.mName);
-
 
517
                    
-
 
518
                    // Exclude the package
539
                    // max 50 chars
519
                    // max 50 chars
540
                    rippleBuildExclude(p, p.mId, "Package has no build environment", -1);
520
                    rippleBuildExclude(p, p.mId, "Package has no build environment", -1);
541
 
521
 
542
                    // package is not reproducible, discard
522
                    // package is not reproducible, discard
543
                    p.mBuildFile = -1;
-
 
544
                    mLogger.info("planRelease set mBuildFile to -1 for package {}", p.mAlias );
-
 
545
                    standardOut(mAnyBuildPlatforms, p.mAlias, mAnyBuildPlatformsFlag);
523
                    standardOut(mAnyBuildPlatforms, p.mAlias, mAnyBuildPlatformsFlag);
546
                    mAnyBuildPlatformsFlag = false;
524
                    mAnyBuildPlatformsFlag = false;
547
                }
525
                }
548
            }
526
            }
549
        }
527
        }
Line 601... Line 579...
601
                    // Exclude the package
579
                    // Exclude the package
602
                    // max 50 chars
580
                    // max 50 chars
603
                    rippleBuildExclude(p, p.mId, "Package not built for configured platforms", -2);
581
                    rippleBuildExclude(p, p.mId, "Package not built for configured platforms", -2);
604
 
582
 
605
                    // package is not reproducible on the build platforms configured for this baseline, discard
583
                    // package is not reproducible on the build platforms configured for this baseline, discard
606
                    p.mBuildFile = -2;
-
 
607
                    mLogger.info("planRelease set mBuildFile to -2 for package {}", p.mAlias );
-
 
608
                    standardOut(mAssocBuildPlatforms, p.mAlias, mAssocBuildPlatformsFlag);
584
                    standardOut(mAssocBuildPlatforms, p.mAlias, mAssocBuildPlatformsFlag);
609
                    mAssocBuildPlatformsFlag = false;
585
                    mAssocBuildPlatformsFlag = false;
610
                }
586
                }
611
            }
587
            }
612
        }      
588
        }      
613
 
589
 
614
        if (mDaemon )
590
        if (mDaemon )
615
        {
591
        {
616
 
592
 
617
                for (Iterator<Package> it1 = mPackageCollection.iterator(); it1.hasNext(); )
-
 
618
                {
-
 
619
                    Package p = it1.next();
-
 
620
 
-
 
621
                    // ensure only root cause, non test build, build exclusions are excluded
-
 
622
                    // mBuildExclusionCollection is at this point based on
-
 
623
                    // relevant (direct and indirect) excluded pv's in the database
-
 
624
                    if ( be.compare(p.mId) && be.isARootCause() && p.mTestBuildInstruction == 0 && p.mForcedRippleInstruction == 0 )
-
 
625
                    {
-
 
626
                        // package is not reproducible, discard
-
 
627
                        rippleBuildExclude( p, p.mId, null, it, be, true );
-
 
628
                        p.mBuildFile = -3;
-
 
629
                        mLogger.info("planRelease set mBuildFile to -3 for package {}", p.mAlias );
-
 
630
                        break;
-
 
631
                    }
-
 
632
                }
-
 
633
            }
-
 
634
 
-
 
635
            //  Daemon Mode Only
593
            //  Daemon Mode Only
636
            //  Process packages which need to be ripple built
594
            //  Process packages which need to be ripple built
637
            mLogger.debug("planRelease process packages which need to be ripple built");
595
            mLogger.debug("planRelease process packages which need to be ripple built");
638
            for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
596
            for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
639
            {
597
            {
Line 654... Line 612...
654
                    //    and we can't build any of its dependent packages
612
                    //    and we can't build any of its dependent packages
655
                    Iterator<Integer> it2 = p.mDependencyIDCollection.iterator();
613
                    Iterator<Integer> it2 = p.mDependencyIDCollection.iterator();
656
                    Iterator<Package> it3 = p.mPackageDependencyCollection.iterator();
614
                    Iterator<Package> it3 = p.mPackageDependencyCollection.iterator();
657
                    while ( it2.hasNext() && it3.hasNext() )
615
                    while ( it2.hasNext() && it3.hasNext() )
658
                    {
616
                    {
659
                        // a WIP exists on the package, or it is a Test Build
-
 
660
                        // exclude all dependent package versions
-
 
661
                        mLogger.info("planRelease package has WIP {}", p.mName);
-
 
662
                        if ( p.mBuildReason == null)
-
 
663
                            p.mBuildReason = BuildReason.NewVersion;
-
 
664
                        rippleIndirectlyPlanned(p);
617
                        Integer dpvId = it2.next();
665
                    }
-
 
666
                    else
-
 
667
                    {
-
 
668
                        //    Examine this packages dependencies
618
                        Package dependency = it3.next();
669
                        //    If one of them does not exist in the 'official release' set then
-
 
670
                        //    the package needs to be built against the official release set
-
 
671
                        //    and we can't build any of its dependent packages
-
 
672
                        Iterator<Integer> it2 = p.mDependencyIDCollection.iterator();
-
 
673
                        Iterator<Package> it3 = p.mPackageDependencyCollection.iterator();
-
 
-
 
619
 
674
                        while ( it2.hasNext() && it3.hasNext() )
620
                        if ( !dependency.mAdvisoryRipple )
675
                        {
621
                        {
676
                            // not advisory, ie: has ripple build impact
622
                            // not advisory, ie: has ripple build impact
677
                            if ( !isInRelease(dpvId) )
623
                            if ( !isInRelease(dpvId) )
678
                            {
624
                            {
679
                                // the package is out of date
625
                                // the package is out of date
Line 688... Line 634...
688
                                //  Packages that depend on this package have been excluded
634
                                //  Packages that depend on this package have been excluded
689
                                //  We need to exclude this one too
635
                                //  We need to exclude this one too
690
                                //
636
                                //
691
                                if (p.mRippleStop == 's' || p.mRippleStop == 'w') 
637
                                if (p.mRippleStop == 's' || p.mRippleStop == 'w') 
692
                                {
638
                                {
693
                                    // the package is out of date
-
 
694
                                    // exclude all dependent package versions
-
 
695
                                    mLogger.info("planRelease package out of date {}", p.mName);
-
 
696
                                    p.mBuildReason = BuildReason.Ripple;
-
 
697
                                    rippleIndirectlyPlanned(p);
-
 
698
                                    
-
 
699
                                    //  This package needs to be rippled
-
 
700
                                    //  If this package has a rippleStop marker of 's', then we cannot
-
 
701
                                    //  build this package at the moment.
-
 
702
                                    //  Packages that depend on this package have been excluded
-
 
703
                                    //  We need to exclude this one too
-
 
704
                                    //
-
 
705
                                    if (p.mRippleStop == 's' || p.mRippleStop == 'w') 
-
 
706
                                    {
-
 
707
                                        // Package marked as a rippleStop
639
                                    // Package marked as a rippleStop
708
                                        // max 50 chars
640
                                    // max 50 chars
709
                                        rippleBuildExclude(p, -2, "Ripple Required." + " Waiting for user", null, null, false);
641
                                    rippleBuildExclude(p, -2, "Ripple Required." + " Waiting for user", -11);
710
 
642
 
711
                                        // package is unBuildable, mark reason and discard
-
 
712
                                        p.mBuildFile = -11;
-
 
713
                                        
-
 
714
                                        if (p.mRippleStop == 's' ) {
643
                                    if (p.mRippleStop == 's' ) {
715
                                            // Need to flag to users that the package build is waiting user action
644
                                        // Need to flag to users that the package build is waiting user action
716
                                            mLogger.info("planRelease Ripple Required. Stopped by flag {}", p.mName);
645
                                        mLogger.info("planRelease Ripple Required. Stopped by flag {}", p.mName);
717
                                            mReleaseManager.setRippleStopWait(mRtagId,p);
646
                                        mReleaseManager.setRippleStopWait(mRtagId,p);
718
                                        }
-
 
719
                                    }
647
                                    }
720
                                }
648
                                }
721
                                
649
                                
722
                                break;
650
                                break;
723
                            }
651
                            }
Line 747... Line 675...
747
                                if (! p.mIsBuildable)
675
                                if (! p.mIsBuildable)
748
                                {
676
                                {
749
                                    //  Package does not exist in dpkg_archive and it has been flagged as unbuildable
677
                                    //  Package does not exist in dpkg_archive and it has been flagged as unbuildable
750
                                    //  This may be because is Unbuildable or Manually built
678
                                    //  This may be because is Unbuildable or Manually built
751
                                    mLogger.info("planRelease Unbuildable package not found in archive {}", p.mName);
679
                                    mLogger.info("planRelease Unbuildable package not found in archive {}", p.mName);
-
 
680
                                    // Exclude the package
752
                                    // max 50 chars
681
                                    // max 50 chars
753
                                    rippleBuildExclude(p, p.mId, "Unbuildable" + " package not found in archive", -10);
682
                                    rippleBuildExclude(p, p.mId, "Unbuildable" + " package not found in archive", -10);
754
                                    
683
                                    
755
                                }
684
                                }
756
                                //  Not interested in a pegged package or a package provided from an SDK.
685
                                //  Not interested in a pegged package or a package provided from an SDK.
Line 762... Line 691...
762
 
691
 
763
                                    //  Pegged packages or packages provided from an SDK MUST exist in dpkg_archive
692
                                    //  Pegged packages or packages provided from an SDK MUST exist in dpkg_archive
764
                                    //  They will not be built within the context of this release. It is the responsibility
693
                                    //  They will not be built within the context of this release. It is the responsibility
765
                                    //  of another release to build them.
694
                                    //  of another release to build them.
766
                                    mLogger.info("planRelease {} package not found in archive {}", reason, p.mName);
695
                                    mLogger.info("planRelease {} package not found in archive {}", reason, p.mName);
-
 
696
                                    // Exclude the package
767
                                    // max 50 chars
697
                                    // max 50 chars
768
                                    rippleBuildExclude(p, p.mId, reason + " package not found in archive", -7);
698
                                    rippleBuildExclude(p, p.mId, reason + " package not found in archive", -7);
769
                                }
699
                                }
770
                                else if (p.mForcedRippleInstruction == 0)
700
                                else if (p.mForcedRippleInstruction == 0)
771
                                {
701
                                {
Line 780... Line 710...
780
                                        {
710
                                        {
781
                                            // This package cannot be rebuilt as one of its dependents is NOT in this release
711
                                            // This package cannot be rebuilt as one of its dependents is NOT in this release
782
                                            // exclude all dependent package versions
712
                                            // exclude all dependent package versions
783
                                            
713
                                            
784
                                            mLogger.info("planRelease package not found in archive. Cannot be rebuilt due to {}", p.mName);
714
                                            mLogger.info("planRelease package not found in archive. Cannot be rebuilt due to {}", p.mName);
-
 
715
                                            // Exclude the package
785
                                            // max 50 chars
716
                                            // max 50 chars
786
                                            rippleBuildExclude(p, p.mId, "Package cannot be rebuilt in this release", -4);
717
                                            rippleBuildExclude(p, p.mId, "Package cannot be rebuilt in this release", -4);
787
                                            break;
718
                                            break;
788
                                        }
719
                                        }
789
                                    }
720
                                    }
Line 823... Line 754...
823
                    if(p.mIsPegged || p.mIsSdk)
754
                    if(p.mIsPegged || p.mIsSdk)
824
                    {
755
                    {
825
                        String reason;
756
                        String reason;
826
                        reason = (p.mIsPegged) ? "Pegged" : "SDK Based";
757
                        reason = (p.mIsPegged) ? "Pegged" : "SDK Based";
827
 
758
 
828
                            mLogger.error("planRelease Daemon Instruction of {} package deleted: {}", reason, p.mName);
759
                        mLogger.error("planRelease Daemon Instruction of {} package deleted: {}", reason, p.mName);
829
                            mReleaseManager.markDaemonInstCompleted( p.mForcedRippleInstruction );
760
                        mReleaseManager.markDaemonInstCompleted( p.mForcedRippleInstruction );
830
                            emailRejectedDaemonInstruction("Cannot 'Ripple' a " + reason + " package",p);
761
                        emailRejectedDaemonInstruction("Cannot 'Ripple' a " + reason + " package",p);
831
 
762
 
832
                            p.mBuildFile = -8; 
763
                        p.mBuildFile = -8; 
833
                        }
-
 
834
                        else
-
 
835
                        {
-
 
836
                            mLogger.info("planRelease package forced ripple {}", p.mName);
-
 
837
                            p.mBuildReason = BuildReason.Ripple;
-
 
838
                            rippleIndirectlyPlanned(p);
-
 
839
                        }
-
 
840
                    }
764
                    }
841
                }
765
                }
842
            }
766
            }
843
 
767
 
844
            //  Daemon Mode Only
768
            //  Daemon Mode Only
Line 855... Line 779...
855
                {
779
                {
856
                    String reason = null;
780
                    String reason = null;
857
                    
781
                    
858
                    //  Not interested in a pegged package or a package provided from an SDK or packages with an active RippleStop
782
                    //  Not interested in a pegged package or a package provided from an SDK or packages with an active RippleStop
859
                    //  Such packages are not built
783
                    //  Such packages are not built
860
                    if (p.mIsPegged || p.mIsSdk)
784
                    if (p.mIsPegged ) {
861
                    {
-
 
862
                        String reason;
785
                        reason = "Pegged";
863
                        reason = (p.mIsPegged) ? "Pegged" : "SDK";
-
 
864
 
-
 
865
                        mLogger.info("planRelease {} not built in this release {}", reason, p.mName);
-
 
866
                        p.mBuildFile = -8;
786
                        p.mBuildFile = -8;
867
                    } else if (p.mIsSdk) {
787
                    } else if (p.mIsSdk) {
868
                        reason = "SDK";
788
                        reason = "SDK";
869
                        p.mBuildFile = -8;
789
                        p.mBuildFile = -8;
870
                    } else if (p.mRippleStop == 's' || p.mRippleStop == 'w') {
790
                    } else if (p.mRippleStop == 's' || p.mRippleStop == 'w') {
Line 939... Line 859...
939
                {
859
                {
940
                    int pvApplied = p.applyPV(mReleaseManager);
860
                    int pvApplied = p.applyPV(mReleaseManager);
941
 
861
 
942
                    if ( pvApplied == 1 )
862
                    if ( pvApplied == 1 )
943
                    {
863
                    {
944
                        String reason;
864
                        // max 50 chars
945
                        switch (p.mBuildFile)
-
 
946
                        {
-
 
947
                        case -1: reason = "Not reproducible"; break;
-
 
948
                        case -2: reason = "Not reproducible on configured build platforms"; break;
-
 
949
                        case -3: reason = "Marked as 'Do not ripple'"; break;
-
 
950
                        case -4: reason = "Dependent on a package not in the release"; break;
-
 
951
                        case -5: reason = "Indirectly dependent on a package not reproducible in the release"; break;
-
 
952
                        case -6: reason = "Has a circular dependency"; break;
-
 
953
                        case -7: reason = "Pegged or SDK package not in dpkg_archive"; break;
865
                        rippleBuildExclude(p, p.mId, "Package has non standard versioning", -5);
954
                        case -8: reason = "Is a Pegged or SDK package"; break;
-
 
955
                        case -9: reason = "Rejected Daemon Instruction"; break;
-
 
956
                        case -10: reason = "Unbuildable package not in dpkg_archive"; break;
-
 
957
                        case -11: reason = "Marked as 'RippleStop'"; break;
-
 
958
                        default: reason = "Unknown reason. Code:" + p.mBuildFile; break;
-
 
959
                        }
-
 
960
                        mLogger.error("planRelease Test Build of an unbuildable of package deleted: {}", p.mName);
-
 
961
                        mReleaseManager.markDaemonInstCompleted( p.mTestBuildInstruction );
-
 
962
                        emailRejectedDaemonInstruction(reason,p);
-
 
963
                    }
866
                    }
964
                    else if ( pvApplied == 2 )
867
                    else if ( pvApplied == 2 )
965
                    {
868
                    {
966
                        // max 50 chars
869
                        // max 50 chars
967
                        rippleBuildExclude(p, p.mId, "Package has reached ripple field limitations", -5);
870
                        rippleBuildExclude(p, p.mId, "Package has reached ripple field limitations", -5);
Line 1451... Line 1354...
1451
                    boolean allDependenciesForThisPackageProcessed = true;
1354
                    boolean allDependenciesForThisPackageProcessed = true;
1452
 
1355
 
1453
                    //  Scan the packages dependencies
1356
                    //  Scan the packages dependencies
1454
                    for ( Iterator<Package> it2 = p.mPackageDependencyCollection.iterator(); it2.hasNext(); )
1357
                    for ( Iterator<Package> it2 = p.mPackageDependencyCollection.iterator(); it2.hasNext(); )
1455
                    {
1358
                    {
1456
                        // Daemon: Flag packages with no build requirement as processed
-
 
1457
                        // Escrow: Flag packages with a foreign build environment as processed
-
 
1458
                        p.mProcessed = true;
-
 
1459
                        mLogger.info("planRelease package has no build requirement {}", p.mName);            
-
 
1460
                    }
-
 
1461
                    else if ( ( p.mBuildFile == 0 ) && ( (mDaemon && ( p.mDirectlyPlanned || p.mIndirectlyPlanned ) ) || ( !mDaemon ) ) )
-
 
1462
                    {
-
 
1463
                        // package yet to be processed and
1359
                        Package dependency = it2.next();
1464
                        //  Daemon mode: Has a build requirement
-
 
1465
                        //  Escrow mode: Can be reproduced
-
 
1466
                        boolean canBeBuiltNow = true;
-
 
1467
                        boolean allDependenciesForThisPackageProcessed = true;
-
 
1468
 
1360
 
1469
                        if ( !dependency.mProcessed )
1361
                        if ( !dependency.mProcessed )
1470
                        {
1362
                        {
1471
                            Package dependency = it2.next();
-
 
1472
 
-
 
1473
                            if ( !dependency.mProcessed )
-
 
1474
                            {
-
 
1475
                                //  If all the dependencies have been processed, then we can potentially build this package
1363
                            //  If all the dependencies have been processed, then we can potentially build this package
1476
                                //  If any of them have not been processed, then cannot calculate canBeBuiltNow until this 
1364
                            //  If any of them have not been processed, then cannot calculate canBeBuiltNow until this 
1477
                                //  dependency has been processed
1365
                            //  dependency has been processed
1478
                                allDependenciesForThisPackageProcessed = false;
1366
                            allDependenciesForThisPackageProcessed = false;
1479
                                allDependenciesProcessed = false;
1367
                            allDependenciesProcessed = false;
1480
                            }
-
 
1481
                            else if (  (  mDaemon && ( dependency.mDirectlyPlanned ) || ( dependency.mIndirectlyPlanned ) ) 
-
 
1482
                                    || ( !mDaemon && ( ( dependency.mBuildFile == 0 ) ||
-
 
1483
                                                           ( dependency.mBuildFile == buildFile &&
-
 
1484
                                                           ( !p.haveSameBuildStandards(dependency)  ) ) ) ) )
-
 
1485
                            {
-
 
1486
                                // Daemon mode:
-
 
1487
                                //    This processed dependency has a build requirement - so can't build
-
 
1488
                                // Escrow mode: This package cannot be built now if
-
 
1489
                                //    This processed dependency has not been assigned to a build iteration or
-
 
1490
                                //    This processed dependency has been assigned to this build iteration, but the 
-
 
1491
                                //    build standards of the package and this dependency prevent the package being
-
 
1492
                                //    built in this iteration.   
-
 
1493
                                canBeBuiltNow = false;
-
 
1494
                                mLogger.info("planRelease package cannot be built in this iteration {}", p.mName);
-
 
1495
                                break;
-
 
1496
                            }
-
 
1497
                        }
1368
                        }
1498
                        else if (  (  mDaemon && (   dependency.mBuildFile == 0 ) ||  (dependency.mBuildFile == buildLevel)) 
1369
                        else if (  (  mDaemon && (   dependency.mBuildFile == 0 ) ||  (dependency.mBuildFile == buildLevel)) 
1499
                                || ( !mDaemon && ( ( dependency.mBuildFile == 0 ) ||
1370
                                || ( !mDaemon && ( ( dependency.mBuildFile == 0 ) ||
1500
                                                       ( dependency.mBuildFile == buildLevel &&
1371
                                                       ( dependency.mBuildFile == buildLevel &&
1501
                                                       ( !p.haveSameBuildStandards(dependency)  ) ) ) ) )
1372
                                                       ( !p.haveSameBuildStandards(dependency)  ) ) ) ) )
Line 1521... Line 1392...
1521
                    if (allDependenciesForThisPackageProcessed)
1392
                    if (allDependenciesForThisPackageProcessed)
1522
                    {
1393
                    {
1523
                        p.mProcessed = true;
1394
                        p.mProcessed = true;
1524
                        if ( canBeBuiltNow )
1395
                        if ( canBeBuiltNow )
1525
                        {
1396
                        {
1526
                            p.mProcessed = true;
-
 
1527
 
-
 
1528
                            if ( mDaemon )
-
 
1529
                            {
-
 
1530
                                mBuildOrder.add(p);
-
 
1531
                                if ( canBeBuiltNow )
-
 
1532
                                {
-
 
1533
                                    // flag package with build requirement, may get down graded to future build requirement
-
 
1534
                                    p.mBuildFile = 1;
-
 
1535
                                    mLogger.info("planRelease set mBuildFile to 1 for package {}", p.mAlias );
-
 
1536
                                }
-
 
1537
                                else
-
 
1538
                                {
-
 
1539
                                    // flag package with future build requirement
1397
                            results.planCollection.add( new PlannedPackage(p, buildLevel));
1540
                                    p.mBuildFile = 2;
1398
                            p.mBuildFile = buildLevel;
1541
                                    mLogger.info("planRelease set mBuildFile to 2 for package {}", p.mAlias );
-
 
1542
                                }
-
 
1543
                            }
-
 
1544
                            else
-
 
1545
                            {
-
 
1546
                                // Escrow Mode
1399
                            p.mIsProcessed = true;
1547
                                if ( canBeBuiltNow )
-
 
1548
                                {
-
 
1549
                                    mBuildOrder.add(p);
-
 
1550
                                    p.mBuildFile = buildFile;
-
 
1551
                                    mLogger.info("planRelease set mBuildFile to {} for package {}",buildFile, p.mAlias );
1400
                            mLogger.info("planRelease set mBuildFile to {} for package {}",buildLevel, p.mAlias );
1552
                                }
-
 
1553
                            }
-
 
1554
                        }
1401
                        }
1555
                    }
1402
                    }
1556
                }
1403
                }
1557
            } while( !allDependenciesProcessed );
1404
            } while( !allDependenciesProcessed );
1558
            
1405
            
Line 1594... Line 1441...
1594
                p.mBuildLevel = 0;
1441
                p.mBuildLevel = 0;
1595
                
1442
                
1596
                if (p.mPkg.mBuildReason != null) {
1443
                if (p.mPkg.mBuildReason != null) {
1597
                    if (mode || ( !mode && p.mPkg.mBuildReason != BuildReason.Ripple ))
1444
                    if (mode || ( !mode && p.mPkg.mBuildReason != BuildReason.Ripple ))
1598
                    {
1445
                    {
1599
                        p.mBuildFile = buildFile;
-
 
1600
                        mLogger.info("planRelease 2 set mBuildFile to {} for package {}", buildFile, p.mAlias );
-
 
1601
 
-
 
1602
                        if ( buildFile == 1 )
-
 
1603
                        {
-
 
1604
                            int pvApplied = p.applyPV(mReleaseManager, mBaseline);
-
 
1605
 
-
 
1606
                            if ( pvApplied == 1 )
-
 
1607
                            {
-
 
1608
                                // max 50 chars
-
 
1609
                                rippleBuildExclude(p, p.mId, "Package has non standard versioning", null, null, true);
-
 
1610
                            }
-
 
1611
                            else if ( pvApplied == 2 )
-
 
1612
                            {
-
 
1613
                                // max 50 chars
-
 
1614
                                rippleBuildExclude(p, p.mId, "Package has reached ripple field limitations", null, null, true);
-
 
1615
                            }
-
 
1616
                            else if ( pvApplied == 3 )
-
 
1617
                            {
-
 
1618
                                // max 50 chars
-
 
1619
                                rippleBuildExclude(p, p.mId, "Package has invalid change type", null, null, true);
-
 
1620
                            }
-
 
1621
                            else
1446
                        toBuild.add(p);
1622
                            {
-
 
1623
                                //    Have found a package to build
-
 
1624
                                //        Prevent finding others
-
 
1625
                                buildFile = 2;
-
 
1626
 
-
 
1627
                                if ( p.mForcedRippleInstruction > 0 )
-
 
1628
                                {
-
 
1629
                                    mReleaseManager.markDaemonInstCompleted( p.mForcedRippleInstruction );
-
 
1630
                                }
-
 
1631
 
-
 
1632
                                if ( p.mTestBuildInstruction > 0 )
-
 
1633
                                {
-
 
1634
                                    mReleaseManager.markDaemonInstInProgress( p.mTestBuildInstruction );
-
 
1635
                                }
-
 
1636
                            }
-
 
1637
                        }
-
 
1638
                        else
-
 
1639
                        {
-
 
1640
                            mLogger.info("planRelease package has future (downgraded) build requirement {} {}", p.mName, buildFile);              
-
 
1641
                        }
-
 
1642
                    }
1447
                    }
1643
                }
1448
                }
1644
            }
1449
            }
1645
            
1450
            
1646
            //  Need (would like to) build stuff
1451
            //  Need (would like to) build stuff
Line 1712... Line 1517...
1712
                Package p = it.next();
1517
                Package p = it.next();
1713
                if (p.mBuildFile >= 0)
1518
                if (p.mBuildFile >= 0)
1714
                {
1519
                {
1715
                    if (!mode)
1520
                    if (!mode)
1716
                    {
1521
                    {
-
 
1522
                        //  Exclude packages that would have been processed in the basicPlan
-
 
1523
                        for (Iterator<PlannedPackage> it1 = basicPlan.planCollection.iterator(); it1.hasNext(); )
1717
                        // at this point...
1524
                        {
1718
                        // only 1 package with a build requirement has a mBuildFile of 1,
1525
                            PlannedPackage pkg = it1.next();
1719
                        // all other packages with a build requirement have an mBuildFile of 2
1526
                            if (pkg.mPkg == p)
-
 
1527
                            {
1720
                        // give packages with no build requirement, reproducible or not, an mBuildFile of 3
1528
                                mLogger.info("Test Plan without {}", p.mAlias);
1721
                        p.mNoBuildReason = p.mBuildFile;
1529
                                continue;
1722
                        p.mBuildFile = 3;
1530
                            }
1723
                        mLogger.info("planRelease 1 set mBuildFile to 3 for package {}", p.mAlias );
1531
                        }
1724
                    }
1532
                    }
1725
                    
1533
                    
1726
                    mLogger.info("Test Plan with {}", p.mAlias);
1534
                    mLogger.info("Test Plan with {}", p.mAlias);
1727
                    Package foundInRelease = mReleaseManager.findPackage(p.mAlias, fullPlanCollection);
1535
                    Package foundInRelease = mReleaseManager.findPackage(p.mAlias, fullPlanCollection);
1728
                    int foundIndex = mReleaseManager.findPackageLastIndex;
1536
                    int foundIndex = mReleaseManager.findPackageLastIndex;
Line 1779... Line 1587...
1779
            //  Is this package 'actively used' in the current build
1587
            //  Is this package 'actively used' in the current build
1780
            if (p.mPkg.mBuildFile >= 0)
1588
            if (p.mPkg.mBuildFile >= 0)
1781
            {
1589
            {
1782
                for (Iterator<String> it2 = p.mPkg.mDependencyCollection.iterator(); it2.hasNext(); )
1590
                for (Iterator<String> it2 = p.mPkg.mDependencyCollection.iterator(); it2.hasNext(); )
1783
                {
1591
                {
1784
                    Package p = it.next();
1592
                    String alias = it2.next();
1785
 
-
 
1786
                    if ( p.mBuildFile == 0 )
1593
                    if (  pkg.mPkg.mAlias.compareTo( alias ) == 0  ) {
1787
                    {
1594
                        //  Have found a consumer of 'pkg'
1788
                        // more build files are required
1595
                        usedBy.add(p);
1789
                        allProcessed = false;
1596
                        if (rippleOrder >= 0)
1790
                        mLogger.info("planRelease more build files are required for {}", p.mName);
1597
                            p.mBuildLevel = rippleOrder;
1791
                        break;
1598
                        break;
1792
                    }
1599
                    }
1793
                }
1600
                }
1794
            }
1601
            }
1795
        }
1602
        }
Line 1873... Line 1680...
1873
            //  IndirectErrors - Add/Remove as detected
1680
            //  IndirectErrors - Add/Remove as detected
1874
            //  
1681
            //  
1875
            
1682
            
1876
            if ( !buildExclusion.isABuildError() )
1683
            if ( !buildExclusion.isABuildError() )
1877
            {
1684
            {
-
 
1685
                if ( !buildExclusion.isProcessed() )
-
 
1686
                {
1878
                if (buildExclusion.isImported() && ! buildExclusion.isARootCause() ) {
1687
                    if (buildExclusion.isImported() && !buildExclusion.isARootCause() ) {
1879
                    // Remove from the exclusion list
1688
                        // Remove from the exclusion list
1880
                    buildExclusion.includeToBuild(mReleaseManager, mBaseline);
1689
                        buildExclusion.includeToBuild(mReleaseManager, mBaseline);
1881
                    mLogger.error("reportChange remove unused exclusion: {}", buildExclusion.info());
1690
                        mLogger.error("reportChange remove unused exclusion: {}", buildExclusion );
1882
                } else {
1691
                    } else {
1883
                    // Exclude and notify
1692
                        // Exclude and notify
1884
                    buildExclusion.excludeFromBuild(mReleaseManager, mBaseline);
1693
                        buildExclusion.excludeFromBuild(mReleaseManager, mBaseline);
1885
                    buildExclusion.email(this, mPackageCollection);
1694
                        buildExclusion.email(this, mPackageCollectionAll);
1886
                    counter++;
1695
                        counter++;
-
 
1696
                    }
1887
                }
1697
                }
1888
            }
1698
            }
1889
        }
1699
        }
1890
        mLogger.error("reportChange exclusion count: {}", counter);
1700
        mLogger.error("reportChange exclusion count: {}", counter);
1891
    }
1701
    }
Line 2025... Line 1835...
2025
    {
1835
    {
2026
        mLogger.debug("rippleBuildExclude");
1836
        mLogger.debug("rippleBuildExclude");
2027
     
1837
     
2028
        if ( p.mBuildFile == 0 || p.mBuildFile == 1 )
1838
        if ( p.mBuildFile == 0 || p.mBuildFile == 1 )
2029
        {
1839
        {
2030
            p.mBuildFile = -5;
1840
            p.mBuildFile = reason;
2031
            mLogger.info("rippleBuildExclude set mBuildFile to -5 for package {}", p.mAlias );
1841
            mLogger.info("rippleBuildExclude set mBuildFile to -5 for package {}", p.mAlias );
-
 
1842
            
-
 
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
-
 
1846
            //  If found, process it, else add it (unprocessed)
-
 
1847
            boolean found = false;
-
 
1848
            for (Iterator<BuildExclusion> it = mBuildExclusionCollection.iterator(); it.hasNext(); )
-
 
1849
            {
-
 
1850
                BuildExclusion buildExclusion = it.next();
2032
 
1851
 
2033
                if ( buildExclusion.compare(p.mId, rootPvId, rootCause))
1852
                if ( buildExclusion.compare(p.mId, rootPvId, rootCause))
2034
                {
1853
                {
2035
                    buildExclusion.setProcessed();
1854
                    buildExclusion.setProcessed();
2036
                    found = true;
1855
                    found = true;
Line 2058... Line 1877...
2058
                BuildExclusion buildExclusion = new BuildExclusion(p.mId, rootPvId, rootCause, p.mTestBuildInstruction);
1877
                BuildExclusion buildExclusion = new BuildExclusion(p.mId, rootPvId, rootCause, p.mTestBuildInstruction);
2059
                mBuildExclusionCollection.add(buildExclusion);
1878
                mBuildExclusionCollection.add(buildExclusion);
2060
            }
1879
            }
2061
        }
1880
        }
2062
 
1881
 
2063
            //  Locate ALL packages that depend on this package and exclude them too
-
 
2064
            //  This process will be recursive
-
 
2065
            //    Not sure that this it is efficient 
-
 
2066
            //  Only ripple a build exclusion through for non test builds
-
 
2067
            //
-
 
2068
            if ( p.mTestBuildInstruction == 0 && dependentToo)
-
 
2069
            {
-
 
2070
                for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
-
 
2071
                {
-
 
2072
                    Package pkg = it.next();
-
 
2073
 
-
 
2074
                    if ( pkg != p )
-
 
2075
                    {
-
 
2076
                        for (Iterator<Package> it2 = pkg.mPackageDependencyCollection.iterator(); it2.hasNext(); )
-
 
2077
                        {
-
 
2078
                            Package dependency = it2.next();
-
 
2079
 
-
 
2080
                            if ( dependency == p )
-
 
2081
                            {
-
 
2082
                                rippleBuildExclude( pkg, rootPvId, null, list, null, dependentToo );
-
 
2083
                                break;
-
 
2084
                            }
-
 
2085
                        }
-
 
2086
                    }
-
 
2087
                }
-
 
2088
            }
-
 
2089
        }
-
 
2090
        mLogger.info("rippleBuildExclude set {} {}", p.mName, p.mBuildFile);
1882
        mLogger.info("rippleBuildExclude set {} {}", p.mAlias, p.mBuildFile);
2091
    }
1883
    }
2092
 
1884
 
2093
    /**Simple XML string escaping
1885
    /**Simple XML string escaping
2094
     * 
1886
     * 
2095
     * @param xml		- String to escape
1887
     * @param xml		- String to escape