Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

Log statements in createS3Client and ensureBucket were executed within Async[F].delay blocks, causing their F[Unit] effects to be discarded rather than sequenced.

Changes

  • createS3Client: Replaced single delay block with for-comprehension to sequence client creation and logging
  • ensureBucket: Refactored to use flatMap pattern, returning Either from bucket check then properly sequencing all log statements

Example

Before (logging effect discarded):

Async[F].delay {
  val client = createClient()
  log.info("Client created")  // F[Unit] discarded
  client
}

After (logging effect sequenced):

for {
  client <- Async[F].delay(createClient())
  _ <- log.info("Client created")  // F[Unit] properly sequenced
} yield client

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: akreit <64101884+akreit@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on 'move to cats logger' PR Properly sequence logging effects in S3Writer Dec 29, 2025
Copilot AI requested a review from akreit December 29, 2025 12:21
@akreit akreit marked this pull request as ready for review December 29, 2025 12:25
@akreit akreit merged commit 053d228 into copilot/build-etl-pipeline-scala Dec 29, 2025
@akreit akreit deleted the copilot/sub-pr-2-again branch December 29, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants