fix(web): Run column shows run_id, the real global progressive

run.number only counts within its own repo/workflow -- meaningless once
the admin endpoint mixes every repo into one list, and already not what
the row order is sorted by. run_id is Gitea's actual instance-wide,
strictly-increasing id, so the displayed number now agrees with "most
recent globally". The link still goes to Gitea's own per-repo run page
(html_url); only the label text changed.
This commit is contained in:
2026-07-26 01:20:44 +02:00
parent 6b338a699a
commit 39abfcef80
3 changed files with 16 additions and 7 deletions
+9
View File
@@ -359,6 +359,15 @@ table is wide as a result — 13 columns — and scrolls horizontally inside the
card's own `.table-wrap` rather than the page, same as the other wide tables
(Templates, Services).
**Run shows `run_id`, not the per-repo `#N`.** Gitea's `run_number` only
counts within its own repo/workflow, so it is meaningless once the admin
endpoint mixes every repo on the instance into one list; `run_id` is Gitea's
own instance-wide, strictly-increasing id, which is what "global recency"
above is sorted on too, so the number in the column and the row order agree.
The cell still links out to Gitea's own run page (`html_url`, which Gitea
builds from the per-repo number internally) — only the *displayed* text
changed.
**Started is click-to-toggle.** It renders relative ("2h ago") by default;
clicking swaps to the absolute local timestamp, and clicking again swaps
back. Both strings are pre-rendered server-side into the button's
@@ -73,9 +73,9 @@
<tr>
<td>
{% if run.html_url %}
<a href="{{ run.html_url }}" target="_blank" rel="noopener noreferrer">#{{ run.number }}{% if run.attempt > 1 %}.{{ run.attempt }}{% endif %}<svg class="icon" aria-hidden="true"><use href="#i-external"></use></svg></a>
<a href="{{ run.html_url }}" target="_blank" rel="noopener noreferrer">#{{ run.run_id }}{% if run.attempt > 1 %}.{{ run.attempt }}{% endif %}<svg class="icon" aria-hidden="true"><use href="#i-external"></use></svg></a>
{% else %}
#{{ run.number }}{% if run.attempt > 1 %}.{{ run.attempt }}{% endif %}
#{{ run.run_id }}{% if run.attempt > 1 %}.{{ run.attempt }}{% endif %}
{% endif %}
</td>
<td>{{ run.repo or "—" }}</td>
+5 -5
View File
@@ -213,7 +213,7 @@ def test_card_renders_run_row_with_its_vm(
resp = client.get("/executions")
assert resp.status_code == 200
assert "#12" in resp.text
assert "#412" in resp.text
assert "build-ns7zip.yml" in resp.text
assert "simone/local-ci-cd-system" in resp.text
assert "a1b2c3d" in resp.text # commit shortened to 7 chars
@@ -238,7 +238,7 @@ def test_attempt_shown_only_when_greater_than_one(
resp = client.get("/executions")
assert "#12.2" in resp.text
assert "#412.2" in resp.text
@pytest.mark.parametrize(
@@ -480,7 +480,7 @@ def test_end_to_end_against_a_stubbed_gitea(
resp = client.get("/executions")
assert resp.status_code == 200
assert "#12" in resp.text
assert "#412" in resp.text
assert "build-ns7zip.yml" in resp.text
# The clone is attached to its run, so it is not listed as "no run".
assert "no run" not in resp.text
@@ -852,7 +852,7 @@ def test_scope_refused_login_token_falls_back_to_the_pat(
resp = client.get("/executions")
assert seen == ["scope-less", _FAKE_PAT]
assert "#12" in resp.text
assert "#412" in resp.text
def test_no_pat_fallback_when_none_configured(
@@ -944,7 +944,7 @@ def test_401_triggers_one_refresh_then_retries(
assert seen == ["stale", "fresh"]
assert len(stub.refresh_calls) == 1
assert "#12" in resp.text
assert "#412" in resp.text
assert gitea_token_for(app, "Simone") is not None