Subversion Repositories DevTools

Rev

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

Rev 864 Rev 866
Line 669... Line 669...
669
         {
669
         {
670
           p = findPackage(5, packageCollection);
670
           p = findPackage(5, packageCollection);
671
           p.addEmail("timbutdim@erggroup.com");
671
           p.addEmail("timbutdim@erggroup.com");
672
         }
672
         }
673
         
673
         
674
        /* planned do not ripple info
-
 
675
         * pv_id
-
 
676
         * 6
-
 
677
         */
-
 
678
         p = findPackage(6, packageCollection);
-
 
679
         p.mDoNotRipple = true;
-
 
680
         
-
 
681
        /* planned advisory ripple info
674
        /* planned advisory ripple info
682
         * pv_id
675
         * pv_id
683
         * 0
676
         * 0
684
         */
677
         */
685
         if ( mConnectionString.compareTo("iteration1") == 0 )
678
         if ( mConnectionString.compareTo("iteration1") == 0 )
Line 1278... Line 1271...
1278
         {
1271
         {
1279
           p = findPackage(10, packageCollection);
1272
           p = findPackage(10, packageCollection);
1280
           p.addEmail("jimmyfishcake@erggroup.com");
1273
           p.addEmail("jimmyfishcake@erggroup.com");
1281
         }
1274
         }
1282
         
1275
         
1283
        /* released do not ripple info
-
 
1284
         * pv_id
-
 
1285
         * 11
-
 
1286
         */
-
 
1287
         p = findPackage(11, packageCollection);
-
 
1288
         p.mDoNotRipple = true;
-
 
1289
         
-
 
1290
        /* released advisory ripple info
1276
        /* released advisory ripple info
1291
         * pv_id
1277
         * pv_id
1292
         * 14
1278
         * 14
1293
         */
1279
         */
1294
         if ( mConnectionString.compareTo("iteration1") != 0 )
1280
         if ( mConnectionString.compareTo("iteration1") != 0 )
Line 1839... Line 1825...
1839
          }
1825
          }
1840
          
1826
          
1841
          rset51.close();
1827
          rset51.close();
1842
          stmt51.close();
1828
          stmt51.close();
1843
 
1829
 
1844
          // get planned package do not ripple info
-
 
1845
          CallableStatement stmt6 = mConnection.prepareCall(
-
 
1846
          "select pl.pv_id " +
-
 
1847
          "from release_manager.planned pl, release_manager.package_versions pv, release_manager.do_not_ripple dnr " +
-
 
1848
          "where pl.rtag_id=" + baseline + " and pv.build_type='A' and pv.dlocked='A' " +
-
 
1849
          "and pv.pv_id = pl.pv_id and dnr.rtag_id=pl.rtag_id and dnr.pv_id=pl.pv_id " +
-
 
1850
          "order by pl.pv_id"
-
 
1851
          );
-
 
1852
          ResultSet rset6 = stmt6.executeQuery();
-
 
1853
               
-
 
1854
          while( rset6.next() )
-
 
1855
          {
-
 
1856
            boolean ignore = false;
-
 
1857
              
-
 
1858
            int pv_id = rset6.getInt("pv_id");
-
 
1859
              
-
 
1860
            if ( rset6.wasNull() )
-
 
1861
            {
-
 
1862
              mLogger.fatal("queryPackageVersions rset6 null pv_id");
-
 
1863
              // show stopper
-
 
1864
              throw new Exception();
-
 
1865
            }
-
 
1866
               
-
 
1867
            Package p = findPackage(pv_id, packageCollection);
-
 
1868
               
-
 
1869
            if ( p == NULL_PACKAGE )
-
 
1870
            {
-
 
1871
              mLogger.warn("queryPackageVersions rset6 highly unlikely " + pv_id);
-
 
1872
              // highly unlikely but package may have been added in between queries
-
 
1873
              ignore = true;
-
 
1874
            }
-
 
1875
               
-
 
1876
            if ( !ignore )
-
 
1877
            {
-
 
1878
              p.mDoNotRipple = true;
-
 
1879
              mLogger.warn("queryPackageVersions rset6 set mDoNotRipple on " + p.mAlias);
-
 
1880
            }
-
 
1881
          }
