Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6651 dpurdie 1
SELECT DISTINCT pkg.pkg_name,
2
       pv.pkg_version,
3
       pv.is_autobuildable,
4
       pv.pv_id,
5
       pm.code_lines,
6
       pm.branches,
7
       (CASE WHEN ut.test_types_fk IS NOT NULL AND ut.test_types_fk != 1 THEN 'Y' ELSE 'N' END) AS unit_tested, 
8
       autotest_qry.autotested,
9
       (select count(*) from test_run tr where tr.build_id = cbi.build_id) as test_count,
10
       modified_stamp as modified_ts,
11
       TO_CHAR( modified_stamp,'DD-Mon-YYYY HH24:MI:SS' ) AS modified_stamp,
12
       (CASE WHEN pv.is_autobuildable != 'Y' THEN 'Manual' ELSE  'New Version' END) as reason,
13
       (CASE WHEN pv.pv_id = :PV_ID THEN  1 ELSE 0 END )as inRelease,
14
       TRUNC( ORA_SYSDATE - modified_stamp ) as ageDays
15
  FROM package_metrics pm,
16
       package_versions pv,
17
       packages pkg,
18
       unit_tests ut,
19
       (SELECT ut.pv_id, 'Y' AS autotested FROM unit_tests ut WHERE ut.test_types_fk = 7 ) autotest_qry,
20
       ( select pv_id, max(build_id) as build_id  from BUILD_INSTANCES bi
21
          where bi.state in ('C')
22
          and bi.reason not in ('T')
23
          group by pv_id
24
        ) cbi,
25
       BUILD_INSTANCES bi
26
 WHERE pv.pkg_id = pkg.pkg_id
27
   AND pv.pkg_id in( select pkg_id from package_versions where pv_id = :PV_ID)
28
   AND pv.v_ext in( select v_ext from package_versions where pv_id = :PV_ID)
29
   AND pm.pv_id (+) = pv.pv_id
30
   AND ut.pv_id (+) = pv.pv_id
31
   AND autotest_qry.pv_id (+) = pv.pv_id
32
   and cbi.pv_id(+) = pv.pv_id
33
   and cbi.build_id = bi.build_id(+)
34
   AND pv.build_type <> 'Y'
35
   AND pv.dlocked     = 'Y'
36
 ORDER BY modified_ts DESC
37