Skip to content

Docs#11

Merged
dragosv merged 1 commit intomainfrom
docs
Mar 30, 2026
Merged

Docs#11
dragosv merged 1 commit intomainfrom
docs

Conversation

@dragosv
Copy link
Copy Markdown
Owner

@dragosv dragosv commented Mar 30, 2026

Summary by Sourcery

Add comprehensive user-facing documentation and site theming for Testcontainers for Zig, including examples, feature guides, module docs, and custom navigation/header styling.

Enhancements:

  • Implement a custom Testcontainers-branded documentation layout, including a global header, navigation sidebar callout, typography, and color scheme overrides via CSS, HTML partials, and JavaScript.
  • Add language and community logo assets used throughout the documentation site for navigation cards and community callouts.

Documentation:

  • Add Quickstart, system requirements, best practices, configuration, garbage collection, networking, image management, wait strategies, low-level API, and connection string reference pages for Testcontainers for Zig.
  • Document Zig test framework integration and usage patterns for containers and modules.
  • Add module-specific docs for PostgreSQL, MySQL, Redis, and MongoDB, plus a general modules overview and examples page.
  • Introduce contributing guides for code and documentation, along with CI usage guides for GitHub Actions and GitLab CI.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive documentation for Testcontainers for Zig library including quickstart guide, system requirements, and configuration instructions.
    • Added feature guides covering container creation, networking, wait strategies, connection strings, image management, and garbage collection.
    • Added examples demonstrating common usage patterns and best practices.
    • Added pre-configured module documentation for PostgreSQL, MySQL, Redis, MongoDB, and others.
    • Added CI/CD integration guides for GitHub Actions and GitLab CI.
    • Enhanced documentation site theme with custom header navigation and styling.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 30, 2026

Reviewer's Guide

Adds a full documentation site for Testcontainers for Zig, including core feature guides, module references, quickstart, examples, CI/system requirements, and a custom Testcontainers-branded MkDocs theme (header, navigation, styling, and assets).

Flow diagram for container lifecycle described in the new docs

flowchart LR
  A["Zig test starts"] --> B["Initialize DockerProvider (optional)"]
  B --> C["Call tc.run or module.run/runDefault\nwith ContainerRequest"]
  C --> D["If image missing or always_pull_image=true\nthen pull image"]
  D --> E["Create and start Docker container"]
  E --> F{"wait_strategy configured?"}
  F -->|"no (.none)"| H["Return running container to test"]
  F -->|"yes"| G["Execute wait strategy\n(log/http/port/health/exec/all)"]
  G --> H
  H --> I["Test code uses container\n(e.g. connectionString(), mappedPort(), exec(), logs())"]
  I --> J["Defer cleanup in test"]
  J --> K["On test scope exit:\nterminate() to stop/remove container"]
  K --> L["deinit() to free Zig-side resources"]
Loading

File-Level Changes

Change Details Files
Introduce a Testcontainers-branded documentation theme with a shared top navigation header and custom styling.
  • Add a reusable Testcontainers marketing header partial with global navigation, icons, and external links for other Testcontainers language docs, Slack, and GitHub
  • Override the MkDocs Material header partial to include the new Testcontainers header above the standard docs header and integrate with palette/search/source controls
  • Override the primary navigation partial to add a community-callout section linking to Slack, GitHub, StackOverflow, and Twitter
  • Define a custom theme entry point to include analytics, fonts, and header JavaScript
  • Add CSS customizations for typography, color scheme, cards, and community callout components
  • Add JavaScript to drive the responsive header menu, dropdowns, and mobile behavior
