From c8aefbc905506b2885d5f5fe5efcb654f319f4b2 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Sat, 3 Oct 2026 08:12:27 +0200 Subject: [PATCH] =?UTF-8?q?feat(mirrors)=20=E2=80=94=20kadans-admin=20rejo?= =?UTF-8?q?int=20le=20miroir=20GitHub=20:=20tous=20les=20projets=20kadans?= =?UTF-8?q?=20sont=20clonables=20par=20une=20session=20Claude=20cloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - inventory : `kadans-admin` ajouté à `gitea_mirrored_repos` (privé, compte personnel `arcodange`) ; playbook appliqué le 2026-10-03, le miroir a poussé `main` (feed7d4) en 75 s. - avertissement : le miroir pousse en `--mirror`, une branche créée côté GitHub par une session cloud est supprimée au push suivant. - nom du playbook corrigé dans les commentaires (06_mirrors → 07_mirrors). - guidebook 07 · Mirrors : état courant, mise en garde, `mediabunny` écarté. Co-Authored-By: Claude Opus 5.5 --- .../factory/inventory/group_vars/all/gitea.yml | 10 +++++++++- ansible/arcodange/factory/playbooks/07_mirrors.yml | 2 +- .../factory-provisioning/ansible/07-mirrors.md | 11 +++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ansible/arcodange/factory/inventory/group_vars/all/gitea.yml b/ansible/arcodange/factory/inventory/group_vars/all/gitea.yml index 9ad52f2..2e7c0c9 100644 --- a/ansible/arcodange/factory/inventory/group_vars/all/gitea.yml +++ b/ansible/arcodange/factory/inventory/group_vars/all/gitea.yml @@ -10,9 +10,13 @@ gitea_secret_propagation_users: - arcodange -# Dépôts mis en miroir vers GitHub (et GitLab) par playbooks/06_mirrors.yml. +# Dépôts mis en miroir vers GitHub (et GitLab) par playbooks/07_mirrors.yml. # Gitea reste la source ; les forges publiques ne reçoivent qu'une copie poussée. # +# ⚠ Le miroir pousse en `git push --mirror` : toute branche qui n'existe QUE sur +# GitHub — celle qu'une session Claude cloud vient d'y pousser, par exemple — est +# SUPPRIMÉE au push suivant (à chaque commit sur Gitea, et toutes les 8 h). +# # `gitea_sync` ne balaie qu'UN propriétaire à la fois et déduit les manques en # comparant les forges : utile pour l'organisation, inadapté ici, où l'on choisit # dépôt par dépôt ce qui sort du homelab. D'où cette liste, explicite et relue. @@ -39,6 +43,10 @@ gitea_mirrored_repos: owner: arcodange github_owner: arcodange github_owner_is_org: false + - name: kadans-admin + owner: arcodange + github_owner: arcodange + github_owner_is_org: false - name: video_analysis owner: arcodange github_owner: arcodange diff --git a/ansible/arcodange/factory/playbooks/07_mirrors.yml b/ansible/arcodange/factory/playbooks/07_mirrors.yml index cec9c3f..f124087 100644 --- a/ansible/arcodange/factory/playbooks/07_mirrors.yml +++ b/ansible/arcodange/factory/playbooks/07_mirrors.yml @@ -6,7 +6,7 @@ # 8 h ET à chaque commit. Les dépôts créés en face le sont en PRIVÉ. # # uv run ansible-playbook -i ansible/arcodange/factory/inventory \ -# ansible/arcodange/factory/playbooks/06_mirrors.yml +# ansible/arcodange/factory/playbooks/07_mirrors.yml # # GitHub seulement (tant que l'espace GitLab personnel n'est pas renseigné) : # … -e gitea_mirror_gitlab=false diff --git a/vibe/guidebooks/factory-provisioning/ansible/07-mirrors.md b/vibe/guidebooks/factory-provisioning/ansible/07-mirrors.md index 227fa7c..cd5c905 100644 --- a/vibe/guidebooks/factory-provisioning/ansible/07-mirrors.md +++ b/vibe/guidebooks/factory-provisioning/ansible/07-mirrors.md @@ -3,7 +3,7 @@ # 07 · Mirrors — Gitea → GitHub / GitLab > [!NOTE] -> **Status:** ✅ active · **Last Updated:** 2026-07-27 +> **Status:** ✅ active · **Last Updated:** 2026-10-03 > **Upstream:** [Ansible sub-hub](README.md) · [Factory provisioning hub](../README.md) > **Downstream:** [Roles reference](roles.md) — `gitea_repo`, `gitea_sync`, `gitea_token` > **Related:** [Inventory & variables](inventory.md) · [03 · CI/CD](03-cicd.md) @@ -12,6 +12,9 @@ Gitea is the **source of truth**; GitHub and GitLab hold a pushed copy. [`playbo Nothing is pulled back. A mirror only ever pushes Gitea → forge, so a change made on GitHub is overwritten at the next sync. +> [!CAUTION] +> Gitea pushes with `git push --mirror` (`Mirror: true, Force: true` in `services/mirror/mirror_push.go`): every ref that exists **only on GitHub is deleted** at the next sync — on any commit to the Gitea repo, and every 8 h. A branch pushed to GitHub by a **Claude cloud session** (`claude/*`) is therefore short-lived: fetch it back to Gitea, or pull the result locally, before the next commit lands on Gitea. + ```sh uv run ansible-playbook -i ansible/arcodange/factory/inventory \ ansible/arcodange/factory/playbooks/07_mirrors.yml @@ -55,14 +58,14 @@ A Gitea repo owned by the **user** `arcodange` does not belong on the GitHub **o --- -## Current state (2026-07-27) +## Current state (2026-10-03) | Owner | Repos mirrored | Target | | --- | --- | --- | | `arcodange-org` | 10 (`factory`, `tools`, `erp`, `cms`, `webapp`, `url-shortener`, `docker.tofu`, `docker-build-workflow`, `super-linter-workflow`, `vault-action`) | `github.com/arcodange-org/*` + GitLab | -| `arcodange` (user) | 5 (`kadans`, `kadans-api`, `kadans-dossier`, `kadans-jobs`, `video_analysis`) — all **private** | `github.com/arcodange/*` | +| `arcodange` (user) | 6 (`kadans`, `kadans-api`, `kadans-admin`, `kadans-dossier`, `kadans-jobs`, `video_analysis`) — all **private** | `github.com/arcodange/*` | -Not mirrored, deliberately left out of `gitea_mirrored_repos`: `documents`, `studio`, `prospection`, `kissmetrics_contract_proposal` (org) and `.profile`, `DanceVideos`, `SecondBrain`, `dance-lessons-coach`, `frame-sdk`, `telegram-gateway` (user). +Not mirrored, deliberately left out of `gitea_mirrored_repos`: `documents`, `studio`, `prospection`, `kissmetrics_contract_proposal` (org) and `.profile`, `DanceVideos`, `SecondBrain`, `dance-lessons-coach`, `frame-sdk`, `telegram-gateway`, `mediabunny` (user). `mediabunny` stays home because `kadans` resolves it from the npm registry (`mediabunny@^1.56.1`), not from the fork — a cloud session cloning `kadans` does not need it. > [!NOTE] > The personal repos have **no GitLab mirror yet**: `gitlab_personal_namespace_id` is still `~`. Fill it with the numeric namespace ID of the `arcodange` account on gitlab.com, otherwise creation would land the project in the `arcodange-org` group.