Skip to content

Fix GitHub Actions#54

Merged
lvarin merged 1 commit intodevfrom
fix-gh-actions
Dec 1, 2025
Merged

Fix GitHub Actions#54
lvarin merged 1 commit intodevfrom
fix-gh-actions

Conversation

@trispera
Copy link
Member

@trispera trispera commented Dec 1, 2025

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have not reduced the existing code coverage
  • I have added docstrings following the Python style guidelines of this project to all new modules, classes, methods and functions are documented with docstrings following; I have updated any previously existing docstrings, if applicable
  • I have updated any sections of the app's documentation that are affected by the proposed changes, if applicable

Summary by Sourcery

CI:

  • Add a setup step for the Docker Compose GitHub Action and switch the app startup command to use the 'docker compose' subcommand in CI.

@sourcery-ai
Copy link

sourcery-ai bot commented Dec 1, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the GitHub Actions checks workflow to use the maintained Docker Compose setup action and the new Docker CLI syntax for starting the application during CI checks.

Sequence diagram for updated GitHub Actions checks workflow using Docker Compose

sequenceDiagram
    actor Developer
    participant GitHubActions as GitHub_Actions_Workflow
    participant Runner as GitHub_Hosted_Runner
    participant DockerEngine as Docker_Engine
    participant AppServices as App_Containers

    Developer->>GitHubActions: Push or open PR
    GitHubActions->>Runner: Start checks job

    Runner->>Runner: Checkout code
    Runner->>Runner: Set up Python and run tests
    Runner->>Runner: Generate coverage.xml

    Runner->>DockerEngine: Install Docker Compose via setup-compose-action
    Runner->>DockerEngine: Configure compose version latest

    Runner->>DockerEngine: Execute docker compose up -d --build
    DockerEngine->>AppServices: Build images and start containers

    Runner->>Runner: Wait 30 seconds
    Runner->>AppServices: Run health check request
    AppServices-->>Runner: Health check response

    Runner-->>GitHubActions: Report job status
    GitHubActions-->>Developer: Checks succeed or fail
Loading

File-Level Changes

Change Details Files
Switch CI workflow to use the official Docker Compose setup action and the modern docker compose CLI syntax when starting the app.
  • Add a step that uses docker/setup-compose-action to install/configure Docker Compose in the runner environment.
  • Replace the docker-compose up -d --build command with /usr/bin/docker compose up -d --build to align with the new Docker CLI invocation.
.github/workflows/checks.yaml

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

Copy link

@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 there - I've reviewed your changes - here's some feedback:

  • Instead of setting version: latest in docker/setup-compose-action, pin Docker Compose to a specific version to avoid unexpected CI breakage when a new Compose release introduces changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Instead of setting `version: latest` in `docker/setup-compose-action`, pin Docker Compose to a specific version to avoid unexpected CI breakage when a new Compose release introduces changes.

## Individual Comments

### Comment 1
<location> `.github/workflows/checks.yaml:62-65` </location>
<code_context>
           fail_ci_if_error: true
           verbose: true
+      - name: Set up Docker Compose
+        uses: docker/setup-compose-action@v1.2.0
+        with:
+          version: latest
       - name: Start app
-        run: docker-compose up -d --build
</code_context>

<issue_to_address>
**suggestion (bug_risk):** Avoid using `version: latest` for Docker Compose to keep CI runs reproducible and stable.

Using `version: latest` makes the workflow sensitive to upstream Compose changes and can cause unexpected CI failures when new releases roll out. Please pin a specific Compose version (or at least a major/minor series like `2.29.x`) so changes are controlled and reproducible.

```suggestion
      - name: Set up Docker Compose
        uses: docker/setup-compose-action@v1.2.0
        with:
          version: v2.29.7
```
</issue_to_address>

### Comment 2
<location> `.github/workflows/checks.yaml:66-67` </location>
<code_context>
+          version: latest
       - name: Start app
-        run: docker-compose up -d --build
+        run: /usr/bin/docker compose up -d --build
       - name: Wait until app is up
         run: sleep 30
</code_context>

<issue_to_address>
**suggestion (bug_risk):** Avoid hard-coding the Docker binary path; use `docker compose` so the workflow is less brittle.

Hard-coding `/usr/bin/docker` couples the workflow to the current runner image and directory layout, so a future GitHub runner change could break this step. Using `docker compose up -d --build` lets the shell resolve `docker` via `PATH`, which is more resilient on GitHub-hosted runners.

```suggestion
      - name: Start app
        run: docker compose up -d --build
```
</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.

@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (fa8a1b0) to head (e05583b).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev       #54   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          189       189           
=========================================
  Hits           189       189           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@lvarin lvarin left a comment

Choose a reason for hiding this comment

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

LGTM

@lvarin lvarin merged commit aef5914 into dev Dec 1, 2025
7 checks passed
@lvarin lvarin deleted the fix-gh-actions branch December 1, 2025 12:15
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