Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

!opengaterag/
!opengaterag/api/**
!scripts/
!scripts/**
!.github/
!pyproject.toml
!config.example.yml
Expand Down
9 changes: 9 additions & 0 deletions .github/.trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# perl-archive-tar: perl-archive-tar: Path traversal via
# crafted symlinks allows arbitrary file access
# https://avd.aquasec.com/nvd/cve-2026-42496
CVE-2026-42496 exp:2026-09-01

# perl: Perl: Heap buffer overflow when compiling regular
# expressions on 32-bit builds...
# https://avd.aquasec.com/nvd/cve-2026-8376
CVE-2026-8376 exp:2026-09-01
2 changes: 1 addition & 1 deletion .github/badges/coverage.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"schemaVersion":1,"label":"coverage","message":"55.92%","color":"red"}
{"schemaVersion":1,"label":"coverage","message":"73.96%","color":"red"}
2 changes: 1 addition & 1 deletion .github/tests/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
environment:
- ALBERT_ADMIN_API_KEY=${ALBERT_ADMIN_API_KEY}
volumes:
- ".github/tests/config.yml:/config.yml:ro"
- "./config.opengatellm.yml:/config.yml:ro"
healthcheck:
test: [ "CMD-SHELL", "curl -sf http://localhost:8000/health || exit 1" ]
interval: 4s
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -------------------------------- dependencies ---------------------------------
dependencies:
postgres:
url: postgresql+asyncpg://postgres:changeme@localhost:5432/postgres
url: postgresql+asyncpg://postgres:changeme@postgres:5432/postgres
echo: False
pool_size: 10
max_overflow: 5
Expand All @@ -14,7 +14,7 @@ dependencies:
command_timeout: 60

redis:
url: redis://:changeme@localhost:6379
url: redis://:changeme@redis:6379
max_connections: 200
socket_connect_timeout: 5
retry_on_timeout: True
Expand All @@ -27,25 +27,24 @@ dependencies:
number_of_shards: 1
number_of_replicas: 1
refresh_interval: 1s
hosts: http://localhost:9200
hosts: http://elasticsearch:9200
basic_auth:
- elasticsearch
- elastic
- changeme

# ---------------------------------- settings -----------------------------------
settings:
vector_store_model: BAAI/bge-m3
vector_store_model: openweight-embeddings

# ----------------------------------- models ------------------------------------
models:
- name: BAAI/bge-m3
- name: openweight-embeddings
type: text-embeddings-inference
aliases: ["openweight-embedding"]
cost_prompt_tokens: 10
cost_completion_tokens: 30
providers:
- type: albert
key: ${ALBERT_API_ADMIN_KEY}
key: ${ALBERT_ADMIN_API_KEY}
timeout: 120
model_name: BAAI/bge-m3
model_total_params: 8
Expand Down
31 changes: 31 additions & 0 deletions .github/tests/e2e/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@
from opengaterag.api.utils.configuration import configuration


def refresh_elasticsearch_index() -> None:
"""Force Elasticsearch to make recently indexed chunks visible to search."""

async def _refresh() -> None:
kwargs = configuration.dependencies.elasticsearch.model_dump()
index_name = kwargs.pop("index_name")
kwargs.pop("index_language")
kwargs.pop("number_of_shards")
kwargs.pop("number_of_replicas")
kwargs.pop("refresh_interval")
client = AsyncElasticsearch(**kwargs)
try:
await client.indices.refresh(index=index_name)
finally:
await client.close()

asyncio.run(_refresh())


class AuthenticatedTestClient:
"""Wrap a shared TestClient and inject auth headers per request."""

Expand Down Expand Up @@ -98,3 +117,15 @@ def admin_client(test_client: TestClient) -> AuthenticatedTestClient:
"""Test client authenticated as an admin user."""
api_key = _validate_opengatellm_api_key("OPENGATELLM_ADMIN_API_KEY", "admin")
return AuthenticatedTestClient(client=test_client, api_key=api_key)


@pytest.fixture(scope="function")
def es_refresh():
"""
Callable fixture: call `es_refresh()` after writes so searches see fresh data.

We return the callable (instead of auto-refresh) so tests can refresh exactly
after indexing (documents/chunks) and avoid timing-based sleeps.
"""

return refresh_elasticsearch_index
Loading
Loading