Commit fa8ea41 1 parent d55b115 commit fa8ea41 Copy full SHA for fa8ea41
File tree 2 files changed +23
-3
lines changed
2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -282,6 +282,22 @@ function db_get_patch_stats() {
282
282
->getArrayResult ();
283
283
}
284
284
285
+ function db_get_pr_stats ($ year ) {
286
+ global $ entityManager ;
287
+ return $ entityManager ->createQueryBuilder ()
288
+ ->from ('Patch ' , 'p ' )
289
+ ->select (['p.status ' ,
290
+ 'p.type ' ,
291
+ 'g.repository ' ,
292
+ 'COUNT(p.status) AS count ' ])
293
+ ->join ('p.group ' , 'g ' )
294
+ ->where ('g.year = :year ' )
295
+ ->groupBy ('p.status, p.type, g.repository ' )
296
+ ->setParameter ('year ' , $ year )
297
+ ->getQuery ()
298
+ ->getArrayResult ();
299
+ }
300
+
285
301
function db_delete_cache () {
286
302
global $ connection ;
287
303
$ connection ->executeStatement ('DROP TABLE IF EXISTS cache_items ' );
Original file line number Diff line number Diff line change 73
73
@++$ projs [$ repo ->name ()];
74
74
75
75
$ prs_per_project [$ repo ->name ()]['url ' ] = (string )$ repo ;
76
- foreach ($ group ->patches as $ patch ) {
77
- @++$ prs_per_project [$ repo ->name ()][$ patch ->type ][$ patch ->wasMerged ()];
78
- }
79
76
}
80
77
}
81
78
79
+ foreach (db_get_pr_stats ($ selected_year ) as $ data ) {
80
+ $ repo = (new Repository ($ data ['repository ' ]))->name ();
81
+ $ merged = $ data ['status ' ] == PATCH_MERGED ||
82
+ $ data ['status ' ] == PATCH_MERGED_ILLEGAL ;
83
+ @$ prs_per_project [$ repo ][$ data ['type ' ]][$ merged ] += $ data ['count ' ];
84
+ }
85
+
82
86
if (sizeof ($ projs ) > 10 ) {
83
87
foreach ($ projs as $ proj => $ n ) {
84
88
if ($ n == 1 )
You can’t perform that action at this time.
0 commit comments