This commit is contained in:
Marco Castelluccio 2023-04-17 12:24:19 +02:00
Родитель c639683af5
Коммит 788f525ee2
50 изменённых файлов: 165 добавлений и 229 удалений

Просмотреть файл

@ -1,4 +1,3 @@
[settings]
profile = black
known_first_party = code_review_backend,code_review_bot,code_review_tools,code_review_events,conftest
force_single_line = True
line_length=159

Просмотреть файл

@ -6,8 +6,7 @@
from django.conf import settings
from django.contrib import admin
from django.shortcuts import redirect
from django.urls import include
from django.urls import path
from django.urls import include, path
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions

Просмотреть файл

@ -5,10 +5,7 @@
from django.contrib import admin
from code_review_backend.issues.models import Diff
from code_review_backend.issues.models import Issue
from code_review_backend.issues.models import Repository
from code_review_backend.issues.models import Revision
from code_review_backend.issues.models import Diff, Issue, Repository, Revision
class RepositoryAdmin(admin.ModelAdmin):

Просмотреть файл

@ -4,43 +4,39 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from collections import defaultdict
from datetime import date
from datetime import datetime
from datetime import timedelta
from datetime import date, datetime, timedelta
from django.conf import settings
from django.db import transaction
from django.db.models import Count
from django.db.models import Prefetch
from django.db.models import Q
from django.db.models import Count, Prefetch, Q
from django.db.models.functions import TruncDate
from django.shortcuts import get_object_or_404
from django.urls import path
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from rest_framework import generics
from rest_framework import mixins
from rest_framework import routers
from rest_framework import viewsets
from rest_framework.exceptions import APIException
from rest_framework.exceptions import ValidationError
from rest_framework import generics, mixins, routers, viewsets
from rest_framework.exceptions import APIException, ValidationError
from code_review_backend.issues.compare import detect_new_for_revision
from code_review_backend.issues.models import LEVEL_ERROR
from code_review_backend.issues.models import Diff
from code_review_backend.issues.models import Issue
from code_review_backend.issues.models import IssueLink
from code_review_backend.issues.models import Repository
from code_review_backend.issues.models import Revision
from code_review_backend.issues.serializers import DiffFullSerializer
from code_review_backend.issues.serializers import DiffSerializer
from code_review_backend.issues.serializers import HistoryPointSerializer
from code_review_backend.issues.serializers import IssueBulkSerializer
from code_review_backend.issues.serializers import IssueCheckSerializer
from code_review_backend.issues.serializers import IssueCheckStatsSerializer
from code_review_backend.issues.serializers import IssueSerializer
from code_review_backend.issues.serializers import RepositorySerializer
from code_review_backend.issues.serializers import RevisionSerializer
from code_review_backend.issues.models import (
LEVEL_ERROR,
Diff,
Issue,
IssueLink,
Repository,
Revision,
)
from code_review_backend.issues.serializers import (
DiffFullSerializer,
DiffSerializer,
HistoryPointSerializer,
IssueBulkSerializer,
IssueCheckSerializer,
IssueCheckStatsSerializer,
IssueSerializer,
RepositorySerializer,
RevisionSerializer,
)
class CachedView(object):

Просмотреть файл

@ -2,8 +2,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from code_review_backend.issues.models import Diff
from code_review_backend.issues.models import IssueLink
from code_review_backend.issues.models import Diff, IssueLink
def detect_new_for_revision(diff: Diff, path: str, hash: str) -> bool:

Просмотреть файл

@ -9,8 +9,7 @@ from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from code_review_backend.issues.models import Issue
from code_review_backend.issues.models import Revision
from code_review_backend.issues.models import Issue, Revision
logging.basicConfig(level=logging.INFO)

Просмотреть файл

@ -11,8 +11,7 @@ from django import db
from django.core.management.base import BaseCommand
from parsepatch.patch import Patch
from code_review_backend.issues.models import Diff
from code_review_backend.issues.models import Issue
from code_review_backend.issues.models import Diff, Issue
logging.basicConfig(level=logging.INFO)

