Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/internal/owner/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
from django.conf import settings
from rest_framework import serializers
from rest_framework.exceptions import PermissionDenied

from codecov_auth.models import Owner
from plan.constants import (
from shared.plan.constants import (
PAID_PLANS,
SENTRY_PAID_USER_PLAN_REPRESENTATIONS,
TEAM_PLAN_MAX_USERS,
TEAM_PLAN_REPRESENTATIONS,
)

from codecov_auth.models import Owner
from plan.service import PlanService
from services.billing import BillingService
from services.sentry import send_user_webhook as send_sentry_webhook
Expand Down
2 changes: 1 addition & 1 deletion api/internal/tests/views/test_account_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
OwnerFactory,
UserFactory,
)
from shared.plan.constants import PlanName, TrialStatus
from stripe import StripeError

from api.internal.tests.test_utils import GetAdminProviderAdapter
from codecov_auth.models import Service
from plan.constants import PlanName, TrialStatus
from utils.test_utils import APIClient

curr_path = os.path.dirname(__file__)
Expand Down
2 changes: 1 addition & 1 deletion billing/helpers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.conf import settings
from shared.plan.constants import ENTERPRISE_CLOUD_USER_PLAN_REPRESENTATIONS

from codecov_auth.models import Owner
from plan.constants import ENTERPRISE_CLOUD_USER_PLAN_REPRESENTATIONS


def on_enterprise_plan(owner: Owner) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion billing/tests/test_helpers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.test import TestCase, override_settings
from shared.django_apps.core.tests.factories import OwnerFactory
from shared.plan.constants import ENTERPRISE_CLOUD_USER_PLAN_REPRESENTATIONS

from billing.helpers import on_enterprise_plan
from plan.constants import ENTERPRISE_CLOUD_USER_PLAN_REPRESENTATIONS


class HelpersTestCase(TestCase):
Expand Down
3 changes: 1 addition & 2 deletions billing/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
from rest_framework.reverse import reverse
from rest_framework.test import APIRequestFactory, APITestCase
from shared.django_apps.core.tests.factories import OwnerFactory, RepositoryFactory

from plan.constants import PlanName
from shared.plan.constants import PlanName

from ..constants import StripeHTTPHeaders

Expand Down
2 changes: 1 addition & 1 deletion codecov_auth/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
InvoiceBilling,
StripeBilling,
)
from shared.plan.constants import USER_PLAN_REPRESENTATIONS

from codecov.admin import AdminMixin
from codecov.commands.exceptions import ValidationError
from codecov_auth.helpers import History
from codecov_auth.models import OrganizationLevelToken, Owner, SentryUser, Session, User
from codecov_auth.services.org_level_token_service import OrgLevelTokenService
from plan.constants import USER_PLAN_REPRESENTATIONS
from plan.service import PlanService
from services.task import TaskService
from utils.services import get_short_service_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from django.test import TransactionTestCase
from freezegun import freeze_time
from shared.django_apps.core.tests.factories import OwnerFactory
from shared.plan.constants import PlanName, TrialStatus

from codecov.commands.exceptions import Unauthorized, ValidationError
from codecov_auth.models import Owner
from plan.constants import PlanName, TrialStatus

from ..cancel_trial import CancelTrialInteractor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
RepositoryFactory,
)
from shared.django_apps.reports.models import ReportType
from shared.plan.constants import TrialStatus
from shared.upload.utils import UploaderType, insert_coverage_measurement

from plan.constants import TrialStatus
from reports.tests.factories import CommitReportFactory, UploadFactory

from ..get_uploads_number_per_user import GetUploadsNumberPerUserInteractor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
from django.test import TransactionTestCase
from freezegun import freeze_time
from shared.django_apps.core.tests.factories import OwnerFactory
from shared.plan.constants import (
TRIAL_PLAN_SEATS,
PlanName,
TrialDaysAmount,
TrialStatus,
)

from codecov.commands.exceptions import Unauthorized, ValidationError
from codecov_auth.models import Owner
from plan.constants import TRIAL_PLAN_SEATS, PlanName, TrialDaysAmount, TrialStatus

from ..start_trial import StartTrialInteractor

Expand Down
6 changes: 3 additions & 3 deletions codecov_auth/management/commands/set_trial_status_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

from django.core.management.base import BaseCommand, CommandParser
from django.db.models import Q

from codecov_auth.models import Owner
from plan.constants import (
from shared.plan.constants import (
FREE_PLAN_REPRESENTATIONS,
PLANS_THAT_CAN_TRIAL,
PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS,
Expand All @@ -13,6 +11,8 @@
TrialStatus,
)

from codecov_auth.models import Owner


class Command(BaseCommand):
help = "Sets the initial trial status values for an owner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from django.test import TestCase
from freezegun import freeze_time
from shared.django_apps.core.tests.factories import OwnerFactory
from shared.plan.constants import PlanName, TrialStatus

from codecov_auth.management.commands.set_trial_status_values import Command
from codecov_auth.models import Owner
from plan.constants import PlanName, TrialStatus


@freeze_time("2023-07-17T00:00:00")
Expand Down
2 changes: 1 addition & 1 deletion codecov_auth/services/org_level_token_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.forms import ValidationError
from shared.plan.constants import USER_PLAN_REPRESENTATIONS

from codecov_auth.models import OrganizationLevelToken, Owner
from plan.constants import USER_PLAN_REPRESENTATIONS

log = logging.getLogger(__name__)

Expand Down
8 changes: 4 additions & 4 deletions codecov_auth/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
UserFactory,
)
from shared.django_apps.core.tests.factories import PullFactory, RepositoryFactory
from shared.plan.constants import (
ENTERPRISE_CLOUD_USER_PLAN_REPRESENTATIONS,
PlanName,
)