-
 
1882
          
-
 
1883
          rset6.close();
-
 
1884
          stmt6.close();
-
 
1885
 
-
 
1886
          // get planned package advisory ripple info
1830
          // get planned package advisory ripple info
1887
          CallableStatement stmt7 = mConnection.prepareCall(
1831
          CallableStatement stmt7 = mConnection.prepareCall(
1888
          "select pl.pv_id " +
1832
          "select pl.pv_id " +
1889
          "from release_manager.planned pl, release_manager.package_versions pv, release_manager.advisory_ripple ar " +
1833
          "from release_manager.planned pl, release_manager.package_versions pv, release_manager.advisory_ripple ar " +
1890
          "where pl.rtag_id=" + baseline + " and pv.build_type='A' and pv.dlocked='A' " +
1834
          "where pl.rtag_id=" + baseline + " and pv.build_type='A' and pv.dlocked='A' " +
Line 2342... Line 2286...
2342
          }
2286
          }
2343
          
2287
          
2344
          rset12.close();
2288
          rset12.close();
2345
          stmt12.close();
2289
          stmt12.close();
2346
 
2290
 
2347
          // get released package do not ripple info
-
 
2348
          CallableStatement stmt13 = mConnection.prepareCall(
-
 
2349
          "select rc.pv_id " +
-
 
2350
          "from release_manager.release_content rc, release_manager.package_versions pv, release_manager.do_not_ripple dnr " +
-
 
2351
          "where rc.rtag_id=" + baseline +
-
 
2352
          " and pv.pv_id = rc.pv_id and dnr.rtag_id=rc.rtag_id and dnr.pv_id=rc.pv_id " +
-
 
2353
          "order by rc.pv_id"
-
 
2354
          );
-
 
2355
          ResultSet rset13 = stmt13.executeQuery();
-
 
2356
                
-
 
2357
          while( rset13.next() )
-
 
2358
          {
-
 
2359
            boolean ignore = false;
-
 
2360
               
-
 
2361
            int pv_id = rset13.getInt("pv_id");
-
 
2362
               
-
 
2363
            if ( rset13.wasNull() )
-
 
2364
            {
-
 
2365
              mLogger.fatal("queryPackageVersions rset13 null pv_id");
-
 
2366
              // show stopper
-
 
2367
              throw new Exception();
-
 
2368
            }
-
 
2369
                
-
 
2370
            Package p = findPackage(pv_id, packageCollection);
-
 
2371
                
-
 
2372
            if ( p == NULL_PACKAGE )
-
 
2373
            {
-
 
2374
              mLogger.warn("queryPackageVersions rset13 package may have been superceded by planned " + pv_id);
-
 
2375
              ignore = true;
-
 
2376
            }
-
 
2377
                
-
 
2378
            if ( !ignore )
-
 
2379
            {
-
 
2380
              p.mDoNotRipple = true;
-
 
2381
              mLogger.warn("queryPackageVersions rset13 set mDoNotRipple on " + p.mAlias);
-
 
2382
            }
-
 
2383
          }
-
 
2384
          
-
 
2385
          rset13.close();
-
 
2386
          stmt13.close();
-
 
2387
 
-
 
2388
          // get released advisory ripple info
2291
          // get released advisory ripple info
2389
          CallableStatement stmt14 = mConnection.prepareCall(
2292
          CallableStatement stmt14 = mConnection.prepareCall(
2390
          "select rc.pv_id " +
2293
          "select rc.pv_id " +
2391
          "from release_manager.release_content rc, release_manager.package_versions pv, release_manager.advisory_ripple ar " +
2294
          "from release_manager.release_content rc, release_manager.package_versions pv, release_manager.advisory_ripple ar " +
2392
          "where rc.rtag_id=" + baseline +
2295
          "where rc.rtag_id=" + baseline +
Line 3495... Line 3398...
3495
      }
3398
      }