Просмотреть файл

@ -14,9 +14,7 @@ from django.db import transaction
from requests.exceptions import HTTPError
from code_review_backend.issues.compare import detect_new_for_revision
from code_review_backend.issues.models import Issue
from code_review_backend.issues.models import IssueLink
from code_review_backend.issues.models import Repository
from code_review_backend.issues.models import Issue, IssueLink, Repository
logger = logging.getLogger(__name__)

Просмотреть файл

@ -8,8 +8,7 @@
import uuid
import django.db.models.deletion
from django.db import migrations
from django.db import models
from django.db import migrations, models
class Migration(migrations.Migration):

Просмотреть файл

@ -5,8 +5,7 @@
# Generated by Django 2.2.6 on 2019-10-31 15:57
from django.db import migrations
from django.db import models
from django.db import migrations, models
from code_review_backend.issues.compare import detect_new_for_revision

Просмотреть файл

@ -6,8 +6,7 @@
# Generated by Django 2.2.6 on 2019-11-27 10:23
import django.db.models.deletion
from django.db import migrations
from django.db import models
from django.db import migrations, models
def _create_diff_repos(apps, schema_editor):

Просмотреть файл

@ -5,8 +5,7 @@
# Generated by Django 2.2.8 on 2020-01-06 10:19
from django.db import migrations
from django.db import models
from django.db import migrations, models
class Migration(migrations.Migration):

Просмотреть файл

@ -6,8 +6,7 @@
# Generated by Django 4.1.2 on 2022-12-07 16:59
import django.db.models.deletion
from django.db import migrations
from django.db import models
from django.db import migrations, models
def clean_unlinked_issue(apps, schema_editor):

Просмотреть файл

@ -4,13 +4,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import django.db.models.deletion
from django.db import migrations
from django.db import models
from django.db.models import Count
from django.db.models import F
from django.db.models import OuterRef
from django.db.models import Q
from django.db.models import Subquery
from django.db import migrations, models
from django.db.models import Count, F, OuterRef, Q, Subquery
def update_revisions(apps, schema_editor):

Просмотреть файл

@ -6,11 +6,13 @@
from django.db import transaction
from rest_framework import serializers
from code_review_backend.issues.models import Diff
from code_review_backend.issues.models import Issue
from code_review_backend.issues.models import IssueLink
from code_review_backend.issues.models import Repository
from code_review_backend.issues.models import Revision
from code_review_backend.issues.models import (
Diff,
Issue,
IssueLink,
Repository,
Revision,
)
class RepositorySerializer(serializers.ModelSerializer):

Просмотреть файл

@ -10,12 +10,14 @@ from django.core.management import call_command
from django.test import TestCase
from django.utils import timezone
from code_review_backend.issues.models import LEVEL_ERROR
from code_review_backend.issues.models import Diff
from code_review_backend.issues.models import Issue
from code_review_backend.issues.models import IssueLink
from code_review_backend.issues.models import Repository
from code_review_backend.issues.models import Revision
from code_review_backend.issues.models import (
LEVEL_ERROR,
Diff,
Issue,
IssueLink,
Repository,
Revision,
)
LOG_PREFIX = "INFO:code_review_backend.issues.management.commands.cleanup_issues:"

Просмотреть файл

@ -7,10 +7,7 @@ from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APITestCase
from code_review_backend.issues.models import Diff
from code_review_backend.issues.models import Issue
from code_review_backend.issues.models import Repository
from code_review_backend.issues.models import Revision
from code_review_backend.issues.models import Diff, Issue, Repository, Revision
class CreationAPITestCase(APITestCase):

Просмотреть файл

@ -11,9 +11,7 @@ from rest_framework import status
from rest_framework.test import APITestCase
from code_review_backend.issues.compare import detect_new_for_revision
from code_review_backend.issues.models import Diff
from code_review_backend.issues.models import Issue
from code_review_backend.issues.models import Repository
from code_review_backend.issues.models import Diff, Issue, Repository
class CompareAPITestCase(APITestCase):

