Compare commits
5
Commits
bb334b10f5
...
v1.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e558570967 | ||
|
|
b6b081b04f | ||
|
|
13b4c20148 | ||
|
|
700d415422 | ||
|
|
6ca34b9008 |
No files matched your search
+25
-37
@@ -1,65 +1,53 @@
|
||||
# Gitea Actions
|
||||
|
||||
Workflow-файлы в [workflows/](workflows/):
|
||||
Workflow: [workflows/ci.yaml](workflows/ci.yaml).
|
||||
|
||||
| Workflow | Триггер | Назначение |
|
||||
|----------|---------|------------|
|
||||
| [ci.yaml](workflows/ci.yaml) | push/PR в `main`/`master` | openapi, web, go, bird2, commitlint (PR) |
|
||||
| [release.yaml](workflows/release.yaml) | после успешного CI (push в main) | semantic-release → tag, CHANGELOG, Gitea Release |
|
||||
| [publish.yaml](workflows/publish.yaml) | push тега `v*` | docker buildx bake → Container Registry |
|
||||
| Job | PR | push в main |
|
||||
|-----|-----|-------------|
|
||||
| changes, openapi, web, go, bird2 | quality gates | quality gates |
|
||||
| commitlint | да | — |
|
||||
| **release** | — | semantic-release + docker push (один run) |
|
||||
|
||||
Подробнее о версионировании: [docs/releasing.md](../docs/releasing.md).
|
||||
Подробнее: [docs/releasing.md](../docs/releasing.md).
|
||||
|
||||
## CI (quality gates)
|
||||
|
||||
Job **changes** вычисляет флаги по путям в diff (`openapi`, `go`, `web`, `bird_conf`, …). Изменение `.gitea/workflows/*` поднимает полный прогон.
|
||||
Job **changes** вычисляет флаги по путям в diff. Изменение `.gitea/workflows/*` поднимает полный прогон.
|
||||
|
||||
На **pull request** дополнительно запускается **commitlint** (Conventional Commits).
|
||||
На **pull request** — **commitlint** (Conventional Commits).
|
||||
|
||||
Требования к runner:
|
||||
Runner: `ubuntu-latest`, **bird2** из apt, Docker для job **release**.
|
||||
|
||||
- Метка `ubuntu-latest`.
|
||||
- Job `bird2` ставит **bird2** из репозитория Ubuntu и вызывает `bird -c … -p`.
|
||||
- Job **publish** требует Docker и доступ к Container Registry.
|
||||
## Release (job в ci.yaml)
|
||||
|
||||
## Release (semantic-release)
|
||||
После успешных quality gates на **push в main** job **release**:
|
||||
|
||||
После успешного CI на push в `main`/`master` workflow **Release** запускает `npx semantic-release` (корневой `package.json`, [.releaserc.json](../.releaserc.json)).
|
||||
1. `npx semantic-release` — тег `vX.Y.Z` на **текущий commit** (без дополнительного commit в main).
|
||||
2. Gitea Release + `CHANGELOG.md` как attachment (не в git).
|
||||
3. `docker buildx bake default --push` с `VERSION=X.Y.Z` — в том же job.
|
||||
|
||||
Результат при releasable-коммитах:
|
||||
|
||||
- git tag `vX.Y.Z`;
|
||||
- commit `CHANGELOG.md` с `[skip ci]`;
|
||||
- Gitea Release с release notes.
|
||||
Если releasable-коммитов нет — semantic-release no-op, образы не публикуются.
|
||||
|
||||
### Секреты
|
||||
|
||||
Один PAT — **`ACTIONS_PAT`**: push/t/tags, releases, запись в Container Registry. Если не задан — fallback на **`gitea.token`** (нужны права на releases и packages в Gitea).
|
||||
|
||||
`GITEA_URL`: `https://git.shts.su` (задано в workflow).
|
||||
|
||||
## Publish (образы)
|
||||
|
||||
Запускается только при **push git-тега** `vX.Y.Z` (не при каждом push в main).
|
||||
|
||||
Собираются все образы из `deploy/docker/*` (`docker buildx bake default --push`). Semver из тега передаётся в Go-бинарники (`VERSION`, `GIT_SHA`, `BUILD_TIME`).
|
||||
|
||||
Registry: **`git.shts.su`**. Login: `${{ gitea.actor }}` / `${{ secrets.ACTIONS_PAT || gitea.token }}` (тот же **`ACTIONS_PAT`**, что и для release).
|
||||
**`ACTIONS_PAT`**: push tags, releases, Container Registry. Fallback: **`gitea.token`**.
|
||||
|
||||
### Теги образов
|
||||
|
||||
```text
|
||||
git.shts.su/<owner_lowercase>/<имя>:<тег>
|
||||
git.shts.su/<owner>/<имя>:latest
|
||||
git.shts.su/<owner>/<имя>:v1.2.3
|
||||
git.shts.su/<owner>/<имя>:1.2.3
|
||||
git.shts.su/<owner>/<имя>:<short-sha>
|
||||
git.shts.su/<owner>/<имя>:sha-<full-sha>
|
||||
```
|
||||
|
||||
Имена: `evobgp-api`, `evobgp-all`, `evobgp-scheduler`, `evobgp-ingest`, `evobgp-render`, `evobgp-deploy`, `evobgp-node`, `evobgp-web`, `evobgp-web-all`, `evobgp-agent`, `evobgp-bird2`.
|
||||
|
||||
Теги при релизе `v1.2.3`: `latest`, `v1.2.3`, короткий SHA, `sha-<full_commit>`.
|
||||
Имена образов: `evobgp-api`, `evobgp-all`, `evobgp-scheduler`, `evobgp-ingest`, `evobgp-render`, `evobgp-deploy`, `evobgp-node`, `evobgp-web`, `evobgp-web-all`, `evobgp-agent`, `evobgp-bird2`.
|
||||
|
||||
Пример:
|
||||
|
||||
```bash
|
||||
docker pull git.shts.su/myuser/evobgp-api:v1.2.3
|
||||
docker pull git.shts.su/myuser/evobgp-api:1.2.3
|
||||
```
|
||||
|
||||
Подробности — [docs/quickstart.md](../docs/quickstart.md), [deploy/docker/README.md](../deploy/docker/README.md).
|
||||
См. [deploy/docker/README.md](../deploy/docker/README.md), [docs/quickstart.md](../docs/quickstart.md).
|
||||
@@ -225,3 +225,88 @@ jobs:
|
||||
set -euxo pipefail
|
||||
npm ci
|
||||
npx commitlint --from "${{ github.event.pull_request.base.sha }}" --to "${{ github.event.pull_request.head.sha }}"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Один push в main: semantic-release (тег на текущий commit, без доп. commit) + docker push.
|
||||
# ---------------------------------------------------------------------------
|
||||
release:
|
||||
needs: [changes, openapi, web, go, bird2]
|
||||
if: >-
|
||||
always() &&
|
||||
github.event_name == 'push' &&
|
||||
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') &&
|
||||
needs.changes.result == 'success' &&
|
||||
(needs.openapi.result == 'success' || needs.openapi.result == 'skipped') &&
|
||||
(needs.web.result == 'success' || needs.web.result == 'skipped') &&
|
||||
(needs.go.result == 'success' || needs.go.result == 'skipped') &&
|
||||
(needs.bird2.result == 'success' || needs.bird2.result == 'skipped')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.ACTIONS_PAT || gitea.token }}
|
||||
persist-credentials: true
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: npm
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: Install release tooling
|
||||
run: npm ci
|
||||
- name: Semantic release
|
||||
run: npx semantic-release
|
||||
env:
|
||||
GITEA_URL: https://git.shts.su
|
||||
GITEA_TOKEN: ${{ secrets.ACTIONS_PAT || gitea.token }}
|
||||
- name: Detect new release
|
||||
id: rel
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -f .release-version ]; then
|
||||
echo "version=$(tr -d '[:space:]' < .release-version)" >> "$GITHUB_OUTPUT"
|
||||
echo "released=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "released=false" >> "$GITHUB_OUTPUT"
|
||||
echo "No releasable commits — skipping image publish"
|
||||
fi
|
||||
- name: Set up Docker Buildx
|
||||
if: steps.rel.outputs.released == 'true'
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Prepare image metadata
|
||||
if: steps.rel.outputs.released == 'true'
|
||||
id: meta
|
||||
run: |
|
||||
set -euo pipefail
|
||||
echo "version=${{ steps.rel.outputs.version }}" >> "$GITHUB_OUTPUT"
|
||||
owner_lc="$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')"
|
||||
echo "owner_lc=$owner_lc" >> "$GITHUB_OUTPUT"
|
||||
short_sha="$(echo '${{ github.sha }}' | cut -c1-7)"
|
||||
echo "short_sha=$short_sha" >> "$GITHUB_OUTPUT"
|
||||
echo "build_time=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT"
|
||||
- name: Log in to Gitea Registry
|
||||
if: steps.rel.outputs.released == 'true'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.shts.su
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.ACTIONS_PAT || gitea.token }}
|
||||
- name: Build and push images (bake)
|
||||
if: steps.rel.outputs.released == 'true'
|
||||
env:
|
||||
REGISTRY: git.shts.su/${{ steps.meta.outputs.owner_lc }}
|
||||
IMAGE_TAG: latest
|
||||
VERSION: ${{ steps.meta.outputs.version }}
|
||||
SHORT_SHA: ${{ steps.meta.outputs.short_sha }}
|
||||
SHA_FULL: ${{ github.sha }}
|
||||
BUILD_TIME: ${{ steps.meta.outputs.build_time }}
|
||||
CACHE_REF_GO: git.shts.su/${{ steps.meta.outputs.owner_lc }}/evobgp-buildcache:go-buildcache
|
||||
CACHE_REF_WEB: git.shts.su/${{ steps.meta.outputs.owner_lc }}/evobgp-buildcache:web-buildcache
|
||||
BUILDX_BAKE_ENTITLEMENTS_FS: "0"
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
cd "${{ github.workspace }}/deploy/docker"
|
||||
sh write-bake-override.sh
|
||||
docker buildx bake --allow=fs.read="${{ github.workspace }}" \
|
||||
-f docker-bake.hcl -f docker-bake.override.hcl default --push
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
jobs:
|
||||
publish-images:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Prepare image metadata
|
||||
id: meta
|
||||
run: |
|
||||
set -euo pipefail
|
||||
ref="${GITHUB_REF_NAME:-}"
|
||||
version="${ref#v}"
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
owner_lc="$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')"
|
||||
echo "owner_lc=$owner_lc" >> "$GITHUB_OUTPUT"
|
||||
short_sha="$(echo '${{ github.sha }}' | cut -c1-7)"
|
||||
echo "short_sha=$short_sha" >> "$GITHUB_OUTPUT"
|
||||
echo "build_time=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT"
|
||||
- name: Log in to Gitea Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.shts.su
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.ACTIONS_PAT || gitea.token }}
|
||||
- name: Build and push images (bake)
|
||||
env:
|
||||
REGISTRY: git.shts.su/${{ steps.meta.outputs.owner_lc }}
|
||||
IMAGE_TAG: latest
|
||||
VERSION: ${{ steps.meta.outputs.version }}
|
||||
SHORT_SHA: ${{ steps.meta.outputs.short_sha }}
|
||||
SHA_FULL: ${{ github.sha }}
|
||||
BUILD_TIME: ${{ steps.meta.outputs.build_time }}
|
||||
CACHE_REF_GO: git.shts.su/${{ steps.meta.outputs.owner_lc }}/evobgp-buildcache:go-buildcache
|
||||
CACHE_REF_WEB: git.shts.su/${{ steps.meta.outputs.owner_lc }}/evobgp-buildcache:web-buildcache
|
||||
BUILDX_BAKE_ENTITLEMENTS_FS: "0"
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
cd "${{ github.workspace }}/deploy/docker"
|
||||
sh write-bake-override.sh
|
||||
docker buildx bake --allow=fs.read="${{ github.workspace }}" \
|
||||
-f docker-bake.hcl -f docker-bake.override.hcl default --push
|
||||
@@ -1,33 +0,0 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [CI]
|
||||
types: [completed]
|
||||
branches: [main, master]
|
||||
|
||||
jobs:
|
||||
release:
|
||||
if: >-
|
||||
github.event.workflow_run.conclusion == 'success' &&
|
||||
github.event.workflow_run.event == 'push'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.workflow_run.head_sha }}
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.ACTIONS_PAT || gitea.token }}
|
||||
persist-credentials: true
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: npm
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: Install release tooling
|
||||
run: npm ci
|
||||
- name: Semantic release
|
||||
run: npx semantic-release
|
||||
env:
|
||||
GITEA_URL: https://git.shts.su
|
||||
GITEA_TOKEN: ${{ secrets.ACTIONS_PAT || gitea.token }}
|
||||
@@ -4,6 +4,10 @@ node_modules/
|
||||
# Generated by deploy/docker/write-bake-override.sh (CI/local bake)
|
||||
deploy/docker/docker-bake.override.hcl
|
||||
|
||||
# CI-only markers (not committed)
|
||||
.release-version
|
||||
CHANGELOG.md
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
+2
-3
@@ -27,10 +27,9 @@
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/git",
|
||||
"@semantic-release/exec",
|
||||
{
|
||||
"assets": ["CHANGELOG.md"],
|
||||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
||||
"successCmd": "echo ${nextRelease.version} > .release-version"
|
||||
}
|
||||
],
|
||||
[
|
||||
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
## 1.0.0 (2026-05-19)
|
||||
|
||||
* feat: add @tanstack/table-core dependency and integrate module name mapping in operations page. Upda ([b140dcb](http://192.168.100.56:3000/denozord/EvoBGP/commit/b140dcb))
|
||||
* feat: add @types/node and undici-types to devDependencies in package.json and package-lock.json for ([d92a06c](http://192.168.100.56:3000/denozord/EvoBGP/commit/d92a06c))
|
||||
* feat: add aggregated router-lists catalog endpoint and update module listing filters ([c811c43](http://192.168.100.56:3000/denozord/EvoBGP/commit/c811c43))
|
||||
* feat: add auto-updater service for Docker stack with configurable settings ([ae9fbe3](http://192.168.100.56:3000/denozord/EvoBGP/commit/ae9fbe3))
|
||||
* feat: add bird configuration preview functionality with tabbed interface for fragments and prefixes. ([1969a00](http://192.168.100.56:3000/denozord/EvoBGP/commit/1969a00))
|
||||
* feat: add BIRD status endpoint and integrate birdc checks into job processing. Enhance UI to display ([94a4c6a](http://192.168.100.56:3000/denozord/EvoBGP/commit/94a4c6a))
|
||||
* feat: add CSV import and export functionality for module entries. Implement endpoints for exporting ([bae2d68](http://192.168.100.56:3000/denozord/EvoBGP/commit/bae2d68))
|
||||
* feat: add debug logging and optimize database queries in Postgres repository ([6d0e214](http://192.168.100.56:3000/denozord/EvoBGP/commit/6d0e214))
|
||||
* feat: add diagnostic log endpoint for revisions and implement download functionality ([2260ecf](http://192.168.100.56:3000/denozord/EvoBGP/commit/2260ecf))
|
||||
* feat: add enabled state to BGP peer types and UI. Implement peer enabling toggle in the network page ([80965ad](http://192.168.100.56:3000/denozord/EvoBGP/commit/80965ad))
|
||||
* feat: add last refreshed timestamp to modules and CDN sources ([1e13ef9](http://192.168.100.56:3000/denozord/EvoBGP/commit/1e13ef9))
|
||||
* feat: add live BGP protocol state tracking to peer listing ([8a50ba4](http://192.168.100.56:3000/denozord/EvoBGP/commit/8a50ba4))
|
||||
* feat: add optional name field to BGP peer creation and update UI ([1a61ae2](http://192.168.100.56:3000/denozord/EvoBGP/commit/1a61ae2))
|
||||
* feat: add optional name field to DoH profile schema and types ([6bee5ad](http://192.168.100.56:3000/denozord/EvoBGP/commit/6bee5ad))
|
||||
* feat: add smart aggregation for IPv4 CIDR prefixes in refresh pipeline. Implement functionality to a ([0428b83](http://192.168.100.56:3000/denozord/EvoBGP/commit/0428b83))
|
||||
* feat: add strict bind configuration to BGP templates. Enhance BGP template rendering by including 's ([07f2ce5](http://192.168.100.56:3000/denozord/EvoBGP/commit/07f2ce5))
|
||||
* feat: add tenant refresh functionality to HTTP API and job processing ([7a2b015](http://192.168.100.56:3000/denozord/EvoBGP/commit/7a2b015))
|
||||
* feat: auto-refresh non-IP module updates and add full project manual ([1e77e1a](http://192.168.100.56:3000/denozord/EvoBGP/commit/1e77e1a))
|
||||
* feat: enhance API client with pagination and new data fetching functions. Implement `apiPageAll` for ([9f0b128](http://192.168.100.56:3000/denozord/EvoBGP/commit/9f0b128))
|
||||
* feat: enhance BGP template and peer configuration handling. Introduce policies_json parameter for lo ([be8e7b5](http://192.168.100.56:3000/denozord/EvoBGP/commit/be8e7b5))
|
||||
* feat: enhance CDN source management with last refreshed timestamp ([4776434](http://192.168.100.56:3000/denozord/EvoBGP/commit/4776434))
|
||||
* feat: enhance community attribute handling in BIRD format. Add validation for community route bodies ([b541794](http://192.168.100.56:3000/denozord/EvoBGP/commit/b541794))
|
||||
* feat: enhance community label handling and improve UI localization across operations pages. Introduc ([53fd527](http://192.168.100.56:3000/denozord/EvoBGP/commit/53fd527))
|
||||
* feat: enhance deployment configuration for secure Web UI with Traefik integration ([4acd685](http://192.168.100.56:3000/denozord/EvoBGP/commit/4acd685))
|
||||
* feat: enhance DoH profile management and resolver policy in modules ([34ecc5c](http://192.168.100.56:3000/denozord/EvoBGP/commit/34ecc5c))
|
||||
* feat: enhance EvoBGP with new command-line options for the evobgp-agent, including a watch command f ([6a55f72](http://192.168.100.56:3000/denozord/EvoBGP/commit/6a55f72))
|
||||
* feat: enhance evobgp with new command-line tools for bundle management, including pull, verify, and ([bf52b21](http://192.168.100.56:3000/denozord/EvoBGP/commit/bf52b21))
|
||||
* feat: enhance job detail handling in UI with caching and loading states. Introduce SvelteMap for job ([05bc5c4](http://192.168.100.56:3000/denozord/EvoBGP/commit/05bc5c4))
|
||||
* feat: enhance job detail UI with improved overflow handling and layout adjustments. Update card comp ([67ce135](http://192.168.100.56:3000/denozord/EvoBGP/commit/67ce135))
|
||||
* feat: enhance job filtering and display functionality in operations page. Introduce job search and f ([e1c4cbc](http://192.168.100.56:3000/denozord/EvoBGP/commit/e1c4cbc))
|
||||
* feat: enhance job processing with detailed logging and UI improvements. Introduce revision log entri ([c48cc4e](http://192.168.100.56:3000/denozord/EvoBGP/commit/c48cc4e))
|
||||
* feat: enhance monitoring page with detailed status tracking and error handling ([458a885](http://192.168.100.56:3000/denozord/EvoBGP/commit/458a885))
|
||||
* feat: enhance observability with prefix aggregation metrics ([07b97bd](http://192.168.100.56:3000/denozord/EvoBGP/commit/07b97bd))
|
||||
* feat: enhance peer neighbor handling by introducing NormalizePeerNeighborString function. Update Cre ([80f3a8d](http://192.168.100.56:3000/denozord/EvoBGP/commit/80f3a8d))
|
||||
* feat: enhance RefreshModule to aggregate prefixes from all enabled tenant modules. Update documentat ([431c6a9](http://192.168.100.56:3000/denozord/EvoBGP/commit/431c6a9))
|
||||
* feat: enhance RefreshModule to support legacy ASN resolution and improve prefix handling. Introduce ([e1aaa18](http://192.168.100.56:3000/denozord/EvoBGP/commit/e1aaa18))
|
||||
* feat: enhance settings page layout and section management ([d91667f](http://192.168.100.56:3000/denozord/EvoBGP/commit/d91667f))
|
||||
* feat: enhance UI components with improved styling and layout adjustments. Update button sizes, text ([6a72842](http://192.168.100.56:3000/denozord/EvoBGP/commit/6a72842))
|
||||
* feat: enhance worker functionality by adding job queuing for deploy_apply. Introduce a Registry fiel ([42d956d](http://192.168.100.56:3000/denozord/EvoBGP/commit/42d956d))
|
||||
* feat: implement AS holder name resolution and enhance ASEntry structure. Add ASHolderName function t ([c958d5a](http://192.168.100.56:3000/denozord/EvoBGP/commit/c958d5a))
|
||||
* feat: implement bulk selection and deletion for modules and entries. Add functionality for selecting ([e816d17](http://192.168.100.56:3000/denozord/EvoBGP/commit/e816d17))
|
||||
* feat: implement CDN source preview functionality and enhance data handling. Add a new endpoint for p ([e20c9f3](http://192.168.100.56:3000/denozord/EvoBGP/commit/e20c9f3))
|
||||
* feat: implement countAll function for API data retrieval ([40c8a8d](http://192.168.100.56:3000/denozord/EvoBGP/commit/40c8a8d))
|
||||
* feat: implement domain resolution via DoH in refresh pipeline. Enhance the collectModulePrefixRows f ([678bd27](http://192.168.100.56:3000/denozord/EvoBGP/commit/678bd27))
|
||||
* feat: implement effective peer enabling logic during peer creation. Update CreatePeer methods in Pos ([3e85431](http://192.168.100.56:3000/denozord/EvoBGP/commit/3e85431))
|
||||
* feat: implement module refresh job management with concurrency control. Add CountOtherActiveModuleRe ([149fb0a](http://192.168.100.56:3000/denozord/EvoBGP/commit/149fb0a))
|
||||
* feat: implement peer reconciliation job for BGP peers ([3b17228](http://192.168.100.56:3000/denozord/EvoBGP/commit/3b17228))
|
||||
* feat: implement revision retention settings and pruning logic ([4f50350](http://192.168.100.56:3000/denozord/EvoBGP/commit/4f50350))
|
||||
* feat: implement theme selection and automatic theme application based on user preference. Update App ([b70a643](http://192.168.100.56:3000/denozord/EvoBGP/commit/b70a643))
|
||||
* feat: implement versioning and release management in the project ([bb334b1](http://192.168.100.56:3000/denozord/EvoBGP/commit/bb334b1))
|
||||
* feat: improve BGP protocol summary handling by introducing isBGPProtocolSummaryRow function. Update ([399622c](http://192.168.100.56:3000/denozord/EvoBGP/commit/399622c))
|
||||
* feat: improve job detail UI with enhanced spacing and layout adjustments. Update table cell classes ([97908b5](http://192.168.100.56:3000/denozord/EvoBGP/commit/97908b5))
|
||||
* feat: improve peer speaker assignment UX in network settings ([f877ec8](http://192.168.100.56:3000/denozord/EvoBGP/commit/f877ec8))
|
||||
* feat: improve UI components with enhanced overflow handling and layout adjustments. Update card and ([0ca5542](http://192.168.100.56:3000/denozord/EvoBGP/commit/0ca5542))
|
||||
* feat: improve UI layout and responsiveness in module and operations pages. Refactor component struct ([233f29b](http://192.168.100.56:3000/denozord/EvoBGP/commit/233f29b))
|
||||
* feat: redesign settings page with structured controls ([2da6d49](http://192.168.100.56:3000/denozord/EvoBGP/commit/2da6d49))
|
||||
* feat: refactor materialization logic to group static routes by community in the refresh pipeline. In ([1c5a9c9](http://192.168.100.56:3000/denozord/EvoBGP/commit/1c5a9c9))
|
||||
* feat: refactor operations page to enhance UI and component structure. Remove unused card components ([88226f6](http://192.168.100.56:3000/denozord/EvoBGP/commit/88226f6))
|
||||
* feat: refine BGP template handling and documentation updates. Remove local IP requirements in BGP te ([6266a39](http://192.168.100.56:3000/denozord/EvoBGP/commit/6266a39))
|
||||
* feat: refine job detail UI with improved layout and scrolling capabilities. Enhance spacing and over ([57c09ac](http://192.168.100.56:3000/denozord/EvoBGP/commit/57c09ac))
|
||||
* feat: update BGP community structure and related documentation. Refactor BGP community handling by r ([a2cbfac](http://192.168.100.56:3000/denozord/EvoBGP/commit/a2cbfac))
|
||||
* feat: update BGP template configuration and OpenAPI documentation. Change import settings from 'all' ([133ea93](http://192.168.100.56:3000/denozord/EvoBGP/commit/133ea93))
|
||||
* feat: update BIRD installation process to build from source. Modify CI workflow to ensure BIRD 2.14 ([e2002ba](http://192.168.100.56:3000/denozord/EvoBGP/commit/e2002ba))
|
||||
* feat: update CI configuration and Dockerfiles for improved build efficiency ([80229b3](http://192.168.100.56:3000/denozord/EvoBGP/commit/80229b3))
|
||||
* feat: update collectModulePrefixRows to support prior snapshots and enhance CDN/domain prefix collec ([ee364c8](http://192.168.100.56:3000/denozord/EvoBGP/commit/ee364c8))
|
||||
* feat: update Go module dependencies and enhance DNS resolution in refresh pipeline. Upgrade Go versi ([655d750](http://192.168.100.56:3000/denozord/EvoBGP/commit/655d750))
|
||||
* feat: update OpenAPI documentation and internal logic for BIRD settings. Enhance the description of ([62bf987](http://192.168.100.56:3000/denozord/EvoBGP/commit/62bf987))
|
||||
* feat: update RevisionDiff type and enhance OperationsDiffTab component for better diff handling. Int ([4aaaa30](http://192.168.100.56:3000/denozord/EvoBGP/commit/4aaaa30))
|
||||
* feat: update Traefik deployment configuration for Let's Encrypt and logging ([39ba976](http://192.168.100.56:3000/denozord/EvoBGP/commit/39ba976))
|
||||
* docs: add router-lists-ui integration documentation to README ([b7a8aab](http://192.168.100.56:3000/denozord/EvoBGP/commit/b7a8aab))
|
||||
* docs: add Web UI section to EvoBGP architecture plan, detailing Svelte and shadcn-svelte integration ([272542b](http://192.168.100.56:3000/denozord/EvoBGP/commit/272542b))
|
||||
* docs: enhance EvoBGP architecture plan with new risk mitigation strategies, testing matrix for BIRD2 ([3992d01](http://192.168.100.56:3000/denozord/EvoBGP/commit/3992d01))
|
||||
* docs: enhance README and CI workflow documentation for Docker image building and publishing process, ([9eb3e33](http://192.168.100.56:3000/denozord/EvoBGP/commit/9eb3e33))
|
||||
* docs: enhance README and CI workflow to clarify Docker image build conditions and Gitea Container Re ([c6687b2](http://192.168.100.56:3000/denozord/EvoBGP/commit/c6687b2))
|
||||
* docs: openapi.html со встроенным Redoc; инструкция для Gitea и скрипт сборки ([a754e1d](http://192.168.100.56:3000/denozord/EvoBGP/commit/a754e1d))
|
||||
* docs: update AGENTS and README to include guidelines for Conventional Commits ([4c23232](http://192.168.100.56:3000/denozord/EvoBGP/commit/4c23232))
|
||||
* docs: update AGENTS and README with engineering rules and guidelines ([aff27e8](http://192.168.100.56:3000/denozord/EvoBGP/commit/aff27e8))
|
||||
* docs: update architecture and API documentation to clarify job processing, in-memory registry usage, ([acc0608](http://192.168.100.56:3000/denozord/EvoBGP/commit/acc0608))
|
||||
* docs: update EvoBGP architecture plan with detailed REST API section, including general agreements, ([1a86d6c](http://192.168.100.56:3000/denozord/EvoBGP/commit/1a86d6c))
|
||||
* docs: update EvoBGP architecture plan with new repository structure, refined sections, and detailed ([4480d64](http://192.168.100.56:3000/denozord/EvoBGP/commit/4480d64))
|
||||
* docs: update README and CI workflow to clarify Docker workspace mounting for bird2 job ([6be46db](http://192.168.100.56:3000/denozord/EvoBGP/commit/6be46db))
|
||||
* docs: update README and CI workflow to clarify Gitea Registry login process and improve Docker image ([f1b33b9](http://192.168.100.56:3000/denozord/EvoBGP/commit/f1b33b9))
|
||||
* docs: update README and Docker Compose configurations to clarify usage of pre-built images from the ([7fac79c](http://192.168.100.56:3000/denozord/EvoBGP/commit/7fac79c))
|
||||
* docs: update README to include information about the EvoBGP web interface, linking to quickstart and ([5d21f01](http://192.168.100.56:3000/denozord/EvoBGP/commit/5d21f01))
|
||||
* docs: статическая Redoc-страница OpenAPI (для просмотра в Gitea без встроенного рендера) ([5c9d2e2](http://192.168.100.56:3000/denozord/EvoBGP/commit/5c9d2e2))
|
||||
* docs: убрать типографское тире и невидимый Unicode из текстов API ([fbe9cd3](http://192.168.100.56:3000/denozord/EvoBGP/commit/fbe9cd3))
|
||||
* refactor: adjust BootstrapWorkers function call in server.go to change the order of returned values, ([032fa99](http://192.168.100.56:3000/denozord/EvoBGP/commit/032fa99))
|
||||
* refactor: consolidate module interval display logic and improve edit form handling ([1f85654](http://192.168.100.56:3000/denozord/EvoBGP/commit/1f85654))
|
||||
* refactor: enhance bird metrics polling with context support ([f6b94a4](http://192.168.100.56:3000/denozord/EvoBGP/commit/f6b94a4))
|
||||
* refactor: enhance CI workflow for granular change detection by module and improve idempotency key ge ([54eaad3](http://192.168.100.56:3000/denozord/EvoBGP/commit/54eaad3))
|
||||
* refactor: enhance job status checks in worker tests ([6107c3e](http://192.168.100.56:3000/denozord/EvoBGP/commit/6107c3e))
|
||||
* refactor: enhance JSON struct tags for various data models in backend and memory store. Update field ([4a860a0](http://192.168.100.56:3000/denozord/EvoBGP/commit/4a860a0))
|
||||
* refactor: enhance module display and input handling in module pages ([25374a6](http://192.168.100.56:3000/denozord/EvoBGP/commit/25374a6))
|
||||
* refactor: enhance module interval label logic and add reset buttons in edit forms ([b99fc17](http://192.168.100.56:3000/denozord/EvoBGP/commit/b99fc17))
|
||||
* refactor: improve code consistency and formatting across components ([c263fd5](http://192.168.100.56:3000/denozord/EvoBGP/commit/c263fd5))
|
||||
* refactor: improve handling of deployable fragments in ApplyRevision and buildPreviewFragments functi ([6932271](http://192.168.100.56:3000/denozord/EvoBGP/commit/6932271))
|
||||
* refactor: improve module save functionality and nullable value handling ([05ec176](http://192.168.100.56:3000/denozord/EvoBGP/commit/05ec176))
|
||||
* refactor: improve PATCH handling for module updates with nullable field support ([e700f90](http://192.168.100.56:3000/denozord/EvoBGP/commit/e700f90))
|
||||
* refactor: optimize job listing and counting logic for concurrency safety. Separate tenant filtering ([d83efe2](http://192.168.100.56:3000/denozord/EvoBGP/commit/d83efe2))
|
||||
* refactor: phase 2 structural alignment — reports, importer, nodecli, pagination ([250cdea](http://192.168.100.56:3000/denozord/EvoBGP/commit/250cdea))
|
||||
* refactor: remove strict bind configuration from BGP templates and update related logic. Eliminate 's ([482eeb1](http://192.168.100.56:3000/denozord/EvoBGP/commit/482eeb1))
|
||||
* refactor: streamline Docker build process in CI configuration and documentation ([6025f38](http://192.168.100.56:3000/denozord/EvoBGP/commit/6025f38))
|
||||
* refactor: streamline edit form handling for community and DoH profile selections ([1765ab8](http://192.168.100.56:3000/denozord/EvoBGP/commit/1765ab8))
|
||||
* refactor: streamline module refresh process and enhance revision handling ([10e2415](http://192.168.100.56:3000/denozord/EvoBGP/commit/10e2415))
|
||||
* refactor: switch BIRD installation from source to Ubuntu package. Update CI workflow and Dockerfiles ([0b3ceaa](http://192.168.100.56:3000/denozord/EvoBGP/commit/0b3ceaa))
|
||||
* refactor: update AS entry handling in API and database to support ASN-only entries. Remove prefix fi ([1db6b5b](http://192.168.100.56:3000/denozord/EvoBGP/commit/1db6b5b))
|
||||
* refactor: update Docker build context and paths in CI configuration and documentation ([7d52a4a](http://192.168.100.56:3000/denozord/EvoBGP/commit/7d52a4a))
|
||||
* refactor: update Docker build variable syntax in CI configuration and documentation ([27e01d0](http://192.168.100.56:3000/denozord/EvoBGP/commit/27e01d0))
|
||||
* refactor: update job kind display logic in schedule page ([dc1f4a5](http://192.168.100.56:3000/denozord/EvoBGP/commit/dc1f4a5))
|
||||
* refactor: update ListModules and GetModule methods in Postgres repository to include cron expression ([73d0003](http://192.168.100.56:3000/denozord/EvoBGP/commit/73d0003))
|
||||
* refactor: update Switch component styles and structure for improved accessibility and responsiveness ([d4282c2](http://192.168.100.56:3000/denozord/EvoBGP/commit/d4282c2))
|
||||
* refactor: update worker processes in EvoBGP to accept dependencies for shared store and job registry ([b7968db](http://192.168.100.56:3000/denozord/EvoBGP/commit/b7968db))
|
||||
* ci: add conditional job for OpenAPI linting based on file changes; update README with workflow detai ([3adfc49](http://192.168.100.56:3000/denozord/EvoBGP/commit/3adfc49))
|
||||
* ci: phase 4 automation — web job, lint-httpapi, golangci ([64516c3](http://192.168.100.56:3000/denozord/EvoBGP/commit/64516c3))
|
||||
* ci: update README and CI workflow to improve bird2 job installation process and clarify Docker usage ([eddc6b8](http://192.168.100.56:3000/denozord/EvoBGP/commit/eddc6b8))
|
||||
* chore: phase 3 code quality — pipeline prefixes, godoc baseline ([ea65451](http://192.168.100.56:3000/denozord/EvoBGP/commit/ea65451))
|
||||
* chore: update CI configuration to disable filesystem entitlement for Docker builds ([9ab7de6](http://192.168.100.56:3000/denozord/EvoBGP/commit/9ab7de6))
|
||||
* chore: update package dependencies and enhance AppShell component with new navigation items and tool ([7d85fef](http://192.168.100.56:3000/denozord/EvoBGP/commit/7d85fef))
|
||||
* chore: upgrade Go version to 1.24 in Dockerfiles for evobgp-agent and gobinary. This change ensures ([4ba5b03](http://192.168.100.56:3000/denozord/EvoBGP/commit/4ba5b03))
|
||||
* fix: adjust Postgres resource limits and healthcheck parameters. Increase memory limit to 256M and m ([20e674c](http://192.168.100.56:3000/denozord/EvoBGP/commit/20e674c))
|
||||
* fix: improve input handling and validation for settings fields ([1386b63](http://192.168.100.56:3000/denozord/EvoBGP/commit/1386b63))
|
||||
* fix: improve sidebar and navigation layout in AppShell component ([9f02128](http://192.168.100.56:3000/denozord/EvoBGP/commit/9f02128))
|
||||
* fix: update BGP configuration in test scenarios to use new IPv6 addresses ([9fd9745](http://192.168.100.56:3000/denozord/EvoBGP/commit/9fd9745))
|
||||
* fix: update bird build script and Dockerfile to include libncurses dependency ([0cb5a7d](http://192.168.100.56:3000/denozord/EvoBGP/commit/0cb5a7d))
|
||||
* fix: update bird build script and Dockerfile to include readline dependency ([35ed79b](http://192.168.100.56:3000/denozord/EvoBGP/commit/35ed79b))
|
||||
* fix: update bird build script and Dockerfile to remove readline dependency ([fefadac](http://192.168.100.56:3000/denozord/EvoBGP/commit/fefadac))
|
||||
* fix: update deployment configuration for Traefik and secure Web UI ([00bd037](http://192.168.100.56:3000/denozord/EvoBGP/commit/00bd037))
|
||||
* fix: update Docker build commands in CI configuration and documentation ([b5061a5](http://192.168.100.56:3000/denozord/EvoBGP/commit/b5061a5))
|
||||
* fix(httpapi): phase 1 compliance — ERR-01, SEC-04, CDN client, scheduler docs ([1dd7135](http://192.168.100.56:3000/denozord/EvoBGP/commit/1dd7135))
|
||||
* test: add CDN prefetch tests for 304 responses and snapshot handling ([a536a2d](http://192.168.100.56:3000/denozord/EvoBGP/commit/a536a2d))
|
||||
* test: add validation for 'strict bind on' in BGP rendering tests. Enhance BGP test cases to ensure ' ([dc5e20e](http://192.168.100.56:3000/denozord/EvoBGP/commit/dc5e20e))
|
||||
* docker: refactor cache handling in Docker bake configuration ([5e59a1c](http://192.168.100.56:3000/denozord/EvoBGP/commit/5e59a1c))
|
||||
* docker: simplify web image targets in Docker bake configuration ([765a805](http://192.168.100.56:3000/denozord/EvoBGP/commit/765a805))
|
||||
* docker: update web image build process and README ([92f6de8](http://192.168.100.56:3000/denozord/EvoBGP/commit/92f6de8))
|
||||
* web(ui): app layout — sidebar, mobile sheet, topbar, PageHeader ([2d78c81](http://192.168.100.56:3000/denozord/EvoBGP/commit/2d78c81))
|
||||
* web(ui): AppDataTable pattern and modules pilot ([b992301](http://192.168.100.56:3000/denozord/EvoBGP/commit/b992301))
|
||||
* web(ui): design tokens — spacing and component scale ([ac635e9](http://192.168.100.56:3000/denozord/EvoBGP/commit/ac635e9))
|
||||
* web(ui): feedback — confirm dialog, skeletons, README ([87309cf](http://192.168.100.56:3000/denozord/EvoBGP/commit/87309cf))
|
||||
* web(ui): form patterns — FormField, formsnap, directories pilot ([77a2cfd](http://192.168.100.56:3000/denozord/EvoBGP/commit/77a2cfd))
|
||||
* web(ui): foundation — ui/core layout, shadcn primitives, notify ([00a2a44](http://192.168.100.56:3000/denozord/EvoBGP/commit/00a2a44))
|
||||
* web(ui): migrate dashboard, schedule, monitoring to ui patterns ([57dcf30](http://192.168.100.56:3000/denozord/EvoBGP/commit/57dcf30))
|
||||
* web(ui): migrate network to ui patterns ([3a3056b](http://192.168.100.56:3000/denozord/EvoBGP/commit/3a3056b))
|
||||
* web(ui): migrate operations and module detail to ui patterns ([1f9930d](http://192.168.100.56:3000/denozord/EvoBGP/commit/1f9930d))
|
||||
* web(ui): migrate settings to ui patterns ([9808aca](http://192.168.100.56:3000/denozord/EvoBGP/commit/9808aca))
|
||||
* Enhance EvoBGP architecture plan by refining the overview, updating todos with detailed descriptions ([30efdbf](http://192.168.100.56:3000/denozord/EvoBGP/commit/30efdbf))
|
||||
* init ([cbf3aaa](http://192.168.100.56:3000/denozord/EvoBGP/commit/cbf3aaa))
|
||||
* Refine EvoBGP architecture plan with updated database schema details, improved descriptions for comp ([431ef3e](http://192.168.100.56:3000/denozord/EvoBGP/commit/431ef3e))
|
||||
* Update EvoBGP architecture plan with new overview and todos. Refined descriptions for control-plane ([31ff5bb](http://192.168.100.56:3000/denozord/EvoBGP/commit/31ff5bb))
|
||||
@@ -50,6 +50,6 @@ docker compose --profile reference up -d
|
||||
|
||||
- [docs/releasing.md](docs/releasing.md) — пайплайн, commit conventions, секреты CI
|
||||
- API: `GET /version` и `GET /v1/version` (поле `version`)
|
||||
- Docker-образы публикуются по git-тегу `vX.Y.Z` (workflow **Publish**)
|
||||
- Docker-образы: теги `latest`, `vX.Y.Z`, `X.Y.Z` — в **том же CI run**, что и релиз (job `release`)
|
||||
|
||||
Лицензия и условия использования — по политике владельца репозитория.
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
Сборка образов — **`docker buildx bake`** (`deploy/docker/docker-bake.hcl`), не отдельные `docker build`.
|
||||
|
||||
**Publish:** push git-тега `vX.Y.Z` запускает [.gitea/workflows/publish.yaml](../.gitea/workflows/publish.yaml) — образы с semver-тегом, `latest`, `sha-*`. Переменная `VERSION` из тега попадает в Go-бинарники через `-ldflags`.
|
||||
**Publish:** push в `main` после quality gates — job **release** в [.gitea/workflows/ci.yaml](../.gitea/workflows/ci.yaml): semantic-release + bake с `VERSION` из релиза.
|
||||
|
||||
Локально BuildKit также кэширует `/go/pkg/mod` и `~/.cache/go-build` через `RUN --mount=type=cache`.
|
||||
|
||||
|
||||
@@ -149,7 +149,10 @@ function "image-tags" {
|
||||
"${REGISTRY}/${name}:${IMAGE_TAG}",
|
||||
"${REGISTRY}/${name}:${SHORT_SHA}",
|
||||
],
|
||||
notequal(VERSION, "dev") && notequal(VERSION, "") ? ["${REGISTRY}/${name}:v${VERSION}"] : []
|
||||
notequal(VERSION, "dev") && notequal(VERSION, "") ? [
|
||||
"${REGISTRY}/${name}:v${VERSION}",
|
||||
"${REGISTRY}/${name}:${VERSION}",
|
||||
] : []
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+22
-33
@@ -15,39 +15,35 @@ EvoBGP использует [Conventional Commits](https://www.conventionalcommi
|
||||
|
||||
Подробные правила сообщений коммитов: [.cursor/rules/conventional-commits.mdc](../.cursor/rules/conventional-commits.mdc).
|
||||
|
||||
## CI-пайплайн
|
||||
## CI-пайплайн (один push в main)
|
||||
|
||||
```text
|
||||
push/merge в main
|
||||
→ CI (openapi, web, go, bird2, commitlint на PR)
|
||||
→ Release (semantic-release после успешного CI)
|
||||
→ git tag vX.Y.Z
|
||||
→ CHANGELOG.md + commit [skip ci]
|
||||
→ Gitea Release с notes
|
||||
→ Publish (push тега v*)
|
||||
→ docker buildx bake с VERSION из тега
|
||||
→ образы: latest, vX.Y.Z, sha-*, короткий SHA
|
||||
→ CI: openapi, web, go, bird2 (параллельно)
|
||||
→ job release (в том же workflow, после quality gates):
|
||||
→ semantic-release: git tag vX.Y.Z на текущий commit (без доп. commit)
|
||||
→ Gitea Release + CHANGELOG.md как attachment
|
||||
→ docker buildx bake с VERSION=X.Y.Z
|
||||
→ образы: latest, vX.Y.Z, X.Y.Z, sha-*, короткий SHA
|
||||
```
|
||||
|
||||
Workflow-файлы:
|
||||
Pull request: только quality gates + commitlint; релиз и образы **не** публикуются.
|
||||
|
||||
- [.gitea/workflows/ci.yaml](../.gitea/workflows/ci.yaml) — quality gates
|
||||
- [.gitea/workflows/release.yaml](../.gitea/workflows/release.yaml) — semantic-release
|
||||
- [.gitea/workflows/publish.yaml](../.gitea/workflows/publish.yaml) — публикация образов
|
||||
Workflow: [.gitea/workflows/ci.yaml](../.gitea/workflows/ci.yaml) (job **release**).
|
||||
|
||||
Конфиг semantic-release: [.releaserc.json](../.releaserc.json).
|
||||
Конфиг semantic-release: [.releaserc.json](../.releaserc.json) — без `@semantic-release/git` (CHANGELOG не коммитится в репозиторий).
|
||||
|
||||
## Секреты Gitea
|
||||
|
||||
Один PAT в репозитории — **`ACTIONS_PAT`** (Settings → Actions → Secrets). Используется для semantic-release, push тегов/CHANGELOG и docker login в registry.
|
||||
Один PAT — **`ACTIONS_PAT`** (Settings → Actions → Secrets).
|
||||
|
||||
| Право PAT | Зачем |
|
||||
|-----------|--------|
|
||||
| push / write repository | commit `CHANGELOG.md`, push тегов |
|
||||
| releases | Gitea Release через semantic-release |
|
||||
| packages (Container Registry) | workflow **Publish** |
|
||||
| push tags | git tag `vX.Y.Z` на commit merge |
|
||||
| releases | Gitea Release + notes |
|
||||
| packages (Container Registry) | push образов |
|
||||
|
||||
Если `ACTIONS_PAT` не задан, workflow пробует **`gitea.token`** job-токен (нужны права на releases и packages в настройках Gitea).
|
||||
Fallback: **`gitea.token`** (нужны права на releases и packages).
|
||||
|
||||
## Источник правды для версии в runtime
|
||||
|
||||
@@ -56,28 +52,21 @@ Semver из git-тега пробрасывается в Go-бинарники
|
||||
- локально (`go run`) — `version: "dev"`
|
||||
- в образе после релиза — совпадает с тегом (например `1.2.3`)
|
||||
|
||||
API:
|
||||
|
||||
- `GET /version`
|
||||
- `GET /v1/version`
|
||||
|
||||
Ответ включает `version`, `git_sha`, `build_time`; поле `api_version` — deprecated alias.
|
||||
API: `GET /version`, `GET /v1/version` — поля `version`, `git_sha`, `build_time`.
|
||||
|
||||
Web UI показывает версию из API (footer sidebar, страница «Мониторинг»).
|
||||
|
||||
## CHANGELOG
|
||||
|
||||
Файл [`CHANGELOG.md`](../CHANGELOG.md) создаётся и обновляется semantic-release. Копия прикрепляется к Gitea Release.
|
||||
Release notes — в Gitea Release; файл `CHANGELOG.md` генерируется в CI и прикрепляется как asset, **не** попадает в git history.
|
||||
|
||||
## Проверка после релиза
|
||||
|
||||
1. В Gitea: тег `vX.Y.Z` и Release с notes.
|
||||
2. Container Registry: образы с тегом `vX.Y.Z`.
|
||||
3. `curl http://localhost:8080/version` → `"version":"X.Y.Z"`.
|
||||
4. Footer Web UI → `vX.Y.Z`.
|
||||
1. Один run workflow **CI** на push в main: job **release** зелёный.
|
||||
2. Gitea: тег `vX.Y.Z` на том же commit, что и merge; Release с notes.
|
||||
3. Container Registry: `evobgp-api:vX.Y.Z`, `evobgp-api:X.Y.Z`, `evobgp-api:latest`.
|
||||
4. `curl http://localhost:8080/version` → `"version":"X.Y.Z"`.
|
||||
|
||||
## Первый релиз (bootstrap)
|
||||
|
||||
Merge PR в `main` с conventional commit типа `feat(release): ...` (не `chore` — иначе релиз не создастся). Ожидаемый результат: **v1.0.0**.
|
||||
|
||||
После merge убедитесь, что workflow **Release** завершился успешно и workflow **Publish** собрал образы по тегу.
|
||||
Merge в `main` с `feat(release): ...` → **v1.0.0** в том же CI run.
|
||||
Generated
+168
-139
@@ -11,7 +11,7 @@
|
||||
"@markwylde/semantic-release-gitea": "^2.2.0",
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/commit-analyzer": "^13.0.1",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/exec": "^7.0.0",
|
||||
"@semantic-release/release-notes-generator": "^14.0.3",
|
||||
"semantic-release": "^25.0.2"
|
||||
}
|
||||
@@ -761,40 +761,28 @@
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/git": {
|
||||
"version": "10.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz",
|
||||
"integrity": "sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==",
|
||||
"node_modules/@semantic-release/exec": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@semantic-release/exec/-/exec-7.1.0.tgz",
|
||||
"integrity": "sha512-4ycZ2atgEUutspPZ2hxO6z8JoQt4+y/kkHvfZ1cZxgl9WKJId1xPj+UadwInj+gMn2Gsv+fLnbrZ4s+6tK2TFQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@semantic-release/error": "^3.0.0",
|
||||
"@semantic-release/error": "^4.0.0",
|
||||
"aggregate-error": "^3.0.0",
|
||||
"debug": "^4.0.0",
|
||||
"dir-glob": "^3.0.0",
|
||||
"execa": "^5.0.0",
|
||||
"lodash": "^4.17.4",
|
||||
"micromatch": "^4.0.0",
|
||||
"p-reduce": "^2.0.0"
|
||||
"execa": "^9.0.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"parse-json": "^8.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
"node": ">=20.8.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"semantic-release": ">=18.0.0"
|
||||
"semantic-release": ">=24.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/git/node_modules/@semantic-release/error": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz",
|
||||
"integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/git/node_modules/aggregate-error": {
|
||||
"node_modules/@semantic-release/exec/node_modules/aggregate-error": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
|
||||
"integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==",
|
||||
@@ -808,7 +796,7 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/git/node_modules/clean-stack": {
|
||||
"node_modules/@semantic-release/exec/node_modules/clean-stack": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
|
||||
"integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
|
||||
@@ -818,7 +806,61 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/git/node_modules/indent-string": {
|
||||
"node_modules/@semantic-release/exec/node_modules/execa": {
|
||||
"version": "9.6.1",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-9.6.1.tgz",
|
||||
"integrity": "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@sindresorhus/merge-streams": "^4.0.0",
|
||||
"cross-spawn": "^7.0.6",
|
||||
"figures": "^6.1.0",
|
||||
"get-stream": "^9.0.0",
|
||||
"human-signals": "^8.0.1",
|
||||
"is-plain-obj": "^4.1.0",
|
||||
"is-stream": "^4.0.1",
|
||||
"npm-run-path": "^6.0.0",
|
||||
"pretty-ms": "^9.2.0",
|
||||
"signal-exit": "^4.1.0",
|
||||
"strip-final-newline": "^4.0.0",
|
||||
"yoctocolors": "^2.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.19.0 || >=20.5.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sindresorhus/execa?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/exec/node_modules/get-stream": {
|
||||
"version": "9.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz",
|
||||
"integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@sec-ant/readable-stream": "^0.4.1",
|
||||
"is-stream": "^4.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/exec/node_modules/human-signals": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.1.tgz",
|
||||
"integrity": "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=18.18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/exec/node_modules/indent-string": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
|
||||
"integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
|
||||
@@ -828,6 +870,106 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/exec/node_modules/is-stream": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz",
|
||||
"integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/exec/node_modules/npm-run-path": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz",
|
||||
"integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^4.0.0",
|
||||
"unicorn-magic": "^0.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/exec/node_modules/parse-json": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz",
|
||||
"integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.26.2",
|
||||
"index-to-position": "^1.1.0",
|
||||
"type-fest": "^4.39.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/exec/node_modules/path-key": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
|
||||
"integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/exec/node_modules/signal-exit": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
|
||||
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/exec/node_modules/strip-final-newline": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz",
|
||||
"integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/exec/node_modules/unicorn-magic": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz",
|
||||
"integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/github": {
|
||||
"version": "12.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-12.0.8.tgz",
|
||||
@@ -2335,30 +2477,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/execa": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
|
||||
"integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.3",
|
||||
"get-stream": "^6.0.0",
|
||||
"human-signals": "^2.1.0",
|
||||
"is-stream": "^2.0.0",
|
||||
"merge-stream": "^2.0.0",
|
||||
"npm-run-path": "^4.0.1",
|
||||
"onetime": "^5.1.2",
|
||||
"signal-exit": "^3.0.3",
|
||||
"strip-final-newline": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sindresorhus/execa?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-content-type-parse": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz",
|
||||
@@ -2970,16 +3088,6 @@
|
||||
"node": ">= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/human-signals": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
|
||||
"integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=10.17.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
"version": "7.0.5",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
|
||||
@@ -3171,19 +3279,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/is-stream": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
|
||||
"integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/is-text-path": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz",
|
||||
@@ -3683,16 +3778,6 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mimic-fn": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
||||
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/mimic-response": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz",
|
||||
@@ -3961,19 +4046,6 @@
|
||||
"node": "^20.17.0 || >=22.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-path": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
|
||||
"integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/npm/node_modules/@gar/promise-retry": {
|
||||
"version": "1.0.3",
|
||||
"dev": true,
|
||||
@@ -5736,22 +5808,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/onetime": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
|
||||
"integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mimic-fn": "^2.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/p-cancelable": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-4.0.1.tgz",
|
||||
@@ -5852,16 +5908,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/p-reduce": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz",
|
||||
"integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/p-timeout": {
|
||||
"version": "6.1.4",
|
||||
"resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.4.tgz",
|
||||
@@ -6850,13 +6896,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/signal-exit": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
|
||||
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/signale": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/signale/-/signale-1.4.0.tgz",
|
||||
@@ -7121,16 +7160,6 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-final-newline": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
|
||||
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-json-comments": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
"@markwylde/semantic-release-gitea": "^2.2.0",
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/commit-analyzer": "^13.0.1",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/exec": "^7.0.0",
|
||||
"@semantic-release/release-notes-generator": "^14.0.3",
|
||||
"semantic-release": "^25.0.2"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/** Ответ GET /v1/version (см. docs/openapi.yaml VersionInfo). */
|
||||
export type VersionInfo = {
|
||||
version?: string;
|
||||
api_version?: string;
|
||||
git_sha?: string;
|
||||
build_time?: string;
|
||||
};
|
||||
|
||||
const PLACEHOLDER_SHA = new Set(['', 'unknown']);
|
||||
|
||||
function nonEmptyString(value: unknown): string {
|
||||
if (typeof value === 'string') {
|
||||
const s = value.trim();
|
||||
return s;
|
||||
}
|
||||
if (value == null) return '';
|
||||
return String(value).trim();
|
||||
}
|
||||
|
||||
/** Semver или legacy api_version; пустая строка, если полей нет. */
|
||||
export function resolveVersionString(info: VersionInfo | null | undefined): string {
|
||||
if (!info) return '';
|
||||
return nonEmptyString(info.version) || nonEmptyString(info.api_version);
|
||||
}
|
||||
|
||||
/** Короткий git SHA; пусто для placeholder «unknown». */
|
||||
export function resolveGitSha(info: VersionInfo | null | undefined): string {
|
||||
if (!info) return '';
|
||||
const sha = nonEmptyString(info.git_sha);
|
||||
if (!sha || PLACEHOLDER_SHA.has(sha.toLowerCase())) return '';
|
||||
return sha;
|
||||
}
|
||||
|
||||
/** Заголовок карточки «Версия» на /monitoring. */
|
||||
export function formatVersionHeadline(info: VersionInfo | null | undefined): string {
|
||||
if (!info) return '—';
|
||||
const ver = resolveVersionString(info);
|
||||
const sha = resolveGitSha(info);
|
||||
if (ver && sha) return `${ver} (${sha.slice(0, 12)})`;
|
||||
if (ver) return ver;
|
||||
if (sha) return sha.slice(0, 12);
|
||||
return '—';
|
||||
}
|
||||
|
||||
/** Подпись в сайдбаре (v1.2.3). */
|
||||
export function formatVersionSidebarLabel(info: VersionInfo | null | undefined): string | null {
|
||||
const ver = resolveVersionString(info);
|
||||
return ver ? `v${ver}` : null;
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
/** Pure-helpers для страницы /monitoring. */
|
||||
|
||||
export type OverallStatus = 'ok' | 'warn' | 'error' | 'unknown';
|
||||
|
||||
export type JobsKpi = { running: number; failed: number; total: number };
|
||||
|
||||
export type ReadyStatus = { status: string; checks?: Record<string, unknown> };
|
||||
|
||||
export type HealthStatus = { ok: boolean; status?: string; error?: string };
|
||||
|
||||
export type CheckBadge = {
|
||||
label: string;
|
||||
variant: 'default' | 'secondary' | 'destructive' | 'outline';
|
||||
class?: string;
|
||||
hint?: string;
|
||||
};
|
||||
|
||||
export function toErrorMessage(error: unknown): string {
|
||||
if (error instanceof Error && error.message.trim() !== '') return error.message;
|
||||
return 'Ошибка запроса';
|
||||
}
|
||||
|
||||
export function summarizeJobsStatuses(items: Array<{ status?: string }>): JobsKpi {
|
||||
let running = 0;
|
||||
let failed = 0;
|
||||
for (const row of items) {
|
||||
const status = String(row.status ?? '').toLowerCase();
|
||||
if (status === 'queued' || status === 'running' || status === 'cancel_requested') {
|
||||
running += 1;
|
||||
}
|
||||
if (status === 'failed' || status === 'error' || status === 'canceled') {
|
||||
failed += 1;
|
||||
}
|
||||
}
|
||||
return { running, failed, total: items.length };
|
||||
}
|
||||
|
||||
export function deriveOverallStatus(input: {
|
||||
health: HealthStatus | null;
|
||||
ready: ReadyStatus | null;
|
||||
jobs: JobsKpi | null;
|
||||
birdConfigured: boolean;
|
||||
birdHealthy: boolean | null;
|
||||
}): OverallStatus {
|
||||
const { health, ready, jobs, birdConfigured, birdHealthy } = input;
|
||||
if (health === null && ready === null && jobs === null) return 'unknown';
|
||||
if (!health?.ok) return 'error';
|
||||
if (ready !== null && ready.status !== 'ready') return 'error';
|
||||
if (jobs !== null && jobs.failed > 0) return 'warn';
|
||||
if (birdConfigured && birdHealthy === false) return 'warn';
|
||||
return 'ok';
|
||||
}
|
||||
|
||||
export function overallStatusLabel(status: OverallStatus): string {
|
||||
switch (status) {
|
||||
case 'ok':
|
||||
return 'В норме';
|
||||
case 'warn':
|
||||
return 'Внимание';
|
||||
case 'error':
|
||||
return 'Ошибка';
|
||||
default:
|
||||
return 'Нет данных';
|
||||
}
|
||||
}
|
||||
|
||||
export function overallStatusHint(
|
||||
status: OverallStatus,
|
||||
input: {
|
||||
healthOk: boolean | undefined;
|
||||
jobsFailed: number;
|
||||
}
|
||||
): string {
|
||||
if (status === 'unknown') return 'Нет данных. Запустите обновление.';
|
||||
if (status === 'error') {
|
||||
if (!input.healthOk) return 'Проверьте доступность API и логи сервиса.';
|
||||
return 'Readiness не в норме: проверьте postgres/store/jobs.';
|
||||
}
|
||||
if (status === 'warn') {
|
||||
if (input.jobsFailed > 0) return 'Есть ошибки в задачах: откройте операции и последние jobs.';
|
||||
return 'Проверьте BGP-сессии и вывод birdc.';
|
||||
}
|
||||
return 'Критичных отклонений не обнаружено.';
|
||||
}
|
||||
|
||||
export function overallBadgeVariant(status: OverallStatus): CheckBadge['variant'] {
|
||||
if (status === 'ok') return 'default';
|
||||
if (status === 'warn') return 'secondary';
|
||||
if (status === 'error') return 'destructive';
|
||||
return 'outline';
|
||||
}
|
||||
|
||||
export function overallBadgeClass(status: OverallStatus): string | undefined {
|
||||
if (status === 'ok') return 'border-success/30 bg-success/15 text-success';
|
||||
if (status === 'warn') return 'border-warning/30 bg-warning/15 text-warning';
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/** Нормализация значений ready.checks и health/readiness в badge. */
|
||||
export function checkStatusBadge(value: unknown): CheckBadge {
|
||||
const raw = String(value ?? '').trim();
|
||||
const lower = raw.toLowerCase();
|
||||
|
||||
if (lower === 'ok' || lower === 'ready' || lower === 'true' || lower === 'up') {
|
||||
return {
|
||||
label: 'OK',
|
||||
variant: 'default',
|
||||
class: 'border-success/30 bg-success/15 text-success'
|
||||
};
|
||||
}
|
||||
if (lower === 'memory') {
|
||||
return {
|
||||
label: 'In-memory',
|
||||
variant: 'secondary',
|
||||
hint: 'Очередь задач в памяти процесса, не shared между воркерами.'
|
||||
};
|
||||
}
|
||||
if (
|
||||
lower === 'failed' ||
|
||||
lower === 'false' ||
|
||||
lower === 'error' ||
|
||||
lower === 'down' ||
|
||||
lower === 'unavailable'
|
||||
) {
|
||||
return { label: 'Ошибка', variant: 'destructive' };
|
||||
}
|
||||
if (raw === '') {
|
||||
return { label: '—', variant: 'outline' };
|
||||
}
|
||||
return { label: raw, variant: 'outline' };
|
||||
}
|
||||
|
||||
/** Человекочитаемое имя проверки readiness. */
|
||||
export function checkDisplayName(key: string): string {
|
||||
switch (key) {
|
||||
case 'postgres':
|
||||
return 'PostgreSQL';
|
||||
case 'store':
|
||||
return 'Хранилище';
|
||||
case 'jobs':
|
||||
return 'Очередь задач';
|
||||
default:
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
export function livenessBadge(health: HealthStatus | null): CheckBadge {
|
||||
if (health === null) return { label: '—', variant: 'outline' };
|
||||
if (health.ok) {
|
||||
return {
|
||||
label: 'В норме',
|
||||
variant: 'default',
|
||||
class: 'border-success/30 bg-success/15 text-success'
|
||||
};
|
||||
}
|
||||
return { label: 'Недоступен', variant: 'destructive' };
|
||||
}
|
||||
|
||||
export function readinessBadge(ready: ReadyStatus | null): CheckBadge {
|
||||
if (ready === null) return { label: '—', variant: 'outline' };
|
||||
if (ready.status === 'ready') {
|
||||
return {
|
||||
label: 'Готов',
|
||||
variant: 'default',
|
||||
class: 'border-success/30 bg-success/15 text-success'
|
||||
};
|
||||
}
|
||||
return { label: ready.status || 'Не готов', variant: 'destructive' };
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { apiJSON } from '$lib/api/client.js';
|
||||
|
||||
type VersionInfo = {
|
||||
version?: string;
|
||||
api_version?: string;
|
||||
};
|
||||
import { formatVersionSidebarLabel, type VersionInfo } from '$lib/api/version-info.js';
|
||||
|
||||
let label = $state<string | null>(null);
|
||||
|
||||
@@ -13,11 +9,7 @@
|
||||
void (async () => {
|
||||
try {
|
||||
const info = await apiJSON<VersionInfo>('/v1/version');
|
||||
const ver =
|
||||
(typeof info.version === 'string' && info.version) ||
|
||||
(typeof info.api_version === 'string' && info.api_version) ||
|
||||
'';
|
||||
label = ver ? `v${ver}` : null;
|
||||
label = formatVersionSidebarLabel(info);
|
||||
} catch {
|
||||
label = null;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,54 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { resolve } from '$app/paths';
|
||||
import { apiJSON, apiFetch } from '$lib/api/client.js';
|
||||
import type { BirdStatus, JobsResponse } from '$lib/api/types.js';
|
||||
import { Badge } from '$lib/components/ui/badge/index.js';
|
||||
import { Button } from '$lib/components/ui/button/index.js';
|
||||
import type { BirdStatus, JobRow, JobsResponse } from '$lib/api/types.js';
|
||||
import {
|
||||
formatVersionHeadline,
|
||||
resolveVersionString,
|
||||
type VersionInfo
|
||||
} from '$lib/api/version-info.js';
|
||||
import { jobKindTitle } from '$lib/operations/job-kind-label.js';
|
||||
import { jobStatusRu } from '$lib/ui-labels.js';
|
||||
import {
|
||||
checkDisplayName,
|
||||
checkStatusBadge,
|
||||
deriveOverallStatus,
|
||||
livenessBadge,
|
||||
overallBadgeClass,
|
||||
overallBadgeVariant,
|
||||
overallStatusHint,
|
||||
overallStatusLabel,
|
||||
readinessBadge,
|
||||
summarizeJobsStatuses,
|
||||
toErrorMessage,
|
||||
type HealthStatus,
|
||||
type JobsKpi,
|
||||
type ReadyStatus
|
||||
} from '$lib/monitoring/status.js';
|
||||
import { Badge } from '$lib/ui/core/badge/index.js';
|
||||
import { Button } from '$lib/ui/core/button/index.js';
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
CardDescription
|
||||
} from '$lib/components/ui/card/index.js';
|
||||
} from '$lib/ui/core/card/index.js';
|
||||
import { Alert, AlertDescription, AlertTitle } from '$lib/ui/core/alert/index.js';
|
||||
import { Separator } from '$lib/ui/core/separator/index.js';
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow
|
||||
} from '$lib/ui/core/table/index.js';
|
||||
import CardSkeleton from '$lib/ui/patterns/feedback/card-skeleton.svelte';
|
||||
import ScrollPreBlock from '$lib/components/app/scroll-pre-block.svelte';
|
||||
import PageHeader from '$lib/ui/app/page-header/page-header.svelte';
|
||||
import { cn } from '$lib/utils.js';
|
||||
import RefreshCw from '@lucide/svelte/icons/refresh-cw';
|
||||
import Gauge from '@lucide/svelte/icons/gauge';
|
||||
import Activity from '@lucide/svelte/icons/activity';
|
||||
@@ -18,138 +56,248 @@
|
||||
import Server from '@lucide/svelte/icons/server';
|
||||
import Hash from '@lucide/svelte/icons/hash';
|
||||
import AlertTriangle from '@lucide/svelte/icons/alert-triangle';
|
||||
import PageHeader from '$lib/ui/app/page-header/page-header.svelte';
|
||||
import CheckCircle from '@lucide/svelte/icons/check-circle';
|
||||
import XCircle from '@lucide/svelte/icons/x-circle';
|
||||
import ArrowRight from '@lucide/svelte/icons/arrow-right';
|
||||
import HeartPulse from '@lucide/svelte/icons/heart-pulse';
|
||||
import ShieldCheck from '@lucide/svelte/icons/shield-check';
|
||||
import Database from '@lucide/svelte/icons/database';
|
||||
import HardDrive from '@lucide/svelte/icons/hard-drive';
|
||||
import ListTodo from '@lucide/svelte/icons/list-todo';
|
||||
import type { Component } from 'svelte';
|
||||
|
||||
type ReadyStatus = { status: string; checks?: Record<string, unknown> };
|
||||
type VersionInfo = {
|
||||
version?: string;
|
||||
git_sha?: string;
|
||||
build_time?: string;
|
||||
[k: string]: unknown;
|
||||
};
|
||||
type JobsKpi = { running: number; failed: number; total: number };
|
||||
|
||||
let health = $state<{ ok: boolean; status?: string; error?: string } | null>(null);
|
||||
let health = $state<HealthStatus | null>(null);
|
||||
let ready = $state<ReadyStatus | null>(null);
|
||||
let version = $state<VersionInfo | null>(null);
|
||||
let bird = $state<BirdStatus | null>(null);
|
||||
let jobs = $state<JobsKpi | null>(null);
|
||||
let jobItems = $state<JobRow[]>([]);
|
||||
let readyError = $state<string | null>(null);
|
||||
let versionError = $state<string | null>(null);
|
||||
let birdError = $state<string | null>(null);
|
||||
let jobsError = $state<string | null>(null);
|
||||
let lastUpdated = $state<Date | null>(null);
|
||||
let loading = $state(false);
|
||||
let initialLoading = $state(true);
|
||||
let refreshing = $state(false);
|
||||
|
||||
function toErrorMessage(error: unknown): string {
|
||||
if (error instanceof Error && error.message.trim() !== '') return error.message;
|
||||
return 'Ошибка запроса';
|
||||
}
|
||||
|
||||
function summarizeJobsStatuses(items: Array<{ status?: string }>): JobsKpi {
|
||||
let running = 0;
|
||||
let failed = 0;
|
||||
for (const row of items) {
|
||||
const status = String(row.status ?? '').toLowerCase();
|
||||
if (status === 'queued' || status === 'running' || status === 'cancel_requested') {
|
||||
running += 1;
|
||||
}
|
||||
if (status === 'failed' || status === 'error' || status === 'canceled') {
|
||||
failed += 1;
|
||||
}
|
||||
const statAccents = [
|
||||
{
|
||||
border: 'border-l-chart-1',
|
||||
bg: 'bg-chart-1/5',
|
||||
iconBg: 'bg-chart-1/15',
|
||||
iconText: 'text-chart-1'
|
||||
},
|
||||
{
|
||||
border: 'border-l-chart-2',
|
||||
bg: 'bg-chart-2/5',
|
||||
iconBg: 'bg-chart-2/15',
|
||||
iconText: 'text-chart-2'
|
||||
},
|
||||
{
|
||||
border: 'border-l-chart-4',
|
||||
bg: 'bg-chart-4/5',
|
||||
iconBg: 'bg-chart-4/15',
|
||||
iconText: 'text-chart-4'
|
||||
},
|
||||
{
|
||||
border: 'border-l-info',
|
||||
bg: 'bg-info/10',
|
||||
iconBg: 'bg-info/15',
|
||||
iconText: 'text-info'
|
||||
}
|
||||
return { running, failed, total: items.length };
|
||||
}
|
||||
] as const;
|
||||
|
||||
function overallBadgeVariant(status: 'ok' | 'warn' | 'error' | 'unknown') {
|
||||
if (status === 'ok') return 'default';
|
||||
if (status === 'warn') return 'secondary';
|
||||
if (status === 'error') return 'destructive';
|
||||
return 'outline';
|
||||
}
|
||||
const overallStatus = $derived.by(() =>
|
||||
deriveOverallStatus({
|
||||
health,
|
||||
ready,
|
||||
jobs,
|
||||
birdConfigured: bird?.birdc_configured ?? false,
|
||||
birdHealthy: bird?.healthy ?? null
|
||||
})
|
||||
);
|
||||
|
||||
const overallStatus = $derived.by(() => {
|
||||
if (health === null && ready === null && bird === null && jobs === null) return 'unknown';
|
||||
if (!health?.ok) return 'error';
|
||||
if (ready !== null && ready.status !== 'ready') return 'error';
|
||||
if (jobs !== null && jobs.failed > 0) return 'warn';
|
||||
if (bird !== null && bird.birdc_configured && bird.healthy === false) return 'warn';
|
||||
return 'ok';
|
||||
});
|
||||
|
||||
const overallHint = $derived.by(() => {
|
||||
if (overallStatus === 'unknown') return 'Нет данных. Запустите обновление.';
|
||||
if (overallStatus === 'error') {
|
||||
if (!health?.ok) return 'Проверьте доступность API и логи сервиса.';
|
||||
return 'Readiness не в норме: проверьте postgres/store/jobs.';
|
||||
}
|
||||
if (overallStatus === 'warn') {
|
||||
if (jobs && jobs.failed > 0)
|
||||
return 'Есть ошибки в задачах: откройте операции и последние jobs.';
|
||||
return 'Проверьте BGP-сессии и вывод birdc.';
|
||||
}
|
||||
return 'Критичных отклонений не обнаружено.';
|
||||
});
|
||||
const overallHint = $derived.by(() =>
|
||||
overallStatusHint(overallStatus, {
|
||||
healthOk: health?.ok,
|
||||
jobsFailed: jobs?.failed ?? 0
|
||||
})
|
||||
);
|
||||
|
||||
const bgpText = $derived.by(() => {
|
||||
if (!bird) return '—';
|
||||
if (!bird.birdc_configured) return 'birdc не настроен';
|
||||
if (bird.error) return 'ошибка birdc';
|
||||
if (!bird.birdc_configured) return '—';
|
||||
if (bird.error) return '—';
|
||||
return `${bird.bgp_established}/${bird.bgp_sessions_total}`;
|
||||
});
|
||||
|
||||
const versionText = $derived.by(() => {
|
||||
if (!version) return '—';
|
||||
const ver =
|
||||
(typeof version.version === 'string' && version.version) ||
|
||||
(typeof version.api_version === 'string' && version.api_version) ||
|
||||
'';
|
||||
const sha =
|
||||
typeof version.git_sha === 'string' && version.git_sha ? version.git_sha : 'unknown';
|
||||
if (ver) return `${ver} (${sha.slice(0, 12)})`;
|
||||
return sha.slice(0, 12);
|
||||
const bgpRatio = $derived.by(() => {
|
||||
if (!bird?.birdc_configured || bird.bgp_sessions_total <= 0) return null;
|
||||
return Math.round((bird.bgp_established / bird.bgp_sessions_total) * 100);
|
||||
});
|
||||
|
||||
const versionText = $derived(formatVersionHeadline(version));
|
||||
|
||||
const versionFooter = $derived.by(() => {
|
||||
if (!version) return '';
|
||||
const parts: string[] = [];
|
||||
const ver = resolveVersionString(version);
|
||||
if (ver) parts.push(`version: ${ver}`);
|
||||
if (version.git_sha) parts.push(`git_sha: ${version.git_sha}`);
|
||||
if (version.build_time) parts.push(`build: ${version.build_time}`);
|
||||
return parts.join(' · ');
|
||||
});
|
||||
|
||||
const failedJobs = $derived.by(() =>
|
||||
jobItems
|
||||
.filter((j) => {
|
||||
const s = String(j.status ?? '').toLowerCase();
|
||||
return s === 'failed' || s === 'error' || s === 'canceled';
|
||||
})
|
||||
.slice(0, 5)
|
||||
);
|
||||
|
||||
const checkIconByKey: Record<string, Component> = {
|
||||
postgres: Database,
|
||||
store: HardDrive,
|
||||
jobs: ListTodo
|
||||
};
|
||||
|
||||
const kpiCards = $derived.by(() => [
|
||||
{
|
||||
id: 'overall',
|
||||
label: 'Общий статус',
|
||||
value: initialLoading ? '—' : overallStatusLabel(overallStatus),
|
||||
description: overallHint,
|
||||
icon: Server,
|
||||
accent: statAccents[0],
|
||||
badge: overallStatusLabel(overallStatus),
|
||||
badgeVariant: overallBadgeVariant(overallStatus),
|
||||
badgeClass: overallBadgeClass(overallStatus),
|
||||
error: null as string | null,
|
||||
href: undefined
|
||||
},
|
||||
{
|
||||
id: 'bgp',
|
||||
label: 'BGP сессии',
|
||||
value: initialLoading ? '—' : bgpText,
|
||||
description: bird?.birdc_configured
|
||||
? 'Established / total на API-хосте'
|
||||
: (bird?.message ?? 'birdc не настроен на API-хосте'),
|
||||
icon: Bird,
|
||||
accent: statAccents[1],
|
||||
badge: !bird ? '—' : !bird.birdc_configured ? 'N/A' : bird.healthy ? 'В норме' : 'Деградация',
|
||||
badgeVariant: !bird?.birdc_configured
|
||||
? ('outline' as const)
|
||||
: bird?.healthy
|
||||
? ('default' as const)
|
||||
: ('secondary' as const),
|
||||
badgeClass:
|
||||
bird?.birdc_configured && bird?.healthy
|
||||
? 'border-success/30 bg-success/15 text-success'
|
||||
: undefined,
|
||||
error: birdError ?? bird?.error ?? null,
|
||||
href: '/network' as const
|
||||
},
|
||||
{
|
||||
id: 'jobs',
|
||||
label: 'Задачи',
|
||||
value: initialLoading ? '—' : String(jobs?.running ?? '—'),
|
||||
description: `Активных из ${jobs?.total ?? '—'} последних`,
|
||||
icon: Activity,
|
||||
accent: statAccents[2],
|
||||
badge: jobs && jobs.failed > 0 ? `ошибок ${jobs.failed}` : 'без ошибок',
|
||||
badgeVariant: jobs && jobs.failed > 0 ? ('secondary' as const) : ('default' as const),
|
||||
badgeClass:
|
||||
jobs && jobs.failed === 0 ? 'border-success/30 bg-success/15 text-success' : undefined,
|
||||
error: jobsError,
|
||||
href: jobs && jobs.failed > 0 ? ('/operations' as const) : undefined
|
||||
},
|
||||
{
|
||||
id: 'version',
|
||||
label: 'Версия',
|
||||
value: initialLoading ? '—' : versionText,
|
||||
description: versionFooter || 'GET /v1/version',
|
||||
icon: Hash,
|
||||
accent: statAccents[3],
|
||||
badge: version ? 'Загружена' : '—',
|
||||
badgeVariant: version ? ('outline' as const) : ('secondary' as const),
|
||||
badgeClass: undefined,
|
||||
error: versionError,
|
||||
href: undefined
|
||||
}
|
||||
]);
|
||||
|
||||
async function fetchHealth(): Promise<HealthStatus> {
|
||||
const h = await apiFetch('/v1/health');
|
||||
const hj = (await h.json().catch(() => ({}))) as { status?: string };
|
||||
return { ok: h.ok, status: hj?.status, error: h.ok ? undefined : `HTTP ${h.status}` };
|
||||
}
|
||||
|
||||
async function load() {
|
||||
loading = true;
|
||||
if (initialLoading) {
|
||||
/* keep skeleton */
|
||||
} else {
|
||||
refreshing = true;
|
||||
}
|
||||
readyError = null;
|
||||
versionError = null;
|
||||
birdError = null;
|
||||
jobsError = null;
|
||||
try {
|
||||
const h = await apiFetch('/v1/health');
|
||||
const hj = await h.json().catch(() => ({}));
|
||||
health = { ok: h.ok, status: hj?.status, error: h.ok ? undefined : `HTTP ${h.status}` };
|
||||
} catch (error) {
|
||||
health = { ok: false, error: toErrorMessage(error) };
|
||||
|
||||
const [healthRes, readyRes, versionRes, birdRes, jobsRes] = await Promise.allSettled([
|
||||
fetchHealth(),
|
||||
apiJSON<ReadyStatus>('/v1/ready'),
|
||||
apiJSON<VersionInfo>('/v1/version'),
|
||||
apiJSON<BirdStatus>('/v1/bird/status'),
|
||||
apiJSON<JobsResponse>('/v1/jobs?limit=100')
|
||||
]);
|
||||
|
||||
if (healthRes.status === 'fulfilled') {
|
||||
health = healthRes.value;
|
||||
} else {
|
||||
health = { ok: false, error: toErrorMessage(healthRes.reason) };
|
||||
}
|
||||
try {
|
||||
ready = await apiJSON<ReadyStatus>('/v1/ready');
|
||||
} catch (error) {
|
||||
|
||||
if (readyRes.status === 'fulfilled') {
|
||||
ready = readyRes.value;
|
||||
} else {
|
||||
ready = null;
|
||||
readyError = toErrorMessage(error);
|
||||
readyError = toErrorMessage(readyRes.reason);
|
||||
}
|
||||
try {
|
||||
version = await apiJSON<VersionInfo>('/v1/version');
|
||||
} catch (error) {
|
||||
|
||||
if (versionRes.status === 'fulfilled') {
|
||||
version = versionRes.value;
|
||||
} else {
|
||||
version = null;
|
||||
versionError = toErrorMessage(error);
|
||||
versionError = toErrorMessage(versionRes.reason);
|
||||
}
|
||||
try {
|
||||
bird = await apiJSON<BirdStatus>('/v1/bird/status');
|
||||
} catch (error) {
|
||||
|
||||
if (birdRes.status === 'fulfilled') {
|
||||
bird = birdRes.value;
|
||||
} else {
|
||||
bird = null;
|
||||
birdError = toErrorMessage(error);
|
||||
birdError = toErrorMessage(birdRes.reason);
|
||||
}
|
||||
try {
|
||||
const jobsPage = await apiJSON<JobsResponse>('/v1/jobs?limit=100');
|
||||
jobs = summarizeJobsStatuses(jobsPage.items ?? []);
|
||||
} catch (error) {
|
||||
|
||||
if (jobsRes.status === 'fulfilled') {
|
||||
const items = jobsRes.value.items ?? [];
|
||||
jobItems = items;
|
||||
jobs = summarizeJobsStatuses(items);
|
||||
} else {
|
||||
jobItems = [];
|
||||
jobs = null;
|
||||
jobsError = toErrorMessage(error);
|
||||
jobsError = toErrorMessage(jobsRes.reason);
|
||||
}
|
||||
|
||||
lastUpdated = new Date();
|
||||
loading = false;
|
||||
initialLoading = false;
|
||||
refreshing = false;
|
||||
}
|
||||
|
||||
function truncateError(error: string | null | undefined, max = 120): string {
|
||||
if (!error) return '';
|
||||
return error.length > max ? `${error.slice(0, max)}…` : error;
|
||||
}
|
||||
|
||||
onMount(load);
|
||||
@@ -165,191 +313,394 @@
|
||||
iconClass="bg-info/15 text-info"
|
||||
>
|
||||
{#snippet actions()}
|
||||
<Button variant="outline" size="sm" onclick={load} disabled={loading}>
|
||||
<RefreshCw class={loading ? 'animate-spin' : ''} />
|
||||
<Button variant="outline" size="sm" onclick={load} disabled={refreshing}>
|
||||
<RefreshCw class={refreshing ? 'animate-spin' : ''} />
|
||||
Обновить
|
||||
</Button>
|
||||
{/snippet}
|
||||
</PageHeader>
|
||||
|
||||
<div class="grid gap-3 sm:grid-cols-2 xl:grid-cols-4">
|
||||
<Card class="border-l-4 border-l-chart-1 bg-chart-1/5 shadow-sm">
|
||||
<CardHeader>
|
||||
<CardTitle class="flex items-center gap-2 text-base">
|
||||
<Server class="size-4" />
|
||||
Общий статус
|
||||
</CardTitle>
|
||||
<CardDescription>Liveness + readiness + jobs/BGP</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<p class="text-2xl font-semibold uppercase">{overallStatus}</p>
|
||||
<Badge variant={overallBadgeVariant(overallStatus)}>{overallStatus}</Badge>
|
||||
</div>
|
||||
<p class="mt-2 text-xs text-muted-foreground">{overallHint}</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
{#if !initialLoading}
|
||||
{#if overallStatus === 'ok'}
|
||||
<Alert class="border-success/30 bg-success/5">
|
||||
<CheckCircle class="text-success" />
|
||||
<AlertTitle>Система в норме</AlertTitle>
|
||||
<AlertDescription>{overallHint}</AlertDescription>
|
||||
</Alert>
|
||||
{:else if overallStatus === 'warn'}
|
||||
<Alert class="border-warning/30 bg-warning/5">
|
||||
<AlertTriangle class="text-warning" />
|
||||
<AlertTitle>Требуется внимание</AlertTitle>
|
||||
<AlertDescription>{overallHint}</AlertDescription>
|
||||
</Alert>
|
||||
{:else if overallStatus === 'error'}
|
||||
<Alert variant="destructive">
|
||||
<XCircle />
|
||||
<AlertTitle>Обнаружена проблема</AlertTitle>
|
||||
<AlertDescription>{overallHint}</AlertDescription>
|
||||
</Alert>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<Card class="border-l-4 border-l-chart-2 bg-chart-2/5 shadow-sm">
|
||||
<CardHeader>
|
||||
<CardTitle class="flex items-center gap-2 text-base">
|
||||
<Bird class="size-4" />
|
||||
BGP сессии
|
||||
</CardTitle>
|
||||
<CardDescription>GET /v1/bird/status</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<p class="text-2xl font-semibold">{bgpText}</p>
|
||||
{#if bird?.birdc_configured}
|
||||
<Badge variant={bird.healthy ? 'default' : 'secondary'}
|
||||
>{bird.healthy ? 'healthy' : 'degraded'}</Badge
|
||||
<div class="grid gap-4 sm:grid-cols-2 xl:grid-cols-4">
|
||||
{#if initialLoading}
|
||||
{#each Array(4) as _, i (i)}
|
||||
<CardSkeleton />
|
||||
{/each}
|
||||
{:else}
|
||||
{#each kpiCards as card (card.id)}
|
||||
{@const Icon = card.icon}
|
||||
{@const a = card.accent}
|
||||
<Card
|
||||
class={cn(
|
||||
'overflow-hidden border-l-4 shadow-sm transition-colors',
|
||||
a.border,
|
||||
a.bg,
|
||||
card.href ? 'hover:border-primary/35' : ''
|
||||
)}
|
||||
>
|
||||
<CardHeader class="pb-2">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<CardDescription class="flex min-w-0 items-center gap-2">
|
||||
<span
|
||||
class={cn(
|
||||
'flex size-9 shrink-0 items-center justify-center rounded-lg',
|
||||
a.iconBg
|
||||
)}
|
||||
aria-hidden="true"
|
||||
>
|
||||
<Icon class={cn('size-4', a.iconText)} />
|
||||
</span>
|
||||
<span class="truncate">{card.label}</span>
|
||||
</CardDescription>
|
||||
{#if card.href}
|
||||
<Button variant="ghost" size="icon-sm" href={resolve(card.href)}>
|
||||
<ArrowRight class="size-3.5" aria-hidden="true" />
|
||||
</Button>
|
||||
{/if}
|
||||
</div>
|
||||
<CardTitle
|
||||
class={cn(
|
||||
'font-bold tabular-nums',
|
||||
card.id === 'version' ? 'font-mono text-xl' : 'text-3xl'
|
||||
)}
|
||||
>
|
||||
{:else}
|
||||
<Badge variant="outline">n/a</Badge>
|
||||
{/if}
|
||||
</div>
|
||||
{#if birdError}
|
||||
<p class="mt-2 text-xs text-destructive">{birdError}</p>
|
||||
{:else if bird && !bird.birdc_configured}
|
||||
<p class="mt-2 text-xs text-muted-foreground">
|
||||
{bird.message ?? 'birdc не настроен на API-хосте.'}
|
||||
</p>
|
||||
{:else if bird?.error}
|
||||
<p class="mt-2 text-xs text-destructive">{bird.error}</p>
|
||||
{:else}
|
||||
<p class="mt-2 text-xs text-muted-foreground">Established / total на API-хосте.</p>
|
||||
{/if}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card class="border-l-4 border-l-chart-4 bg-chart-4/5 shadow-sm">
|
||||
<CardHeader>
|
||||
<CardTitle class="flex items-center gap-2 text-base">
|
||||
<Activity class="size-4" />
|
||||
Задачи
|
||||
</CardTitle>
|
||||
<CardDescription>GET /v1/jobs?limit=100</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<p class="text-2xl font-semibold">{jobs ? jobs.running : '—'}</p>
|
||||
<Badge variant={jobs && jobs.failed > 0 ? 'secondary' : 'default'}>
|
||||
{jobs && jobs.failed > 0 ? `ошибок ${jobs.failed}` : 'без ошибок'}
|
||||
</Badge>
|
||||
</div>
|
||||
{#if jobsError}
|
||||
<p class="mt-2 text-xs text-destructive">{jobsError}</p>
|
||||
{:else}
|
||||
<p class="mt-2 text-xs text-muted-foreground">
|
||||
Активных: {jobs?.running ?? '—'} из {jobs?.total ?? '—'} последних.
|
||||
</p>
|
||||
{/if}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card class="border-l-4 border-l-info bg-info/10 shadow-sm">
|
||||
<CardHeader>
|
||||
<CardTitle class="flex items-center gap-2 text-base">
|
||||
<Hash class="size-4" />
|
||||
Версия
|
||||
</CardTitle>
|
||||
<CardDescription>GET /v1/version</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<p class="font-mono text-2xl font-semibold">{versionText}</p>
|
||||
<Badge variant={version ? 'outline' : 'secondary'}>{version ? 'loaded' : '—'}</Badge>
|
||||
</div>
|
||||
{#if versionError}
|
||||
<p class="mt-2 text-xs text-destructive">{versionError}</p>
|
||||
{:else if version}
|
||||
<p class="mt-2 truncate text-xs text-muted-foreground">
|
||||
api_version: {String(version.api_version ?? 'unknown')}
|
||||
</p>
|
||||
{/if}
|
||||
</CardContent>
|
||||
</Card>
|
||||
{card.value}
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent class="space-y-2">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<Badge variant={card.badgeVariant} class={card.badgeClass}>{card.badge}</Badge>
|
||||
</div>
|
||||
{#if card.error}
|
||||
<p class="text-xs text-destructive">{card.error}</p>
|
||||
{:else}
|
||||
<p class="text-xs text-muted-foreground">{card.description}</p>
|
||||
{/if}
|
||||
</CardContent>
|
||||
</Card>
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="grid gap-4 lg:grid-cols-2">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle class="text-base">Доступность и готовность</CardTitle>
|
||||
<CardDescription>GET /v1/health и GET /v1/ready</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent class="space-y-3">
|
||||
<div class="flex items-center gap-2 text-sm">
|
||||
<span class="text-muted-foreground">Liveness:</span>
|
||||
{#if health === null}
|
||||
<Badge variant="outline">—</Badge>
|
||||
{:else if health.ok}
|
||||
<Badge variant="default">ok</Badge>
|
||||
{:else}
|
||||
<Badge variant="destructive">failed</Badge>
|
||||
{#if initialLoading}
|
||||
<CardSkeleton />
|
||||
<CardSkeleton />
|
||||
{:else}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle class="text-base">Доступность и готовность</CardTitle>
|
||||
<CardDescription>GET /v1/health · GET /v1/ready</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent class="space-y-4">
|
||||
{#if health?.error || readyError}
|
||||
<Alert variant="destructive">
|
||||
<XCircle />
|
||||
<AlertTitle>Ошибка проверки</AlertTitle>
|
||||
<AlertDescription>
|
||||
{#if health?.error}{health.error}{/if}
|
||||
{#if health?.error && readyError}<br />{/if}
|
||||
{#if readyError}{readyError}{/if}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
{/if}
|
||||
{#if health?.status}
|
||||
<span class="text-muted-foreground">{health.status}</span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2 text-sm">
|
||||
<span class="text-muted-foreground">Readiness:</span>
|
||||
{#if ready === null}
|
||||
<Badge variant="outline">—</Badge>
|
||||
{:else}
|
||||
<Badge variant={ready.status === 'ready' ? 'default' : 'destructive'}
|
||||
>{ready.status}</Badge
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead class="w-[55%]">Проверка</TableHead>
|
||||
<TableHead>Статус</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{@const liveBadge = livenessBadge(health)}
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<div class="flex items-center gap-2">
|
||||
<HeartPulse class="size-4 shrink-0 text-muted-foreground" aria-hidden="true" />
|
||||
<div>
|
||||
<p class="text-sm font-medium">Liveness</p>
|
||||
<p class="text-xs text-muted-foreground">/v1/health</p>
|
||||
</div>
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Badge variant={liveBadge.variant} class={liveBadge.class}
|
||||
>{liveBadge.label}</Badge
|
||||
>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
{@const readyBadge = readinessBadge(ready)}
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<div class="flex items-center gap-2">
|
||||
<ShieldCheck class="size-4 shrink-0 text-muted-foreground" aria-hidden="true" />
|
||||
<div>
|
||||
<p class="text-sm font-medium">Readiness</p>
|
||||
<p class="text-xs text-muted-foreground">/v1/ready</p>
|
||||
</div>
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Badge variant={readyBadge.variant} class={readyBadge.class}
|
||||
>{readyBadge.label}</Badge
|
||||
>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
{#if ready?.checks && Object.keys(ready.checks).length > 0}
|
||||
<TableRow>
|
||||
<TableCell colspan={2} class="bg-muted/30 py-2">
|
||||
<p class="text-xs font-medium text-muted-foreground">Зависимости</p>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
{#each Object.entries(ready.checks) as [key, value] (key)}
|
||||
{@const badge = checkStatusBadge(value)}
|
||||
{@const CheckIcon = checkIconByKey[key] ?? ListTodo}
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<div class="flex items-center gap-2">
|
||||
<CheckIcon
|
||||
class="size-4 shrink-0 text-muted-foreground"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<div>
|
||||
<p class="text-sm font-medium">{checkDisplayName(key)}</p>
|
||||
<p class="text-xs text-muted-foreground">{key}</p>
|
||||
</div>
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<div class="space-y-1">
|
||||
<Badge variant={badge.variant} class={badge.class}>{badge.label}</Badge>
|
||||
{#if badge.hint}
|
||||
<p class="text-xs text-muted-foreground">{badge.hint}</p>
|
||||
{/if}
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
{/each}
|
||||
{/if}
|
||||
</TableBody>
|
||||
</Table>
|
||||
|
||||
{#if health?.error}
|
||||
<p class="text-xs text-destructive">{health.error}</p>
|
||||
{/if}
|
||||
{#if readyError}
|
||||
<p class="text-xs text-destructive">{readyError}</p>
|
||||
{/if}
|
||||
<p class="text-xs text-muted-foreground">
|
||||
HTTP 503 на readiness означает недоступность одной из зависимостей в checks.
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{#if ready?.checks}
|
||||
<div class="space-y-1">
|
||||
{#each Object.entries(ready.checks) as [k, v] (k)}
|
||||
<div class="grid grid-cols-[auto_1fr] items-center gap-2 text-xs">
|
||||
<span class="text-muted-foreground">{k}</span>
|
||||
<Badge variant="outline" class="justify-start font-normal">{String(v)}</Badge>
|
||||
</div>
|
||||
{/each}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<div class="flex items-start justify-between gap-2">
|
||||
<div>
|
||||
<CardTitle class="flex items-center gap-2 text-base">
|
||||
<Bird class="size-4" />
|
||||
BGP на API-хосте
|
||||
</CardTitle>
|
||||
<CardDescription>GET /v1/bird/status</CardDescription>
|
||||
</div>
|
||||
<Button variant="outline" size="sm" href={resolve('/network')}>Пиры и спикеры</Button>
|
||||
</div>
|
||||
{/if}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</CardHeader>
|
||||
<CardContent class="space-y-4">
|
||||
{#if birdError}
|
||||
<Alert variant="destructive">
|
||||
<XCircle />
|
||||
<AlertTitle>Ошибка birdc</AlertTitle>
|
||||
<AlertDescription>{birdError}</AlertDescription>
|
||||
</Alert>
|
||||
{:else if bird && !bird.birdc_configured}
|
||||
<p class="text-sm text-muted-foreground">
|
||||
{bird.message ?? 'birdc не настроен на API-хосте (EVOBGP_BIRDC_SOCKET).'}
|
||||
</p>
|
||||
{:else if bird}
|
||||
<div class="space-y-2">
|
||||
<div class="flex items-center justify-between text-sm">
|
||||
<span class="text-muted-foreground">Established / total</span>
|
||||
<span class="font-medium tabular-nums">
|
||||
{bird.bgp_established} / {bird.bgp_sessions_total}
|
||||
{#if bgpRatio !== null}
|
||||
<span class="text-muted-foreground">({bgpRatio}%)</span>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
{#if bgpRatio !== null}
|
||||
<div class="h-2 overflow-hidden rounded-full bg-muted">
|
||||
<div
|
||||
class={cn(
|
||||
'h-full rounded-full transition-all',
|
||||
bgpRatio >= 100
|
||||
? 'bg-success'
|
||||
: bgpRatio >= 50
|
||||
? 'bg-warning'
|
||||
: 'bg-destructive'
|
||||
)}
|
||||
style="width: {bgpRatio}%"
|
||||
></div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if bird.error}
|
||||
<p class="text-xs text-destructive">{bird.error}</p>
|
||||
{/if}
|
||||
</div>
|
||||
{#if bird.protocols_excerpt}
|
||||
<Separator />
|
||||
<div class="space-y-2">
|
||||
<p class="text-sm font-medium">Вывод birdc (protocols)</p>
|
||||
<ScrollPreBlock variant="preserve" text={bird.protocols_excerpt} class="max-h-48" />
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</CardContent>
|
||||
</Card>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle class="flex items-center gap-2 text-base">
|
||||
<AlertTriangle class="size-4 text-muted-foreground" />
|
||||
Что проверять при деградации
|
||||
</CardTitle>
|
||||
<CardDescription>Короткая шпаргалка для triage</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent class="space-y-2 text-sm">
|
||||
<p>
|
||||
<span class="text-muted-foreground">Если </span><code>health=failed</code> — проверьте доступность
|
||||
процесса API и его логи.
|
||||
</p>
|
||||
<p>
|
||||
<span class="text-muted-foreground">Если </span><code>ready!=ready</code> — сначала `postgres`,
|
||||
затем `store/jobs` в checks.
|
||||
</p>
|
||||
<p>
|
||||
<span class="text-muted-foreground">Если low BGP ratio</span> — проверьте `bird/status`, затем
|
||||
BGP peer состояния.
|
||||
</p>
|
||||
<p>
|
||||
<span class="text-muted-foreground">Если ошибки jobs</span> — откройте операции и проверьте
|
||||
последние неуспешные задачи.
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<div class="grid gap-4 lg:grid-cols-2">
|
||||
{#if initialLoading}
|
||||
<CardSkeleton />
|
||||
<CardSkeleton />
|
||||
{:else}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<div class="flex items-start justify-between gap-2">
|
||||
<div>
|
||||
<CardTitle class="flex items-center gap-2 text-base">
|
||||
<Activity class="size-4" />
|
||||
Задачи
|
||||
</CardTitle>
|
||||
<CardDescription>Последние 100 задач · GET /v1/jobs</CardDescription>
|
||||
</div>
|
||||
<Button variant="outline" size="sm" href={resolve('/operations')}>Все операции</Button>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent class="space-y-4">
|
||||
{#if jobsError}
|
||||
<Alert variant="destructive">
|
||||
<XCircle />
|
||||
<AlertTitle>Не удалось загрузить задачи</AlertTitle>
|
||||
<AlertDescription>{jobsError}</AlertDescription>
|
||||
</Alert>
|
||||
{:else if jobs}
|
||||
<div class="flex flex-wrap gap-4 text-sm">
|
||||
<div>
|
||||
<p class="text-muted-foreground">Активных</p>
|
||||
<p class="text-2xl font-bold tabular-nums">{jobs.running}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-muted-foreground">С ошибками</p>
|
||||
<p
|
||||
class={cn(
|
||||
'text-2xl font-bold tabular-nums',
|
||||
jobs.failed > 0 ? 'text-warning' : 'text-success'
|
||||
)}
|
||||
>
|
||||
{jobs.failed}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-muted-foreground">В выборке</p>
|
||||
<p class="text-2xl font-bold tabular-nums">{jobs.total}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Separator />
|
||||
|
||||
{#if failedJobs.length > 0}
|
||||
<div class="space-y-3">
|
||||
<p class="text-sm font-medium">Последние ошибки</p>
|
||||
<ul class="space-y-2">
|
||||
{#each failedJobs as job (job.job_id)}
|
||||
<li class="rounded-lg border px-3 py-2 text-sm">
|
||||
<div class="flex items-start justify-between gap-2">
|
||||
<p class="font-medium">{jobKindTitle(job)}</p>
|
||||
<Badge variant="destructive">{jobStatusRu(job.status)}</Badge>
|
||||
</div>
|
||||
{#if job.error}
|
||||
<p class="mt-1 text-xs text-muted-foreground">
|
||||
{truncateError(job.error)}
|
||||
</p>
|
||||
{/if}
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</div>
|
||||
{:else}
|
||||
<p class="text-sm text-muted-foreground">
|
||||
Критичных сбоев в последних 100 задачах нет.
|
||||
</p>
|
||||
{/if}
|
||||
{/if}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle class="flex items-center gap-2 text-base">
|
||||
<AlertTriangle class="size-4 text-muted-foreground" />
|
||||
Что проверять при деградации
|
||||
</CardTitle>
|
||||
<CardDescription>Короткая шпаргалка для triage</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent class="space-y-3">
|
||||
<Alert>
|
||||
<HeartPulse class="size-4" />
|
||||
<AlertTitle>API недоступен</AlertTitle>
|
||||
<AlertDescription>
|
||||
Если <code class="text-xs">/v1/health</code> возвращает ошибку — проверьте процесс API и
|
||||
его логи.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
<Alert>
|
||||
<Database class="size-4" />
|
||||
<AlertTitle>Readiness не «Готов»</AlertTitle>
|
||||
<AlertDescription>
|
||||
Сначала <code class="text-xs">postgres</code>, затем
|
||||
<code class="text-xs">store</code> и <code class="text-xs">jobs</code> в checks.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
<Alert>
|
||||
<Bird class="size-4" />
|
||||
<AlertTitle>Низкий ratio BGP</AlertTitle>
|
||||
<AlertDescription>
|
||||
Проверьте <code class="text-xs">/v1/bird/status</code>, затем состояние пиров в
|
||||
<Button variant="link" class="h-auto p-0" href={resolve('/network')}>Сети</Button>.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
<Alert>
|
||||
<ListTodo class="size-4" />
|
||||
<AlertTitle>Ошибки задач</AlertTitle>
|
||||
<AlertDescription>
|
||||
Откройте
|
||||
<Button variant="link" class="h-auto p-0" href={resolve('/operations')}
|
||||
>Операции</Button
|
||||
>
|
||||
и проверьте последние неуспешные jobs.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
</CardContent>
|
||||
</Card>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user