Files
rust-xmpp/.github/workflows/ci.yml
T
wt e9329ccbb2
Test, build and publish / All tests and Linux binary (push) Failing after 23s
Test, build and publish / Container smoke test and Gitea publish (push) Skipped
- Исправлена задержка доставки MUC с растущим архивом: после каждого
сообщения
  больше не выполняется полный scan/rewrite архива для expiry. Очистка
  остаётся
  в maintenance и перед MAM-запросами; append и crash checkpoint до
  fanout сохранены.
- Неизменённые native config/persistent index не перезаписываются при
  каждом
  сообщении. Удалённые файлы восстанавливаются, ошибки экспорта
  повторяются.
- CSI больше не сохраняет SM snapshot при отсутствии изменения durable
  очереди.
  Изменённая очередь сохраняется до отправки; при ошибке записи очередь
  откатывается.
- Личные сообщения, IQ и входящая федерация к аккаунтам больше не
  захватывают
  общий MUC mutex, ожидая несвязанную работу с комнатными архивами.
- Добавлены регрессии native exports/archive scanning/CSI rollback и
  реальный
  TLS latency check в verify-local.sh, автоматически включённый и в CI.

Измерения и границы подтверждения:
[docs/MESSAGE-LATENCY.md](docs/MESSAGE-LATENCY.md).
Результаты итогового прогона:
[docs/VALIDATION-0.8.1.md](docs/VALIDATION-0.8.1.md).

- Личные сообщения и SM ACK больше не ждут сетевую отправку push.
  Уведомления
  отправляются через очередь1024 с максимум8параллельных маршрутов;
  worker
  и его задачи отменяются при завершении serve. Ошибки очереди/маршрута
  логируются.
- Offline сообщение сохраняется до публикации push, чтобы проснувшийся
  клиент
  мог сразу получить его. Подтверждена очередь при первом TLS stream
  push gateway.
- По умолчанию CSI считает важными bodyless OMEMO legacy/2, delivery
  receipts
  и chat markers. Явный список `csi_important_payloads` заменяет
  расширенные defaults.
  Низкоприоритетный headline по-прежнему буферизуется. Policy
  обновляется и при SM resume.
- Выбор адресатов и carbons фильтрует владельцев до захвата session
  mutex;
  зависшая сессия чужого аккаунта не задерживает этот путь. Duplicate SM
  ACK
  без изменения durable counters/queue не переписывает snapshot.
- Bind2 и MAM metadata IQ читают только первый/последний native record
  вместо
  сканирования всей истории. Индекс не требуется; recovery/лимиты записи
  сохранены.
- Добавлен `message-processing-slow`: обработка message дольше250мс,
  поля
  duration_ms/route, без payload/токенов. Это время обработки сервером,
  не peer receipt.
- Новые сетевые регрессии включены в verify-local.sh/GitHub CI.

Причины, изменение CSI policy, измерения и ограничения:
[docs/PERSONAL-MESSAGE-LATENCY.md](docs/PERSONAL-MESSAGE-LATENCY.md).
2026-10-21 11:20:09 +07:00

156 lines
5.6 KiB
YAML