Просмотреть файл

@ -10,8 +10,7 @@ from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APITestCase
from code_review_backend.issues.models import Diff
from code_review_backend.issues.models import Repository
from code_review_backend.issues.models import Diff, Repository
class DiffAPITestCase(APITestCase):

Просмотреть файл

@ -10,10 +10,12 @@ from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from code_review_backend.issues.models import LEVEL_ERROR
from code_review_backend.issues.models import LEVEL_WARNING
from code_review_backend.issues.models import Issue
from code_review_backend.issues.models import Repository
from code_review_backend.issues.models import (
LEVEL_ERROR,
LEVEL_WARNING,
Issue,
Repository,
)
class IssueTestCase(TestCase):

Просмотреть файл

@ -6,8 +6,7 @@
from django.conf import settings
from rest_framework.test import APITestCase
from code_review_backend.issues.models import Repository
from code_review_backend.issues.models import Revision
from code_review_backend.issues.models import Repository, Revision
class RevisionAPITestCase(APITestCase):

Просмотреть файл

@ -12,9 +12,7 @@ from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APITestCase
from code_review_backend.issues.models import Issue
from code_review_backend.issues.models import IssueLink
from code_review_backend.issues.models import Repository
from code_review_backend.issues.models import Issue, IssueLink, Repository
class StatsAPITestCase(APITestCase):

Просмотреть файл

@ -11,9 +11,7 @@ import os
import requests
import structlog
from libmozdata.phabricator import LintResult
from libmozdata.phabricator import UnitResult
from libmozdata.phabricator import UnitResultState
from libmozdata.phabricator import LintResult, UnitResult, UnitResultState
from taskcluster.helper import TaskclusterConfig
from code_review_bot.stats import InfluxDb

Просмотреть файл

@ -11,14 +11,14 @@ from pathlib import Path
import structlog
import yaml
from libmozdata.lando import LandoWarnings
from libmozdata.phabricator import BuildState
from libmozdata.phabricator import PhabricatorAPI
from libmozdata.phabricator import UnitResult
from libmozdata.phabricator import UnitResultState
from libmozdata.phabricator import (
BuildState,
PhabricatorAPI,
UnitResult,
UnitResultState,
)
from code_review_bot import AnalysisException
from code_review_bot import stats
from code_review_bot import taskcluster
from code_review_bot import AnalysisException, stats, taskcluster
from code_review_bot.config import settings
from code_review_bot.report import get_reporters
from code_review_bot.revisions import Revision

Просмотреть файл

@ -8,11 +8,9 @@ from typing import List
from urllib.parse import urljoin
import structlog
from libmozdata.phabricator import BuildState
from libmozdata.phabricator import PhabricatorAPI
from libmozdata.phabricator import BuildState, PhabricatorAPI
from code_review_bot import Issue
from code_review_bot import stats
from code_review_bot import Issue, stats
from code_review_bot.backend import BackendAPI
from code_review_bot.report.base import Reporter
from code_review_bot.tasks.clang_tidy_external import ExternalTidyIssue

Просмотреть файл

@ -13,13 +13,13 @@ import rs_parsepatch
import structlog
from libmozdata.phabricator import PhabricatorAPI
from code_review_bot import Issue
from code_review_bot import stats
from code_review_bot import taskcluster
from code_review_bot.config import REGEX_PHABRICATOR_COMMIT
from code_review_bot.config import REPO_AUTOLAND
from code_review_bot.config import REPO_MOZILLA_CENTRAL
from code_review_bot.config import settings
from code_review_bot import Issue, stats, taskcluster
from code_review_bot.config import (
REGEX_PHABRICATOR_COMMIT,
REPO_AUTOLAND,
REPO_MOZILLA_CENTRAL,
settings,
)
from code_review_bot.tasks.base import AnalysisTask
logger = structlog.get_logger(__name__)

