Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move webhooks folder outside api folder #5493

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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from argilla_server.database import get_async_db
from argilla_server.api.policies.v1 import WebhookPolicy, authorize
from argilla_server.api.webhooks.v1.ping import notify_ping_event
from argilla_server.webhooks.v1.ping import notify_ping_event
from argilla_server.security import auth
from argilla_server.models import User
from argilla_server.api.schemas.v1.webhooks import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from typing import List, Optional
from uuid import UUID

from argilla_server.api.webhooks.v1.enums import WebhookEvent
from argilla_server.webhooks.v1.enums import WebhookEvent
from argilla_server.api.schemas.v1.commons import UpdateSchema
from argilla_server.pydantic_v1 import BaseModel, Field, HttpUrl

Expand Down
4 changes: 2 additions & 2 deletions argilla-server/src/argilla_server/bulk/records_bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
)
from argilla_server.api.schemas.v1.responses import UserResponseCreate
from argilla_server.api.schemas.v1.suggestions import SuggestionCreate
from argilla_server.api.webhooks.v1.enums import RecordEvent
from argilla_server.api.webhooks.v1.records import notify_record_event as notify_record_event_v1
from argilla_server.webhooks.v1.enums import RecordEvent
from argilla_server.webhooks.v1.records import notify_record_event as notify_record_event_v1
from argilla_server.contexts import distribution
from argilla_server.contexts.accounts import fetch_users_by_ids_as_dict
from argilla_server.contexts.records import (
Expand Down
8 changes: 4 additions & 4 deletions argilla-server/src/argilla_server/contexts/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
VectorSettingsCreate,
)
from argilla_server.api.schemas.v1.vectors import Vector as VectorSchema
from argilla_server.api.webhooks.v1.enums import DatasetEvent, ResponseEvent, RecordEvent
from argilla_server.api.webhooks.v1.records import notify_record_event as notify_record_event_v1
from argilla_server.api.webhooks.v1.responses import notify_response_event as notify_response_event_v1
from argilla_server.api.webhooks.v1.datasets import notify_dataset_event as notify_dataset_event_v1
from argilla_server.webhooks.v1.enums import DatasetEvent, ResponseEvent, RecordEvent
from argilla_server.webhooks.v1.records import notify_record_event as notify_record_event_v1
from argilla_server.webhooks.v1.responses import notify_response_event as notify_response_event_v1
from argilla_server.webhooks.v1.datasets import notify_dataset_event as notify_dataset_event_v1
from argilla_server.contexts import accounts, distribution
from argilla_server.database import get_async_db
from argilla_server.enums import DatasetStatus, UserRole, RecordStatus
Expand Down
4 changes: 2 additions & 2 deletions argilla-server/src/argilla_server/contexts/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
from sqlalchemy.orm import selectinload
from sqlalchemy.ext.asyncio import AsyncSession

from argilla_server.api.webhooks.v1.enums import RecordEvent
from argilla_server.api.webhooks.v1.records import notify_record_event as notify_record_event_v1
from argilla_server.webhooks.v1.enums import RecordEvent
from argilla_server.webhooks.v1.records import notify_record_event as notify_record_event_v1
from argilla_server.enums import DatasetDistributionStrategy, RecordStatus
from argilla_server.models import Record
from argilla_server.search_engine.base import SearchEngine
Expand Down
2 changes: 1 addition & 1 deletion argilla-server/src/argilla_server/jobs/webhook_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from sqlalchemy.ext.asyncio import AsyncSession
from fastapi.encoders import jsonable_encoder

from argilla_server.api.webhooks.v1.commons import notify_event
from argilla_server.webhooks.v1.commons import notify_event
from argilla_server.database import AsyncSessionLocal
from argilla_server.jobs.queues import HIGH_QUEUE
from argilla_server.contexts import webhooks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