docs/theme/partials/tc-header.html
docs/theme/partials/header.html
docs/theme/partials/nav.html
docs/theme/main.html
docs/css/tc-header.css
docs/css/extra.css
docs/js/tc-header.js
Add core documentation pages describing Testcontainers for Zig concepts, configuration, and usage patterns.
  • Create a new landing page explaining Testcontainers for Zig, showing a quickstart example, and linking to other language docs
  • Add a quickstart guide covering installation via build.zig.zon/build.zig and a first Redis container test
  • Document system requirements and CI integration patterns, including GitHub Actions, GitLab CI, and Docker-in-Docker usage
  • Describe configuration options like Docker host detection, environment variables, socket path behavior, logging, and platform requirements
  • Document container lifecycle management and garbage collection patterns using terminate/deinit, networks, and errdefer
  • Provide best-practices guidance covering port selection, image pinning, wait strategies, module usage, cleanup, networking, and logging
  • Explain container creation APIs, ContainerRequest fields, DockerProvider usage, mounts, env, cmd, and GenericContainerRequest
  • Explain image management behavior including automatic pulls, force pulling, and image platform selection
  • Describe networking behavior including port mapping, daemonHost detection, custom networks, aliases, and inspection helpers
  • Describe available wait strategies and their configuration, including combined strategies and timeouts
  • Describe the low-level DockerClient API for advanced image/container/network operations
docs/index.md
docs/quickstart/index.md
docs/system_requirements/index.md
docs/system_requirements/ci/github_actions.md
docs/system_requirements/ci/gitlab_ci.md
docs/system_requirements/ci/dind_patterns.md
docs/features/configuration.md
docs/features/garbage_collector.md
docs/features/best_practices.md
docs/features/creating_container.md
docs/features/creating_image.md
docs/features/networking.md
docs/features/wait/introduction.md
docs/features/low_level_api.md
Document pre-configured modules and connection-string helpers for common services.
  • Add a modules index page listing available modules, their default images, and key helpers
  • Create dedicated reference pages for PostgreSQL, MySQL, Redis, and MongoDB modules, including options, defaults, wait strategies, and helper methods
  • Add a connection-strings reference page that documents the connection string/URL helpers for all modules (databases, message brokers, storage, search, Kafka, LocalStack) and emphasizes allocator ownership
docs/modules/index.md
docs/modules/postgres.md
docs/modules/mysql.md
docs/modules/redis.md
docs/modules/mongodb.md
docs/features/connection_strings.md
Provide examples and test framework integration docs for Zig tests using Testcontainers.
  • Add an examples page illustrating basic HTTP containers, database modules, combined wait strategies, multi-container networking, exec, logs, and Zig test integration patterns
  • Add a Zig test integration page documenting canonical test structure, module usage, Docker availability checks, multi-container tests, and suggested build invocations
docs/examples/index.md
docs/test_frameworks/zig_test.md
Add contributor-facing documentation and static assets for the documentation site.
  • Add contributor guidelines for code and docs, including style, process, and expectations
  • Add a documentation contribution guide describing docs layout, conventions, and how to add new pages or module docs
  • Add language and community logo SVG placeholders plus brand logo assets used by the theme and navigation
docs/contributing.md
docs/contributing_docs.md
docs/community-logos/github.svg
docs/community-logos/slack.svg
docs/community-logos/stackoverflow.svg
docs/community-logos/twitter.svg
docs/language-logos/dotnet.svg
docs/language-logos/go.svg
docs/language-logos/haskell.svg
docs/language-logos/java.svg
docs/language-logos/nodejs.svg
docs/language-logos/python.svg
docs/language-logos/ruby.svg
docs/language-logos/rust.svg
docs/logo.svg
docs/testcontainers-logo.svg

Possibly linked issues

  • #FEATURE Docs: The PR implements the requested documentation by adding a full docs site, examples, features, modules, and styling.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48956242-8236-4945-9d5c-4f2f4d5b4c2d

📥 Commits

Reviewing files that changed from the base of the PR and between 87b543f and bcbadb0.

⛔ Files ignored due to path filters (17)
  • docs/banner.png is excluded by !**/*.png
  • docs/community-logos/github.svg is excluded by !**/*.svg
  • docs/community-logos/slack.svg is excluded by !**/*.svg
  • docs/community-logos/stackoverflow.svg is excluded by !**/*.svg
  • docs/community-logos/twitter.svg is excluded by !**/*.svg
  • docs/favicon.ico is excluded by !**/*.ico
  • docs/language-logos/dotnet.svg is excluded by !**/*.svg
  • docs/language-logos/go.svg is excluded by !**/*.svg
  • docs/language-logos/haskell.svg is excluded by !**/*.svg
  • docs/language-logos/java.svg is excluded by !**/*.svg
  • docs/language-logos/nodejs.svg is excluded by !**/*.svg
  • docs/language-logos/python.svg is excluded by !**/*.svg
  • docs/language-logos/ruby.svg is excluded by !**/*.svg
  • docs/language-logos/rust.svg is excluded by !**/*.svg
  • docs/logo.png is excluded by !**/*.png
  • docs/logo.svg is excluded by !**/*.svg
  • docs/testcontainers-logo.svg is excluded by !**/*.svg
📒 Files selected for processing (31)
  • docs/contributing.md
  • docs/contributing_docs.md
  • docs/css/extra.css
  • docs/css/tc-header.css
  • docs/examples/index.md
  • docs/features/best_practices.md
  • docs/features/configuration.md
  • docs/features/connection_strings.md
  • docs/features/creating_container.md
  • docs/features/creating_image.md
  • docs/features/garbage_collector.md
  • docs/features/low_level_api.md
  • docs/features/networking.md
  • docs/features/wait/introduction.md
  • docs/index.md
  • docs/js/tc-header.js
  • docs/modules/index.md
  • docs/modules/mongodb.md
  • docs/modules/mysql.md
  • docs/modules/postgres.md
  • docs/modules/redis.md
  • docs/quickstart/index.md
  • docs/system_requirements/ci/dind_patterns.md
  • docs/system_requirements/ci/github_actions.md
  • docs/system_requirements/ci/gitlab_ci.md
  • docs/system_requirements/index.md
  • docs/test_frameworks/zig_test.md
  • docs/theme/main.html
  • docs/theme/partials/header.html
  • docs/theme/partials/nav.html
  • docs/theme/partials/tc-header.html

📝 Walkthrough

Walkthrough

Adds comprehensive documentation for the Testcontainers for Zig library, covering quickstart, features, modules, system requirements, CI/CD patterns, contributing guidelines, and usage examples. Also introduces custom CSS styling for documentation layout, interactive JavaScript for mobile/desktop navigation, and Jinja templates for site header and navigation rendering.

Changes

Cohort / File(s) Summary
Documentation: Quickstart & Guides
docs/index.md, docs/quickstart/index.md, docs/contributing.md, docs/contributing_docs.md
Introductory and contribution documentation covering project purpose, quickstart code examples, contributor expectations, and documentation structure guidelines.
Documentation: Feature Guides
docs/features/best_practices.md, docs/features/configuration.md, docs/features/connection_strings.md, docs/features/creating_container.md, docs/features/creating_image.md, docs/features/garbage_collector.md, docs/features/low_level_api.md, docs/features/networking.md, docs/features/wait/introduction.md
Comprehensive feature documentation with Zig code examples covering container creation/configuration, networking, image management, wait strategies, resource cleanup, and direct Docker API access.
Documentation: Modules
docs/modules/index.md, docs/modules/postgres.md, docs/modules/mysql.md, docs/modules/mongodb.md, docs/modules/redis.md
Module interface documentation and per-module guides for pre-configured database/service containers including default images, configuration options, and connection helpers.
Documentation: Examples & Test Integration
docs/examples/index.md, docs/test_frameworks/zig_test.md
Usage examples demonstrating container patterns (HTTP services, databases, networking, logging) and Zig test framework integration with defer-based cleanup patterns.
Documentation: System Requirements & CI/CD
docs/system_requirements/index.md, docs/system_requirements/ci/github_actions.md, docs/system_requirements/ci/gitlab_ci.md, docs/system_requirements/ci/dind_patterns.md
System version requirements, Docker socket configuration, and CI/CD workflow examples for GitHub Actions, GitLab CI, and Docker-in-Docker patterns.
Styling: CSS
docs/css/extra.css, docs/css/tc-header.css
Custom documentation stylesheets defining global font/theme variables, card grid layout, community callout components, responsive header/navigation styling, and mobile/desktop breakpoints.
Interactive Components
docs/js/tc-header.js
JavaScript implementing mobile menu toggle, dropdown menu state management, and hover-based active menu item tracking for header navigation.
Theme Templates
docs/theme/main.html, docs/theme/partials/header.html, docs/theme/partials/nav.html, docs/theme/partials/tc-header.html
MkDocs/Jinja templates extending base theme with custom header layout, navigation menu with dropdowns, community links section, and analytics/font injection.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Whiskers twitch with delight—
Documentation blooms across the site!
From quickstart to modules, styled just right,
With menus that dance on mobile and light.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs

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.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 4 issues, and left some high level feedback:

  • In docs/css/tc-header.css, the selector #site-header .menu-item a .icon-externa looks like a typo and should likely be .icon-external to match the SVG symbol id and other selectors.
  • In docs/js/tc-header.js, the code references an element with id mobile-submenu-toggle which is not defined in the new HTML header partials, so either add the corresponding element or remove the unused toggle logic.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `docs/css/tc-header.css`, the selector `#site-header .menu-item a .icon-externa` looks like a typo and should likely be `.icon-external` to match the SVG symbol id and other selectors.
- In `docs/js/tc-header.js`, the code references an element with id `mobile-submenu-toggle` which is not defined in the new HTML header partials, so either add the corresponding element or remove the unused toggle logic.

## Individual Comments

### Comment 1
<location path="docs/css/tc-header.css" line_range="110-111" />
<code_context>
+    color: var(--color-topaz);
+}
+
+#site-header .menu-item button .icon-external,
+#site-header .menu-item a .icon-externa {
+    margin-left: auto;
+    opacity: .3;
</code_context>
<issue_to_address>
**issue (bug_risk):** The `.icon-externa` selector looks like a typo and will prevent styles from applying to external icons inside links.

In other places this class is spelled `icon-external`, but here the `<a>` selector uses `.icon-externa`, so link icons won’t receive the margin, opacity, or flex-shrink rules. Please correct the selector to `.icon-external` to match the rest of the code.
</issue_to_address>

### Comment 2
<location path="docs/css/extra.css" line_range="70" />
<code_context>
+.community-callout {
+  color: #F2F4FE;
+  background: linear-gradient(10.88deg, rgba(102, 56, 242, 0.4) 9.56%, #6638F2 100%), #291A3F;
+  box-shadow: 0px 20px 45px rgba(#9991B5, 0.75);
+  border-radius: 10px;
+  padding: 20px;
</code_context>
<issue_to_address>
**issue (bug_risk):** The `rgba(#9991B5, 0.75)` value is invalid CSS and will be ignored by browsers.

`rgba()` requires numeric RGB values, not a hex literal, so this declaration is invalid and the box-shadow will be ignored. To keep `#9991B5` at 75% opacity, use `rgba(153, 145, 181, 0.75)` or `#9991B5BF` instead.
</issue_to_address>

### Comment 3
<location path="docs/theme/partials/tc-header.html" line_range="127" />
<code_context>
+                        <ul class="menu-dropdown">
+                            {% for child in menuItem.children %}
+                                <li class="menu-dropdown-item">
+                                    <a href="{{ child.url }}" {% if child.external %}target="_blank"{% endif %}>
+                                        {% if child.image %}
+                                            <img src="{{ child.image }}" alt="" width="24" height="24"/>
</code_context>
<issue_to_address>
**🚨 suggestion (security):** External links opened with `target="_blank"` should include `rel="noopener noreferrer"` for security and performance.

For `child.external` links, please add `rel="noopener noreferrer"` alongside `target="_blank"` to prevent the new tab accessing `window.opener` and to mitigate tabnabbing risks.

```suggestion
                                    <a href="{{ child.url }}" {% if child.external %}target="_blank" rel="noopener noreferrer"{% endif %}>
```
</issue_to_address>

### Comment 4
<location path="docs/theme/partials/nav.html" line_range="56-65" />
<code_context>
+        <h2>Join the community</h2>
+        <ul>
+          <li>
+            <a href="https://slack.testcontainers.org/" target="_blank">
+              <img src="/community-logos/slack.svg" alt="Slack" width="30" height="31">
+            </a>
+          </li>
+          <li>
+            <a href="https://github.com/testcontainers" target="_blank">
+              <img src="/community-logos/github.svg" alt="GitHub" width="30" height="31">
+            </a>
+          </li>
+          <li>
+            <a href="https://stackoverflow.com/questions/tagged/testcontainers" target="_blank">
+              <img src="/community-logos/stackoverflow.svg" alt="StackOverflow" width="26" height="31">
+            </a>
+          </li>
+          <li>
+            <a href="https://twitter.com/testcontainers" target="_blank">
+              <img src="/community-logos/twitter.svg" alt="Twitter" width="37" height="31">
+            </a>
</code_context>
<issue_to_address>
**🚨 suggestion (security):** Community links using `target="_blank"` should set `rel="noopener noreferrer"` to harden against tabnabbing.

These four external links open in a new tab but omit `rel`. Please add `rel="noopener noreferrer"` (or at least `noopener`) to each so the new page cannot access `window.opener`.

Suggested implementation:

```
            <a href="https://slack.testcontainers.org/" target="_blank" rel="noopener noreferrer">

```

```
            <a href="https://github.com/testcontainers" target="_blank" rel="noopener noreferrer">

```

```
            <a href="https://stackoverflow.com/questions/tagged/testcontainers" target="_blank" rel="noopener noreferrer">

```

```
            <a href="https://twitter.com/testcontainers" target="_blank" rel="noopener noreferrer">

```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +110 to +111
#site-header .menu-item button .icon-external,
#site-header .menu-item a .icon-externa {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): The .icon-externa selector looks like a typo and will prevent styles from applying to external icons inside links.

In other places this class is spelled icon-external, but here the <a> selector uses .icon-externa, so link icons won’t receive the margin, opacity, or flex-shrink rules. Please correct the selector to .icon-external to match the rest of the code.

.community-callout {
color: #F2F4FE;
background: linear-gradient(10.88deg, rgba(102, 56, 242, 0.4) 9.56%, #6638F2 100%), #291A3F;
box-shadow: 0px 20px 45px rgba(#9991B5, 0.75);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): The rgba(#9991B5, 0.75) value is invalid CSS and will be ignored by browsers.

rgba() requires numeric RGB values, not a hex literal, so this declaration is invalid and the box-shadow will be ignored. To keep #9991B5 at 75% opacity, use rgba(153, 145, 181, 0.75) or #9991B5BF instead.

<ul class="menu-dropdown">
{% for child in menuItem.children %}
<li class="menu-dropdown-item">
<a href="{{ child.url }}" {% if child.external %}target="_blank"{% endif %}>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚨 suggestion (security): External links opened with target="_blank" should include rel="noopener noreferrer" for security and performance.

For child.external links, please add rel="noopener noreferrer" alongside target="_blank" to prevent the new tab accessing window.opener and to mitigate tabnabbing risks.

Suggested change
<a href="{{ child.url }}" {% if child.external %}target="_blank"{% endif %}>
<a href="{{ child.url }}" {% if child.external %}target="_blank" rel="noopener noreferrer"{% endif %}>

Comment on lines +56 to +65
<a href="https://slack.testcontainers.org/" target="_blank">
<img src="/community-logos/slack.svg" alt="Slack" width="30" height="31">
</a>
</li>
<li>
<a href="https://github.com/testcontainers" target="_blank">
<img src="/community-logos/github.svg" alt="GitHub" width="30" height="31">
</a>
</li>
<li>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚨 suggestion (security): Community links using target="_blank" should set rel="noopener noreferrer" to harden against tabnabbing.

These four external links open in a new tab but omit rel. Please add rel="noopener noreferrer" (or at least noopener) to each so the new page cannot access window.opener.

Suggested implementation:

            <a href="https://slack.testcontainers.org/" target="_blank" rel="noopener noreferrer">

            <a href="https://github.com/testcontainers" target="_blank" rel="noopener noreferrer">

            <a href="https://stackoverflow.com/questions/tagged/testcontainers" target="_blank" rel="noopener noreferrer">

            <a href="https://twitter.com/testcontainers" target="_blank" rel="noopener noreferrer">

@dragosv dragosv merged commit c6040ae into main Mar 30, 2026
2 of 3 checks passed
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.

1 participant