Просмотреть файл

@ -3,8 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from abc import ABC
from abc import abstractmethod
from abc import ABC, abstractmethod
import structlog
import yaml

Просмотреть файл

@ -2,8 +2,7 @@
import rs_parsepatch
import structlog
from code_review_bot import Issue
from code_review_bot import Level
from code_review_bot import Issue, Level
from code_review_bot.config import settings
from code_review_bot.tasks.base import AnalysisTask

Просмотреть файл

@ -8,9 +8,7 @@ import re
import structlog
from code_review_bot import Issue
from code_review_bot import Level
from code_review_bot import Reliability
from code_review_bot import Issue, Level, Reliability
from code_review_bot.tasks.base import AnalysisTask
logger = structlog.get_logger(__name__)

Просмотреть файл

@ -8,10 +8,8 @@ import re
import structlog
from code_review_bot import Level
from code_review_bot import Reliability
from code_review_bot.tasks.clang_tidy import ClangTidyIssue
from code_review_bot.tasks.clang_tidy import ClangTidyTask
from code_review_bot import Level, Reliability
from code_review_bot.tasks.clang_tidy import ClangTidyIssue, ClangTidyTask
logger = structlog.get_logger(__name__)

Просмотреть файл

@ -3,8 +3,7 @@ import os
import structlog
from code_review_bot import Issue
from code_review_bot import Level
from code_review_bot import Issue, Level
from code_review_bot.config import settings
from code_review_bot.tasks.base import AnalysisTask

Просмотреть файл

@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
import structlog
from code_review_bot import Issue
from code_review_bot import Level
from code_review_bot import taskcluster
from code_review_bot import Issue, Level, taskcluster
from code_review_bot.tasks.base import AnalysisTask
logger = structlog.get_logger(__name__)

Просмотреть файл

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import structlog
from code_review_bot import Issue
from code_review_bot import Level
from code_review_bot import Issue, Level
from code_review_bot.tasks.base import AnalysisTask
logger = structlog.get_logger(__name__)

Просмотреть файл

@ -3,25 +3,18 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from datetime import datetime
from datetime import timedelta
from datetime import datetime, timedelta
import structlog
from libmozdata.phabricator import BuildState
from libmozdata.phabricator import PhabricatorAPI
from libmozdata.phabricator import BuildState, PhabricatorAPI
from taskcluster.utils import stringDate
from code_review_bot import Level
from code_review_bot import stats
from code_review_bot import Level, stats
from code_review_bot.backend import BackendAPI
from code_review_bot.config import REPO_AUTOLAND
from code_review_bot.config import REPO_MOZILLA_CENTRAL
from code_review_bot.config import settings
from code_review_bot.config import REPO_AUTOLAND, REPO_MOZILLA_CENTRAL, settings
from code_review_bot.report.debug import DebugReporter
from code_review_bot.revisions import Revision
from code_review_bot.tasks.base import AnalysisTask
from code_review_bot.tasks.base import BaseTask
from code_review_bot.tasks.base import NoticeTask
from code_review_bot.tasks.base import AnalysisTask, BaseTask, NoticeTask
from code_review_bot.tasks.clang_format import ClangFormatTask
from code_review_bot.tasks.clang_tidy import ClangTidyTask
from code_review_bot.tasks.clang_tidy_external import ExternalTidyTask

Просмотреть файл

@ -10,20 +10,17 @@ import re
import urllib
import urllib.parse
import uuid
from collections import defaultdict
from collections import namedtuple
from collections import defaultdict, namedtuple
from contextlib import contextmanager
import pytest
import responses
from libmozdata.phabricator import PhabricatorAPI
from code_review_bot import Level
from code_review_bot import stats
from code_review_bot import Level, stats
from code_review_bot.backend import BackendAPI
from code_review_bot.config import settings
from code_review_bot.tasks.clang_tidy import ClangTidyIssue
from code_review_bot.tasks.clang_tidy import ClangTidyTask
from code_review_bot.tasks.clang_tidy import ClangTidyIssue, ClangTidyTask
from code_review_bot.tasks.default import DefaultTask
MOCK_DIR = os.path.join(os.path.dirname(__file__), "mocks")

