Skip to content

Add CI workflow, Dependabot, and testcontainers infrastructure#1

Merged
robfrank merged 8 commits intomainfrom
infra/project-maintainance
Mar 18, 2026
Merged

Add CI workflow, Dependabot, and testcontainers infrastructure#1
robfrank merged 8 commits intomainfrom
infra/project-maintainance

Conversation

@robfrank
Copy link
Contributor

Summary

  • Add Dependabot configuration for pip and GitHub Actions dependencies (weekly)
  • Add CI workflow with two parallel jobs: Ruff lint and integration tests
  • Add testcontainers fixture so integration tests self-manage ArcadeDB 26.3.1 lifecycle (no pre-running instance needed)
  • Refactor integration tests from unittest.TestCase to pytest functions using the arcadedb_url session fixture
  • Add dev dependencies: testcontainers, docker, ruff (both [project.optional-dependencies] and hatch envs)

Test plan

  • All 26 tests pass locally (15 unit + 11 integration)
  • Ruff check and format pass
  • CI workflow runs on this PR

🤖 Generated with Claude Code

robfrank and others added 7 commits March 18, 2026 11:58
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix E501 line-too-long violations across source, examples, and tests.
Fix integration test auth by using explicit Secret.from_token credentials
instead of relying on env vars. Fix serialization test to use env-var
based secrets that support to_dict().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes foundational project infrastructure by integrating Dependabot for automated dependency management and setting up a comprehensive CI workflow using GitHub Actions. It significantly enhances the testing environment by introducing testcontainers to dynamically manage ArcadeDB instances for integration tests, thereby streamlining the development and testing process. The integration tests for ArcadeDBDocumentStore were also refactored to align with this new pytest-based, containerized approach, ensuring more reliable and isolated testing.

Highlights

  • CI Workflow: Introduced a GitHub Actions CI workflow with two parallel jobs: Ruff linting and integration tests, triggered on pull requests to main, pushes to main, and manual dispatch.
  • Dependabot Configuration: Added Dependabot to automatically monitor and create pull requests for pip and github-actions dependencies on a weekly schedule.
  • Testcontainers Infrastructure: Implemented testcontainers to manage the lifecycle of an ArcadeDB instance for integration tests, eliminating the need for a pre-running database instance.
  • Integration Test Refactoring: Refactored ArcadeDBDocumentStore integration tests from unittest.TestCase to pytest functions, leveraging a new arcadedb_url session fixture provided by testcontainers.
  • Development Dependencies: Added testcontainers, docker, and ruff to the development dependencies in pyproject.toml for both hatch environments and pip optional installs.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces significant infrastructure improvements, including a CI workflow, Dependabot configuration, and a robust integration testing setup using testcontainers. The refactoring of tests to be self-contained is a great step towards reliability and ease of use. I've provided a couple of suggestions to further enhance the CI workflow's efficiency and to make the testcontainer setup more idiomatic.

Comment on lines +101 to +132
```yaml
name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- run: pip install ruff
- run: ruff check .
- run: ruff format --check .

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- run: pip install -e ".[dev]"
- run: pytest tests/ --cov=haystack_integrations --cov-report=term-missing -v
```

Choose a reason for hiding this comment

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

medium

The CI workflow can be improved for efficiency and reproducibility.

  1. Dependency Caching: To speed up workflow runs, you can enable pip dependency caching in the setup-python action. This will cache installed packages and reuse them in subsequent runs.
  2. Reproducible Linting: The lint job currently installs the latest version of ruff from PyPI (pip install ruff). It's better to install dependencies from your project's pyproject.toml to ensure the linter version is consistent with what's defined for the project. This prevents unexpected issues when a new version of ruff is released.

Here is a suggested update that incorporates these improvements and adds step names for clarity:

name: CI

on:
  pull_request:
    branches: [main]
  push:
    branches: [main]
  workflow_dispatch:

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.13"
          cache: 'pip'
      - name: Install dependencies
        run: pip install -e ".[dev]"
      - name: Check linting
        run: ruff check .
      - name: Check formatting
        run: ruff format --check .

  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.13"
          cache: 'pip'
      - name: Install dependencies
        run: pip install -e ".[dev]"
      - name: Run tests
        run: pytest tests/ --cov=haystack_integrations --cov-report=term-missing -v

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d0372b7. Added pip caching, step names, and switched lint job to install from .[dev] so ruff version stays consistent with the project.

Comment on lines +31 to +49
@pytest.fixture(scope="session")
def arcadedb_url():
"""Start an ArcadeDB container and yield its HTTP base URL."""
container = (
DockerContainer(ARCADEDB_IMAGE)
.with_exposed_ports(2480)
.with_env(
"JAVA_OPTS",
"-Darcadedb.server.rootPassword=arcadedb",
)
)
container.start()
_wait_for_ready(container)

host = container.get_container_host_ip()
port = container.get_exposed_port(2480)
yield f"http://{host}:{port}"

container.stop()

Choose a reason for hiding this comment

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

medium

The custom _wait_for_ready function can be replaced by using the built-in waiting strategies from testcontainers. This makes the code more concise and idiomatic by leveraging the library's features for handling container readiness.

You can use Wait.for_http(...) to wait for the HTTP endpoint to be ready. With this change, you can also remove the _wait_for_ready function and the import time and import requests statements. You will need to add from testcontainers.core.wait import Wait.

Suggested change
@pytest.fixture(scope="session")
def arcadedb_url():
"""Start an ArcadeDB container and yield its HTTP base URL."""
container = (
DockerContainer(ARCADEDB_IMAGE)
.with_exposed_ports(2480)
.with_env(
"JAVA_OPTS",
"-Darcadedb.server.rootPassword=arcadedb",
)
)
container.start()
_wait_for_ready(container)
host = container.get_container_host_ip()
port = container.get_exposed_port(2480)
yield f"http://{host}:{port}"
container.stop()
@pytest.fixture(scope="session")
def arcadedb_url():
"""Start an ArcadeDB container and yield its HTTP base URL."""
container = (
DockerContainer(ARCADEDB_IMAGE)
.with_exposed_ports(2480)
.with_env(
"JAVA_OPTS",
"-Darcadedb.server.rootPassword=arcadedb",
)
.with_waiting_for(Wait.for_http("/api/v1/ready", status_code=204, timeout=60))
)
container.start()
host = container.get_container_host_ip()
port = container.get_exposed_port(2480)
yield f"http://{host}:{port}"
container.stop()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d0372b7. Replaced custom _wait_for_ready with testcontainers' built-in HttpWaitStrategy. Note: the suggested API (Wait.for_http()) doesn't exist in testcontainers-python — the actual API is HttpWaitStrategy(port, path).for_status_code(204).with_startup_timeout(60) with .waiting_for() on the container. All 26 tests pass.

Address code review feedback:
- Add pip cache to setup-python steps
- Install ruff from project deps for version consistency
- Add step names for clarity
- Replace custom _wait_for_ready with testcontainers HttpWaitStrategy

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@robfrank robfrank merged commit af966e4 into main Mar 18, 2026
2 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