Skip to content

Миронюк Матвей Лаб. 3 Группа 6512#142

Open
Matvey6M6 wants to merge 4 commits into
itsecd:mainfrom
Matvey6M6:Lab3
Open

Миронюк Матвей Лаб. 3 Группа 6512#142
Matvey6M6 wants to merge 4 commits into
itsecd:mainfrom
Matvey6M6:Lab3

Conversation

@Matvey6M6
Copy link
Copy Markdown

ФИО: Миронюк Матвей
Номер группы: 6512
Номер лабораторной: 3
Номер варианта: 28
Краткое описание предметной области: Сотрудник компании.
Краткое описание добавленных фич:.

Matvey6M6 added 2 commits May 10, 2026 22:12
+ FileService файловый сервис, который читает события и сохраняет JSON сотрудников в S3.
+ LocalStack в AppHost.
+ Публикация событий из ServiceApi в SNS
+ Подписка SNS -> SQS, которую опрашивает FileService.
+ Endpoint GET /files/{id} для проверки сохранённого файла
+ Backend.IntegrationTests с интеграционными тестами.
@github-actions github-actions Bot added In progress Код в процессе проверки Lab 3 Лабораторная №3. Интеграционное тестирование labels May 10, 2026
@github-actions github-actions Bot requested a review from Gwymlas May 10, 2026 19:19
Comment thread AspireApp/AspireApp.AppHost/AppHost.cs Outdated
Comment on lines +6 to +10
var localstack = builder.AddContainer("localstack", "localstack/localstack", "3.5")
.WithEnvironment("SERVICES", "s3,sns,sqs")
.WithEnvironment("AWS_DEFAULT_REGION", "us-east-1")
.WithEnvironment("DEBUG", "1")
.WithHttpEndpoint(port: 4566, targetPort: 4566, name: "http", isProxied: false);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Лучше использовать готовый aspire пакет, в просто поднятом контейнере не будет телеметрии и сервис дискавери

Comment thread FileService/Background/FileExportHealthCheck.cs Outdated
Comment thread FileService/Background/SnsSqsFileExportWorker.cs Outdated
Comment thread FileService/Background/SnsSqsFileExportWorker.cs Outdated
Comment thread FileService/Infrastructure/FileExportReadinessProbe.cs Outdated
Comment thread ServiceApi/Generator/EmployeeGeneratorService.cs Outdated
Comment thread Backend.IntegrationTests/EmployeeExportIntegrationTests.cs Outdated
Comment thread Backend.IntegrationTests/EmployeeExportIntegrationTests.cs
+ Удалён неиспользуемый FileExportHealthCheck
+ Удалён неиспользуемый FileExportReadinessProbe
+ SnsSqsFileExportWorker заменён на SnsFileExportWorker без SQS
+ Упрощён формат SNS-сообщения: публикуется чистый Employee JSON
+ Не публиковать в SNS при cache hit
+ Удалён неиспользуемый using в Backend.IntegrationTests
+ Стабилизирована HTTP-подписка SNS (auto-confirm, dynamic endpoint, ожидание Confirmed)
+ Aspire-пакеты подняты до 9.5.2
@Matvey6M6 Matvey6M6 requested a review from Gwymlas May 20, 2026 06:57
Comment thread AspireApp/AspireApp.AppHost/AppHost.cs Outdated

// LocalStack поднимаем как контейнерный ресурс Aspire с фиксированным edge-портом,
// чтобы и процессы на хосте, и сами сервисы могли обращаться к нему по одному адресу.
var localstack = builder.AddContainer("localstack", "localstack/localstack", "3.5")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LocalStack все еще поднят как обычный контейнер через AddContainer, лучше использовать aspire интеграцию LocalStack.Aspire.Hosting и добавлять его через AddLocalStack

UseHttp = _options.ServiceUrl.StartsWith("http://", StringComparison.OrdinalIgnoreCase)
};

_snsClient = new AmazonSimpleNotificationServiceClient(credentials, snsConfig);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

А aws клиенты не создавать вручную, а регистрировать их через DI

builder.Services.AddAWSService<IAmazonS3>();
builder.Services.AddAWSService<IAmazonSimpleNotificationService>();

Comment thread FileService/Program.cs Outdated
Comment on lines +57 to +62
app.MapPost("/sns/notifications", async (
HttpContext context,
IEmployeeFileStorage storage,
IHttpClientFactory httpClientFactory,
ILoggerFactory loggerFactory,
CancellationToken cancellationToken) =>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Program.cs сейчас перегружен логикой обработки sns, давай вынесем ее в отдельный сервис

+ LocalStack через AddLocalStack
+ AWS-клиенты через DI
+ SNS-обработка вынесена в отдельный сервис
@Matvey6M6 Matvey6M6 requested a review from Gwymlas May 22, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In progress Код в процессе проверки Lab 3 Лабораторная №3. Интеграционное тестирование

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants