feat(pipeline): уведомления CI/CD — PipelineWatcher, CI загрузок на Gitea Actions
CI / ruff · mypy · pytest (pull_request) Failing after 3m40s
CI / ruff · mypy · pytest (pull_request) Failing after 3m40s
- app/pipeline: протокол CIProvider, клиент Gitea Actions (прогон по head_sha, упавший шаг, лог джоба, ретраи), PipelineWatcher — опрос только при незавершённых push, сообщение о push обновляется CI ⏳ → ✅/❌ → CD 🚀/⛔, автору — отдельные уведомления - деплой сервисов — только после зелёного CI; старый push не откатывает сервис, который развернёт более новый; после рестарта бот продолжает с того же места - CI_PROVIDER=none — прежнее поведение (деплой сразу после push) - шаблон tgit-uploads: .gitea/workflows/check.yml; .gitea/ защищён от правок из бота - миграция 0002: старые push помечены skipped, чтобы не слать им «таймаут CI» - ADR-016, ARCHITECTURE §2.5/§5.2, README, DEPLOY, .env.example Refs #11 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+1
-11
@@ -1,4 +1,4 @@
|
||||
"""After a push: the services it touched are (re)deployed through tgit-runner, the pusher hears how it went.
|
||||
"""After a push passes CI: the services it touched are (re)deployed through tgit-runner (PipelineWatcher, #11).
|
||||
|
||||
A service = `services/<name>/`. Gone from the commit — removed on the host. A refused deploy keeps the old version
|
||||
running (the runner switches only to a healthy one) and raises ⛔ for the whole team.
|
||||
@@ -43,16 +43,6 @@ class Deployer:
|
||||
self._runner = runner
|
||||
self._alerts = alerts
|
||||
self._lock = asyncio.Lock() # one deploy at a time: builds are heavy for the shared host
|
||||
self._tasks: set[asyncio.Task[None]] = set()
|
||||
|
||||
def schedule(self, sha: str, paths: Iterable[str], report: Report) -> list[str]:
|
||||
"""Start in the background; returns the services that will be deployed."""
|
||||
services = changed_services(paths)
|
||||
if services:
|
||||
task = asyncio.create_task(self.deploy(sha, services, report))
|
||||
self._tasks.add(task)
|
||||
task.add_done_callback(self._tasks.discard)
|
||||
return services
|
||||
|
||||
async def deploy(self, sha: str, services: list[str], report: Report) -> None:
|
||||
async with self._lock:
|
||||
|
||||
Reference in New Issue
Block a user