@@ -191,6 +191,8 @@ def commitfest(request, cfid):
191191 orderby_str = 'p.id'
192192 elif sortkey == 5 :
193193 orderby_str = 'p.name, created'
194+ elif sortkey == 6 :
195+ orderby_str = "branch.all_additions + branch.all_deletions NULLS LAST, created"
194196 else :
195197 orderby_str = 'p.id'
196198 sortkey = 0
@@ -229,7 +231,12 @@ def commitfest(request, cfid):
229231 count(*) total,
230232 string_agg(task.task_name, ', ') FILTER (WHERE task.status in ('ABORTED', 'ERRORED', 'FAILED')) as failed_task_names,
231233 branch.commit_id IS NULL as needs_rebase,
232- branch.apply_url
234+ branch.apply_url,
235+ branch.patch_count,
236+ branch.first_additions,
237+ branch.first_deletions,
238+ branch.all_additions,
239+ branch.all_deletions
233240 FROM commitfest_cfbotbranch branch
234241 LEFT JOIN commitfest_cfbottask task ON task.branch_id = branch.branch_id
235242 WHERE branch.patch_id=p.id
@@ -241,8 +248,9 @@ def commitfest(request, cfid):
241248INNER JOIN commitfest_topic t ON t.id=p.topic_id
242249LEFT JOIN auth_user committer ON committer.id=p.committer_id
243250LEFT JOIN commitfest_targetversion v ON p.targetversion_id=v.id
251+ LEFT JOIN commitfest_cfbotbranch branch ON branch.patch_id=p.id
244252WHERE poc.commitfest_id=%(cid)s {0}
245- GROUP BY p.id, poc.id, committer.id, t.id, v.version
253+ GROUP BY p.id, poc.id, committer.id, t.id, v.version, branch.patch_id
246254ORDER BY is_open DESC, {1}""" .format (where_str , orderby_str ), params )
247255 patches = [dict (zip ([col [0 ] for col in curs .description ], row )) for row in curs .fetchall ()]
248256
@@ -842,16 +850,26 @@ def cfbot_ingest(message):
842850 cursor .execute ("""INSERT INTO commitfest_cfbotbranch (patch_id, branch_id,
843851 branch_name, commit_id,
844852 apply_url, status,
845- created, modified)
846- VALUES (%s, %s, %s, %s, %s, %s, %s, %s)
853+ created, modified,
854+ version, patch_count,
855+ first_additions, first_deletions,
856+ all_additions, all_deletions
857+ )
858+ VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
847859 ON CONFLICT (patch_id) DO UPDATE
848860 SET status = EXCLUDED.status,
849861 modified = EXCLUDED.modified,
850862 branch_id = EXCLUDED.branch_id,
851863 branch_name = EXCLUDED.branch_name,
852864 commit_id = EXCLUDED.commit_id,
853865 apply_url = EXCLUDED.apply_url,
854- created = EXCLUDED.created
866+ created = EXCLUDED.created,
867+ version = EXCLUDED.version,
868+ patch_count = EXCLUDED.patch_count,
869+ first_additions = EXCLUDED.first_additions,
870+ first_deletions = EXCLUDED.first_deletions,
871+ all_additions = EXCLUDED.all_additions,
872+ all_deletions = EXCLUDED.all_deletions
855873 WHERE commitfest_cfbotbranch.created < EXCLUDED.created
856874 OR (commitfest_cfbotbranch.branch_id = EXCLUDED.branch_id
857875 AND commitfest_cfbotbranch.modified < EXCLUDED.modified)
@@ -864,7 +882,13 @@ def cfbot_ingest(message):
864882 branch_status ["apply_url" ],
865883 branch_status ["status" ],
866884 branch_status ["created" ],
867- branch_status ["modified" ])
885+ branch_status ["modified" ],
886+ branch_status ["version" ],
887+ branch_status ["patch_count" ],
888+ branch_status ["first_additions" ],
889+ branch_status ["first_deletions" ],
890+ branch_status ["all_additions" ],
891+ branch_status ["all_deletions" ])
868892 )
869893
870894 # Now we check what we have in our database. If that contains a different
0 commit comments