docs: forbid bare git push; use git-push.sh helpers.
[skip ci]
This commit is contained in:
@@ -27,10 +27,13 @@ alwaysApply: true
|
|||||||
| `editor` / not a terminal | Не `git commit` без `-F` в WSL; из Windows: `git commit -F file` |
|
| `editor` / not a terminal | Не `git commit` без `-F` в WSL; из Windows: `git commit -F file` |
|
||||||
| Сотни `M` после reset на `/mnt/c` | `git config core.filemode false` (локально); не «чинить» код |
|
| Сотни `M` после reset на `/mnt/c` | `git config core.filemode false` (локально); не «чинить» код |
|
||||||
| Удалились `.cursor/`, `.idea/` | **`git clean -fdx` только с backup** env + certs; IDE-директории **не трогать** |
|
| Удалились `.cursor/`, `.idea/` | **`git clean -fdx` только с backup** env + certs; IDE-директории **не трогать** |
|
||||||
|
| Push «висит» / ждёт login | **Не** `git push origin` — только `~/.cursor/eventhub/git-push.sh` / `git-push-main.sh` |
|
||||||
| Push заблокирован Auto-review | Push в `master` — только по явной просьбе; `request_smart_mode_approval` |
|
| Push заблокирован Auto-review | Push в `master` — только по явной просьбе; `request_smart_mode_approval` |
|
||||||
|
|
||||||
**`git clean` / reset к origin:** сначала сохранить `docker/.env*`, `.env.development`, `docker/traefik/certs/*`.
|
**`git clean` / reset к origin:** сначала сохранить `docker/.env*`, `.env.development`, `docker/traefik/certs/*`.
|
||||||
|
|
||||||
|
**Push:** запрещены голые `git push` / `git push origin …`. Канон — `bash ~/.cursor/eventhub/git-push.sh <repo-dir>` (токен из secrets).
|
||||||
|
|
||||||
## 3. Docker dev (Swarm локально)
|
## 3. Docker dev (Swarm локально)
|
||||||
|
|
||||||
| Ошибка | Правильно |
|
| Ошибка | Правильно |
|
||||||
|
|||||||
@@ -47,13 +47,25 @@ npm / npx / node из Windows # сломан
|
|||||||
| Front lint/build/e2e | `wsl -e bash` + `cd …/EventHubFront && npm …` |
|
| Front lint/build/e2e | `wsl -e bash` + `cd …/EventHubFront && npm …` |
|
||||||
| Front перед push main | сначала `npm run test:e2e:ift` в WSL, потом `~/.cursor/eventhub/git-push-main.sh` |
|
| Front перед push main | сначала `npm run test:e2e:ift` в WSL, потом `~/.cursor/eventhub/git-push-main.sh` |
|
||||||
| Back rebar/eunit | `source scripts/wsl-dev-env.sh` в WSL |
|
| Back rebar/eunit | `source scripts/wsl-dev-env.sh` в WSL |
|
||||||
| Git commit/push | `~/.cursor/eventhub/git-commit.sh` / `git-push.sh` / `git-push-main.sh` |
|
| Git commit/push | **только** `~/.cursor/eventhub/git-commit.sh` / `git-push.sh` / `git-push-main.sh` |
|
||||||
| JSON/API/python | скрипт `.sh` или `.py` на диске, запуск из WSL |
|
| JSON/API/python | скрипт `.sh` или `.py` на диске, запуск из WSL |
|
||||||
|
|
||||||
|
## Git push (обязательно)
|
||||||
|
|
||||||
|
**Запрещено агентам:** `git push`, `git push origin`, `git push origin HEAD` / `master` напрямую — без токена зависают на HTTPS prompt.
|
||||||
|
|
||||||
|
**Канон:**
|
||||||
|
```text
|
||||||
|
bash ~/.cursor/eventhub/git-push.sh /mnt/c/Users/alexc/IdeaProjects/eventHub/EventHubBack
|
||||||
|
bash ~/.cursor/eventhub/git-push-main.sh /mnt/c/Users/alexc/IdeaProjects/eventHub/EventHubFront
|
||||||
|
```
|
||||||
|
|
||||||
|
Credential store в WSL уже настроен (`credential.helper=store` + `git.sabilin.com`); хелпер всё равно предпочтителен (явный URL с токеном из secrets).
|
||||||
|
|
||||||
## Перед push Front
|
## Перед push Front
|
||||||
1. WSL: `npm run lint && npm run build` (ловит синтаксис/TS)
|
1. WSL: `npm run lint && npm run build` (ловит синтаксис/TS)
|
||||||
2. WSL: `npm run test:e2e:ift`
|
2. WSL: `npm run test:e2e:ift`
|
||||||
3. Только потом push. **Не пушить**, если lint/build/IFT красные.
|
3. Только потом push через `git-push-main.sh`. **Не пушить**, если lint/build/IFT красные.
|
||||||
|
|
||||||
## Частые сбои (подробнее)
|
## Частые сбои (подробнее)
|
||||||
См. **`agent-pitfalls.mdc`**: git `-F` вместо heredoc, `&&` в PS, docker dev scale, `git clean` vs `.cursor/`.
|
См. **`agent-pitfalls.mdc`**: git `-F` вместо heredoc, `&&` в PS, docker dev scale, `git clean` vs `.cursor/`.
|
||||||
|
|||||||
Reference in New Issue
Block a user