Files
AFFiNE-Mirror/.github/actions/server-test-env/action.yml
T
DarkSky b530198a3b feat(server): improve indexer perf (#15512)
#### PR Dependency Tree


* **PR #15512** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Search now supports generation-based indexing with embedded and remote
providers.
* Added automatic search reconciliation and improved handling of
document, workspace, and permission changes.
* Added clearer search status errors for unavailable, syncing, unready,
or failed indexes.
* Added Manticore Search end-to-end support and provider-specific search
behavior.

* **Improvements**
* Search and aggregate pagination now report returned results and
continuation status more accurately.
* Improved permission filtering to prevent inaccessible documents from
appearing in results.
  * Admin provider selection now consistently enables indexing.

* **Documentation**
* Clarified search pagination, aggregation counts, provider
configuration, and end-to-end setup.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-23 17:54:49 +08:00

58 lines
2.0 KiB
YAML

name: 'Prepare Server Test Environment'
description: 'Prepare Server Test Environment'
inputs:
indexer-provider:
description: 'Search provider used by the server test runtime'
required: false
default: embedded
runs:
using: 'composite'
steps:
- name: Initialize database
shell: bash
run: |
psql -h localhost -U postgres -c "CREATE DATABASE affine;"
psql -h localhost -U postgres -c "CREATE USER affine WITH PASSWORD 'affine';"
psql -h localhost -U postgres -c "ALTER USER affine WITH SUPERUSER;"
env:
PGPASSWORD: affine
- name: Run init-db script
shell: bash
env:
NODE_ENV: test
run: |
yarn affine @affine/server prisma generate
yarn affine @affine/server data-migration admit-legacy-context-blobs
yarn affine @affine/server prisma migrate deploy
yarn affine @affine/server data-migration run
- name: Import config
shell: bash
run: |
case '${{ inputs.indexer-provider }}' in
disabled)
default_indexer='{"enabled":false,"provider":{"type":"embedded","endpoint":""}}'
;;
embedded)
default_indexer='{"enabled":true,"provider":{"type":"embedded","endpoint":""}}'
;;
elasticsearch)
default_indexer='{"enabled":true,"provider":{"type":"elasticsearch","endpoint":"http://localhost:9200"}}'
;;
manticoresearch)
default_indexer='{"enabled":true,"provider":{"type":"manticoresearch","endpoint":"http://localhost:9308"}}'
;;
*)
echo "Unsupported test indexer provider: ${{ inputs.indexer-provider }}" >&2
exit 1
;;
esac
if [[ -n "${SERVER_CONFIG:-}" ]]; then
jq --argjson indexer "$default_indexer" '.indexer = $indexer' <<<"$SERVER_CONFIG" > ./packages/backend/server/config.json
else
jq -n --argjson indexer "$default_indexer" '{indexer: $indexer}' > ./packages/backend/server/config.json
fi