Subversion Repositories DevTools

Rev

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

Rev 7033 Rev 7044
Line 187... Line 187...
187
     * @param rtagId         - Release Identifier
187
     * @param rtagId         - Release Identifier
188
     * @param isDaemon        - Mode of operation. False: Escrow, True: Daemon
188
     * @param isDaemon        - Mode of operation. False: Escrow, True: Daemon
189
     */
189
     */
190
    public RippleEngine(ReleaseManager releaseManager, int rtagId, boolean isDaemon)
190
    public RippleEngine(ReleaseManager releaseManager, int rtagId, boolean isDaemon)
191
    {
191
    {
192
        mLogger.debug("RippleEngine rtag_id " + rtagId + " isDaemon " + isDaemon);
192
        mLogger.debug("RippleEngine rtag_id {} isDaemon {}", rtagId, isDaemon);
193
        mReleaseManager = releaseManager;
193
        mReleaseManager = releaseManager;
194
        mBaseline = rtagId;
194
        mBaseline = rtagId;
195
        mRtagId = rtagId;
195
        mRtagId = rtagId;
196
        mDaemon = isDaemon;
196
        mDaemon = isDaemon;
197
        mReleaseManager.setDaemonMode(mDaemon);
197
        mReleaseManager.setDaemonMode(mDaemon);
198
    }
198
    }
199
 
199
 
200
    /**
200
    /**
201
     * getRtagId
201
     * getRtagId
-
 
202
     * @return The rtagId of the Release attached to this instance of the RippleEngine
202
     */
203
     */
203
    public int getRtagId()
204
    public int getRtagId()
204
    {
205
    {
205
        return mRtagId;
206
        return mRtagId;
206
    }
207
    }
Line 216... Line 217...
216
     *                                will result in a build, so it is given priority to connect 
217
     *                                will result in a build, so it is given priority to connect 
217
     *                                to the database.	
218
     *                                to the database.	
218
     */
219
     */
219
    public void planRelease(final boolean lastBuildActive) throws SQLException, Exception
220
    public void planRelease(final boolean lastBuildActive) throws SQLException, Exception
220
    {
221
    {
221
        mLogger.warn("planRelease mDaemon " + mDaemon);
222
        mLogger.warn("planRelease mDaemon {}", mDaemon);
222
 
223
 
223
        mBuildCollection.clear();
224
        mBuildCollection.clear();
224
        mPackageCollection.clear();
225
        mPackageCollection.clear();
225
        mReleasedPvIDCollection.clear();
226
        mReleasedPvIDCollection.clear();
226
        mBuildOrder.clear();
227
        mBuildOrder.clear();
Line 349... Line 350...
349
                phase.setPhase("disconnectForPlanning");
350
                phase.setPhase("disconnectForPlanning");
350
                mReleaseManager.disconnectForPlanning(lastBuildActive);
351
                mReleaseManager.disconnectForPlanning(lastBuildActive);
351
            }
352
            }
352
        }
353
        }
353
 
354
 
354
        mLogger.warn("planRelease mDaemon " + mDaemon + " returned");
355
        mLogger.warn("planRelease mDaemon {} returned", mDaemon);
355
        phase.setPhase("EndPlan");
356
        phase.setPhase("EndPlan");
356
    }
357
    }
357
    
358
    