3496
    }
3399
    }
3497
  }
3400
  }
3498
 
3401
 
3499
  /**handles database connection/disconnection
3402
  /**handles database connection/disconnection
3500
   * executes the ExcludeFromBuild stored procedure with the passed parameters
3403
   * executes the Exclude_Indirect_From_Build stored procedure with the passed parameters
3501
   */
3404
   */
3502
  public void excludeFromBuild(String packageVersionId, 
3405
  public void excludeFromBuild(String packageVersionId, 
-
 
3406
                               String packageVersion, String rtagId, String rootPvId,
3503
                               String packageVersion, String rtagId) throws SQLException, Exception
3407
                               String rootCause, String rootFile) throws SQLException, Exception
3504
  {
3408
  {
3505
    mLogger.debug("excludeFromBuild " + packageVersionId);
3409
    mLogger.debug("excludeFromBuild " + packageVersionId);
3506
    if ( mUseDatabase )
3410
    if ( mUseDatabase )
3507
    {
3411
    {
3508
      try
3412
      try
3509
      {
3413
      {
3510
        connect();
3414
        connect();
3511
        CallableStatement stmt = mConnection.prepareCall( "begin ? := PK_RMAPI.EXCLUDE_FROM_BUILD(?,?,?,?); end;" );
3415
        CallableStatement stmt = mConnection.prepareCall( "begin ? := PK_RMAPI.EXCLUDE_INDIRECT_FROM_BUILD(?,?,?,?,?,?,?); end;" );
3512
        stmt.registerOutParameter( 1, Types.INTEGER);
3416
        stmt.registerOutParameter( 1, Types.INTEGER);
3513
        stmt.setString( 2, packageVersionId );
3417
        stmt.setString( 2, packageVersionId );
3514
        stmt.setString( 3, packageVersion );
3418
        stmt.setString( 3, packageVersion );
3515
        stmt.setString( 4, rtagId );
3419
        stmt.setString( 4, rtagId );
3516
        stmt.setString( 5, "buildadm" );
3420
        stmt.setString( 5, "buildadm" );
-
 
3421
        stmt.setString( 6, rootPvId);
-
 
3422
        stmt.setString( 7, rootCause);
-
 
3423
        stmt.setString( 8, rootFile);
3517
        stmt.executeUpdate();
3424
        stmt.executeUpdate();
3518
        int result = stmt.getInt( 1 );
3425
        int result = stmt.getInt( 1 );
3519
      
3426
      
3520
        if ( result != 0 )
3427
        if ( result != 0 )
3521
        {
3428
        {
3522
          // flag build failure
3429
          // flag build failure
3523
          mLogger.fatal( "excludeFromBuild show stopper PK_RMAPI.EXCLUDE_FROM_BUILD failed, returned " + result );
3430
          mLogger.fatal( "excludeFromBuild show stopper PK_RMAPI.EXCLUDE_INDIRECT_FROM_BUILD failed, returned " + result );
3524
          throw new Exception();
3431
          throw new Exception();
3525
        }
3432
        }
3526
        stmt.close();
3433
        stmt.close();
3527
        mConnection.commit();
3434
        mConnection.commit();
3528
        disconnect();
3435
        disconnect();
Line 3541... Line 3448...
3541
        }
3448
        }
3542
      }
3449
      }
3543
    }
3450
    }
3544
  }
3451
  }
3545
 
3452
 
-
 
3453
  /**removes an excluded package from the do_not_ripple table
-
 
3454
   */
-
 
3455
  public void includeToBuild(String packageVersionId, String rtagId) throws SQLException, Exception
-
 
