Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-45676: Update repo infrastructure #160

Merged
merged 24 commits into from
Aug 14, 2024
Merged

DM-45676: Update repo infrastructure #160

merged 24 commits into from
Aug 14, 2024

Commits on Aug 8, 2024

  1. Use SQuaRE's run-nox workflow

    This takes care of installing nox and caching.
    jonathansick committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    b9bfc05 View commit details
    Browse the repository at this point in the history
  2. Drop dependencies GitHub Actions workflow

    We now recompute dependencies whenever we update the app, rather than on
    an automatic schedule. periodic-ci.yaml ensures that the dependencies
    can be updated without breaking tests.
    jonathansick committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    0ec1644 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3fabd16 View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2024

  1. Update dependencies

    jonathansick committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    79424cb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8407a96 View commit details
    Browse the repository at this point in the history
  3. Adopt ruff-shared.toml

    This toml configuration comes from the FastAPI template at
    https://github.com/lsst/templates
    jonathansick committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    03c9da1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0229fb7 View commit details
    Browse the repository at this point in the history
  5. Start upgrade to Pydantic 2

    This updates the Pydantic dependency to version 2, but likely isn't
    working yet. The issue is that Kafkit is still using Pydantic 2. But
    since we're moving to faststream and using Pydantic models directly
    without the Confluent Schema Registry we may just switch to that now
    too.
    jonathansick committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    b6787de View commit details
    Browse the repository at this point in the history
  6. Switch over to faststream

    This switches Ook to using faststream and directly using Pydantic models
    rather than using Kafkit's Pydantic adapter for the Confluent Schema
    Registry. This faststream is approach is also how we're now building
    squarebot.
    jonathansick committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    8a4e277 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b50e356 View commit details
    Browse the repository at this point in the history
  8. Adopt testcontainers for kafka testing

    To get testcontainers to work
    
    - Change the app so that its creation is deferred to a create_app
      function
    - Don't import the kafka_router into the main namespace so that the app
      fixture in conftest.py can reset the kafka_router with the new
      configuration.
    jonathansick committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    e44e828 View commit details
    Browse the repository at this point in the history
  9. Run Testcontainers Kafka via nox

    This changes the approach previously taken where I ran testcontainers in
    the pytest conftest.py module. Here I'm running the testcontainers in
    the nox sessions, which is more similar to how tox-docker runs. The
    advantage of this approach is that it doesn't require any code
    modifications and patching because the environment variables for the
    Kafka configuration can be made *before* starting up the app tests /
    development run or documentation building sessions.
    
    Running testcontainers via pytest could still be a useful technique if
    different tests need full isolation of their testcontainers, but of
    course this is a slow and resource-intensive approach.
    jonathansick committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    ac52c83 View commit details
    Browse the repository at this point in the history
  10. Update to Python 3.12.5

    jonathansick committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    4b19350 View commit details
    Browse the repository at this point in the history
  11. Update GitHub Actions to install testcontainers

    We need to make sure testcontainers[kafka] is in the environment that
    nox is running in. Locally this is handled by having nox set up the
    local virtual environmemnt with nox -s init or nox -s venv-init.
    jonathansick committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    dc779bc View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    66c6a85 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    e1fcc4a View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    07ce51f View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    9a2eb13 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    d934b3e View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    941ba82 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2024

  1. Manually connect the broker

    This is needed to ensure the standalone Factory in the CLI context
    works.
    jonathansick committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    bb1c2b5 View commit details
    Browse the repository at this point in the history
  2. Import kafka_router from handlers module

    This ensures that the handler function is imported and therefore
    registered to the kafka router.
    
    Note need to avoid circ deps with kafkarouter
    jonathansick committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    8641d70 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5d6116f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1bac26f View commit details
    Browse the repository at this point in the history