358
    /** Process packages that have been collected as a part of the plan
359
    /** Process packages that have been collected as a part of the plan
359
     * @param phase
360
     * @param phase
Line 377... Line 378...
377
                if (p.mBuildFile == 0)
378
                if (p.mBuildFile == 0)
378
                {
379
                {
379
                    // package has yet to be processed
380
                    // package has yet to be processed
380
                    if (  p.mTestBuildInstruction > 0 )
381
                    if (  p.mTestBuildInstruction > 0 )
381
                    {
382
                    {
382
                        mLogger.info("planRelease package test build " + p.mName);
383
                        mLogger.info("planRelease package test build {}", p.mName);
383
 
384
 
384
                        //
385
                        //
385
                        //    Cannot test build an SDK based package or a Pegged Package
386
                        //    Cannot test build an SDK based package or a Pegged Package
386
                        //        Remove the test build request from the database
387
                        //        Remove the test build request from the database
387
                        //        Send a warning email
388
                        //        Send a warning email
Line 389... Line 390...
389
                        if(p.mIsPegged || p.mIsSdk)
390
                        if(p.mIsPegged || p.mIsSdk)
390
                        {
391
                        {
391
                            String reason;
392
                            String reason;
392
                            reason = (p.mIsPegged) ? "Pegged" : "SDK Based";
393
                            reason = (p.mIsPegged) ? "Pegged" : "SDK Based";
393
 
394
 
394
                            mLogger.error("planRelease Daemon Instruction of " + reason + " package deleted: " + p.mName);
395
                            mLogger.error("planRelease Daemon Instruction of {} package deleted: {}", reason, p.mName);
395
                            mReleaseManager.markDaemonInstCompleted( p.mTestBuildInstruction );
396
                            mReleaseManager.markDaemonInstCompleted( p.mTestBuildInstruction );
396
                            emailRejectedDaemonInstruction("Cannot 'Test Build' a " + reason + " package",p);
397
                            emailRejectedDaemonInstruction("Cannot 'Test Build' a " + reason + " package",p);
397
                        }
398
                        }
398
 
399
 
399
                        // force patch for test build numbering
400
                        // force patch for test build numbering
Line 437... Line 438...
437
        {
438
        {
438
            Package p = it.next();
439
            Package p = it.next();
439
 
440
 
440
            if ( p.hasCircularDependency( this ) )
441
            if ( p.hasCircularDependency( this ) )
441
            {
442
            {
442
                mLogger.info("planRelease circular dependency detected " + p.mAlias);
443
                mLogger.info("planRelease circular dependency detected {}", p.mAlias);
443
                
444
                
444
                //  Force this package to be marked as having a circular dependency - even if its been excluded
445
                //  Force this package to be marked as having a circular dependency - even if its been excluded
445
                p.mBuildFile = 0;
446
                p.mBuildFile = 0;
446
                
447
                
447
                // exclude all dependent packages
448
                // exclude all dependent packages
448
                // max 50 chars
449
                // max 50 chars
449
                rippleBuildExclude(p, p.mId, "Package has circular dependency", null, null, true);
450
                rippleBuildExclude(p, p.mId, "Package has circular dependency", null, null, true);
450
 
451
 
451
                // take the package out of the build
452
                // take the package out of the build
452
                p.mBuildFile = -6;
453
                p.mBuildFile = -6;
453
                mLogger.info("planRelease set mBuildFile to -6 for package " + p.mAlias );
454
                mLogger.info("planRelease set mBuildFile to -6 for package {}", p.mAlias );
454
                standardOut(mCircularDependency, p.mAlias, mCircularDependencyFlag);
455
                standardOut(mCircularDependency, p.mAlias, mCircularDependencyFlag);
455
                mCircularDependencyFlag = false;
456
                mCircularDependencyFlag = false;
456
            }
457
            }
457
        }
458
        }
458
 
459
 
Line 480... Line 481...
480
                String alias = it2.next();
481
                String alias = it2.next();
481
                Package dependency = findPackage(alias);
482
                Package dependency = findPackage(alias);
482
 
483
 
483
                if (dependency == ReleaseManager.NULL_PACKAGE)
484
                if (dependency == ReleaseManager.NULL_PACKAGE)
484
                {
485
                {
485
                    mLogger.info("planRelease dependency is not in the baseline " + alias);
486
                    mLogger.info("planRelease dependency is not in the baseline {}", alias);
486
                    // exclude all dependent packages
487
                    // exclude all dependent packages
487
                    // max 50 chars
488
                    // max 50 chars
488
                    rippleBuildExclude(p, p.mId, "Package build dependency not in the release", null, null, true);
489
                    rippleBuildExclude(p, p.mId, "Package build dependency not in the release", null, null, true);
489
 
490
 
490
                    // take the package out of the build
491
                    // take the package out of the build
491
                    p.mBuildFile = -4;
492
                    p.mBuildFile = -4;
492
                    mLogger.info("planRelease set mBuildFile to -4 for package " + p.mAlias );
493
                    mLogger.info("planRelease set mBuildFile to -4 for package {}", p.mAlias );
493
                    standardOut(mNotInBaseline, p.mAlias, mNotInBaselineFlag);
494
                    standardOut(mNotInBaseline, p.mAlias, mNotInBaselineFlag);
494
                    mNotInBaselineFlag = false;
495
                    mNotInBaselineFlag = false;
495
                    break;
496
                    break;
496
                }
497
                }
497
            }
498
            }
Line 519... Line 520...
519
 
520
 
520
                // package has yet to be processed
521
                // package has yet to be processed
521
                if (!p.isReproducible())
522
                if (!p.isReproducible())
522
                {
523
                {
523
                    // for escrow build purposes, exclude all dependent package versions
524
                    // for escrow build purposes, exclude all dependent package versions
524
                    mLogger.info("planRelease package not reproducible " + p.mName);
525
                    mLogger.info("planRelease package not reproducible {}" ,p.mName);
525
                    // max 50 chars
526
                    // max 50 chars
526
                    rippleBuildExclude(p, p.mId, "Package has no build environment", null, null, true);
527
                    rippleBuildExclude(p, p.mId, "Package has no build environment", null, null, true);
527
 
528
 
528
                    // package is not reproducible, discard
529
                    // package is not reproducible, discard
529
                    p.mBuildFile = -1;
530
                    p.mBuildFile = -1;
530
                    mLogger.info("planRelease set mBuildFile to -1 for package " + p.mAlias );
531
                    mLogger.info("planRelease set mBuildFile to -1 for package {}", p.mAlias );
531
                    standardOut(mAnyBuildPlatforms, p.mAlias, mAnyBuildPlatformsFlag);
532
                    standardOut(mAnyBuildPlatforms, p.mAlias, mAnyBuildPlatformsFlag);
532
                    mAnyBuildPlatformsFlag = false;
533
                    mAnyBuildPlatformsFlag = false;
533
                }
534
                }
534
            }
535
            }
535
        }
536
        }
Line 574... Line 575...
574
                    String machineClass = it2.next();
575
                    String machineClass = it2.next();
575
 
576
 
576
                    if ( p.canBeBuildby(machineClass))
577
                    if ( p.canBeBuildby(machineClass))
577
                    {
578
                    {
578
                        reproduce = true;
579
                        reproduce = true;
579
                        mLogger.info("planRelease package built on " + machineClass + " " + p.mAlias );
580
                        mLogger.info("planRelease package built on {} {}", machineClass, p.mAlias );
580
                        break;
581
                        break;
581
                    }
582
                    }
582
                }
583
                }
583
 
584
 
584
                if ( !reproduce )
585
                if ( !reproduce )
585
                {
586
                {
586
                    mLogger.info("planRelease package not reproducible on the build platforms configured for this baseline " + p.mName);
587
                    mLogger.info("planRelease package not reproducible on the build platforms configured for this baseline {}", p.mName);
587
 
588
 
588
                    if (mDaemon)
589
                    if (mDaemon)
589
                    {
590
                    {
590
                        // DEVI 54816
591
                        // DEVI 54816
591
                        // for escrow build purposes, do not exclude all dependent package versions
592
                        // for escrow build purposes, do not exclude all dependent package versions
Line 593... Line 594...
593
                        rippleBuildExclude(p, p.mId, "Package not built for configured platforms", null, null, false);
594
                        rippleBuildExclude(p, p.mId, "Package not built for configured platforms", null, null, false);
594
                    }
595
                    }
595
 
596
 
596
                    // package is not reproducible on the build platforms configured for this baseline, discard
597
                    // package is not reproducible on the build platforms configured for this baseline, discard
597
                    p.mBuildFile = -2;
598
                    p.mBuildFile = -2;
598
                    mLogger.info("planRelease set mBuildFile to -2 for package " + p.mAlias );
599
                    mLogger.info("planRelease set mBuildFile to -2 for package {}", p.mAlias );
599
                    standardOut(mAssocBuildPlatforms, p.mAlias, mAssocBuildPlatformsFlag);
600
                    standardOut(mAssocBuildPlatforms, p.mAlias, mAssocBuildPlatformsFlag);
600
                    mAssocBuildPlatformsFlag = false;
601
                    mAssocBuildPlatformsFlag = false;
601
                }
602
                }
602
            }
603
            }
603
        }      
604
        }      
Line 621... Line 622...
621
                    if ( be.compare(p.mId) && be.isARootCause() && p.mTestBuildInstruction == 0 && p.mForcedRippleInstruction == 0 )
622
                    if ( be.compare(p.mId) && be.isARootCause() && p.mTestBuildInstruction == 0 && p.mForcedRippleInstruction == 0 )
622
                    {
623
                    {
623
                        // package is not reproducible, discard
624
                        // package is not reproducible, discard
624
                        rippleBuildExclude( p, p.mId, null, it, be, true );
625
                        rippleBuildExclude( p, p.mId, null, it, be, true );
625
                        p.mBuildFile = -3;
626
                        p.mBuildFile = -3;
626
                        mLogger.info("planRelease set mBuildFile to -3 for package " + p.mAlias );
627
                        mLogger.info("planRelease set mBuildFile to -3 for package {}", p.mAlias );
627
                        break;
628
                        break;
628
                    }
629
                    }
629
                }
630
                }
630
            }
631
            }
631
 
632
 
Line 648... Line 649...
648
                    // package has yet to be processed
649
                    // package has yet to be processed
649
                    if (p.mDirectlyPlanned)
650
                    if (p.mDirectlyPlanned)
650
                    {
651
                    {
651
                        // a WIP exists on the package, or it is a Test Build
652
                        // a WIP exists on the package, or it is a Test Build
652
                        // exclude all dependent package versions
653
                        // exclude all dependent package versions
653
                        mLogger.info("planRelease package has WIP " + p.mName);
654
                        mLogger.info("planRelease package has WIP {}", p.mName);
654
                        if ( p.mBuildReason == null)
655
                        if ( p.mBuildReason == null)
655
                            p.mBuildReason = BuildReason.NewVersion;
656
                            p.mBuildReason = BuildReason.NewVersion;
656
                        rippleIndirectlyPlanned(p);
657
                        rippleIndirectlyPlanned(p);
657
                    }
658
                    }
658
                    else
659
                    else
Line 673... Line 674...
673
                                // not advisory, ie: has ripple build impact
674
                                // not advisory, ie: has ripple build impact
674
                                if ( !isInRelease(dpvId) )
675
                                if ( !isInRelease(dpvId) )
675
                                {
676
                                {
676
                                    // the package is out of date
677
                                    // the package is out of date
677
                                    // exclude all dependent package versions
678
                                    // exclude all dependent package versions
678
                                    mLogger.info("planRelease package out of date " + p.mName);
679
                                    mLogger.info("planRelease package out of date {}", p.mName);
679
                                    p.mBuildReason = BuildReason.Ripple;
680
                                    p.mBuildReason = BuildReason.Ripple;
680
                                    rippleIndirectlyPlanned(p);
681
                                    rippleIndirectlyPlanned(p);
681
                                    
682
                                    
682
                                    //  This package needs to be rippled
683
                                    //  This package needs to be rippled
683
                                    //  If this package has a rippleStop marker of 's', then we cannot
684
                                    //  If this package has a rippleStop marker of 's', then we cannot
Line 694... Line 695...
694
                                        // package is unBuildable, mark reason and discard
695
                                        // package is unBuildable, mark reason and discard
695
                                        p.mBuildFile = -11;
696
                                        p.mBuildFile = -11;
696
                                        
697
                                        
697
                                        if (p.mRippleStop == 's' ) {
698
                                        if (p.mRippleStop == 's' ) {
698
                                            // Need to flag to users that the package build is waiting user action
699
                                            // Need to flag to users that the package build is waiting user action
699
                                            mLogger.info("planRelease " + "Ripple Required." + " Stopped by flag" + p.mName);
700
                                            mLogger.info("planRelease Ripple Required. Stopped by flag {}", p.mName);
700
                                            mReleaseManager.setRippleStopWait(mRtagId,p);
701
                                            mReleaseManager.setRippleStopWait(mRtagId,p);
701
                                        }
702
                                        }
702
                                    }
703
                                    }
703
                                    
704
                                    
704
                                    
705
                                    
Line 730... Line 731...
730
                            {
731
                            {
731
                                if (! p.mIsBuildable)
732
                                if (! p.mIsBuildable)
732
                                {
733
                                {
733
                                    //  Package does not exist in dpkg_archive and it has been flagged as unbuildable
734
                                    //  Package does not exist in dpkg_archive and it has been flagged as unbuildable
734
                                    //  This may be because is Unbuildable or Manually built
735
                                    //  This may be because is Unbuildable or Manually built
735
                                    mLogger.info("planRelease " + "Unbuildable" + " package not found in archive " + p.mName);
736
                                    mLogger.info("planRelease Unbuildable package not found in archive {}", p.mName);
736
                                    // max 50 chars
737
                                    // max 50 chars
737
                                    rippleBuildExclude(p, p.mId, "Unbuildable" + " package not found in archive", null, null, true);
738
                                    rippleBuildExclude(p, p.mId, "Unbuildable" + " package not found in archive", null, null, true);
738
 
739
 
739
                                    // package is unBuildable, mark reason and discard
740
                                    // package is unBuildable, mark reason and discard
740
                                    p.mBuildFile = -10;
741
                                    p.mBuildFile = -10;
Line 748... Line 749...
748
                                    reason = (p.mIsPegged) ? "Pegged" : "SDK";
749
                                    reason = (p.mIsPegged) ? "Pegged" : "SDK";
749
 
750
 
750
                                    //  Pegged packages or packages provided from an SDK MUST exist in dpkg_archive
751
                                    //  Pegged packages or packages provided from an SDK MUST exist in dpkg_archive
751
                                    //  They will not be built within the context of this release. It is the responsibility
752
                                    //  They will not be built within the context of this release. It is the responsibility
752
                                    //  of another release to build them.
753
                                    //  of another release to build them.
753
                                    mLogger.info("planRelease " + reason + " package not found in archive " + p.mName);
754
                                    mLogger.info("planRelease {} package not found in archive {}", reason, p.mName);
754
                                    // max 50 chars
755
                                    // max 50 chars
755
                                    rippleBuildExclude(p, p.mId, reason + " package not found in archive", null, null, true);
756
                                    rippleBuildExclude(p, p.mId, reason + " package not found in archive", null, null, true);
756
 
757
 
757
                                    // package is not reproducible, mark reason and discard
758
                                    // package is not reproducible, mark reason and discard
758
                                    p.mBuildFile = -7;
759
                                    p.mBuildFile = -7;
Line 770... Line 771...
770
                                        if ( !isInRelease(dpvId) )
771
                                        if ( !isInRelease(dpvId) )
771
                                        {
772
                                        {
772
                                            // This package cannot be rebuilt as one of its dependents is NOT in this release
773
                                            // This package cannot be rebuilt as one of its dependents is NOT in this release
773
                                            // exclude all dependent package versions
774
                                            // exclude all dependent package versions
774
                                            
775
                                            
775
                                            mLogger.info("planRelease package not found in archive. Cannot be rebuilt du to  " + p.mName);
776
                                            mLogger.info("planRelease package not found in archive. Cannot be rebuilt due to {}", p.mName);
776
                                            // max 50 chars
777
                                            // max 50 chars
777
                                            rippleBuildExclude(p, p.mId, "Package cannot be rebuilt in this release", null, null, true);
778
                                            rippleBuildExclude(p, p.mId, "Package cannot be rebuilt in this release", null, null, true);
778
 
779
 
779
                                            // package is not reproducible, mark reason and discard
780
                                            // package is not reproducible, mark reason and discard
780
                                            p.mBuildFile = -4;
781
                                            p.mBuildFile = -4;
Line 783... Line 784...
783
                                    }
784
                                    }
784
                                    
785
                                    
785
                                    //  The package has not been excluded from the build
786
                                    //  The package has not been excluded from the build
786
                                    if (p.mBuildFile == 0)
787
                                    if (p.mBuildFile == 0)
787
                                    {
788
                                    {
788
                                        mLogger.info("planRelease package not found in archive " + p.mName);
789
                                        mLogger.info("planRelease package not found in archive {}", p.mName);
789
                                        // DEVI 47395 the cause of this build is not WIP or ripple induced,
790
                                        // DEVI 47395 the cause of this build is not WIP or ripple induced,
790
                                        // it simply does not exist in the archive (has been removed)
791
                                        // it simply does not exist in the archive (has been removed)
791
                                        // prevent source control interaction
792
                                        // prevent source control interaction
792
                                        p.mRequiresSourceControlInteraction = false;
793
                                        p.mRequiresSourceControlInteraction = false;
793
                                        p.mBuildReason = BuildReason.Restore;
794
                                        p.mBuildReason = BuildReason.Restore;
Line 820... Line 821...
820
                        if(p.mIsPegged || p.mIsSdk)
821
                        if(p.mIsPegged || p.mIsSdk)
821
                        {
822
                        {
822
                            String reason;
823
                            String reason;
823
                            reason = (p.mIsPegged) ? "Pegged" : "SDK Based";
824
                            reason = (p.mIsPegged) ? "Pegged" : "SDK Based";
824
 
825
 
825
                            mLogger.error("planRelease Daemon Instruction of " + reason + " package deleted: " + p.mName);
826
                            mLogger.error("planRelease Daemon Instruction of {} package deleted: {}", reason, p.mName);
826
                            mReleaseManager.markDaemonInstCompleted( p.mForcedRippleInstruction );
827
                            mReleaseManager.markDaemonInstCompleted( p.mForcedRippleInstruction );
827
                            emailRejectedDaemonInstruction("Cannot 'Ripple' a " + reason + " package",p);
828
                            emailRejectedDaemonInstruction("Cannot 'Ripple' a " + reason + " package",p);
828
 
829
 
829
                            p.mBuildFile = -8; 
830
                            p.mBuildFile = -8; 
830
                        }
831
                        }
831
                        else
832
                        else
832
                        {
833
                        {
833
                            mLogger.info("planRelease package forced ripple " + p.mName);
834
                            mLogger.info("planRelease package forced ripple {}", p.mName);
834
                            p.mBuildReason = BuildReason.Ripple;
835
                            p.mBuildReason = BuildReason.Ripple;
835
                            rippleIndirectlyPlanned(p);
836
                            rippleIndirectlyPlanned(p);
836
                        }
837
                        }
837
                    }
838
                    }
838
                }
839
                }
Line 854... Line 855...
854
                    if (p.mIsPegged || p.mIsSdk)
855
                    if (p.mIsPegged || p.mIsSdk)
855
                    {
856
                    {
856
                        String reason;
857
                        String reason;
857
                        reason = (p.mIsPegged) ? "Pegged" : "SDK";
858
                        reason = (p.mIsPegged) ? "Pegged" : "SDK";
858
 
859
 
859
                        mLogger.info("planRelease " + reason + " not built in this release " + p.mName);
860
                        mLogger.info("planRelease {} not built in this release {}", reason, p.mName);
860
                        p.mBuildFile = -8;
861
                        p.mBuildFile = -8;
861
                    }
862
                    }
862
                }
863
                }
863
            }
864
            }
864
 
865
 
Line 888... Line 889...
888
                        case -9: reason = "Rejected Daemon Instruction"; break;
889
                        case -9: reason = "Rejected Daemon Instruction"; break;
889
                        case -10: reason = "Unbuildable package not in dpkg_archive"; break;
890
                        case -10: reason = "Unbuildable package not in dpkg_archive"; break;
890
                        case -11: reason = "Marked as 'RippleStop'"; break;
891
                        case -11: reason = "Marked as 'RippleStop'"; break;
891
                        default: reason = "Unknown reason. Code:" + p.mBuildFile; break;
892
                        default: reason = "Unknown reason. Code:" + p.mBuildFile; break;
892
                        }
893
                        }
893
                        mLogger.error("planRelease Test Build of an unbuildable of package deleted: " + p.mName);
894
                        mLogger.error("planRelease Test Build of an unbuildable of package deleted: {}", p.mName);
894
                        mReleaseManager.markDaemonInstCompleted( p.mTestBuildInstruction );
895
                        mReleaseManager.markDaemonInstCompleted( p.mTestBuildInstruction );
895
                        emailRejectedDaemonInstruction(reason,p);
896
                        emailRejectedDaemonInstruction(reason,p);
896
                    }
897
                    }
897
                }
898
                }
898
            }
899
            }
Line 973... Line 974...
973
                         ( !mDaemon && p.mBuildFile == -2 ) )
974
                         ( !mDaemon && p.mBuildFile == -2 ) )
974
                    {
975
                    {
975
                        // Daemon: Flag packages with no build requirement as processed
976
                        // Daemon: Flag packages with no build requirement as processed
976
                        // Escrow: Flag packages with a foreign build environment as processed
977
                        // Escrow: Flag packages with a foreign build environment as processed
977
                        p.mProcessed = true;
978
                        p.mProcessed = true;
978
                        mLogger.info("planRelease package has no build requirement " + p.mName);            
979
                        mLogger.info("planRelease package has no build requirement {}", p.mName);            
979
                    }
980
                    }
980
                    else if ( ( p.mBuildFile == 0 ) && ( (mDaemon && ( p.mDirectlyPlanned || p.mIndirectlyPlanned ) ) || ( !mDaemon ) ) )
981
                    else if ( ( p.mBuildFile == 0 ) && ( (mDaemon && ( p.mDirectlyPlanned || p.mIndirectlyPlanned ) ) || ( !mDaemon ) ) )
981
                    {
982
                    {
982
                        // package yet to be processed and
983
                        // package yet to be processed and
983
                        //  Daemon mode: Has a build requirement
984
                        //  Daemon mode: Has a build requirement
Line 1009... Line 1010...
1009
                                //    This processed dependency has not been assigned to a build iteration or
1010
                                //    This processed dependency has not been assigned to a build iteration or
1010
                                //    This processed dependency has been assigned to this build iteration, but the 
1011
                                //    This processed dependency has been assigned to this build iteration, but the 
1011
                                //    build standards of the package and this dependency prevent the package being
1012
                                //    build standards of the package and this dependency prevent the package being
1012
                                //    built in this iteration.   
1013
                                //    built in this iteration.   
1013
                                canBeBuiltNow = false;
1014
                                canBeBuiltNow = false;
1014
                                mLogger.info("planRelease package cannot be built in this iteration " + p.mName);
1015
                                mLogger.info("planRelease package cannot be built in this iteration {}", p.mName);
1015
                                break;
1016
                                break;
1016
                            }
1017
                            }
1017
                        }
1018
                        }
1018
 
1019
 
1019
                        if (allDependenciesForThisPackageProcessed)
1020
                        if (allDependenciesForThisPackageProcessed)
Line 1025... Line 1026...
1025
                                mBuildOrder.add(p);
1026
                                mBuildOrder.add(p);
1026
                                if ( canBeBuiltNow )
1027
                                if ( canBeBuiltNow )
1027
                                {
1028
                                {
1028
                                    // flag package with build requirement, may get down graded to future build requirement
1029
                                    // flag package with build requirement, may get down graded to future build requirement
1029
                                    p.mBuildFile = 1;
1030
                                    p.mBuildFile = 1;
1030
                                    mLogger.info("planRelease set mBuildFile to 1 for package " + p.mAlias );
1031
                                    mLogger.info("planRelease set mBuildFile to 1 for package {}", p.mAlias );
1031
                                }
1032
                                }
1032
                                else
1033
                                else
1033
                                {
1034
                                {
1034
                                    // flag package with future build requirement
1035
                                    // flag package with future build requirement
1035
                                    p.mBuildFile = 2;
1036
                                    p.mBuildFile = 2;
1036
                                    mLogger.info("planRelease set mBuildFile to 2 for package " + p.mAlias );
1037
                                    mLogger.info("planRelease set mBuildFile to 2 for package {}", p.mAlias );
1037
                                }
1038
                                }
1038
                            }
1039
                            }
1039
                            else
1040
                            else
1040
                            {
1041
                            {
1041
                                // Escrow Mode
1042
                                // Escrow Mode
1042
                                if ( canBeBuiltNow )
1043
                                if ( canBeBuiltNow )
1043
                                {
1044
                                {
1044
                                    mBuildOrder.add(p);
1045
                                    mBuildOrder.add(p);
1045
                                    p.mBuildFile = buildFile;
1046
                                    p.mBuildFile = buildFile;
1046
                                    mLogger.info("planRelease set mBuildFile to " + buildFile + " for package " + p.mAlias );
1047
                                    mLogger.info("planRelease set mBuildFile to {} for package {}",buildFile, p.mAlias );
1047
                                }
1048
                                }
1048
                            }
1049
                            }
1049
                        }
1050
                        }
1050
                    }
1051
                    }
1051
                }
1052
                }
Line 1064... Line 1065...
1064
                    Package p = it.next();
1065
                    Package p = it.next();
1065
 
1066
 
1066
                    if ( p.mProcessed && p.mBuildFile == 1 )
1067
                    if ( p.mProcessed && p.mBuildFile == 1 )
1067
                    {
1068
                    {
1068
                        p.mBuildFile = buildFile;
1069
                        p.mBuildFile = buildFile;
1069
                        mLogger.info("planRelease 2 set mBuildFile to " + buildFile + " for package " + p.mAlias );
1070
                        mLogger.info("planRelease 2 set mBuildFile to {} for package {}", buildFile, p.mAlias );
1070
 
1071
 
1071
                        if ( buildFile == 1 )
1072
                        if ( buildFile == 1 )
1072
                        {
1073
                        {
1073
                            int pvApplied = p.applyPV(mReleaseManager, mBaseline);
1074
                            int pvApplied = p.applyPV(mReleaseManager, mBaseline);
1074
 
1075
 
Line 1104... Line 1105...
1104
                                }
1105
                                }
1105
                            }
1106
                            }
1106
                        }
1107
                        }
1107
                        else
1108
                        else
1108
                        {
1109
                        {
1109
                            mLogger.info("planRelease package has future (downgraded) build requirement " + p.mName + " " + buildFile);              
1110
                            mLogger.info("planRelease package has future (downgraded) build requirement {} {}", p.mName, buildFile);              
1110
                        }
1111
                        }
1111
                    }
1112
                    }
1112
                }
1113
                }
1113
            }
1114
            }
1114
 
1115
 
Line 1148... Line 1149...
1148
                        // only 1 package with a build requirement has a mBuildFile of 1,
1149
                        // only 1 package with a build requirement has a mBuildFile of 1,
1149
                        // all other packages with a build requirement have an mBuildFile of 2
1150
                        // all other packages with a build requirement have an mBuildFile of 2
1150
                        // give packages with no build requirement, reproducible or not, an mBuildFile of 3
1151
                        // give packages with no build requirement, reproducible or not, an mBuildFile of 3
1151
                        p.mNoBuildReason = p.mBuildFile;
1152
                        p.mNoBuildReason = p.mBuildFile;
1152
                        p.mBuildFile = 3;
1153
                        p.mBuildFile = 3;
1153
                        mLogger.info("planRelease 1 set mBuildFile to 3 for package " + p.mAlias );
1154
                        mLogger.info("planRelease 1 set mBuildFile to 3 for package {}", p.mAlias );
1154
                    }
1155
                    }
1155
                }
1156
                }
1156
            }
1157
            }
1157
            else
1158
            else
1158
            {
1159
            {
Line 1163... Line 1164...
1163
 
1164
 
1164
                    if ( p.mBuildFile == 0 )
1165
                    if ( p.mBuildFile == 0 )
1165
                    {
1166
                    {
1166
                        // more build files are required
1167
                        // more build files are required
1167
                        allProcessed = false;
1168
                        allProcessed = false;
1168
                        mLogger.info("planRelease more build files are required for " + p.mName);
1169
                        mLogger.info("planRelease more build files are required for {}", p.mName);
1169
                        break;
1170
                        break;
1170
                    }
1171
                    }
1171
                }
1172
                }
1172
 
1173
 
1173
                buildFile++;
1174
                buildFile++;
Line 1212... Line 1213...
1212
            if ( !buildExclusion.isProcessed() )
1213
            if ( !buildExclusion.isProcessed() )
1213
            {
1214
            {
1214
                if (buildExclusion.isImported() && ! buildExclusion.isARootCause() ) {
1215
                if (buildExclusion.isImported() && ! buildExclusion.isARootCause() ) {
1215
                    // Remove from the exclusion list
1216
                    // Remove from the exclusion list
1216
                    buildExclusion.includeToBuild(mReleaseManager, mBaseline);
1217
                    buildExclusion.includeToBuild(mReleaseManager, mBaseline);
1217
                    mLogger.error("reportChange remove unused exclusion: " + buildExclusion.info());
1218
                    mLogger.error("reportChange remove unused exclusion: {}", buildExclusion.info());
1218
                } else {
1219
                } else {
1219
                    // Exclude and notify
1220
                    // Exclude and notify
1220
                    buildExclusion.excludeFromBuild(mReleaseManager, mBaseline);
1221
                    buildExclusion.excludeFromBuild(mReleaseManager, mBaseline);
1221
                    buildExclusion.email(this, mPackageCollection);
1222
                    buildExclusion.email(this, mPackageCollection);
1222
                    counter++;
1223
                    counter++;
1223
                }
1224
                }
1224
            }
1225
            }
1225
        }
1226
        }
1226
        mLogger.error("reportChange exclusion count: " + counter);
1227
        mLogger.error("reportChange exclusion count: {}", counter);
1227
    }
1228
    }
1228
 
1229
 
1229
    /**reports the build plan
1230
    /**reports the build plan
1230
     */
