Skip to content

Autobuild docker images fixes#37

Merged
edinstance merged 2 commits intodevfrom
build-docker-images
Oct 20, 2025
Merged

Autobuild docker images fixes#37
edinstance merged 2 commits intodevfrom
build-docker-images

Conversation

@edinstance
Copy link
Owner

@edinstance edinstance commented Oct 20, 2025

Summary by CodeRabbit

  • Chores
    • Improved build and image pipeline to support per-service configuration flags, enabling conditional build steps (e.g. protocol/tool builds and app file creation) per service.
    • Added an explicit repository checkout step before conditional processing.
    • Continued build-and-push to the container registry, now respecting per-service conditions.

@coderabbitai
Copy link

coderabbitai bot commented Oct 20, 2025

Walkthrough

The GitHub Actions workflow .github/workflows/build_images.yml is refactored to use an include-based matrix with per-service metadata flags (uses_buf, needs_app_file). It adds conditional steps for installing/building protos and creating an app file, and keeps checkout, GHCR login and image build/push with dynamic tagging.

Changes

Cohort / File(s) Summary
GitHub Actions workflow
\.github/workflows/build_images\.yml
Replaces a static service matrix with an include-based matrix that carries per-service metadata flags (uses_buf, needs_app_file). Adds an unconditional repository checkout step, conditional steps to install buf and build protobufs when uses_buf is true, and to create an application file when needs_app_file is true. Retains GHCR authentication and docker/build-push-action usage to build and push images, tagging with PR SHA and conditionally latest on the main branch.

Sequence Diagram

sequenceDiagram
    participant GHA as GitHub Actions
    participant Repo as Repository
    participant Buf as Buf (optional)
    participant Builder as docker/build-push-action
    participant GHCR as GitHub Container Registry

    GHA->>Repo: Checkout repository

    loop per service (matrix include)
        GHA->>GHA: Read service metadata (uses_buf, needs_app_file)

        alt uses_buf == true
            GHA->>Buf: Install buf
            GHA->>Buf: Generate protobufs
        end

        alt needs_app_file == true
            GHA->>Repo: Create application file
        end

        GHA->>GHCR: Authenticate (docker/login-action)
        GHA->>Builder: Build image (context, Dockerfile)
        Builder-->>Builder: Tag with PR SHA
        alt branch == main
            Builder-->>Builder: Also tag as latest
        end
        Builder->>GHCR: Push image(s)
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Autobuild docker images #36: Modifies the same workflow file to build/push images using a matrix; strongly related as this PR replaces the static matrix with an include-based matrix and adds per-service conditional steps.

Poem

🐰 Matrix seeds sown in orderly rows,
Flags flutter where each service goes,
Buf hums softly when protobufs arise,
App files appear under conditional skies,
Docker tags leap — the CI rabbit knows. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Autobuild docker images fixes" is related to the changeset, which modifies the GitHub Actions workflow for building Docker images. The title clearly identifies the system being changed (autobuild docker images) and indicates improvements are being made. However, the title does not fully capture the main technical improvement in the changeset—which is the introduction of per-service conditional build steps with metadata flags (uses_buf and needs_app_file). The word "fixes" is somewhat generic and doesn't convey the specific nature of the refactoring. This constitutes a partial relationship with the changeset, as it refers to a real aspect of the change but doesn't capture its main point.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch build-docker-images

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d56f59c and 948d4e2.

📒 Files selected for processing (1)
  • .github/workflows/build_images.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/build_images.yml

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/build_images.yml (1)

49-53: Migrate buf-setup-action to the unified bufbuild/buf-action.

The individual buf GitHub actions (including buf-setup-action) have been consolidated into the unified bufbuild/buf-action; the docs recommend migrating to the unified action, with the existing individual actions (buf-setup-action, buf-lint-action, buf-breaking-action, buf-push-action) deprecated in favour of buf-action. Replace bufbuild/buf-setup-action@v1.50.0 with bufbuild/buf-action@v1.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b67142 and d56f59c.

📒 Files selected for processing (1)
  • .github/workflows/build_images.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: verify_supergraph
🔇 Additional comments (2)
.github/workflows/build_images.yml (2)

29-41: ✓ Matrix design looks clean.

The include-based matrix with per-service metadata flags is well-structured for managing conditional build steps across services.


77-79: Verify Docker image tag format is intentional.

The image tag format produces ghcr.io/edinstance/distributed-aviation-system-services/flights:sha (with a slash in the image name). This is valid but unconventional. Confirm this is the desired format rather than hyphenated alternatives like ghcr.io/edinstance/distributed-aviation-system-flights-services:sha.

@edinstance edinstance merged commit 7ac5b5d into dev Oct 20, 2025
2 checks passed
@edinstance edinstance deleted the build-docker-images branch October 20, 2025 17:29
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