Pick last expires and types from the history (#4811)

The history is ordered from first introduction of the metric to the
latest change.
So the last element is the _current_ valid value for expires (and types).

For example this can be seen for `top_sites.contile_reporting_url` in
Firefox Android which initially was set to expire in v112, but has been
change to never expire later. The current database still lists 112 for
it though.

Co-authored-by: Leli <33942105+lelilia@users.noreply.github.com>
This commit is contained in:
Jan-Erik Rediger 2024-01-12 14:15:01 +01:00 коммит произвёл GitHub
Родитель 0d70573048
Коммит ad15d5f2bf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -61,13 +61,13 @@ def download_glean_metrics(url, threshold):
for name, metric in metrics.items():
first_seen = metric["history"][0]["dates"]["first"][:10]
last_seen = metric["history"][-1]["dates"]["last"][:10]
expires = metric["history"][0]["expires"]
expires = metric["history"][-1]["expires"]
in_source = metric["in-source"]
glean_metrics.append(
{
"glean_app": glean_app,
"metric": name,
"type": metric["history"][0]["type"],
"type": metric["history"][-1]["type"],
"first_seen_date": first_seen,
"last_seen_date": last_seen,
"expires": expires,