Просмотреть файл

@ -4,8 +4,7 @@ import os.path
import pytest
from code_review_bot.tasks.clang_format import ClangFormatTask
from code_review_bot.tasks.clang_tidy import ClangTidyIssue
from code_review_bot.tasks.clang_tidy import ClangTidyTask
from code_review_bot.tasks.clang_tidy import ClangTidyIssue, ClangTidyTask
from conftest import FIXTURES_DIR
@ -80,8 +79,7 @@ def test_as_dict(mock_revision, mock_hgmo, mock_task):
"""
Test text export for ClangTidyIssue
"""
from code_review_bot import Level
from code_review_bot import Reliability
from code_review_bot import Level, Reliability
issue = ClangTidyIssue(
mock_task(ClangTidyTask, "clang-tidy"),
@ -116,8 +114,7 @@ def test_as_markdown(mock_revision, mock_task):
"""
Test markdown generation for ClangTidyIssue
"""
from code_review_bot import Level
from code_review_bot import Reliability
from code_review_bot import Level, Reliability
issue = ClangTidyIssue(
mock_task(ClangTidyTask, "clang-tidy"),

Просмотреть файл

@ -6,8 +6,7 @@
import pytest
from code_review_bot import Level
from code_review_bot.tasks.default import DefaultIssue
from code_review_bot.tasks.default import DefaultTask
from code_review_bot.tasks.default import DefaultIssue, DefaultTask
@pytest.mark.parametrize(

Просмотреть файл

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import pytest
from code_review_bot.tasks.docupload import MAX_LINKS
from code_review_bot.tasks.docupload import DocUploadTask
from code_review_bot.tasks.docupload import MAX_LINKS, DocUploadTask
ARTIFACTS = {
"public/firefox-source-docs-url.txt": b"http://firefox-test-docs.mozilla.org/index.html",

Просмотреть файл

@ -7,8 +7,7 @@ import hashlib
import pytest
from code_review_bot.tasks.lint import MozLintIssue
from code_review_bot.tasks.lint import MozLintTask
from code_review_bot.tasks.lint import MozLintIssue, MozLintTask
def test_build_hash(mock_revision, mock_hgmo, mock_task):

Просмотреть файл

@ -3,8 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from code_review_bot.tasks.clang_format import ClangFormatIssue
from code_review_bot.tasks.clang_format import ClangFormatTask
from code_review_bot.tasks.clang_format import ClangFormatIssue, ClangFormatTask
def test_allowed_paths(mock_config, mock_revision, mock_task):

Просмотреть файл

@ -6,8 +6,7 @@
import json
import os
from code_review_bot.tasks.lint import MozLintIssue
from code_review_bot.tasks.lint import MozLintTask
from code_review_bot.tasks.lint import MozLintIssue, MozLintTask
from conftest import FIXTURES_DIR

Просмотреть файл

@ -3,8 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from code_review_bot.report.lando import LANDO_MESSAGE
from code_review_bot.report.lando import LandoReporter
from code_review_bot.report.lando import LANDO_MESSAGE, LandoReporter
MOCK_LANDO_API_URL = "http://api.lando.test"
MOCK_LANDO_TOKEN = "Some Test Token"

Просмотреть файл

@ -12,21 +12,17 @@ from structlog.testing import capture_logs
from code_review_bot import Level
from code_review_bot.report.phabricator import PhabricatorReporter
from code_review_bot.revisions import ImprovementPatch
from code_review_bot.revisions import Revision
from code_review_bot.tasks.clang_format import ClangFormatIssue
from code_review_bot.tasks.clang_format import ClangFormatTask
from code_review_bot.tasks.clang_tidy import ClangTidyIssue
from code_review_bot.tasks.clang_tidy import ClangTidyTask
from code_review_bot.tasks.clang_tidy_external import ExternalTidyIssue
from code_review_bot.tasks.clang_tidy_external import ExternalTidyTask
from code_review_bot.tasks.coverage import CoverageIssue
from code_review_bot.tasks.coverage import ZeroCoverageTask
from code_review_bot.tasks.default import DefaultIssue
from code_review_bot.tasks.default import DefaultTask
from code_review_bot.revisions import ImprovementPatch, Revision
from code_review_bot.tasks.clang_format import ClangFormatIssue, ClangFormatTask
from code_review_bot.tasks.clang_tidy import ClangTidyIssue, ClangTidyTask
from code_review_bot.tasks.clang_tidy_external import (
ExternalTidyIssue,
ExternalTidyTask,
)
from code_review_bot.tasks.coverage import CoverageIssue, ZeroCoverageTask
from code_review_bot.tasks.default import DefaultIssue, DefaultTask
from code_review_bot.tasks.docupload import COMMENT_LINK_TO_DOC
from code_review_bot.tasks.lint import MozLintIssue
from code_review_bot.tasks.lint import MozLintTask
from code_review_bot.tasks.lint import MozLintIssue, MozLintTask
from code_review_bot.tasks.tgdiff import COMMENT_TASKGRAPH_DIFF
VALID_CLANG_TIDY_MESSAGE = """

Просмотреть файл

@ -6,8 +6,7 @@
import re
import time
from datetime import datetime
from datetime import timedelta
from datetime import datetime, timedelta
import requests
from taskcluster.helper import TaskclusterConfig

Просмотреть файл

@ -6,16 +6,17 @@ import jsone
import jsonschema
import structlog
from libmozdata.phabricator import UnitResultState
from libmozevent.phabricator import PhabricatorBuild
from libmozevent.phabricator import PhabricatorBuildState
from libmozevent.phabricator import PhabricatorBuild, PhabricatorBuildState
from libmozevent.storage import EphemeralStorage
from code_review_events import QUEUE_BUGBUG
from code_review_events import QUEUE_BUGBUG_TRY_PUSH
from code_review_events import QUEUE_MONITORING_COMMUNITY
from code_review_events import QUEUE_PHABRICATOR_RESULTS
from code_review_events import community_taskcluster_config
from code_review_events import taskcluster_config
from code_review_events import (
QUEUE_BUGBUG,
QUEUE_BUGBUG_TRY_PUSH,
QUEUE_MONITORING_COMMUNITY,
QUEUE_PHABRICATOR_RESULTS,
community_taskcluster_config,
taskcluster_config,
)
from code_review_tools.treeherder import get_job_url
logger = structlog.get_logger(__name__)

Просмотреть файл

@ -6,8 +6,7 @@ import tempfile
import structlog
import yaml
from code_review_events import community_taskcluster_config
from code_review_events import taskcluster_config
from code_review_events import community_taskcluster_config, taskcluster_config
from code_review_events.workflow import Events
from code_review_tools.log import init_logger

Просмотреть файл

@ -4,35 +4,36 @@ import os
import structlog
from libmozdata.lando import LandoWarnings
from libmozdata.phabricator import BuildState
from libmozdata.phabricator import UnitResult
from libmozdata.phabricator import UnitResultState
from libmozdata.phabricator import BuildState, UnitResult, UnitResultState
from libmozevent.bus import MessageBus
from libmozevent.mercurial import MercurialWorker
from libmozevent.mercurial import Repository
from libmozevent.mercurial import MercurialWorker, Repository
from libmozevent.monitoring import Monitoring
from libmozevent.phabricator import PhabricatorActions
from libmozevent.phabricator import PhabricatorBuild
from libmozevent.phabricator import PhabricatorBuildState
from libmozevent.phabricator import (
PhabricatorActions,
PhabricatorBuild,
PhabricatorBuildState,
)
from libmozevent.pulse import PulseListener
from libmozevent.utils import run_tasks
from libmozevent.web import WebServer
from code_review_events import MONITORING_PERIOD
from code_review_events import QUEUE_BUGBUG
from code_review_events import QUEUE_BUGBUG_TRY_PUSH
from code_review_events import QUEUE_MERCURIAL
from code_review_events import QUEUE_MERCURIAL_APPLIED
from code_review_events import QUEUE_MONITORING
from code_review_events import QUEUE_MONITORING_COMMUNITY
from code_review_events import QUEUE_PHABRICATOR_RESULTS
from code_review_events import QUEUE_PULSE_AUTOLAND
from code_review_events import QUEUE_PULSE_BUGBUG_TEST_SELECT
from code_review_events import QUEUE_PULSE_MOZILLA_CENTRAL
from code_review_events import QUEUE_PULSE_TRY_TASK_END
from code_review_events import QUEUE_WEB_BUILDS
from code_review_events import community_taskcluster_config
from code_review_events import taskcluster_config
from code_review_events import (
MONITORING_PERIOD,
QUEUE_BUGBUG,
QUEUE_BUGBUG_TRY_PUSH,
QUEUE_MERCURIAL,
QUEUE_MERCURIAL_APPLIED,
QUEUE_MONITORING,
QUEUE_MONITORING_COMMUNITY,
QUEUE_PHABRICATOR_RESULTS,
QUEUE_PULSE_AUTOLAND,
QUEUE_PULSE_BUGBUG_TEST_SELECT,
QUEUE_PULSE_MOZILLA_CENTRAL,
QUEUE_PULSE_TRY_TASK_END,
QUEUE_WEB_BUILDS,
community_taskcluster_config,
taskcluster_config,
)
from code_review_events.bugbug_utils import BugbugUtils
from code_review_tools import heroku

Просмотреть файл

@ -12,8 +12,7 @@ import pytest
import responses
from libmozevent.phabricator import PhabricatorActions
from code_review_events import community_taskcluster_config
from code_review_events import taskcluster_config
from code_review_events import community_taskcluster_config, taskcluster_config
FIXTURES_DIR = os.path.join(os.path.dirname(__file__), "fixtures")

Просмотреть файл

@ -9,9 +9,11 @@ from libmozdata.phabricator import UnitResultState
from libmozevent.bus import MessageBus
from libmozevent.phabricator import PhabricatorBuild
from code_review_events import QUEUE_MONITORING_COMMUNITY
from code_review_events import QUEUE_PHABRICATOR_RESULTS
from code_review_events import taskcluster_config
from code_review_events import (
QUEUE_MONITORING_COMMUNITY,
QUEUE_PHABRICATOR_RESULTS,
taskcluster_config,
)
from code_review_events.bugbug_utils import BugbugUtils

Просмотреть файл

@ -1,19 +1,18 @@
# -*- coding: utf-8 -*-
import pytest
from libmozdata.phabricator import BuildState
from libmozdata.phabricator import ConduitError
from libmozdata.phabricator import UnitResultState
from libmozdata.phabricator import BuildState, ConduitError, UnitResultState
from libmozevent.bus import MessageBus
from libmozevent.phabricator import PhabricatorBuild
from structlog.testing import capture_logs
from code_review_events import QUEUE_BUGBUG
from code_review_events import QUEUE_MERCURIAL
from code_review_events.workflow import LANDO_FAILURE_HG_MESSAGE
from code_review_events.workflow import LANDO_FAILURE_MESSAGE
from code_review_events.workflow import LANDO_WARNING_MESSAGE
from code_review_events.workflow import CodeReview
from code_review_events import QUEUE_BUGBUG, QUEUE_MERCURIAL
from code_review_events.workflow import (
LANDO_FAILURE_HG_MESSAGE,
LANDO_FAILURE_MESSAGE,
LANDO_WARNING_MESSAGE,
CodeReview,
)
MOCK_LANDO_API_URL = "http://api.lando.test"
MOCK_LANDO_TOKEN = "Some Test Token"