Skip to content

Comments

[4108] Сервис подписок: админка промокодов#72

Open
sipmine wants to merge 1 commit intostagingfrom
feat/subscription-service
Open

[4108] Сервис подписок: админка промокодов#72
sipmine wants to merge 1 commit intostagingfrom
feat/subscription-service

Conversation

@sipmine
Copy link
Contributor

@sipmine sipmine commented Sep 22, 2025

@sipmine sipmine self-assigned this Sep 22, 2025
@sipmine sipmine added ci:covered If coverage checks should be run on the PR ci:deployable If deployment of the PR should be attempted ci:migrated If migration checks should be run on the PR labels Sep 22, 2025
@sipmine sipmine force-pushed the feat/subscription-service branch 2 times, most recently from ae7b5d2 to bd0fb09 Compare September 23, 2025 13:41
@sipmine sipmine force-pushed the feat/subscription-service branch from bd0fb09 to 6bf3c9c Compare September 23, 2025 14:42
Copy link
Member

@taaylor taaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Оставил комменты, если будут вопросы - спрашивай и пингуй в дс

Copy link
Contributor

@ByrDen ByrDen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Выглядит неплохо :)
Старался подробно расписывать, если что-то не понятно, буду рад объяснить в треде таски

Copy link
Member

@taaylor taaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кайф! У меня усе :)

Copy link
Contributor

@ByrDen ByrDen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хорошо идём :)

@sipmine sipmine force-pushed the feat/subscription-service branch from 42c024e to 6f05218 Compare October 11, 2025 04:03
Copy link
Contributor

@ByrDen ByrDen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

чуть-чуть нашлось новенького)

Copy link
Contributor

@ByrDen ByrDen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

забыл моментик

@sipmine sipmine force-pushed the feat/subscription-service branch 2 times, most recently from 57f39b9 to 4dc388c Compare October 18, 2025 02:20
Copy link
Contributor

@ByrDen ByrDen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Финишная прямая)

@sipmine sipmine force-pushed the feat/subscription-service branch 2 times, most recently from 05fb9ab to b513496 Compare October 25, 2025 05:16
@sipmine sipmine force-pushed the feat/subscription-service branch from 6f3020f to 7eaed2d Compare November 11, 2025 16:38
@sipmine sipmine force-pushed the feat/subscription-service branch 2 times, most recently from 59243bd to c1a8ac5 Compare November 12, 2025 12:49
@niqzart niqzart removed the ci:deployable If deployment of the PR should be attempted label Nov 12, 2025
@niqzart niqzart force-pushed the feat/subscription-service branch from c1a8ac5 to 6d72584 Compare November 12, 2025 14:10
Copy link
Member

@niqzart niqzart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В тестах тоже много осталось

@sipmine sipmine force-pushed the feat/subscription-service branch from 6d72584 to e783caf Compare December 6, 2025 05:49
@sipmine sipmine force-pushed the feat/subscription-service branch from e783caf to 1ee4ca9 Compare December 29, 2025 14:59
@sipmine sipmine force-pushed the feat/subscription-service branch from 1ee4ca9 to 0fd7776 Compare January 14, 2026 11:31
@sipmine sipmine requested review from ByrDen and taaylor January 14, 2026 11:41
Copy link
Contributor

@ByrDen ByrDen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Как-то так.

@sipmine sipmine force-pushed the feat/subscription-service branch from 0fd7776 to 145f361 Compare January 21, 2026 13:53
Copy link
Contributor

@ByrDen ByrDen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всё гуд, парочка новых. И один не закрыл - решение ты придумал, но оно около костыльное. Подробности в ДС.

@sipmine sipmine force-pushed the feat/subscription-service branch from 145f361 to 1c9c65f Compare January 26, 2026 14:25
Copy link
Contributor

@ByrDen ByrDen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Последний комментарий.

@sipmine sipmine force-pushed the feat/subscription-service branch from 1c9c65f to 908ed8f Compare January 28, 2026 12:09
Copy link
Contributor

@ByrDen ByrDen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почти :)

@sipmine sipmine force-pushed the feat/subscription-service branch 3 times, most recently from 87ce1f1 to ab518d3 Compare February 2, 2026 12:34
Copy link
Contributor

@ByrDen ByrDen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всё гуд)

Copy link
Member

@niqzart niqzart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отлично, практически всё выправили до меня! Осталось немного мелочей

UPD: Не совсем, уникальность всё же не добили. Отписал ещё комментов ниже

)


async def test_promocode_creation_promocode_already_exist(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo(if-minor): exist -> exists, точно также, как в ошибке

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Аналогично в update-тесте

],
)
async def test_promocode_retrieving_promocode_not_found(
mub_client: TestClient, path: str, field_by: str
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

polish: запятая на конце позволит сложить это получше

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Аналогично в тестах ниже, где куча аргументов в одну строчку



@pytest.mark.parametrize(
("path", "field_by"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

polish: field_by нелогичное название ("поле по")

promocodes: list[Promocode] = [
await Promocode.create(
**LimitedPromocodeInputFactory.build_python(
code=faker.unique.pystr(min_chars=2, max_chars=10)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue(repeat): faker.unique не лучшее решение для большого количества кодов и для глобального faker-а (а он у нас именно такой). Обговаривали, что коды надо генерить так, чтобы они гарантированно генерились разные. Раньше идея была практически корректная, не хватало только нижней границы. Сейчас стало хуже

Comment on lines 9 to 27
@pytest.fixture()
async def promocode(active_session: ActiveSession) -> Promocode:
async with active_session():
return await Promocode.create(
**factories.LimitedPromocodeInputFactory.build_python()
)


@pytest.fixture()
async def promocode_data(promocode: Promocode) -> AnyJSON:
return Promocode.ResponseSchema.model_validate(promocode).model_dump(mode="json")


@pytest.fixture()
async def other_promocode(active_session: ActiveSession) -> Promocode:
async with active_session():
return await Promocode.create(
**factories.LimitedPromocodeInputFactory.build_python()
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: нет гарантии, что у promocode и other_promocode не совпадут поля code. Это создаёт flaky-тесты

@sipmine sipmine force-pushed the feat/subscription-service branch from ab518d3 to 836433f Compare February 23, 2026 03:45
@sipmine sipmine force-pushed the feat/subscription-service branch from 836433f to 2810a47 Compare February 23, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:covered If coverage checks should be run on the PR ci:migrated If migration checks should be run on the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants