Skip to content
Snippets Groups Projects
Commit 381c6124 authored by Dylan Aïssi's avatar Dylan Aïssi
Browse files

Report outdated packages imported from a different channel


Some Apertis packages come from a different Debian release. In order keep
them in sync, active descendant branches are analyzed to determine in which
apertis versions they landed. Then, this information is used to report on the
dashboard which apertis releases need to be updated.

Signed-off-by: default avatarDylan Aïssi <dylan.aissi@collabora.com>
parent beec43db
No related branches found
No related tags found
No related merge requests found
Pipeline #461696 passed
......@@ -30,6 +30,19 @@ def sources_for_branches(data, branchnames):
def compute_updates(data):
ret = {"packages": {}}
def channel_is_active(channel):
return channel.get("status") == "active"
def get_channel_base(channel):
return channel.get("base")
channels = data["channels"]
channels_keys = set(channels.keys())
base_channels = {get_channel_base(channels[name]) for name in channels_keys}
active_channels = {
name for name in base_channels if channel_is_active(channels[name])
}
def updatable(package, base, branch, upstream):
msg = f"Branch {package.git['path_with_namespace']}:{branch.name}/{branch.version}"
if base and base != branch:
......@@ -45,6 +58,13 @@ def compute_updates(data):
"upstream": upstream,
}
if hasattr(branch, "descendant_branches"):
descendant_channels = set(b for b in branch.descendant_branches)
active_descendant_channels = descendant_channels.intersection(
active_channels
)
update["downstreams"] = list(active_descendant_channels)
if base:
update["base"] = {"name": base.name, "version": base.version}
p = ret["packages"].setdefault(package.name, {})
......
......@@ -234,6 +234,9 @@
{%- for channel in channels.values() if channel.source.distribution+"/"+channel.source.release == sources[report.upstream.source].base -%}
{{- report_channels.append(channel.base) or "" -}}
{%- endfor -%}
{%- for downstream in report.downstreams -%}
{{- report_channels.append(channels[downstream].base) or "" -}}
{%- endfor -%}
{%- elif report.branch in sources -%}
{%- for channel in channels.values() if channel.source.distribution+"/"+channel.source.release == sources[report.branch].base -%}
{{- report_channels.append(channel.base) or "" -}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment