Skills von blackbook: software-development/gitea-repo-management

This commit is contained in:
2026-12-02 05:07:27 +01:00
parent f055d8afe8
commit aa14233e17
2 changed files with 8 additions and 0 deletions
@@ -15,6 +15,7 @@ description: Use for gitea.mindboost.team repos, PRs and n8n layout.
- Push with the working user embedded in the URL (`https://USER:PW@host/...`), mask the password in output with sed, and keep the stored remote URL clean. Put restructuring work on a `feature/...` branch and open a PR via `POST /api/v1/repos/<owner>/<repo>/pulls` (Basic auth with the same account) instead of pushing to main. - Push with the working user embedded in the URL (`https://USER:PW@host/...`), mask the password in output with sed, and keep the stored remote URL clean. Put restructuring work on a `feature/...` branch and open a PR via `POST /api/v1/repos/<owner>/<repo>/pulls` (Basic auth with the same account) instead of pushing to main.
- Check CI with `GET .../actions/runs?limit=N` (fields: `path`, `event`, `conclusion`) and `.../actions/runs/<id>/jobs`; secrets list is `.../actions/secrets`. The first push to main of a repo with an auto-deploy action runs it: without `N8N_*` secrets it fails harmlessly, but once secrets exist it deploys, so warn the user while another repo still deploys the same workflow ids. - Check CI with `GET .../actions/runs?limit=N` (fields: `path`, `event`, `conclusion`) and `.../actions/runs/<id>/jobs`; secrets list is `.../actions/secrets`. The first push to main of a repo with an auto-deploy action runs it: without `N8N_*` secrets it fails harmlessly, but once secrets exist it deploys, so warn the user while another repo still deploys the same workflow ids.
- `empty: true` in the repo API can be stale right after the first push; compare `git rev-parse HEAD` with the fetched remote head instead. - `empty: true` in the repo API can be stale right after the first push; compare `git rev-parse HEAD` with the fetched remote head instead.
- **Protected `main`:** A direct push is rejected (`pre-receive hook declined ... protected branch`), even when the user says "hotfix without PR". Do not touch branch protection. Take the lightest sanctioned route: push a `hotfix/...` branch (one commit), open the PR via API, poll `.../commits/<branch>/status` until the required checks are `success` (an earlier merge call returns 405 `Not all required status checks successful`), then `POST .../pulls/<n>/merge` with `{"Do":"merge","delete_branch_after_merge":true}`. Before pushing to a repo that auto-deploys, diff its workflow file against the live workflow so the deploy changes nothing but the intended value.
## Splitting part of a repo into a new repo (keeping history) ## Splitting part of a repo into a new repo (keeping history)
Recipe and checks: `references/repo-split.md`. Short form: dependency analysis first, ask scope questions, `git filter-repo` on a throwaway single-branch clone, fix cross-repo paths, run the tests, only then create and push. Recipe and checks: `references/repo-split.md`. Short form: dependency analysis first, ask scope questions, `git filter-repo` on a throwaway single-branch clone, fix cross-repo paths, run the tests, only then create and push.
@@ -46,3 +46,10 @@
- Neue Felder muessen durch **jeden** Knoten, der Objekte mit fester Feldliste neu baut (Review-Modell, Snapshot, Seite). Der Pfad-Test, der Snapshot-Inhalte prueft, findet vergessene Stellen; nicht nur den ersten Knoten anpassen. - Neue Felder muessen durch **jeden** Knoten, der Objekte mit fester Feldliste neu baut (Review-Modell, Snapshot, Seite). Der Pfad-Test, der Snapshot-Inhalte prueft, findet vergessene Stellen; nicht nur den ersten Knoten anpassen.
- Bestehende Pfad-Tests fixieren Aufrufreihenfolge und Verbindungen: erwartete Kette, Aufrufliste und Indizes (`calls[n]`) bewusst nachziehen und dem neuen Aufruf eine Attrappe geben, die die Schutzregel selbst prueft (z. B. `dry_run === true`). Erwartungen nicht lockern, nur erweitern. - Bestehende Pfad-Tests fixieren Aufrufreihenfolge und Verbindungen: erwartete Kette, Aufrufliste und Indizes (`calls[n]`) bewusst nachziehen und dem neuen Aufruf eine Attrappe geben, die die Schutzregel selbst prueft (z. B. `dry_run === true`). Erwartungen nicht lockern, nur erweitern.
- Den Bestand live erst einspielen, wenn geklaert ist, welches Repo dieselben IDs deployt; sonst wird die Aenderung beim naechsten Deploy dort ueberschrieben. - Den Bestand live erst einspielen, wenn geklaert ist, welches Repo dieselben IDs deployt; sonst wird die Aenderung beim naechsten Deploy dort ueberschrieben.
## Repo-Stand per MCP live einspielen (nach Okay)
1. **Live gegen Repo vergleichen, bevor etwas geschrieben wird:** Knoten fuer Knoten `parameters` vergleichen (ohne Sticky-Notes). Abweichungen nur durch n8n-Standardwerte (`httpMethod: GET`, `options: {}`, `outputPropertyName`) sind harmlos; Code-Knoten mit `difflib` pruefen, ob der Repo-Code gegenueber Live **nur Einfuegungen** hat. Steht Entwurf != aktive Version, `get_workflow_versions_diff(fromVersionId=aktiv, toVersionId=Entwurf)` lesen: sind es nur Standardwerte/Groessen, kann man veroeffentlichen, sonst stecken fremde Aenderungen im Entwurf.
2. **Reihenfolge:** zuerst Verbraucher, die ein fehlendes Feld tolerieren (Pruefseite zeigt "nicht geprueft"), dann den Erzeuger; aufgerufene Teilworkflows **vor** dem Aufrufer veroeffentlichen, damit der Aufruf auf eine aktive Version trifft.
3. **Ein atomarer `update_workflow`-Aufruf:** `addNode` (Felder `name,type,typeVersion,parameters,position`), `removeConnection`/`addConnection` (`source,target,sourceIndex`; IF-false = Index 1), `setNodeSettings` (`settings: {onError, alwaysOutputData}`), `updateNodeParameters` fuer geaenderte Code-Knoten (vorhandene Parameter kopieren, nur `jsCode` tauschen). Positionen: freier Platz unterhalb der bisherigen Knoten (max-y + 400), nicht das neue Layout aus dem PR uebernehmen.
4. **Belegen, dann veroeffentlichen:** Entwurf per `get_workflow_details` gegen den Repo-Export vergleichen (Parameter und normalisierte Verbindungen gleich, `onError`/`alwaysOutputData` gesetzt), erst dann `publish_workflow` mit der `versionId`; danach pruefen, dass aktive Version == Entwurf.
5. Nach einem Deploy in einem anderen Repo den Live-Stand nochmals lesen: Der Auto-Deploy darf die Korrektur nicht zurueckgesetzt haben.