remove unused Event generation from the pre-2.0.0 SignalR integration (#477)

Remove a vestige of the adhoc events used by the previous SingalR integration for container updates.
This commit is contained in:
bmc-msft
2021-01-28 16:56:31 -05:00
committed by GitHub
parent f155ad625f
commit 14fc1ca51f
2 changed files with 4 additions and 28 deletions

View File

@ -4,7 +4,7 @@
# Licensed under the MIT License. # Licensed under the MIT License.
import logging import logging
from typing import Dict, List, Optional, Sequence, Tuple from typing import List, Optional, Sequence, Tuple
from uuid import UUID from uuid import UUID
from memoization import cached from memoization import cached
@ -19,13 +19,9 @@ from onefuzztypes.models import (
Result, Result,
TeamsTemplate, TeamsTemplate,
) )
from onefuzztypes.primitives import Container, Event from onefuzztypes.primitives import Container
from ..azure.containers import ( from ..azure.containers import container_exists, get_file_sas_url
container_exists,
get_container_metadata,
get_file_sas_url,
)
from ..azure.queue import send_message from ..azure.queue import send_message
from ..azure.storage import StorageType from ..azure.storage import StorageType
from ..events import send_event from ..events import send_event
@ -105,25 +101,8 @@ def get_queue_tasks() -> Sequence[Tuple[Task, Sequence[str]]]:
return results return results
@cached(ttl=60)
def container_metadata(container: Container) -> Optional[Dict[str, str]]:
return get_container_metadata(container, StorageType.corpus)
def new_files(container: Container, filename: str) -> None: def new_files(container: Container, filename: str) -> None:
results: Dict[str, Event] = {"container": container, "file": filename}
metadata = container_metadata(container)
if metadata:
results["metadata"] = metadata
report = get_report(container, filename) report = get_report(container, filename)
if report:
results["executable"] = report.executable
results["crash_type"] = report.crash_type
results["crash_site"] = report.crash_site
results["job_id"] = report.job_id
results["task_id"] = report.task_id
notifications = get_notifications(container) notifications = get_notifications(container)
if notifications: if notifications:

View File

@ -3,14 +3,11 @@
# Copyright (c) Microsoft Corporation. # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License. # Licensed under the MIT License.
from enum import Enum from typing import Any, Dict, NewType
from typing import Any, Dict, NewType, Union
from uuid import UUID
from onefuzztypes.validators import check_alnum, check_alnum_dash from onefuzztypes.validators import check_alnum, check_alnum_dash
Extension = Dict[str, Any] Extension = Dict[str, Any]
Event = Union[str, int, UUID, Enum, Dict[str, str]]
Directory = NewType("Directory", str) Directory = NewType("Directory", str)
File = NewType("File", str) File = NewType("File", str)