1231
     */
1231
    public void reportPlan() throws SQLException, Exception
1232
    public void reportPlan() throws SQLException, Exception
Line 1265... Line 1266...
1265
        if (retVal == null)
1266
        if (retVal == null)
1266
        {
1267
        {
1267
            retVal = new BuildFile();
1268
            retVal = new BuildFile();
1268
        }
1269
        }
1269
 
1270
 
1270
        mLogger.debug("getNextBuildFileContent returned " + retVal.state.name() );
1271
        mLogger.debug("getNextBuildFileContent returned {}", retVal.state.name() );
1271
        return retVal;
1272
        return retVal;
1272
    }
1273
    }
1273
 
1274
 
1274
 
1275
 
1275
    /**collects meta data associated with the baseline
1276
    /**collects meta data associated with the baseline
Line 1281... Line 1282...
1281
     *          mBaseline is an RTAGID
1282
     *          mBaseline is an RTAGID
1282
     */
1283
     */
1283
    public void collectMetaData() throws SQLException, Exception
1284
    public void collectMetaData() throws SQLException, Exception
1284
    {
1285
    {
1285
        Phase phase = new Phase("cmd");
1286
        Phase phase = new Phase("cmd");
1286
        mLogger.debug("collectMetaData mDaemon " + mDaemon);
1287
        mLogger.debug("collectMetaData mDaemon {}", mDaemon);
1287
 
1288
 
1288
        try
1289
        try
1289
        {
1290
        {
1290
            phase.setPhase("connect");
1291
            phase.setPhase("connect");
1291
            mReleaseManager.connect();
1292
            mReleaseManager.connect();
Line 1341... Line 1342...
1341
    {
1342
    {
1342
        mLogger.debug("findPackage");
1343
        mLogger.debug("findPackage");
1343
 
1344
 
1344
        Package retVal = mReleaseManager.findPackage(alias, mPackageCollection);
1345
        Package retVal = mReleaseManager.findPackage(alias, mPackageCollection);
1345
 
1346
 
1346
        mLogger.info("findPackage returned " + retVal.mName);
1347
        mLogger.info("findPackage returned {}", retVal.mName);
1347
        return retVal;
1348
        return retVal;
1348
    }
1349
    }
1349
 
1350
 
1350
    /**
1351
    /**
1351
     * Sets the mBuildFile to -5 (indirectly dependent on package versions which are not reproducible) 
1352
     * Sets the mBuildFile to -5 (indirectly dependent on package versions which are not reproducible) 
Line 1363... Line 1364...
1363
    {
1364
    {
1364
        mLogger.debug("rippleBuildExclude");
1365
        mLogger.debug("rippleBuildExclude");
1365
        if ( p.mBuildFile == 0 || p.mBuildFile == 1 )
1366
        if ( p.mBuildFile == 0 || p.mBuildFile == 1 )
1366
        {
1367
        {
1367
            p.mBuildFile = -5;
1368
            p.mBuildFile = -5;
1368
            mLogger.info("rippleBuildExclude set mBuildFile to -5 for package " + p.mAlias );
1369
            mLogger.info("rippleBuildExclude set mBuildFile to -5 for package {}", p.mAlias );
1369
 
1370
 
1370
            if ( be != null )
1371
            if ( be != null )
1371
            {
1372
            {
1372
                be.setProcessed();
1373
                be.setProcessed();
1373
            }
1374
            }
Line 1445... Line 1446...
1445
                        }
1446
                        }
1446
                    }
1447
                    }
1447
                }
1448
                }
1448
            }
1449
            }
1449
        }
1450
        }
1450
        mLogger.info("rippleBuildExclude set " + p.mName + " " + p.mBuildFile);
1451
        mLogger.info("rippleBuildExclude set {} {}", p.mName, p.mBuildFile);
1451
    }
1452
    }
1452
 
1453
 
1453
    /**Simple XML string escaping
1454
    /**Simple XML string escaping
1454
     * 
1455
     * 
1455
     * @param xml		- String to escape
1456
     * @param xml		- String to escape
Line 1677... Line 1678...
1677
 
1678
 
1678
                    if ( p.mBuildFile > buildFile )
1679
                    if ( p.mBuildFile > buildFile )
1679
                    {
1680
                    {
1680
                        // more build files are required
1681
                        // more build files are required
1681
                        allProcessed = false;
1682
                        allProcessed = false;
1682
                        mLogger.info("planRelease reiterating package has no build requirement " + p.mName + " " + p.mBuildFile + " " + buildFile);
1683
                        mLogger.info("planRelease reiterating package has no build requirement {} {} {}",p.mName, p.mBuildFile,  buildFile);
1683
                        break;
1684
                        break;
1684
                    }
1685
                    }
1685
                } 
1686
                } 
1686
 
1687
 
1687
                buildFile++;
1688
                buildFile++;
Line 2203... Line 2204...
2203
                        }
2204
                        }
2204
                    }
2205
                    }
2205
                }
2206
                }
2206
            }
2207
            }
2207
        }
2208
        }
2208
        mLogger.info("rippleIndirectlyPlanned set " + p.mName + " " + p.mIndirectlyPlanned);    
2209
        mLogger.info("rippleIndirectlyPlanned set {} {}", p.mName, p.mIndirectlyPlanned);    
2209
    }
2210
    }
2210
 
2211
 
2211
    /**accessor method
2212
    /**accessor method
2212
     */
2213
     */
2213
    public String getEscrowSetUp()
2214
    public String getEscrowSetUp()
2214
    {
2215
    {
2215
        mLogger.debug("getEscrowSetUp");
2216
        mLogger.debug("getEscrowSetUp");
2216
        String retVal = mEscrowSetup;
2217
        String retVal = mEscrowSetup;
2217
 
2218
 
2218
        mLogger.debug("getEscrowSetUp returned " + retVal);
2219
        mLogger.debug("getEscrowSetUp returned {}", retVal);
2219
        return retVal;
2220
        return retVal;
2220
    }
2221
    }
2221
 
2222
 
2222
    /**accessor method
2223
    /**accessor method
2223
     */
2224
     */
2224
    public String getRawData()
2225
    public String getRawData()
2225
    {
2226
    {
2226
        mLogger.debug("getRawData");
2227
        mLogger.debug("getRawData");
2227
        String retVal = mEscrowRawData;
2228
        String retVal = mEscrowRawData;
2228
 
2229
 
2229
        mLogger.debug("getRawData returned " + retVal);
2230
        mLogger.debug("getRawData returned {}", retVal);
2230
        return retVal;
2231
        return retVal;
2231
    }
2232
    }
2232
 
2233
 
2233
    /**Get the build loc (location)
2234
    /**Get the build loc (location)
2234
     * This is package specific and will depend on the build mode (Escrow/Daemon)
2235
     * This is package specific and will depend on the build mode (Escrow/Daemon)
Line 2302... Line 2303...
2302
                String info = bs.getBuildStandardText();
2303
                String info = bs.getBuildStandardText();
2303
                result.append(info);
2304
                result.append(info);
2304
            }
2305
            }
2305
        }
2306
        }
2306
 
2307
 
2307
        mLogger.info("buildInfoText returned " + result);
2308
        mLogger.info("buildInfoText returned {}", result);
2308
        return result.toString();
2309
        return result.toString();
2309
    }
2310
    }
2310
 
2311
 
2311
    /**prints to standard out in escrow mode only
2312
    /**prints to standard out in escrow mode only
2312
     * <br>Prints a title and information. The title is only printed once.
2313
     * <br>Prints a title and information. The title is only printed once.
Line 2357... Line 2358...
2357
        //        Transfer the daemon instruction email list into the package before use
2358
        //        Transfer the daemon instruction email list into the package before use
2358
 
2359
 
2359
        p.setTestEmail();
2360
        p.setTestEmail();
2360
        String target = p.emailInfoNonAntTask(this);
2361
        String target = p.emailInfoNonAntTask(this);
2361
 
2362
 
2362
        mLogger.error("emailRejectedDaemonInstruction Server: " + getMailServer());
2363
        mLogger.error("emailRejectedDaemonInstruction Server: {}", getMailServer());
2363
        mLogger.error("emailRejectedDaemonInstruction Sender: " + getMailSender());
2364
        mLogger.error("emailRejectedDaemonInstruction Sender: {}", getMailSender());
2364
        mLogger.error("emailRejectedDaemonInstruction Target: " + target);
2365
        mLogger.error("emailRejectedDaemonInstruction Target: {}", target);
2365
 
2366
 
2366
        try
2367
        try
2367
        {
2368
        {
2368
            //    
2369
            //    
2369
            Smtpsend.send(getMailServer(), // mailServer
2370
            Smtpsend.send(getMailServer(), // mailServer
Line 2375... Line 2376...
2375
                    mailBody,          // body
2376
                    mailBody,          // body
2376
                    null               // attachment
2377
                    null               // attachment
2377
                    );
2378
                    );
2378
        } catch (Exception e)
2379
        } catch (Exception e)
2379
        {
2380
        {
2380
            mLogger.warn("Email Failure: emailRejectedDaemonInstruction:" + e.getMessage());
2381
            mLogger.warn("Email Failure: emailRejectedDaemonInstruction:{}", e.getMessage());
2381
        }
2382
        }
2382
    }
2383
    }
2383
 
2384
 
2384
    /**
2385
    /**
2385
     * @return the mMailServer
2386
     * @return the mMailServer