3456
  {
-
 
3457
    mLogger.debug("includeToBuild " + packageVersionId);
-
 
3458
    if ( mUseDatabase )
-
 
3459
    {
-
 
3460
      try
-
 
3461
      {
-
 
3462
        CallableStatement stmt = mConnection.prepareCall("delete from release_manager.do_not_ripple where rtag_id=" + rtagId + " and pv_id=" + packageVersionId);
-
 
3463
        stmt.executeUpdate();
-
 
3464
        stmt.close();
-
 
3465
        mConnection.commit();
-
 
3466
      }
-
 
3467
      catch( SQLException e )
-
 
3468
      {
-
 
3469
        if ( mConnection == null || ( mConnection != null && !mConnection.isValid(10) ) )
-
 
3470
        {
-
 
3471
          mLogger.error("includeToBuild database access error only");
-
 
3472
          throw new SQLException();
-
 
3473
        }
-
 
3474
        else
-
 
3475
        {
-
 
3476
          mLogger.fatal("includeToBuild show stopper");
-
 
3477
          throw new Exception();
-
 
3478
        }
-
 
3479
      }
-
 
3480
    }
-
 
3481
  }
-
 
3482
 
3546
  /**Representation of a row in the RELEASE_CONFIG table
3483
  /**Representation of a row in the RELEASE_CONFIG table
3547
   */
3484
   */
3548
  private class ReleaseConfig
3485
  private class ReleaseConfig
3549
  {
3486
  {
3550
    /**rtag_id column value
3487
    /**rtag_id column value
Line 4767... Line 4704...
4767
        }
4704
        }
4768
      }
4705
      }
4769
    }
4706
    }
4770
  }
4707
  }
4771
 
4708
 
-
 
4709
  public void queryBuildExclusions(Vector<BuildExclusion> buildExclusionCollection, int baseline) throws SQLException, Exception
-
 
4710
  {
-
 
4711
    mLogger.debug("queryBuildExclusions " + baseline);
-
 
4712
    
-
 
4713
    if ( !mUseDatabase )
-
 
4714
    {
-
 
4715
      mLogger.info("queryBuildExclusions !mUseDatabase");
-
 
4716
    }
-
 
4717
    else
-
 
4718
    {
-
 
4719
      try
-
 
4720
      {
-
 
4721
        CallableStatement stmt = mConnection.prepareCall("select pv_id, root_pv_id, root_cause from release_manager.do_not_ripple where rtag_id=" + baseline);
-
 
4722
        ResultSet rset = stmt.executeQuery();
-
 
4723
        
-
 
4724
        while( rset.next() )
-
 
4725
        {
-
 
4726
          int pvId = rset.getInt("pv_id");
-
 
4727
          
-
 
4728
          if ( rset.wasNull() )
-
 
4729
          {
-
 
4730
            mLogger.fatal("queryBuildExclusions rset null pv_id");
-
 
4731
            // show stopper
-
 
4732
            throw new Exception();
-
 
4733
          }
-
 
4734
          
-
 
4735
          int rootPvId = rset.getInt("root_pv_id");
-
 
4736
          
-
 
4737
          if ( rset.wasNull() )
-
 
4738
          {
-
 
4739
            // quite acceptable
-
 
4740
            rootPvId = -1;
-
 
4741
          }
-
 
4742
          
-
 
4743
          // again, a null root_cause is quite acceptable
-
 
4744
          String rootCause = rset.getString("root_cause");
-
 
4745
          
-
 
4746
          BuildExclusion buildExclusion = new BuildExclusion(pvId, rootPvId, rootCause);
-
 
4747
          buildExclusionCollection.add(buildExclusion);
-
 
4748
        }
-
 
4749
 
-
 
4750
        rset.close();
-
 
4751
        stmt.close();
-
 
4752
      }
-
 
4753
      catch ( SQLException e )
-
 
4754
      {
-
 
4755
        if ( mConnection == null || ( mConnection != null && !mConnection.isValid(10) ) )
-
 
4756
        {
-
 
4757
          mLogger.error("queryBuildExclusions database access error only");
-
 
4758
          throw new SQLException();
-
 
4759
        }
-
 
4760
        else
-
 
4761
        {
-
 
4762
          mLogger.fatal("queryBuildExclusions show stopper");
-
 
4763
          throw new Exception();
-
 
4764
        }
-
 
4765
      }
-
 
4766
    }
-
 
4767
  }
4772
}
4768
}