from argilla_server.models import Dataset
from argilla_server.jobs.webhook_jobs import enqueue_notify_events
from argilla_server.api.webhooks.v1.schemas import DatasetEventSchema
from argilla_server.api.webhooks.v1.enums import DatasetEvent
from argilla_server.webhooks.v1.schemas import DatasetEventSchema
from argilla_server.webhooks.v1.enums import DatasetEvent


async def notify_dataset_event(db: AsyncSession, dataset_event: DatasetEvent, dataset: Dataset) -> List[Job]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

from argilla_server.models import Webhook
from argilla_server.contexts import info
from argilla_server.api.webhooks.v1.commons import notify_event
from argilla_server.api.webhooks.v1.enums import WebhookEvent
from argilla_server.webhooks.v1.commons import notify_event
from argilla_server.webhooks.v1.enums import WebhookEvent


def notify_ping_event(webhook: Webhook) -> httpx.Response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import selectinload

from argilla_server.api.webhooks.v1.enums import RecordEvent
from argilla_server.api.webhooks.v1.schemas import RecordEventSchema
from argilla_server.webhooks.v1.enums import RecordEvent
from argilla_server.webhooks.v1.schemas import RecordEventSchema
from argilla_server.jobs.webhook_jobs import enqueue_notify_events
from argilla_server.models import Record, Dataset

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

from argilla_server.models import Response, Record, Dataset
from argilla_server.jobs.webhook_jobs import enqueue_notify_events
from argilla_server.api.webhooks.v1.schemas import ResponseEventSchema
from argilla_server.api.webhooks.v1.enums import ResponseEvent
from argilla_server.webhooks.v1.schemas import ResponseEventSchema
from argilla_server.webhooks.v1.enums import ResponseEvent


async def notify_response_event(db: AsyncSession, response_event: ResponseEvent, response: Response) -> List[Job]:
Expand Down
2 changes: 1 addition & 1 deletion argilla-server/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from sqlalchemy.ext.asyncio import async_object_session

from argilla_server.enums import DatasetDistributionStrategy, FieldType, MetadataPropertyType, OptionsOrder
from argilla_server.api.webhooks.v1.enums import WebhookEvent
from argilla_server.webhooks.v1.enums import WebhookEvent
from argilla_server.models import (
Dataset,
Field,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from sqlalchemy import func, select
from sqlalchemy.ext.asyncio import AsyncSession

from argilla_server.api.webhooks.v1.enums import WebhookEvent
from argilla_server.webhooks.v1.enums import WebhookEvent
from argilla_server.models import Webhook
from argilla_server.constants import API_KEY_HEADER_NAME

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from sqlalchemy import func, select
from sqlalchemy.ext.asyncio import AsyncSession

from argilla_server.api.webhooks.v1.enums import WebhookEvent
from argilla_server.webhooks.v1.enums import WebhookEvent
from argilla_server.models import Webhook
from argilla_server.constants import API_KEY_HEADER_NAME

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from httpx import AsyncClient

from argilla_server.api.webhooks.v1.enums import WebhookEvent
from argilla_server.webhooks.v1.enums import WebhookEvent
from argilla_server.constants import API_KEY_HEADER_NAME

from tests.factories import AdminFactory, AnnotatorFactory, WebhookFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from httpx import AsyncClient
from typing import Any

from argilla_server.api.webhooks.v1.enums import WebhookEvent
from argilla_server.webhooks.v1.enums import WebhookEvent
from argilla_server.constants import API_KEY_HEADER_NAME

from tests.factories import AdminFactory, AnnotatorFactory, WebhookFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from httpx import Response
from standardwebhooks.webhooks import Webhook

from argilla_server.api.webhooks.v1.enums import WebhookEvent
from argilla_server.api.webhooks.v1.ping import notify_ping_event
from argilla_server.webhooks.v1.enums import WebhookEvent
from argilla_server.webhooks.v1.ping import notify_ping_event
from argilla_server.contexts import info

from tests.factories import WebhookFactory
Expand Down
Loading