Skip to content

Conversation

@mdelapenya
Copy link
Member

@mdelapenya mdelapenya commented Oct 7, 2025

What does this PR do?

Use the Run function in qdrant

Why is it important?

Migrate modules to the new API, improving consistency and leveraging the latest testcontainers functionality.

Related issues

This commit updates the qdrant module to use the new Run() API from testcontainers-go, replacing the deprecated GenericContainer approach. The migration converts exposed ports and wait strategy to moduleOpts, simplifying the container creation process.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@mdelapenya mdelapenya requested a review from a team as a code owner October 7, 2025 22:28
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Oct 7, 2025
@netlify
Copy link

netlify bot commented Oct 7, 2025

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 07d58d0
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-go/deploys/68e5f89e7241900008929afc
😎 Deploy Preview https://deploy-preview-3427--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Oct 7, 2025

Summary by CodeRabbit

  • Refactor
    • Simplified Qdrant container initialization with a cleaner, consolidated configuration approach.
    • Improved startup handling and clarified error messages for easier diagnostics.
    • Ensures consistent port exposure and readiness checks to reduce setup friction.
    • Enhances reliability across local and CI environments.
    • No user-facing behavior changes; existing functionality remains intact.

Walkthrough

Refactors modules/qdrant/qdrant.go to replace GenericContainerRequest/GenericContainer with testcontainers.Run using a composed slice of ContainerCustomizer options (e.g., WithExposedPorts, WithWaitStrategy). Removes the manual customization loop, updates container instantiation, and adjusts the error message to "run qdrant: %w".

Changes

Cohort / File(s) Summary of changes
Qdrant module Run refactor
modules/qdrant/qdrant.go
Replaced GenericContainerRequest + manual customization loop with a moduleOpts slice (e.g., WithExposedPorts, WithWaitStrategy). Switched from GenericContainer(...) to testcontainers.Run(ctx, img, moduleOpts...). Updated container variable usage (ctr) and changed error text to "run qdrant: %w".

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller as Caller
  participant QMod as Qdrant.Run
  participant TC as testcontainers.Run
  participant Engine as Container Runtime

  Caller->>QMod: Run(ctx, img, opts...)
  QMod->>QMod: compose moduleOpts (WithExposedPorts, WithWaitStrategy, ...)
  QMod->>TC: Run(ctx, img, moduleOpts...)
  TC->>Engine: create & start container
  Engine-->>TC: container handle or error
  TC-->>QMod: ctr, err
  alt success
    QMod-->>Caller: ctr
  else error
    QMod-->>Caller: error ("run qdrant: %w")
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A hop, a skip, I refactor and run,
From Generic to Run—oh what fun!
Ports exposed, waits aligned,
Fewer loops, cleaner mind.
Qdrant boots up—tests in sun. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly and concisely references the primary change of migrating the qdrant module to use the Run function and follows conventional commit syntax without extraneous details.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed The pull request description clearly states that it uses the Run function in the qdrant module and explains why migrating to the new API improves consistency and leverages updated functionality, which directly corresponds to the changes made in container instantiation and error messaging.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mdelapenya mdelapenya self-assigned this Oct 8, 2025
@mdelapenya mdelapenya merged commit 1d901d9 into testcontainers:main Oct 8, 2025
17 checks passed
@mdelapenya mdelapenya deleted the use-run-claude-qdrant branch October 8, 2025 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Changes that do not impact the existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant