diff --git a/docs/WEB-UI.md b/docs/WEB-UI.md index 6f75014..39ad3a5 100644 --- a/docs/WEB-UI.md +++ b/docs/WEB-UI.md @@ -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 diff --git a/src/ci_orchestrator/web/templates/partials/executions.html b/src/ci_orchestrator/web/templates/partials/executions.html index 740319f..6a890dc 100644 --- a/src/ci_orchestrator/web/templates/partials/executions.html +++ b/src/ci_orchestrator/web/templates/partials/executions.html @@ -73,9 +73,9 @@ {% if run.html_url %} - #{{ run.number }}{% if run.attempt > 1 %}.{{ run.attempt }}{% endif %} + #{{ run.run_id }}{% if run.attempt > 1 %}.{{ run.attempt }}{% endif %} {% else %} - #{{ run.number }}{% if run.attempt > 1 %}.{{ run.attempt }}{% endif %} + #{{ run.run_id }}{% if run.attempt > 1 %}.{{ run.attempt }}{% endif %} {% endif %} {{ run.repo or "—" }} diff --git a/tests/python/test_web_executions.py b/tests/python/test_web_executions.py index 73ce516..6228200 100644 --- a/tests/python/test_web_executions.py +++ b/tests/python/test_web_executions.py @@ -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