from codecov.commands.exceptions import ValidationError
from codecov_auth.admin import (
Expand All @@ -37,10 +41,6 @@
)
from codecov_auth.models import OrganizationLevelToken, Owner, SentryUser, User
from core.models import Pull
from plan.constants import (
ENTERPRISE_CLOUD_USER_PLAN_REPRESENTATIONS,
PlanName,
)


class OwnerAdminTest(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion graphql_api/tests/mutation/test_cancel_trial.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from django.test import TransactionTestCase
from prometheus_client import REGISTRY
from shared.django_apps.core.tests.factories import OwnerFactory
from shared.plan.constants import PlanName, TrialStatus

from graphql_api.tests.helper import GraphQLTestHelper
from graphql_api.views import GQL_ERROR_COUNTER, GQL_HIT_COUNTER, GQL_REQUEST_LATENCIES
from plan.constants import PlanName, TrialStatus

query = """
mutation($input: CancelTrialInput!) {
Expand Down
2 changes: 1 addition & 1 deletion graphql_api/tests/test_owner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
RepositoryFactory,
)
from shared.django_apps.reports.models import ReportType
from shared.plan.constants import PlanName, TrialStatus
from shared.upload.utils import UploaderType, insert_coverage_measurement

from codecov.commands.exceptions import (
Expand All @@ -28,7 +29,6 @@
)
from codecov_auth.models import GithubAppInstallation, OwnerProfile
from graphql_api.types.repository.repository import TOKEN_UNAVAILABLE
from plan.constants import PlanName, TrialStatus
from reports.tests.factories import CommitReportFactory, UploadFactory

from .helper import GraphQLTestHelper, paginate_connection
Expand Down
3 changes: 1 addition & 2 deletions graphql_api/tests/test_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
from shared.django_apps.codecov_auth.tests.factories import AccountFactory
from shared.django_apps.core.tests.factories import OwnerFactory
from shared.license import LicenseInformation
from shared.plan.constants import PlanName, TrialStatus
from shared.utils.test_utils import mock_config_helper

from plan.constants import PlanName, TrialStatus

from .helper import GraphQLTestHelper


Expand Down
3 changes: 1 addition & 2 deletions graphql_api/tests/test_plan_representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from django.utils import timezone
from freezegun import freeze_time
from shared.django_apps.core.tests.factories import OwnerFactory

from plan.constants import PlanName, TrialStatus
from shared.plan.constants import PlanName, TrialStatus

from .helper import GraphQLTestHelper

Expand Down
2 changes: 1 addition & 1 deletion graphql_api/types/enums/enum_types.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from ariadne import EnumType
from shared.plan.constants import TierName, TrialStatus

from codecov_auth.models import RepositoryToken
from compare.commands.compare.interactors.fetch_impacted_files import (
ImpactedFileParameter,
)
from core.models import Commit
from plan.constants import TierName, TrialStatus
from services.yaml import YamlStates
from timeseries.models import Interval as MeasurementInterval
from timeseries.models import MeasurementName
Expand Down
2 changes: 1 addition & 1 deletion graphql_api/types/owner/owner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from ariadne import ObjectType
from django.conf import settings
from graphql import GraphQLResolveInfo
from shared.plan.constants import FREE_PLAN_REPRESENTATIONS, PlanData, PlanName

import services.activation as activation
import timeseries.helpers as timeseries_helpers
Expand Down Expand Up @@ -39,7 +40,6 @@
from graphql_api.types.enums import OrderingDirection, RepositoryOrdering
from graphql_api.types.errors.errors import NotFoundError, OwnerNotActivatedError
from graphql_api.types.repository.repository import TOKEN_UNAVAILABLE
from plan.constants import FREE_PLAN_REPRESENTATIONS, PlanData, PlanName
from plan.service import PlanService
from services.billing import BillingService
from services.profiling import ProfilingSummary
Expand Down
6 changes: 3 additions & 3 deletions graphql_api/types/plan/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from typing import List, Optional

from ariadne import ObjectType
from shared.plan.constants import (
TrialStatus,
)

from codecov.db import sync_to_async
from graphql_api.helpers.ariadne import ariadne_load_local_graphql
from plan.constants import (
TrialStatus,
)
from plan.service import PlanService

plan = ariadne_load_local_graphql(__file__, "plan.graphql")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import List, Optional

from ariadne import ObjectType
from shared.plan.constants import PlanData

from graphql_api.helpers.ariadne import ariadne_load_local_graphql
from plan.constants import PlanData
from plan.service import PlanService

plan_representation = ariadne_load_local_graphql(
Expand Down
Loading
Loading