{% extends "base.html" %} {% block content %}

{% if gitea_org and gitea_org != 'pool' %} {{ gitea_org }}/ {% endif %} {{ package_name }}

{% if filter_project %}
Filtered View: Showing build results only for project {{ filter_project }} {% if tracking_branch %} on branch {{ tracking_branch }} {% endif %}  |  Clear filter
{% endif %} {% if repo_data %} {% if repo_data.description %}
Description

{{ repo_data.description }}

{% endif %}
Repository
{% if open_issues is not none %} Issues {{ open_issues }} {% endif %} {% if open_prs is not none %} Pull Requests {{ open_prs }} {% endif %} {% if forks_count > 0 %} {% endif %}
{% if repo_data.stars_count is not none %}
{{ repo_data.stars_count }} Stars
{% endif %} {% if repo_data.watchers_count is not none %}
{{ repo_data.watchers_count }} Watchers
{% endif %}
{% if all_branches or build_results_by_branch %} {% if tracking_branch %} {# When filtering by project, show only the tracking branch #} {% set branches_to_show = [tracking_branch] %} {% elif default_branch_name and default_branch_name in all_branches %} {# Reorder branches so default branch is first #} {% set branches_to_show = [default_branch_name] + (all_branches | reject('equalto', default_branch_name) | list) %} {% else %} {# No default branch or default not in list, show all branches as-is #} {% set branches_to_show = all_branches %} {% endif %}
Branches & Build Results {% if tracking_branch %} Tracking: {{ tracking_branch }} {% endif %}
{% if not tracking_branch %}

Click on a branch to see which OBS projects build it

{% endif %}
{% for branch_name in branches_to_show %} {% set builds = build_results_by_branch.get(branch_name, []) %} {% set is_default = (branch_name == default_branch_name) %}
{{ branch_name }} {% if is_default %} Default Branch {% endif %}
{% if builds %}

{{ builds|length }} build result(s) across multiple projects

{% else %}

No OBS builds found for this branch

{% endif %}
{% if builds %} {# Group builds by project #} {% set projects = {} %} {% for build in builds %} {% if build.project not in projects %} {% set _ = projects.update({build.project: []}) %} {% endif %} {% set _ = projects[build.project].append(build) %} {% endfor %}
{% for project, project_builds in projects.items() %} {% set project_id = (branch_name|replace('/', '-')|replace('.', '-') ~ '-proj-' ~ loop.index) %} {% set is_first_project = loop.first %} {# Count status types for this project #} {% set status_counts = {} %} {% for build in project_builds %} {% set status_parts = build.status.split(':', 1) %} {% set status = status_parts[0] %} {% if status in status_counts %} {% set _ = status_counts.update({status: status_counts[status] + 1}) %} {% else %} {% set _ = status_counts.update({status: 1}) %} {% endif %} {% endfor %} {# Project summary row (clickable) #} {# Detail rows for each build (hidden by default, except first project) #} {% for build in project_builds %} {% set unique_build_id = project_id ~ '-build-' ~ loop.index %} {% endfor %} {% endfor %}
Project Builds Status Summary
{{ project }} {{ project_builds|length }} {% if status_counts.get('failed') or status_counts.get('unresolvable') or status_counts.get('broken') %} {% set failed_count = (status_counts.get('failed', 0) + status_counts.get('unresolvable', 0) + status_counts.get('broken', 0)) %} {{ failed_count }} failed {% endif %} {% if status_counts.get('building') or status_counts.get('scheduled') or status_counts.get('dispatching') %} {% set building_count = (status_counts.get('building', 0) + status_counts.get('scheduled', 0) + status_counts.get('dispatching', 0)) %} {{ building_count }} building {% endif %} {% if status_counts.get('succeeded') %} {{ status_counts['succeeded'] }} succeeded {% endif %}
{{ build.package }} {{ build.repository }} / {{ build.arch }} {% set status_parts = build.status.split(':', 1) %} {% set main_status = status_parts[0] %} {% set status_detail = status_parts[1] if status_parts|length > 1 else (build.details or '') %} {% if main_status == 'succeeded' %} {{ main_status }} {% elif main_status in ['failed', 'unresolvable', 'broken'] %} {{ main_status }} {% elif main_status in ['scheduled', 'building', 'dispatching'] %} {{ main_status }} {% else %} {{ main_status }} {% endif %}
{% else %}
This branch exists in the Git repository but is not currently being built in any OBS project.
{% endif %}
{% endfor %} {% if build_results_by_branch.get('unknown') %} {% set unknown_builds = build_results_by_branch.get('unknown') %}
Unknown Branch

{{ unknown_builds|length }} build result(s) without branch information

{# Group unknown builds by project #} {% set unknown_projects = {} %} {% for build in unknown_builds %} {% if build.project not in unknown_projects %} {% set _ = unknown_projects.update({build.project: []}) %} {% endif %} {% set _ = unknown_projects[build.project].append(build) %} {% endfor %}
{% for project, project_builds in unknown_projects.items() %} {% set project_id = 'unknown-proj-' ~ loop.index %} {% set is_first_project = loop.first %} {# Count status types for this project #} {% set status_counts = {} %} {% for build in project_builds %} {% set status_parts = build.status.split(':', 1) %} {% set status = status_parts[0] %} {% if status in status_counts %} {% set _ = status_counts.update({status: status_counts[status] + 1}) %} {% else %} {% set _ = status_counts.update({status: 1}) %} {% endif %} {% endfor %} {# Project summary row #} {# Detail rows (hidden by default, except first project) #} {% for build in project_builds %} {% set unique_build_id = project_id ~ '-build-' ~ loop.index %} {% endfor %} {% endfor %}
Project Builds Status Summary
{{ project }} {{ project_builds|length }} {% if status_counts.get('failed') or status_counts.get('unresolvable') or status_counts.get('broken') %} {% set failed_count = (status_counts.get('failed', 0) + status_counts.get('unresolvable', 0) + status_counts.get('broken', 0)) %} {{ failed_count }} failed {% endif %} {% if status_counts.get('building') or status_counts.get('scheduled') or status_counts.get('dispatching') %} {% set building_count = (status_counts.get('building', 0) + status_counts.get('scheduled', 0) + status_counts.get('dispatching', 0)) %} {{ building_count }} building {% endif %} {% if status_counts.get('succeeded') %} {{ status_counts['succeeded'] }} succeeded {% endif %}
{{ build.package }} {{ build.repository }} / {{ build.arch }} {% set status_parts = build.status.split(':', 1) %} {% set main_status = status_parts[0] %} {% set status_detail = status_parts[1] if status_parts|length > 1 else (build.details or '') %} {% if main_status == 'succeeded' %} {{ main_status }} {% elif main_status in ['failed', 'unresolvable', 'broken'] %} {{ main_status }} {% elif main_status in ['scheduled', 'building', 'dispatching'] %} {{ main_status }} {% else %} {{ main_status }} {% endif %}
{% endif %}
{% endif %}
Timestamps
{% if repo_data.updated_at %}

Last Updated: {{ repo_data.updated_at }}

{% endif %} {% if repo_data.created_at %}

Created: {{ repo_data.created_at }}

{% endif %}
{% else %}
Could not fetch repository details from Gitea.
{% endif %}
{% endblock %}