name: Test, build and publish
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_INCREMENTAL: '0'
CARGO_PROFILE_DEV_DEBUG: '0'
CARGO_PROFILE_TEST_DEBUG: '0'
RUST_BACKTRACE: '1'
jobs:
verify:
name: All tests and Linux binary
runs-on: ubuntu-24.04
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install native test dependencies and make room for 10 GiB tests
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential pkg-config libssl-dev libicu-dev lua5.4 liblua5.4-dev lua-filesystem lua-expat lua-socket lua-sec openssl
rust_version=$(python3 -c 'import tomllib; print(tomllib.load(open("rust-toolchain.toml", "rb"))["toolchain"]["channel"])')
rustup toolchain install "$rust_version" --profile minimal --component rustfmt --component clippy
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/setup-go@v5
with:
go-version: '1.24.3'
cache: false
- name: Build exact native Prosody reference
run: bash scripts/ci/prepare-reference.sh "$RUNNER_TEMP/reference"
- name: Build genuine MinIO
run: |
bash scripts/ci/prepare-minio.sh "$RUNNER_TEMP/minio"
go clean -cache -modcache
df -h . "$RUNNER_TEMP"
python3 -c 'import shutil; assert shutil.disk_usage(".").free >= 20 * 2**30, "Need 20 GiB free for actual upload tests"'
- name: Run every test, native oracle, load and real 10 GiB uploads
env:
PROSODY_REFERENCE_SOURCE: ${{ runner.temp }}/reference/prosody-cafd74b9c5ea
PROSODY_REFERENCE_LUA: lua5.4
MINIO_BINARY: ${{ runner.temp }}/minio
run: |
mkdir -p ci-results
set -o pipefail
bash scripts/ci/verify-all.sh 2>&1 | tee ci-results/verify.log
- name: Package tested binary
run: |
mkdir -p dist
cp target/release/rust-xmpp dist/rust-xmpp
chmod 0755 dist/rust-xmpp
dist/rust-xmpp --version
(cd dist && sha256sum rust-xmpp > SHA256SUMS)
- name: Save binary
uses: actions/upload-artifact@v4
with:
name: rust-xmpp-linux-amd64
path: dist/
if-no-files-found: error
retention-days: 30
- name: Save test reports even on failure
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
ci-results/
/tmp/muc-sm-load.json
/tmp/xmpp-message-latency.json
/tmp/personal-message-latency.json
/tmp/push-latency.json
/tmp/push-offline-latency.json
/tmp/bind2-archive-latency.json
if-no-files-found: warn
retention-days: 14
image:
name: Container smoke test and Gitea publish
needs: verify
runs-on: ubuntu-24.04
timeout-minutes: 20
# Only the publication job needs registry credentials. PRs still build and test images.
env:
GITEA_REGISTRY: ${{ vars.GITEA_REGISTRY }}
GITEA_IMAGE: ${{ vars.GITEA_IMAGE }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
PUBLISH: ${{ github.event_name != 'pull_request' && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/v')) }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/download-artifact@v4
with:
name: rust-xmpp-linux-amd64
path: dist
- name: Verify downloaded executable
run: |
(cd dist && sha256sum --check SHA256SUMS)
chmod 0755 dist/rust-xmpp
- uses: docker/setup-buildx-action@v3
- name: Build exact tested binary into runtime image
uses: docker/build-push-action@v6
with:
context: .
target: ci-runtime
platforms: linux/amd64
load: true
push: false
tags: rust-xmpp:ci
- name: Smoke-test runtime image
run: |
docker run --rm rust-xmpp:ci --version
docker run --rm --entrypoint /usr/local/bin/prosodyctl rust-xmpp:ci --version
id=$(docker create rust-xmpp:ci)
trap 'docker rm "$id" >/dev/null' EXIT
docker cp "$id:/usr/local/bin/rust-xmpp" /tmp/container-rust-xmpp
cmp dist/rust-xmpp /tmp/container-rust-xmpp
- name: Validate publication configuration
if: env.PUBLISH == 'true'
env:
REGISTRY_USER: ${{ secrets.GITEA_REGISTRY_USERNAME }}
REGISTRY_TOKEN: ${{ secrets.GITEA_REGISTRY_TOKEN }}
run: python3 scripts/ci/image-tags.py
id: image
- name: Login to private Gitea registry
if: env.PUBLISH == 'true'
uses: docker/login-action@v3
with:
registry: ${{ vars.GITEA_REGISTRY }}
username: ${{ secrets.GITEA_REGISTRY_USERNAME }}
password: ${{ secrets.GITEA_REGISTRY_TOKEN }}
- name: Push the smoke-tested image
if: env.PUBLISH == 'true'
env:
IMAGE_TAGS: ${{ steps.image.outputs.tags }}
run: |
while IFS= read -r tag; do
docker tag rust-xmpp:ci "$tag"
docker push "$tag"
printf 'Published `%s`\n' "$tag" >> "$GITHUB_STEP_SUMMARY"
done <<< "$IMAGE_TAGS"