Files
crank/scripts/README.md
T
github-ops 81efa2f0fb
Deploy / deploy (push) Successful in 29s
CI / Rust Checks (push) Failing after 4m51s
CI / UI Checks (push) Has been skipped
CI / Frontend E2E (push) Has been skipped
CI / Deployment Manifests (push) Has been skipped
Enforce Rust code health gate
2026-06-20 20:53:46 +00:00

113 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Scripts
## `staging-smoke.sh`
Post-deploy smoke helper для staging/production-like окружений.
```bash
./scripts/staging-smoke.sh https://crank.example.com
```
## `authenticated-staging-smoke.sh`
Browser-authenticated smoke helper.
Обязательные переменные:
- `CRANK_STAGING_ADMIN_EMAIL`
- `CRANK_STAGING_ADMIN_PASSWORD`
```bash
CRANK_STAGING_ADMIN_EMAIL=owner@example.com \
CRANK_STAGING_ADMIN_PASSWORD=secret \
./scripts/authenticated-staging-smoke.sh https://crank.example.com
```
## `authenticated-product-smoke.sh`
Authenticated product smoke helper. Создает временную REST operation на
внутренний `admin-api` health endpoint, публикует агента, выпускает API-ключ и
проверяет MCP `tools/list` / `tools/call`. Внешние публичные API не используются.
Обязательные переменные:
- `CRANK_STAGING_ADMIN_EMAIL`
- `CRANK_STAGING_ADMIN_PASSWORD`
```bash
CRANK_STAGING_ADMIN_EMAIL=owner@example.com \
CRANK_STAGING_ADMIN_PASSWORD=secret \
./scripts/authenticated-product-smoke.sh https://crank.example.com
```
По умолчанию временные сущности удаляются после успешной проверки. Для отладки
можно оставить их в workspace:
```bash
CRANK_PRODUCT_SMOKE_KEEP_ASSETS=1 ./scripts/authenticated-product-smoke.sh https://crank.example.com
```
## `staging-note-block.sh`
Генерирует markdown-блок для `docs/staging-regression-notes.md` после реального
staging pass.
```bash
./scripts/staging-note-block.sh crank.example.com abc1234 "operator" partial
```
## `load-openbao-env.sh`
Логинится в OpenBao через AppRole и выгружает deploy/runtime secrets в локальный
shell env file.
Обязательные переменные:
- `BAO_ADDR`
- `BAO_ROLE_ID`
- `BAO_SECRET_ID`
- `OPENBAO_APP`
Опционально:
- `OPENBAO_ENV_FILE`, default `.openbao-env`
Скрипт читает KV v2 secrets из mount `ci`:
- `shared/registry`
- `shared/deploy-ssh`
- `projects/${OPENBAO_APP}/deploy`
- `projects/${OPENBAO_APP}/runtime`
Также он создает workflow-compatible aliases:
- `REGISTRY_USERNAME -> DEPLOY_REGISTRY_USER`
- `REGISTRY_PASSWORD -> DEPLOY_REGISTRY_TOKEN`
## `check-rust-code-health.sh`
Проверяет базовые правила сопровождаемости Rust-кода:
- новые `.rs` файлы не больше 1000 строк;
- существующие крупные файлы не должны расти сверх текущего baseline;
- крупные inline test modules запрещены вне legacy allowlist.
```bash
./scripts/check-rust-code-health.sh
```
## `check-community-scope.sh`
Проверяет, что в community-репозиторий не попали функции и тексты за пределами
REST -> MCP сценария.
```bash
./scripts/check-community-scope.sh
```
Unit-тесты checker-а лежат в `tests/unit`:
```bash
python3 -m unittest discover -s tests/unit
```