mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
rrs: Fix last updated.
Don't conditional last updated to upstream status. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
This commit is contained in:
parent
4936eaa65a
commit
b2e04c0a9e
|
@ -449,15 +449,9 @@ class Raw():
|
||||||
def get_reup_by_last_updated(date):
|
def get_reup_by_last_updated(date):
|
||||||
""" Get last time the Recipes were upgraded """
|
""" Get last time the Recipes were upgraded """
|
||||||
cur = connection.cursor()
|
cur = connection.cursor()
|
||||||
cur.execute("""SELECT te.recipe_id, te.status, te.date, te.rownum FROM(
|
cur.execute("""SELECT recipe_id, MAX(commit_date) AS date
|
||||||
SELECT recipe_id, status, date, ROW_NUMBER() OVER(
|
FROM rrs_recipeupgrade
|
||||||
PARTITION BY recipe_id
|
GROUP BY recipe_id;
|
||||||
ORDER BY date DESC
|
|
||||||
) AS rownum
|
|
||||||
FROM rrs_RecipeUpstream
|
|
||||||
WHERE status = 'Y'
|
|
||||||
AND date <= %s) AS te
|
|
||||||
WHERE te.rownum = 1;
|
|
||||||
""", [date])
|
""", [date])
|
||||||
return Raw.dictfetchall(cur)
|
return Raw.dictfetchall(cur)
|
||||||
|
|
||||||
|
|
25
rrs/views.py
25
rrs/views.py
|
@ -145,22 +145,23 @@ def _get_recipe_list(milestone):
|
||||||
recipes[i]['version'] = re['pv']
|
recipes[i]['version'] = re['pv']
|
||||||
recipes_ids.append(re['id'])
|
recipes_ids.append(re['id'])
|
||||||
|
|
||||||
if recipes and recipe_upstream_history:
|
if recipes:
|
||||||
recipe_upstream_all = Raw.get_reup_by_recipes_and_date(
|
|
||||||
recipes_ids, recipe_upstream_history.id)
|
|
||||||
recipe_last_updated = Raw.get_reup_by_last_updated(
|
recipe_last_updated = Raw.get_reup_by_last_updated(
|
||||||
milestone.end_date)
|
milestone.end_date)
|
||||||
maintainers_all = Raw.get_ma_by_recipes_and_date(
|
|
||||||
recipes_ids, recipe_maintainer_history[0])
|
|
||||||
for reup in recipe_upstream_all:
|
|
||||||
recipe_upstream_dict_all[reup['recipe_id']] = reup
|
|
||||||
for rela in recipe_last_updated:
|
for rela in recipe_last_updated:
|
||||||
recipe_last_updated_dict_all[rela['recipe_id']] = rela
|
recipe_last_updated_dict_all[rela['recipe_id']] = rela
|
||||||
for ma in maintainers_all:
|
|
||||||
maintainers_dict_all[ma['recipe_id']] = ma['name']
|
|
||||||
|
|
||||||
else:
|
if recipe_upstream_history:
|
||||||
recipe_upstream_all = None
|
recipe_upstream_all = Raw.get_reup_by_recipes_and_date(
|
||||||
|
recipes_ids, recipe_upstream_history.id)
|
||||||
|
for reup in recipe_upstream_all:
|
||||||
|
recipe_upstream_dict_all[reup['recipe_id']] = reup
|
||||||
|
|
||||||
|
if recipe_maintainer_history:
|
||||||
|
maintainers_all = Raw.get_ma_by_recipes_and_date(
|
||||||
|
recipes_ids, recipe_maintainer_history[0])
|
||||||
|
for ma in maintainers_all:
|
||||||
|
maintainers_dict_all[ma['recipe_id']] = ma['name']
|
||||||
|
|
||||||
for recipe in recipes:
|
for recipe in recipes:
|
||||||
upstream_version = ''
|
upstream_version = ''
|
||||||
|
@ -201,8 +202,6 @@ def _get_recipe_list(milestone):
|
||||||
if recipe_last_updated:
|
if recipe_last_updated:
|
||||||
recipe_date = recipe_last_updated['date']
|
recipe_date = recipe_last_updated['date']
|
||||||
outdated = recipe_date.date().isoformat()
|
outdated = recipe_date.date().isoformat()
|
||||||
else:
|
|
||||||
outdated = 'Unknown'
|
|
||||||
else:
|
else:
|
||||||
outdated = 'Up-to-date'
|
outdated = 'Up-to-date'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user