From e332dac0919029c173b8ae5a049b1d7587005137 Mon Sep 17 00:00:00 2001 From: Zeid Zabaneh Date: Thu, 21 Mar 2024 15:56:31 -0400 Subject: [PATCH] misc: translate legacy imports (bug 1878767) - landoapi imports - landui imports - current_app - remaining models --- src/lando/api/legacy/api/diff_warnings.py | 6 +- src/lando/api/legacy/api/landing_jobs.py | 6 +- src/lando/api/legacy/api/stacks.py | 32 ++--- src/lando/api/legacy/api/transplants.py | 39 +++--- src/lando/api/legacy/api/try_push.py | 10 +- src/lando/api/legacy/api/uplift.py | 16 +-- src/lando/api/legacy/app.py | 30 ++-- src/lando/api/legacy/auth.py | 19 +-- src/lando/api/legacy/bmo.py | 6 +- src/lando/api/legacy/cache.py | 4 +- src/lando/api/legacy/celery.py | 2 +- src/lando/api/legacy/cli.py | 26 ++-- src/lando/api/legacy/decorators.py | 8 +- src/lando/api/legacy/email.py | 2 +- src/lando/api/legacy/hg.py | 4 +- src/lando/api/legacy/hooks.py | 8 +- src/lando/api/legacy/logging.py | 2 +- src/lando/api/legacy/mocks/auth.py | 2 +- src/lando/api/legacy/models/__init__.py | 17 --- src/lando/api/legacy/models/transplant.py | 132 ------------------ src/lando/api/legacy/notifications.py | 2 +- src/lando/api/legacy/phabricator.py | 2 +- src/lando/api/legacy/projects.py | 4 +- src/lando/api/legacy/repos.py | 4 +- src/lando/api/legacy/reviews.py | 4 +- src/lando/api/legacy/revisions.py | 6 +- src/lando/api/legacy/sentry.py | 2 +- src/lando/api/legacy/smtp.py | 2 +- src/lando/api/legacy/stacks.py | 4 +- src/lando/api/legacy/storage.py | 2 +- src/lando/api/legacy/tasks.py | 22 +-- src/lando/api/legacy/transactions.py | 2 +- src/lando/api/legacy/transplants.py | 20 +-- src/lando/api/legacy/treestatus.py | 2 +- src/lando/api/legacy/ui.py | 2 +- src/lando/api/legacy/uplift.py | 16 +-- src/lando/api/legacy/users.py | 2 +- src/lando/api/legacy/workers/base.py | 6 +- .../api/legacy/workers/landing_worker.py | 22 +-- src/lando/api/tests/conftest.py | 18 +-- src/lando/api/tests/mocks.py | 4 +- src/lando/api/tests/test_auth.py | 8 +- src/lando/api/tests/test_commit_message.py | 2 +- src/lando/api/tests/test_decorators.py | 4 +- src/lando/api/tests/test_diff_warnings.py | 2 +- src/lando/api/tests/test_health.py | 8 +- src/lando/api/tests/test_hg.py | 2 +- src/lando/api/tests/test_hgexports.py | 2 +- src/lando/api/tests/test_hooks.py | 4 +- src/lando/api/tests/test_landing_job.py | 2 +- src/lando/api/tests/test_landings.py | 10 +- src/lando/api/tests/test_models.py | 2 +- src/lando/api/tests/test_notifications.py | 12 +- src/lando/api/tests/test_phabricator.py | 2 +- .../api/tests/test_phabricator_client.py | 2 +- src/lando/api/tests/test_phabricator_patch.py | 2 +- src/lando/api/tests/test_py3_codequality.py | 2 +- src/lando/api/tests/test_redis.py | 2 +- src/lando/api/tests/test_reviews.py | 8 +- src/lando/api/tests/test_revisions.py | 8 +- src/lando/api/tests/test_stacks.py | 6 +- src/lando/api/tests/test_tasks.py | 4 +- src/lando/api/tests/test_transactions.py | 2 +- src/lando/api/tests/test_transplants.py | 22 +-- src/lando/api/tests/test_treestatus.py | 2 +- src/lando/api/tests/test_try.py | 10 +- src/lando/api/tests/test_uplift.py | 6 +- src/lando/api/tests/test_validation.py | 2 +- src/lando/ui/legacy/errorhandlers.py | 2 +- src/lando/ui/legacy/landoapi.py | 4 +- src/lando/ui/legacy/pages.py | 10 +- src/lando/ui/legacy/usersettings.py | 2 +- src/lando/ui/tests/conftest.py | 2 +- src/lando/ui/tests/test_errorhandlers.py | 2 +- src/lando/ui/tests/test_forms.py | 2 +- src/lando/ui/tests/test_landoapi.py | 2 +- src/lando/ui/tests/test_stacks.py | 2 +- src/lando/ui/tests/test_template_helpers.py | 2 +- src/lando/ui/tests/test_usersettings.py | 4 +- 79 files changed, 272 insertions(+), 419 deletions(-) delete mode 100644 src/lando/api/legacy/models/__init__.py delete mode 100644 src/lando/api/legacy/models/transplant.py diff --git a/src/lando/api/legacy/api/diff_warnings.py b/src/lando/api/legacy/api/diff_warnings.py index fd158e0d..64a8417b 100644 --- a/src/lando/api/legacy/api/diff_warnings.py +++ b/src/lando/api/legacy/api/diff_warnings.py @@ -13,9 +13,9 @@ from connexion import problem -from landoapi.decorators import require_phabricator_api_key -from landoapi.models.revisions import DiffWarning, DiffWarningStatus -from landoapi.storage import db +from lando.api.legacy.decorators import require_phabricator_api_key +from lando.main.models.revision import DiffWarning, DiffWarningStatus +from lando.api.legacy.storage import db logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/api/landing_jobs.py b/src/lando/api/legacy/api/landing_jobs.py index bb88c84b..cbca3e51 100644 --- a/src/lando/api/legacy/api/landing_jobs.py +++ b/src/lando/api/legacy/api/landing_jobs.py @@ -6,9 +6,9 @@ from connexion import ProblemException from flask import g -from landoapi import auth -from landoapi.models.landing_job import LandingJob, LandingJobAction, LandingJobStatus -from landoapi.storage import db +from lando.api import auth +from lando.main.models.landing_job import LandingJob, LandingJobAction, LandingJobStatus +from lando.api.legacy.storage import db logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/api/stacks.py b/src/lando/api/legacy/api/stacks.py index 66006920..6aff49c3 100644 --- a/src/lando/api/legacy/api/stacks.py +++ b/src/lando/api/legacy/api/stacks.py @@ -5,26 +5,26 @@ import urllib.parse from connexion import problem -from flask import current_app +from lando import settings -from landoapi.commit_message import format_commit_message -from landoapi.decorators import require_phabricator_api_key -from landoapi.models.revisions import Revision -from landoapi.phabricator import PhabricatorClient -from landoapi.projects import ( +from lando.api.legacy.commit_message import format_commit_message +from lando.api.legacy.decorators import require_phabricator_api_key +from lando.main.models.revision import Revision +from lando.api.legacy.phabricator import PhabricatorClient +from lando.api.legacy.projects import ( get_release_managers, get_sec_approval_project_phid, get_secure_project_phid, project_search, ) -from landoapi.repos import get_repos_for_env -from landoapi.reviews import ( +from lando.api.legacy.repos import get_repos_for_env +from lando.api.legacy.reviews import ( approvals_for_commit_message, get_collated_reviewers, reviewers_for_commit_message, serialize_reviewers, ) -from landoapi.revisions import ( +from lando.api.legacy.revisions import ( find_title_and_summary_for_display, gather_involved_phids, get_bugzilla_bug, @@ -33,15 +33,15 @@ serialize_diff, serialize_status, ) -from landoapi.stacks import ( +from lando.api.legacy.stacks import ( build_stack_graph, calculate_landable_subgraphs, get_landable_repos_for_revision_data, request_extended_revision_data, ) -from landoapi.transplants import get_blocker_checks -from landoapi.users import user_search -from landoapi.validation import revision_id_to_int +from lando.api.legacy.transplants import get_blocker_checks +from lando.api.legacy.users import user_search +from lando.api.legacy.validation import revision_id_to_int logger = logging.getLogger(__name__) @@ -75,7 +75,7 @@ def get(phab: PhabricatorClient, revision_id: str): except ValueError: return not_found_problem - supported_repos = get_repos_for_env(current_app.config.get("ENVIRONMENT")) + supported_repos = get_repos_for_env(settings.ENVIRONMENT) landable_repos = get_landable_repos_for_revision_data(stack_data, supported_repos) release_managers = get_release_managers(phab) @@ -129,7 +129,7 @@ def get(phab: PhabricatorClient, revision_id: str): diff = stack_data.diffs[diff_phid] human_revision_id = "D{}".format(PhabricatorClient.expect(phab_revision, "id")) revision_url = urllib.parse.urljoin( - current_app.config["PHABRICATOR_URL"], human_revision_id + settings.PHABRICATOR_URL, human_revision_id ) secure = revision_is_secure(phab_revision, secure_project_phid) commit_description = find_title_and_summary_for_display( @@ -208,7 +208,7 @@ def get(phab: PhabricatorClient, revision_id: str): url = ( repo.url if landing_supported - else f"{current_app.config['PHABRICATOR_URL']}/source/{short_name}" + else f"{settings.PHABRICATOR_URL}/source/{short_name}" ) repositories.append( diff --git a/src/lando/api/legacy/api/transplants.py b/src/lando/api/legacy/api/transplants.py index ff0a792e..edbebb8c 100644 --- a/src/lando/api/legacy/api/transplants.py +++ b/src/lando/api/legacy/api/transplants.py @@ -8,19 +8,20 @@ import kombu from connexion import ProblemException, problem -from flask import current_app, g +from lando import settings +from flask import g -from landoapi import auth -from landoapi.commit_message import format_commit_message -from landoapi.decorators import require_phabricator_api_key -from landoapi.models.landing_job import ( +from lando.api import auth +from lando.api.legacy.commit_message import format_commit_message +from lando.api.legacy.decorators import require_phabricator_api_key +from lando.main.models.landing_job import ( LandingJob, LandingJobStatus, add_revisions_to_job, ) -from landoapi.models.revisions import Revision -from landoapi.phabricator import PhabricatorClient -from landoapi.projects import ( +from lando.main.models.revision import Revision +from lando.api.legacy.phabricator import PhabricatorClient +from lando.api.legacy.projects import ( CHECKIN_PROJ_SLUG, get_checkin_project_phid, get_release_managers, @@ -30,41 +31,41 @@ get_testing_tag_project_phids, project_search, ) -from landoapi.repos import ( +from lando.api.legacy.repos import ( Repo, get_repos_for_env, ) -from landoapi.reviews import ( +from lando.api.legacy.reviews import ( approvals_for_commit_message, get_approved_by_ids, get_collated_reviewers, reviewers_for_commit_message, ) -from landoapi.revisions import ( +from lando.api.legacy.revisions import ( find_title_and_summary_for_landing, gather_involved_phids, get_bugzilla_bug, revision_is_secure, select_diff_author, ) -from landoapi.stacks import ( +from lando.api.legacy.stacks import ( RevisionData, build_stack_graph, calculate_landable_subgraphs, get_landable_repos_for_revision_data, request_extended_revision_data, ) -from landoapi.storage import db -from landoapi.tasks import admin_remove_phab_project -from landoapi.transplants import ( +from lando.api.legacy.storage import db +from lando.api.legacy.tasks import admin_remove_phab_project +from lando.api.legacy.transplants import ( TransplantAssessment, check_landing_blockers, check_landing_warnings, convert_path_id_to_phid, get_blocker_checks, ) -from landoapi.users import user_search -from landoapi.validation import ( +from lando.api.legacy.users import user_search +from lando.api.legacy.validation import ( parse_landing_path, revision_id_to_int, ) @@ -145,7 +146,7 @@ def _assess_transplant_request( stack_data = request_extended_revision_data(phab, list(nodes)) landing_path_phid = convert_path_id_to_phid(landing_path, stack_data) - supported_repos = get_repos_for_env(current_app.config.get("ENVIRONMENT")) + supported_repos = get_repos_for_env(settings.ENVIRONMENT) landable_repos = get_landable_repos_for_revision_data(stack_data, supported_repos) other_checks = get_blocker_checks( @@ -339,7 +340,7 @@ def post(phab: PhabricatorClient, data: dict): approval_reviewers, commit_description.summary, urllib.parse.urljoin( - current_app.config["PHABRICATOR_URL"], "D{}".format(revision["id"]) + settings.PHABRICATOR_URL, "D{}".format(revision["id"]) ), flags, )[1] diff --git a/src/lando/api/legacy/api/try_push.py b/src/lando/api/legacy/api/try_push.py index 0c04b994..8dbe3e00 100644 --- a/src/lando/api/legacy/api/try_push.py +++ b/src/lando/api/legacy/api/try_push.py @@ -14,18 +14,18 @@ g, ) -from landoapi import auth -from landoapi.hgexports import ( +from lando.api import auth +from lando.api.legacy.hgexports import ( GitPatchHelper, HgPatchHelper, PatchHelper, ) -from landoapi.models.landing_job import ( +from lando.main.models.landing_job import ( LandingJobStatus, add_job_with_revisions, ) -from landoapi.models.revisions import Revision -from landoapi.repos import ( +from lando.main.models.revision import Revision +from lando.api.legacy.repos import ( get_repos_for_env, ) diff --git a/src/lando/api/legacy/api/uplift.py b/src/lando/api/legacy/api/uplift.py index 198a896b..289726e6 100644 --- a/src/lando/api/legacy/api/uplift.py +++ b/src/lando/api/legacy/api/uplift.py @@ -5,19 +5,19 @@ import logging from connexion import problem -from flask import current_app +from lando import settings -from landoapi import auth -from landoapi.decorators import require_phabricator_api_key -from landoapi.phabricator import PhabricatorClient -from landoapi.repos import get_repos_for_env -from landoapi.uplift import ( +from lando.api import auth +from lando.api.legacy.decorators import require_phabricator_api_key +from lando.api.legacy.phabricator import PhabricatorClient +from lando.api.legacy.repos import get_repos_for_env +from lando.api.legacy.uplift import ( create_uplift_revision, get_local_uplift_repo, get_uplift_conduit_state, get_uplift_repositories, ) -from landoapi.validation import revision_id_to_int +from lando.api.legacy.validation import revision_id_to_int logger = logging.getLogger(__name__) @@ -41,7 +41,7 @@ def create(phab: PhabricatorClient, data: dict): revision_id = revision_id_to_int(data["revision_id"]) # Validate repository. - all_repos = get_repos_for_env(current_app.config.get("ENVIRONMENT")) + all_repos = get_repos_for_env(settings.ENVIRONMENT) repository = all_repos.get(repo_name) if repository is None: return problem( diff --git a/src/lando/api/legacy/app.py b/src/lando/api/legacy/app.py index 6155b270..fc46084b 100644 --- a/src/lando/api/legacy/app.py +++ b/src/lando/api/legacy/app.py @@ -10,21 +10,21 @@ from connexion.resolver import RestyResolver import landoapi.models # noqa, makes sure alembic knows about the models. -from landoapi.auth import auth0_subsystem -from landoapi.cache import cache_subsystem -from landoapi.celery import celery_subsystem -from landoapi.dockerflow import dockerflow -from landoapi.hooks import initialize_hooks -from landoapi.logging import logging_subsystem -from landoapi.phabricator import phabricator_subsystem -from landoapi.repos import repo_clone_subsystem -from landoapi.sentry import sentry_subsystem -from landoapi.smtp import smtp_subsystem -from landoapi.storage import db_subsystem -from landoapi.systems import Subsystem -from landoapi.treestatus import treestatus_subsystem -from landoapi.ui import lando_ui_subsystem -from landoapi.version import version +from lando.api.legacy.auth import auth0_subsystem +from lando.api.legacy.cache import cache_subsystem +from lando.api.legacy.celery import celery_subsystem +from lando.api.legacy.dockerflow import dockerflow +from lando.api.legacy.hooks import initialize_hooks +from lando.api.legacy.logging import logging_subsystem +from lando.api.legacy.phabricator import phabricator_subsystem +from lando.api.legacy.repos import repo_clone_subsystem +from lando.api.legacy.sentry import sentry_subsystem +from lando.api.legacy.smtp import smtp_subsystem +from lando.api.legacy.storage import db_subsystem +from lando.api.legacy.systems import Subsystem +from lando.api.legacy.treestatus import treestatus_subsystem +from lando.api.legacy.ui import lando_ui_subsystem +from lando.api.legacy.version import version logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/auth.py b/src/lando/api/legacy/auth.py index cad4d913..c300ec1f 100644 --- a/src/lando/api/legacy/auth.py +++ b/src/lando/api/legacy/auth.py @@ -16,13 +16,14 @@ import requests from connexion import ProblemException, request -from flask import current_app, g +from lando import settings +from flask import g from jose import jwt -from landoapi.cache import cache -from landoapi.mocks.auth import MockAuth0 -from landoapi.repos import AccessGroup -from landoapi.systems import Subsystem +from django.core.cache import cache +from lando.api.legacy.mocks.auth import MockAuth0 +from lando.api.legacy.repos import AccessGroup +from lando.api.legacy.systems import Subsystem logger = logging.getLogger(__name__) @@ -96,7 +97,7 @@ def jwks_cache_key(url: str) -> str: def get_jwks() -> dict: """Return the auth0 jwks.""" jwks_url = "https://{oidc_domain}/.well-known/jwks.json".format( - oidc_domain=current_app.config["OIDC_DOMAIN"] + oidc_domain=settings.OIDC_DOMAIN ) cache_key = jwks_cache_key(jwks_url) @@ -163,7 +164,7 @@ def userinfo_cache_key(access_token: str, user_sub: str) -> str: def get_userinfo_url() -> str: - return "https://{}/userinfo".format(current_app.config["OIDC_DOMAIN"]) + return "https://{}/userinfo".format(settings.OIDC_DOMAIN) def fetch_auth0_userinfo(access_token: str) -> requests.Response: @@ -442,7 +443,7 @@ def wrapped(*args, **kwargs): ) issuer = "https://{oidc_domain}/".format( - oidc_domain=current_app.config["OIDC_DOMAIN"] + oidc_domain=settings.OIDC_DOMAIN ) try: @@ -450,7 +451,7 @@ def wrapped(*args, **kwargs): token, key, algorithms=ALGORITHMS, - audience=current_app.config["OIDC_IDENTIFIER"], + audience=settings.OIDC_IDENTIFIER, issuer=issuer, ) except jwt.ExpiredSignatureError: diff --git a/src/lando/api/legacy/bmo.py b/src/lando/api/legacy/bmo.py index a2c0e585..bbb335d3 100644 --- a/src/lando/api/legacy/bmo.py +++ b/src/lando/api/legacy/bmo.py @@ -3,19 +3,19 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. import requests -from flask import current_app +from lando import settings def bmo_uplift_endpoint() -> str: """Returns the BMO uplift endpoint url for bugs.""" - return f"{current_app.config['BUGZILLA_URL']}/rest/lando/uplift" + return f"{settings.BUGZILLA_URL}/rest/lando/uplift" def bmo_default_headers() -> dict[str, str]: """Returns a `dict` containing the default REST API headers.""" return { "User-Agent": "Lando-API", - "X-Bugzilla-API-Key": current_app.config["BUGZILLA_API_KEY"], + "X-Bugzilla-API-Key": settings.BUGZILLA_API_KEY, } diff --git a/src/lando/api/legacy/cache.py b/src/lando/api/legacy/cache.py index 6d8053b9..4569081c 100644 --- a/src/lando/api/legacy/cache.py +++ b/src/lando/api/legacy/cache.py @@ -10,8 +10,8 @@ from flask_caching.backends.rediscache import RedisCache from redis import RedisError -from landoapi.redis import SuppressRedisFailure -from landoapi.systems import Subsystem +from lando.api.legacy.redis import SuppressRedisFailure +from lando.api.legacy.systems import Subsystem # 60s * 60m * 24h DEFAULT_CACHE_KEY_TIMEOUT_SECONDS = 60 * 60 * 24 diff --git a/src/lando/api/legacy/celery.py b/src/lando/api/legacy/celery.py index c1ab5849..5121a1aa 100644 --- a/src/lando/api/legacy/celery.py +++ b/src/lando/api/legacy/celery.py @@ -15,7 +15,7 @@ ) from datadog import statsd -from landoapi.systems import Subsystem +from lando.api.legacy.systems import Subsystem logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/cli.py b/src/lando/api/legacy/cli.py index 5065b3a5..d74e538a 100644 --- a/src/lando/api/legacy/cli.py +++ b/src/lando/api/legacy/cli.py @@ -11,12 +11,12 @@ import connexion from flask.cli import FlaskGroup -from landoapi.models.configuration import ( +from lando.main.models.configuration import ( ConfigurationKey, ConfigurationVariable, VariableType, ) -from landoapi.systems import Subsystem +from lando.api.legacy.systems import Subsystem LINT_PATHS = ("setup.py", "tasks.py", "landoapi", "migrations", "tests") @@ -29,14 +29,14 @@ def get_subsystems(exclude: Optional[list[Subsystem]] = None) -> list[Subsystem] Returns: list of Subsystem """ - from landoapi.app import SUBSYSTEMS + from lando.api.legacy.app import SUBSYSTEMS exclusions = exclude or [] return [s for s in SUBSYSTEMS if s not in exclusions] def create_lando_api_app() -> connexion.App: - from landoapi.app import construct_app, load_config + from lando.api.legacy.app import construct_app, load_config config = load_config() app = construct_app(config) @@ -55,25 +55,25 @@ def cli(): @click.argument("celery_arguments", nargs=-1, type=click.UNPROCESSED) def worker(celery_arguments): """Initialize a Celery worker for this app.""" - from landoapi.app import repo_clone_subsystem + from lando.api.legacy.app import repo_clone_subsystem for system in get_subsystems(exclude=[repo_clone_subsystem]): system.ensure_ready() - from landoapi.celery import celery + from lando.api.legacy.celery import celery celery.worker_main((sys.argv[0],) + celery_arguments) @cli.command(name="landing-worker") def landing_worker(): - from landoapi.app import auth0_subsystem, lando_ui_subsystem + from lando.api.legacy.app import auth0_subsystem, lando_ui_subsystem exclusions = [auth0_subsystem, lando_ui_subsystem] for system in get_subsystems(exclude=exclusions): system.ensure_ready() - from landoapi.workers.landing_worker import LandingWorker + from lando.api.legacy.workers.landing_worker import LandingWorker worker = LandingWorker() worker.start() @@ -82,7 +82,7 @@ def landing_worker(): @cli.command(name="run-pre-deploy-sequence") def run_pre_deploy_sequence(): """Runs the sequence of commands required before a deployment.""" - from landoapi.storage import db_subsystem + from lando.api.legacy.storage import db_subsystem db_subsystem.ensure_ready() ConfigurationVariable.set( @@ -96,7 +96,7 @@ def run_pre_deploy_sequence(): @cli.command(name="run-post-deploy-sequence") def run_post_deploy_sequence(): """Runs the sequence of commands required after a deployment.""" - from landoapi.storage import db_subsystem + from lando.api.legacy.storage import db_subsystem db_subsystem.ensure_ready() ConfigurationVariable.set( @@ -111,12 +111,12 @@ def run_post_deploy_sequence(): @click.argument("celery_arguments", nargs=-1, type=click.UNPROCESSED) def celery(celery_arguments): """Run the celery base command for this app.""" - from landoapi.app import repo_clone_subsystem + from lando.api.legacy.app import repo_clone_subsystem for system in get_subsystems(exclude=[repo_clone_subsystem]): system.ensure_ready() - from landoapi.celery import celery + from lando.api.legacy.celery import celery celery.start([sys.argv[0]] + list(celery_arguments)) @@ -124,7 +124,7 @@ def celery(celery_arguments): @cli.command() def uwsgi(): """Run the service in production mode with uwsgi.""" - from landoapi.app import repo_clone_subsystem + from lando.api.legacy.app import repo_clone_subsystem for system in get_subsystems(exclude=[repo_clone_subsystem]): system.ensure_ready() diff --git a/src/lando/api/legacy/decorators.py b/src/lando/api/legacy/decorators.py index 48ea91f0..74284131 100644 --- a/src/lando/api/legacy/decorators.py +++ b/src/lando/api/legacy/decorators.py @@ -7,9 +7,9 @@ ) from connexion import problem, request -from flask import current_app +from lando import settings -from landoapi.phabricator import PhabricatorClient +from lando.api.legacy.phabricator import PhabricatorClient class require_phabricator_api_key: @@ -51,8 +51,8 @@ def wrapped(*args, **kwargs): ) phab = PhabricatorClient( - current_app.config["PHABRICATOR_URL"], - api_key or current_app.config["PHABRICATOR_UNPRIVILEGED_API_KEY"], + settings.PHABRICATOR_URL, + api_key or settings.PHABRICATOR_UNPRIVILEGED_API_KEY, ) if api_key is not None and not phab.verify_api_token(): return problem( diff --git a/src/lando/api/legacy/email.py b/src/lando/api/legacy/email.py index 0f458fe7..7f798dcf 100644 --- a/src/lando/api/legacy/email.py +++ b/src/lando/api/legacy/email.py @@ -4,7 +4,7 @@ import logging from email.message import EmailMessage -from landoapi.validation import REVISION_ID_RE +from lando.api.legacy.validation import REVISION_ID_RE logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/hg.py b/src/lando/api/legacy/hg.py index b08224b1..dc1a726b 100644 --- a/src/lando/api/legacy/hg.py +++ b/src/lando/api/legacy/hg.py @@ -20,8 +20,8 @@ import hglib -from landoapi.commit_message import bug_list_to_commit_string -from landoapi.hgexports import HgPatchHelper +from lando.api.legacy.commit_message import bug_list_to_commit_string +from lando.api.legacy.hgexports import HgPatchHelper logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/hooks.py b/src/lando/api/legacy/hooks.py index a95abb5b..c15d3c8f 100644 --- a/src/lando/api/legacy/hooks.py +++ b/src/lando/api/legacy/hooks.py @@ -15,10 +15,10 @@ request, ) -from landoapi.models.configuration import ConfigurationKey, ConfigurationVariable -from landoapi.phabricator import PhabricatorAPIException -from landoapi.sentry import sentry_sdk -from landoapi.treestatus import TreeStatusException +from lando.main.models.configuration import ConfigurationKey, ConfigurationVariable +from lando.api.legacy.phabricator import PhabricatorAPIException +from lando.api.legacy.sentry import sentry_sdk +from lando.api.legacy.treestatus import TreeStatusException logger = logging.getLogger(__name__) request_logger = logging.getLogger("request.summary") diff --git a/src/lando/api/legacy/logging.py b/src/lando/api/legacy/logging.py index cae238d2..9e7257cd 100644 --- a/src/lando/api/legacy/logging.py +++ b/src/lando/api/legacy/logging.py @@ -7,7 +7,7 @@ import socket import traceback -from landoapi.systems import Subsystem +from lando.api.legacy.systems import Subsystem logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/mocks/auth.py b/src/lando/api/legacy/mocks/auth.py index 58795343..fabda3a0 100644 --- a/src/lando/api/legacy/mocks/auth.py +++ b/src/lando/api/legacy/mocks/auth.py @@ -6,7 +6,7 @@ from jose import jwt -from landoapi.mocks.canned_responses.auth0 import CANNED_USERINFO_STANDARD +from lando.api.legacy.mocks.canned_responses.auth0 import CANNED_USERINFO_STANDARD TEST_KEY_PUB = { "kid": "testkey", diff --git a/src/lando/api/legacy/models/__init__.py b/src/lando/api/legacy/models/__init__.py deleted file mode 100644 index 51ef4238..00000000 --- a/src/lando/api/legacy/models/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# 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 landoapi.models.configuration import ConfigurationVariable -from landoapi.models.landing_job import LandingJob -from landoapi.models.revisions import DiffWarning, Revision -from landoapi.models.transplant import Transplant - -__all__ = [ - "LandingJob", - "Revision", - "SecApprovalRequest", - "Transplant", - "ConfigurationVariable", - "DiffWarning", -] diff --git a/src/lando/api/legacy/models/transplant.py b/src/lando/api/legacy/models/transplant.py deleted file mode 100644 index 4cce1c9b..00000000 --- a/src/lando/api/legacy/models/transplant.py +++ /dev/null @@ -1,132 +0,0 @@ -# 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/. -import datetime -import enum -import logging -from typing import Any - -import flask_sqlalchemy -from sqlalchemy.dialects.postgresql import array -from sqlalchemy.dialects.postgresql.json import JSONB - -from landoapi.models.base import Base -from landoapi.storage import db - -logger = logging.getLogger(__name__) - - -@enum.unique -class TransplantStatus(enum.Enum): - """Status of the landing request.""" - - # Legacy value - aborted = "aborted" - - # Set from pingback - submitted = "submitted" - landed = "landed" - failed = "failed" - - -class Transplant(Base): - """Represents a request to Autoland Transplant.""" - - __tablename__ = "transplants" - - # Autoland Transplant request ID. - request_id = db.Column(db.Integer, unique=True) - - status = db.Column( - db.Enum(TransplantStatus), nullable=False, default=TransplantStatus.aborted - ) - - # JSON object mapping string revision id of the form "" (used because - # json keys may not be integers) to integer diff id. This is used to - # record the diff id used with each revision and make searching for - # Transplants that match a set of revisions easy (such as those - # in a stack). - # e.g. - # { - # "1001": 1221, - # "1002": 1246, - # "1003": 1412 - # } - revision_to_diff_id = db.Column(JSONB, nullable=False) - - # JSON array of string revision ids of the form "" (used to match - # the string type of revision_to_diff_id keys) listing the order - # of the revisions in the request from most ancestral to most - # descendant. - # e.g. - # ["1001", "1002", "1003"] - revision_order = db.Column(JSONB, nullable=False) - - # Text describing errors when not landed. - error = db.Column(db.Text(), default="") - - # Revision (sha) of the head of the push. - result = db.Column(db.Text(), default="") - - # LDAP email of the user who requested transplant. - requester_email = db.Column(db.String(254)) - - # URL of the repository revisions are to land to. - repository_url = db.Column(db.Text(), default="") - - # Treestatus tree name the revisions are to land to. - tree = db.Column(db.String(128)) - - def update_from_transplant(self, landed: bool, error: str = "", result: str = ""): - """Set the status from pingback request.""" - self.error = error - self.result = result - if not landed: - self.status = ( - TransplantStatus.failed if error else TransplantStatus.submitted - ) - else: - self.status = TransplantStatus.landed - - @property - def landing_path(self) -> list[tuple[int, int]]: - return [(int(r), self.revision_to_diff_id[r]) for r in self.revision_order] - - @property - def head_revision(self) -> str: - """Human-readable representation of the branch head's Phabricator revision ID.""" - assert ( - self.revision_order - ), "head_revision should never be called without setting self.revision_order!" - return "D" + self.revision_order[-1] - - @classmethod - def revisions_query(cls, revisions: list[str]) -> flask_sqlalchemy.BaseQuery: - revisions = [str(int(r)) for r in revisions] - return cls.query.filter(cls.revision_to_diff_id.has_any(array(revisions))) - - def serialize(self) -> dict[str, Any]: - """Return a JSON compatible dictionary.""" - return { - "id": self.id, - "request_id": self.request_id, - "status": self.status.value, - "landing_path": [ - {"revision_id": "D{}".format(r), "diff_id": self.revision_to_diff_id[r]} - for r in self.revision_order - ], - "details": ( - self.error or self.result - if self.status in (TransplantStatus.failed, TransplantStatus.aborted) - else self.result or self.error - ), - "requester_email": self.requester_email, - "tree": self.tree, - "repository_url": self.repository_url, - "created_at": ( - self.created_at.astimezone(datetime.timezone.utc).isoformat() - ), - "updated_at": ( - self.updated_at.astimezone(datetime.timezone.utc).isoformat() - ), - } diff --git a/src/lando/api/legacy/notifications.py b/src/lando/api/legacy/notifications.py index 9445b65e..fd9a2458 100644 --- a/src/lando/api/legacy/notifications.py +++ b/src/lando/api/legacy/notifications.py @@ -5,7 +5,7 @@ import kombu -from landoapi.tasks import ( +from lando.api.legacy.tasks import ( send_bug_update_failure_email, send_landing_failure_email, ) diff --git a/src/lando/api/legacy/phabricator.py b/src/lando/api/legacy/phabricator.py index 37fb8826..0ca634c0 100644 --- a/src/lando/api/legacy/phabricator.py +++ b/src/lando/api/legacy/phabricator.py @@ -24,7 +24,7 @@ import requests -from landoapi.systems import Subsystem +from lando.api.legacy.systems import Subsystem logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/projects.py b/src/lando/api/legacy/projects.py index d2f3384b..bc32e1b9 100644 --- a/src/lando/api/legacy/projects.py +++ b/src/lando/api/legacy/projects.py @@ -4,8 +4,8 @@ import logging from typing import Optional -from landoapi.cache import DEFAULT_CACHE_KEY_TIMEOUT_SECONDS, cache -from landoapi.phabricator import PhabricatorClient, result_list_to_phid_dict +from lando.api.legacy.cache import DEFAULT_CACHE_KEY_TIMEOUT_SECONDS, cache +from lando.api.legacy.phabricator import PhabricatorClient, result_list_to_phid_dict logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/repos.py b/src/lando/api/legacy/repos.py index 45bd80af..7dd77ffb 100644 --- a/src/lando/api/legacy/repos.py +++ b/src/lando/api/legacy/repos.py @@ -14,7 +14,7 @@ ) from typing import Optional -from landoapi.systems import Subsystem +from lando.api.legacy.systems import Subsystem logger = logging.getLogger(__name__) @@ -435,7 +435,7 @@ def ready(self) -> Optional[bool | str]: self.repos = {name: repos[name] for name in repo_names} self.repo_paths = {} - from landoapi.hg import HgRepo + from lando.api.legacy.hg import HgRepo for name, repo in self.repos.items(): path = clones_path.joinpath(name) diff --git a/src/lando/api/legacy/reviews.py b/src/lando/api/legacy/reviews.py index f16fccd5..ccd726da 100644 --- a/src/lando/api/legacy/reviews.py +++ b/src/lando/api/legacy/reviews.py @@ -5,12 +5,12 @@ import logging from collections import namedtuple -from landoapi.phabricator import ( +from lando.api.legacy.phabricator import ( PhabricatorClient, PhabricatorCommunicationException, ReviewerStatus, ) -from landoapi.projects import ( +from lando.api.legacy.projects import ( RELMAN_PROJECT_SLUG, ) diff --git a/src/lando/api/legacy/revisions.py b/src/lando/api/legacy/revisions.py index bbcef637..b8377679 100644 --- a/src/lando/api/legacy/revisions.py +++ b/src/lando/api/legacy/revisions.py @@ -10,13 +10,13 @@ Optional, ) -from landoapi.phabricator import ( +from lando.api.legacy.phabricator import ( PhabricatorClient, PhabricatorRevisionStatus, ReviewerStatus, ) -from landoapi.reviews import get_collated_reviewers -from landoapi.uplift import ( +from lando.api.legacy.reviews import get_collated_reviewers +from lando.api.legacy.uplift import ( stack_uplift_form_submitted, ) diff --git a/src/lando/api/legacy/sentry.py b/src/lando/api/legacy/sentry.py index e3f19dcc..ddf4583a 100644 --- a/src/lando/api/legacy/sentry.py +++ b/src/lando/api/legacy/sentry.py @@ -6,7 +6,7 @@ import sentry_sdk from sentry_sdk.integrations.flask import FlaskIntegration -from landoapi.systems import Subsystem +from lando.api.legacy.systems import Subsystem logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/smtp.py b/src/lando/api/legacy/smtp.py index 2ed1cdb2..d7a68c21 100644 --- a/src/lando/api/legacy/smtp.py +++ b/src/lando/api/legacy/smtp.py @@ -5,7 +5,7 @@ import smtplib from contextlib import contextmanager -from landoapi.systems import Subsystem +from lando.api.legacy.systems import Subsystem logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/stacks.py b/src/lando/api/legacy/stacks.py index 6f120c36..fe707a03 100644 --- a/src/lando/api/legacy/stacks.py +++ b/src/lando/api/legacy/stacks.py @@ -15,12 +15,12 @@ import networkx as nx -from landoapi.phabricator import ( +from lando.api.legacy.phabricator import ( PhabricatorClient, PhabricatorRevisionStatus, result_list_to_phid_dict, ) -from landoapi.repos import Repo +from lando.api.legacy.repos import Repo logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/storage.py b/src/lando/api/legacy/storage.py index 429c5c9b..ae6afcef 100644 --- a/src/lando/api/legacy/storage.py +++ b/src/lando/api/legacy/storage.py @@ -6,7 +6,7 @@ from flask_sqlalchemy import SQLAlchemy from sqlalchemy.exc import DBAPIError, SQLAlchemyError -from landoapi.systems import Subsystem +from lando.api.legacy.systems import Subsystem db = SQLAlchemy() migrate = Migrate() diff --git a/src/lando/api/legacy/tasks.py b/src/lando/api/legacy/tasks.py index 83911fbf..92f8919c 100644 --- a/src/lando/api/legacy/tasks.py +++ b/src/lando/api/legacy/tasks.py @@ -6,12 +6,12 @@ import ssl from typing import Optional -from flask import current_app +from lando import settings -from landoapi.celery import celery -from landoapi.email import make_failure_email -from landoapi.phabricator import PhabricatorClient, PhabricatorCommunicationException -from landoapi.smtp import smtp +from lando.api.legacy.celery import celery +from lando.api.legacy.email import make_failure_email +from lando.api.legacy.phabricator import PhabricatorClient, PhabricatorCommunicationException +from lando.api.legacy.smtp import smtp logger = logging.getLogger(__name__) @@ -64,7 +64,7 @@ def send_landing_failure_email( recipient_email, landing_job_identifier, error_msg, - current_app.config["LANDO_UI_URL"], + settings.LANDO_UI_URL, ) ) @@ -119,7 +119,7 @@ def send_bug_update_failure_email( recipient_email, landing_job_identifier, error_msg, - current_app.config["LANDO_UI_URL"], + settings.LANDO_UI_URL, ) ) @@ -152,8 +152,8 @@ def admin_remove_phab_project( transactions.append({"type": "comment", "value": comment}) privileged_phab = PhabricatorClient( - current_app.config["PHABRICATOR_URL"], - current_app.config["PHABRICATOR_ADMIN_API_KEY"], + settings.PHABRICATOR_URL, + settings.PHABRICATOR_ADMIN_API_KEY, ) # We only retry for PhabricatorCommunicationException, rather than the # base PhabricatorAPIException to treat errors in this implementation as @@ -175,7 +175,7 @@ def phab_trigger_repo_update(repo_identifier: str): """Trigger a repo update in Phabricator's backend.""" # Tell Phabricator to scan the landing repo so revisions are closed quickly. phab = PhabricatorClient( - current_app.config["PHABRICATOR_URL"], - current_app.config["PHABRICATOR_ADMIN_API_KEY"], + settings.PHABRICATOR_URL, + settings.PHABRICATOR_ADMIN_API_KEY, ) phab.call_conduit("diffusion.looksoon", repositories=[repo_identifier]) diff --git a/src/lando/api/legacy/transactions.py b/src/lando/api/legacy/transactions.py index deaf9bf8..4226491a 100644 --- a/src/lando/api/legacy/transactions.py +++ b/src/lando/api/legacy/transactions.py @@ -10,7 +10,7 @@ Optional, ) -from landoapi.phabricator import PhabricatorClient +from lando.api.legacy.phabricator import PhabricatorClient # Type for a Phabricator API Transaction returned by the transaction.search operation. Transaction = NewType("Transaction", dict) diff --git a/src/lando/api/legacy/transplants.py b/src/lando/api/legacy/transplants.py index a23285c7..6674d071 100644 --- a/src/lando/api/legacy/transplants.py +++ b/src/lando/api/legacy/transplants.py @@ -10,28 +10,28 @@ import requests from connexion import ProblemException -from flask import current_app +from lando import settings -from landoapi.models.landing_job import LandingJob, LandingJobStatus -from landoapi.models.revisions import DiffWarning, DiffWarningStatus -from landoapi.phabricator import ( +from lando.main.models.landing_job import LandingJob, LandingJobStatus +from lando.main.models.revision import DiffWarning, DiffWarningStatus +from lando.api.legacy.phabricator import ( PhabricatorClient, PhabricatorRevisionStatus, ReviewerStatus, ) -from landoapi.repos import Repo, get_repos_for_env -from landoapi.reviews import calculate_review_extra_state, reviewer_identity -from landoapi.revisions import ( +from lando.api.legacy.repos import Repo, get_repos_for_env +from lando.api.legacy.reviews import calculate_review_extra_state, reviewer_identity +from lando.api.legacy.revisions import ( check_author_planned_changes, check_diff_author_is_known, check_uplift_approval, revision_is_secure, revision_needs_testing_tag, ) -from landoapi.stacks import ( +from lando.api.legacy.stacks import ( RevisionData, ) -from landoapi.transactions import get_inline_comments +from lando.api.legacy.transactions import get_inline_comments logger = logging.getLogger(__name__) @@ -321,7 +321,7 @@ def warning_wip_commit_message(*, revision, **kwargs): @RevisionWarningCheck(8, "Repository is under a soft code freeze.", True) def warning_code_freeze(*, repo, **kwargs): - supported_repos = get_repos_for_env(current_app.config.get("ENVIRONMENT")) + supported_repos = get_repos_for_env(settings.ENVIRONMENT) try: repo_details = supported_repos[repo["fields"]["shortName"]] except KeyError: diff --git a/src/lando/api/legacy/treestatus.py b/src/lando/api/legacy/treestatus.py index e01e582b..f6f65601 100644 --- a/src/lando/api/legacy/treestatus.py +++ b/src/lando/api/legacy/treestatus.py @@ -6,7 +6,7 @@ import requests -from landoapi.systems import Subsystem +from lando.api.legacy.systems import Subsystem logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/ui.py b/src/lando/api/legacy/ui.py index fc18013b..1744e840 100644 --- a/src/lando/api/legacy/ui.py +++ b/src/lando/api/legacy/ui.py @@ -7,7 +7,7 @@ import logging from urllib.parse import urlparse -from landoapi.systems import Subsystem +from lando.api.legacy.systems import Subsystem logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/uplift.py b/src/lando/api/legacy/uplift.py index a31a4a8c..ab8f264e 100644 --- a/src/lando/api/legacy/uplift.py +++ b/src/lando/api/legacy/uplift.py @@ -12,21 +12,21 @@ ) import requests -from flask import current_app +from lando import settings from packaging.version import ( InvalidVersion, Version, ) -from landoapi import bmo -from landoapi.cache import DEFAULT_CACHE_KEY_TIMEOUT_SECONDS, cache -from landoapi.phabricator import PhabricatorClient -from landoapi.phabricator_patch import patch_to_changes -from landoapi.repos import ( +from lando.api import bmo +from lando.api.legacy.cache import DEFAULT_CACHE_KEY_TIMEOUT_SECONDS, cache +from lando.api.legacy.phabricator import PhabricatorClient +from lando.api.legacy.phabricator_patch import patch_to_changes +from lando.api.legacy.repos import ( Repo, get_repos_for_env, ) -from landoapi.stacks import ( +from lando.api.legacy.stacks import ( RevisionData, RevisionStack, build_stack_graph, @@ -154,7 +154,7 @@ def get_local_uplift_repo(phab: PhabricatorClient, target_repository: dict) -> R Raise if the repo is not an uplift repo. """ # Check the target repository needs an approval. - repos = get_repos_for_env(current_app.config.get("ENVIRONMENT")) + repos = get_repos_for_env(settings.ENVIRONMENT) repo_shortname = phab.expect(target_repository, "fields", "shortName") local_repo = repos.get(repo_shortname) diff --git a/src/lando/api/legacy/users.py b/src/lando/api/legacy/users.py index 4533e33b..6d0213ea 100644 --- a/src/lando/api/legacy/users.py +++ b/src/lando/api/legacy/users.py @@ -2,7 +2,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 landoapi.phabricator import result_list_to_phid_dict +from lando.api.legacy.phabricator import result_list_to_phid_dict def user_search(phabricator, user_phids): diff --git a/src/lando/api/legacy/workers/base.py b/src/lando/api/legacy/workers/base.py index ce9b75b9..e08a0b01 100644 --- a/src/lando/api/legacy/workers/base.py +++ b/src/lando/api/legacy/workers/base.py @@ -10,9 +10,9 @@ import subprocess from time import sleep -from landoapi.models.configuration import ConfigurationKey, ConfigurationVariable -from landoapi.repos import repo_clone_subsystem -from landoapi.treestatus import treestatus_subsystem +from lando.main.models.configuration import ConfigurationKey, ConfigurationVariable +from lando.api.legacy.repos import repo_clone_subsystem +from lando.api.legacy.treestatus import treestatus_subsystem logger = logging.getLogger(__name__) diff --git a/src/lando/api/legacy/workers/landing_worker.py b/src/lando/api/legacy/workers/landing_worker.py index 67ef99e4..032d7f9f 100644 --- a/src/lando/api/legacy/workers/landing_worker.py +++ b/src/lando/api/legacy/workers/landing_worker.py @@ -13,8 +13,8 @@ import kombu -from landoapi.commit_message import parse_bugs -from landoapi.hg import ( +from lando.api.legacy.commit_message import parse_bugs +from lando.api.legacy.hg import ( REJECTS_PATH, AutoformattingException, HgmoInternalServerError, @@ -26,26 +26,26 @@ TreeApprovalRequired, TreeClosed, ) -from landoapi.models.configuration import ConfigurationKey -from landoapi.models.landing_job import LandingJob, LandingJobAction, LandingJobStatus -from landoapi.notifications import ( +from lando.api.legacy.models.configuration import ConfigurationKey +from lando.api.legacy.models.landing_job import LandingJob, LandingJobAction, LandingJobStatus +from lando.api.legacy.notifications import ( notify_user_of_bug_update_failure, notify_user_of_landing_failure, ) -from landoapi.repos import ( +from lando.api.legacy.repos import ( Repo, repo_clone_subsystem, ) -from landoapi.storage import SQLAlchemy, db -from landoapi.tasks import phab_trigger_repo_update -from landoapi.treestatus import ( +from lando.api.legacy.storage import SQLAlchemy, db +from lando.api.legacy.tasks import phab_trigger_repo_update +from lando.api.legacy.treestatus import ( TreeStatus, treestatus_subsystem, ) -from landoapi.uplift import ( +from lando.api.legacy.uplift import ( update_bugs_for_uplift, ) -from landoapi.workers.base import Worker +from lando.api.legacy.workers.base import Worker logger = logging.getLogger(__name__) diff --git a/src/lando/api/tests/conftest.py b/src/lando/api/tests/conftest.py index d999186c..25892165 100644 --- a/src/lando/api/tests/conftest.py +++ b/src/lando/api/tests/conftest.py @@ -18,20 +18,20 @@ from flask import current_app from pytest_flask.plugin import JSONResponse -from landoapi.app import SUBSYSTEMS, construct_app, load_config -from landoapi.cache import cache -from landoapi.mocks.auth import TEST_JWKS, MockAuth0 -from landoapi.phabricator import PhabricatorClient -from landoapi.projects import ( +from lando.api.legacy.app import SUBSYSTEMS, construct_app, load_config +from lando.api.legacy.cache import cache +from lando.api.legacy.mocks.auth import TEST_JWKS, MockAuth0 +from lando.api.legacy.phabricator import PhabricatorClient +from lando.api.legacy.projects import ( CHECKIN_PROJ_SLUG, RELMAN_PROJECT_SLUG, SEC_APPROVAL_PROJECT_SLUG, SEC_PROJ_SLUG, ) -from landoapi.repos import SCM_LEVEL_1, SCM_LEVEL_3, Repo -from landoapi.storage import db as _db -from landoapi.tasks import celery -from landoapi.transplants import CODE_FREEZE_OFFSET, tokens_are_equal +from lando.api.legacy.repos import SCM_LEVEL_1, SCM_LEVEL_3, Repo +from lando.api.legacy.storage import db as _db +from lando.api.legacy.tasks import celery +from lando.api.legacy.transplants import CODE_FREEZE_OFFSET, tokens_are_equal from tests.mocks import PhabricatorDouble, TreeStatusDouble PATCH_NORMAL_1 = r""" diff --git a/src/lando/api/tests/mocks.py b/src/lando/api/tests/mocks.py index 30819a3b..b962af6c 100644 --- a/src/lando/api/tests/mocks.py +++ b/src/lando/api/tests/mocks.py @@ -6,13 +6,13 @@ from collections import defaultdict from copy import deepcopy -from landoapi.phabricator import ( +from lando.api.legacy.phabricator import ( PhabricatorAPIException, PhabricatorClient, PhabricatorRevisionStatus, ReviewerStatus, ) -from landoapi.treestatus import TreeStatus, TreeStatusError +from lando.api.legacy.treestatus import TreeStatus, TreeStatusError from tests.canned_responses.phabricator.diffs import ( CANNED_DEFAULT_DIFF_CHANGES, CANNED_RAW_DEFAULT_DIFF, diff --git a/src/lando/api/tests/test_auth.py b/src/lando/api/tests/test_auth.py index 448ada8d..c27ce925 100644 --- a/src/lando/api/tests/test_auth.py +++ b/src/lando/api/tests/test_auth.py @@ -11,15 +11,15 @@ from connexion.lifecycle import ConnexionResponse from flask import g -from landoapi.auth import ( +from lando.api.legacy.auth import ( A0User, ensure_user_has_scm_level, fetch_auth0_userinfo, require_auth0, ) -from landoapi.mocks.auth import TEST_KEY_PRIV, create_access_token -from landoapi.mocks.canned_responses.auth0 import CANNED_USERINFO -from landoapi.repos import SCM_LEVEL_1 +from lando.api.legacy.mocks.auth import TEST_KEY_PRIV, create_access_token +from lando.api.legacy.mocks.canned_responses.auth0 import CANNED_USERINFO +from lando.api.legacy.repos import SCM_LEVEL_1 def noop(*args, **kwargs): diff --git a/src/lando/api/tests/test_commit_message.py b/src/lando/api/tests/test_commit_message.py index 97051b01..0e1dbb2e 100644 --- a/src/lando/api/tests/test_commit_message.py +++ b/src/lando/api/tests/test_commit_message.py @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest -from landoapi.commit_message import ( +from lando.api.legacy.commit_message import ( bug_list_to_commit_string, format_commit_message, split_title_and_summary, diff --git a/src/lando/api/tests/test_decorators.py b/src/lando/api/tests/test_decorators.py index bda2537b..39ab2202 100644 --- a/src/lando/api/tests/test_decorators.py +++ b/src/lando/api/tests/test_decorators.py @@ -4,8 +4,8 @@ import pytest from connexion.lifecycle import ConnexionResponse -from landoapi.decorators import require_phabricator_api_key -from landoapi.phabricator import PhabricatorClient +from lando.api.legacy.decorators import require_phabricator_api_key +from lando.api.legacy.phabricator import PhabricatorClient def noop(phab, *args, **kwargs): diff --git a/src/lando/api/tests/test_diff_warnings.py b/src/lando/api/tests/test_diff_warnings.py index d106f5d7..17c298bb 100644 --- a/src/lando/api/tests/test_diff_warnings.py +++ b/src/lando/api/tests/test_diff_warnings.py @@ -4,7 +4,7 @@ import pytest -from landoapi.models.revisions import ( +from lando.api.legacy.models.revisions import ( DiffWarning, DiffWarningGroup, DiffWarningStatus, diff --git a/src/lando/api/tests/test_health.py b/src/lando/api/tests/test_health.py index cde7456f..5da055ca 100644 --- a/src/lando/api/tests/test_health.py +++ b/src/lando/api/tests/test_health.py @@ -7,10 +7,10 @@ import redis from sqlalchemy.exc import SQLAlchemyError -from landoapi.auth import auth0_subsystem -from landoapi.cache import cache_subsystem -from landoapi.phabricator import PhabricatorAPIException, phabricator_subsystem -from landoapi.storage import db_subsystem +from lando.api.legacy.auth import auth0_subsystem +from lando.api.legacy.cache import cache_subsystem +from lando.api.legacy.phabricator import PhabricatorAPIException, phabricator_subsystem +from lando.api.legacy.storage import db_subsystem def test_database_healthy(db): diff --git a/src/lando/api/tests/test_hg.py b/src/lando/api/tests/test_hg.py index 2453a010..e18c3f80 100644 --- a/src/lando/api/tests/test_hg.py +++ b/src/lando/api/tests/test_hg.py @@ -6,7 +6,7 @@ import pytest -from landoapi.hg import ( +from lando.api.legacy.hg import ( REQUEST_USER_ENV_VAR, HgCommandError, HgException, diff --git a/src/lando/api/tests/test_hgexports.py b/src/lando/api/tests/test_hgexports.py index 59ba58fa..0dd4d6c6 100644 --- a/src/lando/api/tests/test_hgexports.py +++ b/src/lando/api/tests/test_hgexports.py @@ -5,7 +5,7 @@ import pytest -from landoapi.hgexports import ( +from lando.api.legacy.hgexports import ( GitPatchHelper, HgPatchHelper, build_patch_for_revision, diff --git a/src/lando/api/tests/test_hooks.py b/src/lando/api/tests/test_hooks.py index a04dd992..e81c55bd 100644 --- a/src/lando/api/tests/test_hooks.py +++ b/src/lando/api/tests/test_hooks.py @@ -1,11 +1,11 @@ # 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 landoapi.phabricator import ( +from lando.api.legacy.phabricator import ( PhabricatorAPIException, PhabricatorCommunicationException, ) -from landoapi.treestatus import TreeStatusCommunicationException, TreeStatusError +from lando.api.legacy.treestatus import TreeStatusCommunicationException, TreeStatusError def test_app_wide_headers_set(client): diff --git a/src/lando/api/tests/test_landing_job.py b/src/lando/api/tests/test_landing_job.py index 4315f1ab..61cb55ce 100644 --- a/src/lando/api/tests/test_landing_job.py +++ b/src/lando/api/tests/test_landing_job.py @@ -4,7 +4,7 @@ import pytest -from landoapi.models.landing_job import LandingJob, LandingJobStatus +from lando.api.legacy.models.landing_job import LandingJob, LandingJobStatus @pytest.fixture diff --git a/src/lando/api/tests/test_landings.py b/src/lando/api/tests/test_landings.py index 6d03f077..723ba376 100644 --- a/src/lando/api/tests/test_landings.py +++ b/src/lando/api/tests/test_landings.py @@ -8,15 +8,15 @@ import pytest -from landoapi.hg import AUTOFORMAT_COMMIT_MESSAGE, HgRepo -from landoapi.models.landing_job import ( +from lando.api.legacy.hg import AUTOFORMAT_COMMIT_MESSAGE, HgRepo +from lando.api.legacy.models.landing_job import ( LandingJob, LandingJobStatus, add_job_with_revisions, ) -from landoapi.models.revisions import Revision -from landoapi.repos import SCM_LEVEL_3, Repo -from landoapi.workers.landing_worker import LandingWorker +from lando.api.legacy.models.revisions import Revision +from lando.api.legacy.repos import SCM_LEVEL_3, Repo +from lando.api.legacy.workers.landing_worker import LandingWorker @pytest.fixture diff --git a/src/lando/api/tests/test_models.py b/src/lando/api/tests/test_models.py index c9c8630b..226217db 100644 --- a/src/lando/api/tests/test_models.py +++ b/src/lando/api/tests/test_models.py @@ -1,7 +1,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 landoapi.models.base import Base +from lando.api.legacy.models.base import Base class TestModelsBase: diff --git a/src/lando/api/tests/test_notifications.py b/src/lando/api/tests/test_notifications.py index c95aac4f..937de0a5 100644 --- a/src/lando/api/tests/test_notifications.py +++ b/src/lando/api/tests/test_notifications.py @@ -5,12 +5,12 @@ import pytest -from landoapi.celery import FlaskCelery -from landoapi.email import make_failure_email -from landoapi.models.landing_job import LandingJob -from landoapi.models.revisions import Revision -from landoapi.notifications import notify_user_of_landing_failure -from landoapi.tasks import send_landing_failure_email +from lando.api.legacy.celery import FlaskCelery +from lando.api.legacy.email import make_failure_email +from lando.api.legacy.models.landing_job import LandingJob +from lando.api.legacy.models.revisions import Revision +from lando.api.legacy.notifications import notify_user_of_landing_failure +from lando.api.legacy.tasks import send_landing_failure_email dedent = inspect.cleandoc diff --git a/src/lando/api/tests/test_phabricator.py b/src/lando/api/tests/test_phabricator.py index ae8fa83b..e58415eb 100644 --- a/src/lando/api/tests/test_phabricator.py +++ b/src/lando/api/tests/test_phabricator.py @@ -4,7 +4,7 @@ import pytest -from landoapi.phabricator import ( +from lando.api.legacy.phabricator import ( PhabricatorCommunicationException, PhabricatorRevisionStatus, result_list_to_phid_dict, diff --git a/src/lando/api/tests/test_phabricator_client.py b/src/lando/api/tests/test_phabricator_client.py index cc834caa..6214cde3 100644 --- a/src/lando/api/tests/test_phabricator_client.py +++ b/src/lando/api/tests/test_phabricator_client.py @@ -9,7 +9,7 @@ import requests import requests_mock -from landoapi.phabricator import PhabricatorAPIException +from lando.api.legacy.phabricator import PhabricatorAPIException from tests.utils import phab_url pytestmark = pytest.mark.usefixtures("docker_env_vars") diff --git a/src/lando/api/tests/test_phabricator_patch.py b/src/lando/api/tests/test_phabricator_patch.py index 233037df..7801e06b 100644 --- a/src/lando/api/tests/test_phabricator_patch.py +++ b/src/lando/api/tests/test_phabricator_patch.py @@ -8,7 +8,7 @@ import pytest -from landoapi.phabricator_patch import patch_to_changes +from lando.api.legacy.phabricator_patch import patch_to_changes @pytest.mark.parametrize("patch_name", ["basic", "random", "add"]) diff --git a/src/lando/api/tests/test_py3_codequality.py b/src/lando/api/tests/test_py3_codequality.py index d315c53c..1ae3d97d 100644 --- a/src/lando/api/tests/test_py3_codequality.py +++ b/src/lando/api/tests/test_py3_codequality.py @@ -7,7 +7,7 @@ import subprocess -from landoapi.cli import LINT_PATHS +from lando.api.legacy.cli import LINT_PATHS def test_check_python_style(): diff --git a/src/lando/api/tests/test_redis.py b/src/lando/api/tests/test_redis.py index 95b4ce71..c1576376 100644 --- a/src/lando/api/tests/test_redis.py +++ b/src/lando/api/tests/test_redis.py @@ -6,7 +6,7 @@ import pytest from redis import RedisError -from landoapi.redis import SuppressRedisFailure +from lando.api.legacy.redis import SuppressRedisFailure def test_suppress_redis_failure_logs_exceptions(caplog): diff --git a/src/lando/api/tests/test_reviews.py b/src/lando/api/tests/test_reviews.py index c93944df..cd236b68 100644 --- a/src/lando/api/tests/test_reviews.py +++ b/src/lando/api/tests/test_reviews.py @@ -4,15 +4,15 @@ import pytest -from landoapi.phabricator import PhabricatorCommunicationException -from landoapi.projects import project_search -from landoapi.reviews import ( +from lando.api.legacy.phabricator import PhabricatorCommunicationException +from lando.api.legacy.projects import project_search +from lando.api.legacy.reviews import ( approvals_for_commit_message, collate_reviewer_attachments, get_collated_reviewers, reviewers_for_commit_message, ) -from landoapi.users import user_search +from lando.api.legacy.users import user_search def test_collate_reviewer_attachments_malformed_raises(): diff --git a/src/lando/api/tests/test_revisions.py b/src/lando/api/tests/test_revisions.py index 55019e43..5be2715b 100644 --- a/src/lando/api/tests/test_revisions.py +++ b/src/lando/api/tests/test_revisions.py @@ -4,16 +4,16 @@ import pytest -from landoapi.phabricator import PhabricatorRevisionStatus, ReviewerStatus -from landoapi.repos import get_repos_for_env -from landoapi.revisions import ( +from lando.api.legacy.phabricator import PhabricatorRevisionStatus, ReviewerStatus +from lando.api.legacy.repos import get_repos_for_env +from lando.api.legacy.revisions import ( check_author_planned_changes, check_diff_author_is_known, check_uplift_approval, revision_is_secure, revision_needs_testing_tag, ) -from landoapi.stacks import ( +from lando.api.legacy.stacks import ( request_extended_revision_data, ) diff --git a/src/lando/api/tests/test_stacks.py b/src/lando/api/tests/test_stacks.py index cfcb97e4..49d993f0 100644 --- a/src/lando/api/tests/test_stacks.py +++ b/src/lando/api/tests/test_stacks.py @@ -4,9 +4,9 @@ import pytest -from landoapi.phabricator import PhabricatorRevisionStatus -from landoapi.repos import get_repos_for_env -from landoapi.stacks import ( +from lando.api.legacy.phabricator import PhabricatorRevisionStatus +from lando.api.legacy.repos import get_repos_for_env +from lando.api.legacy.stacks import ( RevisionStack, build_stack_graph, calculate_landable_subgraphs, diff --git a/src/lando/api/tests/test_tasks.py b/src/lando/api/tests/test_tasks.py index 37dd1365..2d64243e 100644 --- a/src/lando/api/tests/test_tasks.py +++ b/src/lando/api/tests/test_tasks.py @@ -3,11 +3,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest -from landoapi.phabricator import ( +from lando.api.legacy.phabricator import ( PhabricatorAPIException, PhabricatorCommunicationException, ) -from landoapi.tasks import admin_remove_phab_project +from lando.api.legacy.tasks import admin_remove_phab_project def test_admin_remove_phab_project_succeeds(phabdouble, app): diff --git a/src/lando/api/tests/test_transactions.py b/src/lando/api/tests/test_transactions.py index 722a0aec..1231ff8a 100644 --- a/src/lando/api/tests/test_transactions.py +++ b/src/lando/api/tests/test_transactions.py @@ -2,7 +2,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 landoapi.transactions import get_inline_comments, transaction_search +from lando.api.legacy.transactions import get_inline_comments, transaction_search def test_transaction_search_for_all_transactions(phabdouble): diff --git a/src/lando/api/tests/test_transplants.py b/src/lando/api/tests/test_transplants.py index 1a49cb07..bd1f2821 100644 --- a/src/lando/api/tests/test_transplants.py +++ b/src/lando/api/tests/test_transplants.py @@ -6,20 +6,20 @@ import pytest -from landoapi.hg import HgRepo -from landoapi.mocks.canned_responses.auth0 import CANNED_USERINFO -from landoapi.models.landing_job import ( +from lando.api.legacy.hg import HgRepo +from lando.api.legacy.mocks.canned_responses.auth0 import CANNED_USERINFO +from lando.api.legacy.models.landing_job import ( LandingJob, LandingJobStatus, add_job_with_revisions, ) -from landoapi.models.revisions import Revision -from landoapi.models.transplant import Transplant -from landoapi.phabricator import PhabricatorRevisionStatus, ReviewerStatus -from landoapi.repos import DONTBUILD, SCM_CONDUIT, SCM_LEVEL_3, Repo -from landoapi.reviews import get_collated_reviewers -from landoapi.tasks import admin_remove_phab_project -from landoapi.transplants import ( +from lando.api.legacy.models.revisions import Revision +from lando.api.legacy.models.transplant import Transplant +from lando.api.legacy.phabricator import PhabricatorRevisionStatus, ReviewerStatus +from lando.api.legacy.repos import DONTBUILD, SCM_CONDUIT, SCM_LEVEL_3, Repo +from lando.api.legacy.reviews import get_collated_reviewers +from lando.api.legacy.tasks import admin_remove_phab_project +from lando.api.legacy.transplants import ( RevisionWarning, TransplantAssessment, warning_not_accepted, @@ -28,7 +28,7 @@ warning_revision_secure, warning_wip_commit_message, ) -from landoapi.workers.landing_worker import LandingWorker +from lando.api.legacy.workers.landing_worker import LandingWorker def _create_landing_job( diff --git a/src/lando/api/tests/test_treestatus.py b/src/lando/api/tests/test_treestatus.py index b2b4222b..081d79a0 100644 --- a/src/lando/api/tests/test_treestatus.py +++ b/src/lando/api/tests/test_treestatus.py @@ -5,7 +5,7 @@ import requests import requests_mock -from landoapi.treestatus import ( +from lando.api.legacy.treestatus import ( TreeStatus, TreeStatusCommunicationException, TreeStatusError, diff --git a/src/lando/api/tests/test_try.py b/src/lando/api/tests/test_try.py index 8a6e42af..1a4dbdaf 100644 --- a/src/lando/api/tests/test_try.py +++ b/src/lando/api/tests/test_try.py @@ -6,14 +6,14 @@ import pytest -from landoapi.hg import HgRepo -from landoapi.hgexports import ( +from lando.api.legacy.hg import HgRepo +from lando.api.legacy.hgexports import ( get_timestamp_from_git_date_header, parse_git_author_information, ) -from landoapi.models.landing_job import LandingJob, LandingJobStatus -from landoapi.repos import SCM_LEVEL_1, Repo -from landoapi.workers.landing_worker import LandingWorker +from lando.api.legacy.models.landing_job import LandingJob, LandingJobStatus +from lando.api.legacy.repos import SCM_LEVEL_1, Repo +from lando.api.legacy.workers.landing_worker import LandingWorker PATCH_DIFF = rb""" diff --git a/test.txt b/test.txt diff --git a/src/lando/api/tests/test_uplift.py b/src/lando/api/tests/test_uplift.py index 70dd4e2e..04d7716f 100644 --- a/src/lando/api/tests/test_uplift.py +++ b/src/lando/api/tests/test_uplift.py @@ -7,13 +7,13 @@ Version, ) -from landoapi.phabricator import ( +from lando.api.legacy.phabricator import ( PhabricatorClient, ) -from landoapi.stacks import ( +from lando.api.legacy.stacks import ( build_stack_graph, ) -from landoapi.uplift import ( +from lando.api.legacy.uplift import ( add_original_revision_line_if_needed, create_uplift_bug_update_payload, get_revisions_without_bugs, diff --git a/src/lando/api/tests/test_validation.py b/src/lando/api/tests/test_validation.py index f9ab357d..44f2543c 100644 --- a/src/lando/api/tests/test_validation.py +++ b/src/lando/api/tests/test_validation.py @@ -4,7 +4,7 @@ import pytest from connexion import ProblemException -from landoapi.validation import revision_id_to_int +from lando.api.legacy.validation import revision_id_to_int def test_convertion_success(): diff --git a/src/lando/ui/legacy/errorhandlers.py b/src/lando/ui/legacy/errorhandlers.py index 57b16e54..47c2ea65 100644 --- a/src/lando/ui/legacy/errorhandlers.py +++ b/src/lando/ui/legacy/errorhandlers.py @@ -6,7 +6,7 @@ import sentry_sdk from flask import render_template -from landoui.landoapi import ( +from lando.ui.legacy.landoapi import ( LandoAPICommunicationException, LandoAPIError, LandoAPIException, diff --git a/src/lando/ui/legacy/landoapi.py b/src/lando/ui/legacy/landoapi.py index 127e9739..466f91eb 100644 --- a/src/lando/ui/legacy/landoapi.py +++ b/src/lando/ui/legacy/landoapi.py @@ -17,7 +17,7 @@ session, ) -from landoui.helpers import get_phabricator_api_token +from lando.ui.legacy.helpers import get_phabricator_api_token logger = logging.getLogger(__name__) @@ -120,7 +120,7 @@ def from_environment(cls, token: Optional[str] = None) -> LandoAPI: class LandoAPIException(Exception): - """Exception from LandoAPI.""" + """Exception from lando.api.legacy.""" class LandoAPICommunicationException(LandoAPIException): diff --git a/src/lando/ui/legacy/pages.py b/src/lando/ui/legacy/pages.py index a7b00e95..1a2c7bdc 100644 --- a/src/lando/ui/legacy/pages.py +++ b/src/lando/ui/legacy/pages.py @@ -18,11 +18,11 @@ session, ) -from landoui.app import oidc -from landoui.errorhandlers import UIError -from landoui.forms import UserSettingsForm -from landoui.helpers import set_last_local_referrer, is_user_authenticated -from landoui.usersettings import manage_phab_api_token_cookie +from lando.ui.legacy.app import oidc +from lando.ui.legacy.errorhandlers import UIError +from lando.ui.legacy.forms import UserSettingsForm +from lando.ui.legacy.helpers import set_last_local_referrer, is_user_authenticated +from lando.ui.legacy.usersettings import manage_phab_api_token_cookie logger = logging.getLogger(__name__) diff --git a/src/lando/ui/legacy/usersettings.py b/src/lando/ui/legacy/usersettings.py index bb8edda9..c7000d11 100644 --- a/src/lando/ui/legacy/usersettings.py +++ b/src/lando/ui/legacy/usersettings.py @@ -8,7 +8,7 @@ Response, ) -from landoui.forms import UserSettingsForm +from lando.ui.legacy.forms import UserSettingsForm def manage_phab_api_token_cookie(form: UserSettingsForm, payload: dict) -> Response: diff --git a/src/lando/ui/tests/conftest.py b/src/lando/ui/tests/conftest.py index 5ed04241..37954f15 100644 --- a/src/lando/ui/tests/conftest.py +++ b/src/lando/ui/tests/conftest.py @@ -9,7 +9,7 @@ import pytest import socket -from landoui.app import create_app +from lando.ui.legacy.app import create_app @pytest.fixture diff --git a/src/lando/ui/tests/test_errorhandlers.py b/src/lando/ui/tests/test_errorhandlers.py index bcc3230a..4a449c54 100644 --- a/src/lando/ui/tests/test_errorhandlers.py +++ b/src/lando/ui/tests/test_errorhandlers.py @@ -2,7 +2,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 landoui.errorhandlers import UIError, RevisionNotFound +from lando.ui.legacy.errorhandlers import UIError, RevisionNotFound def test_unknown_route_shows_default_404_page(client): diff --git a/src/lando/ui/tests/test_forms.py b/src/lando/ui/tests/test_forms.py index a8bdd0c8..adb5a2ec 100644 --- a/src/lando/ui/tests/test_forms.py +++ b/src/lando/ui/tests/test_forms.py @@ -5,7 +5,7 @@ from werkzeug.datastructures import MultiDict -from landoui.forms import UserSettingsForm +from lando.ui.legacy.forms import UserSettingsForm class MockUserSettingsForm(UserSettingsForm): diff --git a/src/lando/ui/tests/test_landoapi.py b/src/lando/ui/tests/test_landoapi.py index 9b8b2c8f..c45c434f 100644 --- a/src/lando/ui/tests/test_landoapi.py +++ b/src/lando/ui/tests/test_landoapi.py @@ -5,7 +5,7 @@ import requests import requests_mock -from landoui.landoapi import ( +from lando.ui.legacy.landoapi import ( LandoAPI, LandoAPIError, LandoAPICommunicationException, diff --git a/src/lando/ui/tests/test_stacks.py b/src/lando/ui/tests/test_stacks.py index 8f9a8c7b..948b85c3 100644 --- a/src/lando/ui/tests/test_stacks.py +++ b/src/lando/ui/tests/test_stacks.py @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest -from landoui.stacks import ( +from lando.ui.legacy.stacks import ( draw_stack_graph, Edge, sort_stack_topological, diff --git a/src/lando/ui/tests/test_template_helpers.py b/src/lando/ui/tests/test_template_helpers.py index 21e2d783..374151cb 100644 --- a/src/lando/ui/tests/test_template_helpers.py +++ b/src/lando/ui/tests/test_template_helpers.py @@ -5,7 +5,7 @@ import pytest -from landoui.template_helpers import ( +from lando.ui.legacy.template_helpers import ( avatar_url, linkify_bug_numbers, linkify_revision_ids, diff --git a/src/lando/ui/tests/test_usersettings.py b/src/lando/ui/tests/test_usersettings.py index cac1693e..f7c0c7a3 100644 --- a/src/lando/ui/tests/test_usersettings.py +++ b/src/lando/ui/tests/test_usersettings.py @@ -1,8 +1,8 @@ # 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 landoui.forms import UserSettingsForm -from landoui.usersettings import manage_phab_api_token_cookie +from lando.ui.legacy.forms import UserSettingsForm +from lando.ui.legacy.usersettings import manage_phab_api_token_cookie def test_setting_token(app):