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
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ updates:
schedule:
interval: "weekly"
open-pull-requests-limit: 5
ignore:
- dependency-name: "eslint"
update-types:
- "version-update:semver-major"
- dependency-name: "@eslint/js"
update-types:
- "version-update:semver-major"
groups:
frontend-dependencies:
patterns:
Expand Down
1 change: 0 additions & 1 deletion SESSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ docker inspect newsletter-maker-django-1 --format '{{json .Mounts}}'
pytest core/tests/test_embeddings.py -q
ruff check core/management/commands/seed_demo.py core/tests/test_embeddings.py
```

Binary file removed celerybeat-schedule
Binary file not shown.
27 changes: 15 additions & 12 deletions core/management/commands/seed_demo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from datetime import timedelta
from typing import Any
from typing import Any, cast

from django.conf import settings
from django.contrib.auth import get_user_model
Expand Down Expand Up @@ -578,14 +578,15 @@ def _seed_entities(self, tenant: Tenant) -> dict[str, Entity]:
def _seed_source_configs(self, tenant: Tenant) -> int:
now = timezone.now()
for spec in SOURCE_CONFIG_SPECS:
hours_ago = cast(int | None, spec["hours_ago"])
last_fetched_at = None
if spec["hours_ago"] is not None:
last_fetched_at = now - timedelta(hours=spec["hours_ago"])
if hours_ago is not None:
last_fetched_at = now - timedelta(hours=hours_ago)
SourceConfig.objects.create(
tenant=tenant,
plugin_name=spec["plugin_name"],
plugin_name=cast(str, spec["plugin_name"]),
config=spec["config"],
is_active=spec["is_active"],
is_active=cast(bool, spec["is_active"]),
last_fetched_at=last_fetched_at,
)
return len(SOURCE_CONFIG_SPECS)
Expand Down Expand Up @@ -829,16 +830,18 @@ def _seed_ingestion_runs(self, tenant: Tenant) -> int:
]
now = timezone.now()
for spec in run_specs:
started_hours_ago = cast(int, spec["started_hours_ago"])
duration_minutes = cast(int, spec["duration_minutes"])
run = IngestionRun.objects.create(
tenant=tenant,
plugin_name=spec["plugin_name"],
status=spec["status"],
items_fetched=spec["items_fetched"],
items_ingested=spec["items_ingested"],
error_message=spec["error_message"],
plugin_name=cast(str, spec["plugin_name"]),
status=cast(str, spec["status"]),
items_fetched=cast(int, spec["items_fetched"]),
items_ingested=cast(int, spec["items_ingested"]),
error_message=cast(str, spec["error_message"]),
)
run.started_at = now - timedelta(hours=spec["started_hours_ago"])
run.completed_at = run.started_at + timedelta(minutes=spec["duration_minutes"])
run.started_at = now - timedelta(hours=started_hours_ago)
run.completed_at = run.started_at + timedelta(minutes=duration_minutes)
run.save(update_fields=["started_at", "completed_at"])
return len(run_specs)

Expand Down
18 changes: 16 additions & 2 deletions core/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@
from django.contrib.admin.sites import AdminSite
from django.utils import timezone

from core.admin import ContentAdmin, IngestionRunAdmin, ReviewQueueAdmin, SourceConfigAdmin
from core.models import Content, IngestionRun, ReviewQueue, ReviewReason, RunStatus, SourceConfig, SourcePluginName, Tenant
from core.admin import (
ContentAdmin,
IngestionRunAdmin,
ReviewQueueAdmin,
SourceConfigAdmin,
)
from core.models import (
Content,
IngestionRun,
ReviewQueue,
ReviewReason,
RunStatus,
SourceConfig,
SourcePluginName,
Tenant,
)

pytestmark = pytest.mark.django_db

Expand Down
40 changes: 0 additions & 40 deletions docs/GENRES.md

This file was deleted.

148 changes: 0 additions & 148 deletions docs/OLLAMA.md

This file was deleted.

Loading
Loading