From aa88ea6f8b83b574ebae34653c5a4a65b70a0356 Mon Sep 17 00:00:00 2001 From: Jens Tirsvad Nielsen Date: Sun, 11 Oct 2026 10:42:18 +0800 Subject: [PATCH] End the sync log with Skipped when there is no GitHub mirror Task: MIL-001#1 --- CHANGELOG.md | 2 ++ guides/troubleshooting.md | 6 +++--- tests/test_sync_github_metadata.py | 4 +++- tools/sync_github_metadata.py | 1 + wiki/Troubleshooting.da.md | 4 ++-- wiki/Troubleshooting.md | 6 +++--- wiki/Troubleshooting.ms.md | 4 ++-- 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5108ea1..48b09ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ Each release lists its changes in these groups, in this order: ### Changed +- Sync GitHub mirror metadata: a repository without a GitHub push mirror still + succeeds, and the log now ends with the line `Skipped`. - The scoped workflows fetch their scripts at the tag `v1` instead of `main`, so a merge to `main` reaches consumers only when it is released. diff --git a/guides/troubleshooting.md b/guides/troubleshooting.md index a736d58..82fc5e4 100644 --- a/guides/troubleshooting.md +++ b/guides/troubleshooting.md @@ -43,9 +43,9 @@ never starts, or stops before the step) is a **runner** problem. ## Not an error -`No GitHub push mirror configured for ; nothing to sync.` The run -succeeds. Not every Gitea repository has a GitHub mirror, so this is expected -for those. If the repository should have one, add it in the repository +`No GitHub push mirror configured for ; nothing to sync.` followed by +`Skipped`. The run succeeds. Not every Gitea repository has a GitHub mirror, so +this is expected for those. If the repository should have one, add it in the repository settings. `WARNING: Gitea returned an invalid push mirror list; GitHub metadata was not diff --git a/tests/test_sync_github_metadata.py b/tests/test_sync_github_metadata.py index 6a7e213..4daccf8 100644 --- a/tests/test_sync_github_metadata.py +++ b/tests/test_sync_github_metadata.py @@ -245,7 +245,9 @@ class TestMain: assert all(call[0] == "GET" for call in api.calls) assert not any(call[1].startswith("https://api.github.com") for call in api.calls) - assert "No GitHub push mirror configured" in capsys.readouterr().out + output = capsys.readouterr().out + assert "No GitHub push mirror configured" in output + assert output.rstrip().splitlines()[-1] == "Skipped" def test_fails_before_any_change_when_github_credentials_are_missing( self, sync, environment, monkeypatch diff --git a/tools/sync_github_metadata.py b/tools/sync_github_metadata.py index db96168..3a1a856 100644 --- a/tools/sync_github_metadata.py +++ b/tools/sync_github_metadata.py @@ -170,6 +170,7 @@ def main(): "No GitHub push mirror configured for " f"{source_owner}/{source_repo}; nothing to sync." ) + print("Skipped") return 0 github_token = parse_github_token(os.environ.get("PAT_FOR_GITHUB")) diff --git a/wiki/Troubleshooting.da.md b/wiki/Troubleshooting.da.md index 2f47961..b05c6b4 100644 --- a/wiki/Troubleshooting.da.md +++ b/wiki/Troubleshooting.da.md @@ -1,4 +1,4 @@ - + > Dette er en oversættelse af [`Troubleshooting`](Troubleshooting). Den engelske side er autoritativ, og ændringer her bliver overskrevet, næste gang wikien publiceres. @@ -47,7 +47,7 @@ Kategorien fortæller, hvor du skal kigge. En fejl uden for scriptet (jobbet sta ## Ikke en fejl -`No GitHub push mirror configured for ; nothing to sync.` Kørslen lykkes. Ikke alle Gitea-repositories har et GitHub-spejl, så det er forventet for dem. Hvis repositoryet skal have et, så tilføj det i repositoryets indstillinger. +`No GitHub push mirror configured for ; nothing to sync.` efterfulgt af `Skipped`. Kørslen lykkes. Ikke alle Gitea-repositories har et GitHub-spejl, så det er forventet for dem. Hvis repositoryet skal have et, så tilføj det i repositoryets indstillinger. `WARNING: Gitea returned an invalid push mirror list; GitHub metadata was not synced.` Kørslen lykkes, men intet blev synkroniseret. Kontroller, at Gitea-versionen understøtter push mirror-API'et, og kør igen. diff --git a/wiki/Troubleshooting.md b/wiki/Troubleshooting.md index 736fc3e..cebe8e6 100644 --- a/wiki/Troubleshooting.md +++ b/wiki/Troubleshooting.md @@ -49,9 +49,9 @@ never starts, or stops before the step) is a **runner** problem. ## Not an error -`No GitHub push mirror configured for ; nothing to sync.` The run -succeeds. Not every Gitea repository has a GitHub mirror, so this is expected -for those. If the repository should have one, add it in the repository +`No GitHub push mirror configured for ; nothing to sync.` followed by +`Skipped`. The run succeeds. Not every Gitea repository has a GitHub mirror, so +this is expected for those. If the repository should have one, add it in the repository settings. `WARNING: Gitea returned an invalid push mirror list; GitHub metadata was not diff --git a/wiki/Troubleshooting.ms.md b/wiki/Troubleshooting.ms.md index 6153378..b0cad32 100644 --- a/wiki/Troubleshooting.ms.md +++ b/wiki/Troubleshooting.ms.md @@ -1,4 +1,4 @@ - + > Ini ialah terjemahan [`Troubleshooting`](Troubleshooting). Halaman bahasa Inggeris ialah teks yang sah, dan perubahan di sini akan ditimpa pada penerbitan wiki yang seterusnya. @@ -47,7 +47,7 @@ Kategori menunjukkan di mana perlu dilihat. Kegagalan di luar skrip (kerja tidak ## Bukan satu ralat -`No GitHub push mirror configured for ; nothing to sync.` Larian berjaya. Tidak semua repositori Gitea mempunyai cermin GitHub, jadi ini dijangka bagi repositori tersebut. Jika repositori itu sepatutnya mempunyainya, tambahkannya dalam tetapan repositori. +`No GitHub push mirror configured for ; nothing to sync.` diikuti oleh `Skipped`. Larian berjaya. Tidak semua repositori Gitea mempunyai cermin GitHub, jadi ini dijangka bagi repositori tersebut. Jika repositori itu sepatutnya mempunyainya, tambahkannya dalam tetapan repositori. `WARNING: Gitea returned an invalid push mirror list; GitHub metadata was not synced.` Larian berjaya tetapi tiada apa-apa disegerakkan. Semak bahawa versi Gitea menyokong API push mirror dan jalankan semula.