Skip to content

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Jul 9, 2025

Closes #1779

Based on https://docs.docker.com/compose/how-tos/dependent-images/#use-another-services-image-as-the-base-image

Summary by CodeRabbit

  • Chores
    • Enhanced Docker Compose configurations and related fixtures by adding an additional context for the CLI service in the build setup of nginx, php, and solr services, maintaining existing build arguments and service behavior.

@coderabbitai
Copy link

coderabbitai bot commented Jul 9, 2025

"""

Walkthrough

The changes update Docker Compose configuration and related JSON fixture files by adding an additional_contexts field referencing the cli service for the nginx, php, and solr services alongside existing build arguments. No other service configuration or logic was changed.

Changes

Files Change Summary
docker-compose.yml Added additional_contexts: { cli: "service:cli" } to the build configuration of nginx, php, and solr services alongside existing args.
.vortex/tests/bats/fixtures/docker-compose.env.json
.vortex/tests/bats/fixtures/docker-compose.env_local.json
.vortex/tests/bats/fixtures/docker-compose.env_mod.json
.vortex/tests/bats/fixtures/docker-compose.noenv.json
Added additional_contexts: { cli: "service:cli" } to the build section of nginx, php, and solr services alongside existing args.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DockerCompose
    participant CLI_Service
    participant Nginx/PHP/Solr_Service

    User->>DockerCompose: docker compose build
    DockerCompose->>CLI_Service: Build cli image first
    DockerCompose->>Nginx/PHP/Solr_Service: Build referencing cli service context
    Nginx/PHP/Solr_Service->>CLI_Service: Use cli service context for build
    DockerCompose-->>User: Build completes successfully
Loading

Assessment against linked issues

Objective Addressed Explanation
Prevent build race condition by ensuring services use additional_contexts instead of relying solely on CLI_IMAGE build arg (#1779)
Update Docker Compose and fixture files to add additional_contexts referencing cli service context (#1779)
Ensure nginx, php, and solr services no longer attempt to pull non-existent CLI image (#1779)
No changes to unrelated environment variables, dependencies, or service logic (#1779)

Poem

In the warren of Compose, a race did ensue,
But now the build bunnies know just what to do!
No more chasing phantom images in fright,
They follow the cli context and build it right.
🐇✨ Compose runs smooth, with carrots in view!
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 70faea3 and b93db0e.

⛔ Files ignored due to path filters (7)
  • .vortex/installer/tests/Fixtures/install/_baseline/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/hosting_lagoon/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/services_no_clamav/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/services_no_solr/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/services_no_valkey/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/services_none/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (5)
  • .vortex/tests/bats/fixtures/docker-compose.env.json (3 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env_local.json (3 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env_mod.json (3 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.noenv.json (3 hunks)
  • docker-compose.yml (3 hunks)
🧰 Additional context used
🧠 Learnings (3)
.vortex/tests/bats/fixtures/docker-compose.env.json (1)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Composer dependencies in Vortex Drupal projects are automatically updated with compatibility checks via RenovateBot; Node.js dependencies are updated in theme directories, and Docker images are updated for containers.
.vortex/tests/bats/fixtures/docker-compose.env_mod.json (1)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Composer dependencies in Vortex Drupal projects are automatically updated with compatibility checks via RenovateBot; Node.js dependencies are updated in theme directories, and Docker images are updated for containers.
.vortex/tests/bats/fixtures/docker-compose.noenv.json (1)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Composer dependencies in Vortex Drupal projects are automatically updated with compatibility checks via RenovateBot; Node.js dependencies are updated in theme directories, and Docker images are updated for containers.
⏰ 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). (12)
  • GitHub Check: build (0)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-docs
🔇 Additional comments (2)
.vortex/tests/bats/fixtures/docker-compose.env_mod.json (1)

227-229: Confirm your target Compose/BuildKit version supports additional_contexts

The new key is valid only for recent Docker Compose v2 + BuildKit releases (≥ v2.20 roughly).
If CI / production still runs the classic docker-compose binary or an older plugin the build will fail long before tests run.

Run something like docker compose version in CI and ensure the “Version” line is ≥ 2.20.

Also applies to: 294-296, 360-362

docker-compose.yml (1)

122-124: Confirm Compose/BuildKit version before merging

additional_contexts requires the Compose v2-plugin & BuildKit backend. Building this file with classic docker-compose (or old CI runners) will error with “unsupported config option”.
Verify the deployment pipeline upgrades are already in place before this hits main.

Also applies to: 147-149, 195-196


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot temporarily deployed to commit July 9, 2025 18:32 Inactive
@codecov
Copy link

codecov bot commented Jul 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.96%. Comparing base (5a98e90) to head (b93db0e).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1780   +/-   ##
========================================
  Coverage    72.96%   72.96%           
========================================
  Files           83       83           
  Lines         4590     4590           
  Branches        35       35           
========================================
  Hits          3349     3349           
  Misses        1241     1241           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot temporarily deployed to commit July 9, 2025 18:54 Inactive
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: 3

♻️ Duplicate comments (4)
.github/workflows/vortex-test-common.yml (2)

112-113: See comment on lines 22-24 – same concern and recommended fix.


172-173: See comment on lines 22-24 – same concern and recommended fix.

.github/workflows/build-test-deploy.yml (2)

168-169: Same issue as lines 58-60 – apply the chosen mitigation consistently.


367-368: Same issue as lines 58-60 – apply the chosen mitigation consistently.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e428143 and a557daf.

📒 Files selected for processing (3)
  • .circleci/config.yml (1 hunks)
  • .github/workflows/build-test-deploy.yml (3 hunks)
  • .github/workflows/vortex-test-common.yml (3 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Composer dependencies in Vortex Drupal projects are automatically updated with compatibility checks via RenovateBot; Node.js dependencies are updated in theme directories, and Docker images are updated for containers.
.github/workflows/vortex-test-common.yml (2)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Automated deployment in Vortex Drupal projects can be configured with GitHub Actions, CircleCI, Lagoon, Acquia, or container registry-based workflows.
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Composer dependencies in Vortex Drupal projects are automatically updated with compatibility checks via RenovateBot; Node.js dependencies are updated in theme directories, and Docker images are updated for containers.
.circleci/config.yml (1)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Automated deployment in Vortex Drupal projects can be configured with GitHub Actions, CircleCI, Lagoon, Acquia, or container registry-based workflows.
.github/workflows/build-test-deploy.yml (1)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Automated deployment in Vortex Drupal projects can be configured with GitHub Actions, CircleCI, Lagoon, Acquia, or container registry-based workflows.
⏰ 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). (11)
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-docs

Comment on lines 22 to 24
container:
image: drevops/ci-runner:25.5.0
image: drevops/ci-runner:canary
env:
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Canary tag → non-deterministic builds – pin or parameterise the runner image

Switching to the floating canary tag means every workflow run may pull a different image, breaking reproducibility and making roll-backs harder when the canary image changes.
Prefer a fixed semver tag or, at minimum, surface the version via a workflow variable so you can bump it deliberately:

-      image: drevops/ci-runner:canary
+      image: drevops/ci-runner:${{ vars.CI_RUNNER_VERSION || '25.5.0' }}

(Apply the same pattern to all jobs in this file.)

Also double-check that the canary image still contains the tooling versions your scripts expect.


🏁 Script executed:

#!/bin/bash
echo "Occurrences of drevops/ci-runner references:"
rg 'drevops/ci-runner:' -n .

echo
echo "Occurrences of CI_RUNNER_VERSION usage:"
rg 'CI_RUNNER_VERSION' -n .

echo
echo "vars: blocks in .github/workflows files:"
rg '^\s*vars:' -n .github/workflows

Length of output: 389


🏁 Script executed:

#!/bin/bash
echo "Listing .github/workflows directory structure:"
find .github/workflows -maxdepth 1 -type f -printf "%f\n"

echo
echo "Searching for 'ci-runner' in all workflow files:"
rg 'ci-runner' -n .github/workflows

echo
echo "Searching for 'drevops/ci-runner' in all workflow files:"
rg 'drevops/ci-runner' -n .github/workflows

Length of output: 1716


Pin or parameterise the drevops/ci-runner image version

Switching to a floating canary tag introduces non-deterministic builds and makes roll-backs harder. Replace all instances of :canary with a fixed semver or a workflow variable:

• .github/workflows/vortex-test-common.yml – lines 23, 112, 172
• .github/workflows/build-test-deploy.yml – lines 59, 168, 367

-      image: drevops/ci-runner:canary
+      image: drevops/ci-runner:${{ vars.CI_RUNNER_VERSION || '25.5.0' }}
  1. Define CI_RUNNER_VERSION under a top-level vars: block in each workflow.
  2. Verify your chosen runner image still contains the tooling versions your scripts expect.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
container:
image: drevops/ci-runner:25.5.0
image: drevops/ci-runner:canary
env:
container:
image: drevops/ci-runner:${{ vars.CI_RUNNER_VERSION || '25.5.0' }}
env:
🤖 Prompt for AI Agents
In .github/workflows/vortex-test-common.yml around lines 22 to 24, replace the
floating image tag "canary" for drevops/ci-runner with a fixed semantic version
or a workflow variable. Define a top-level vars block in the workflow file and
add a variable like CI_RUNNER_VERSION with the chosen fixed version. Then update
all references to the image tag ":canary" to use this variable instead. Verify
the selected image version includes all required tooling for your scripts.

Comment on lines 58 to 60
container:
image: drevops/ci-runner:25.5.0
image: drevops/ci-runner:canary

Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

canary image may introduce breaking changes unnoticed

All CI logic downstream (Composer, PHPStan, etc.) assumes specific toolchain versions. A moving canary image can silently upgrade those tools and break builds.
Pin to a digest or expose the version via an input/variable so upgrades are explicit and reviewable.

Also note cache keys below (e.g. v25.5.0-db11-…, line 121) still reference the old version – consider aligning them or making them version-agnostic.


I’ll verify the workflow file for the moving canary tag and the cache key versions.


🏁 Script executed:

#!/bin/bash
# Locate the canary image reference
rg -n "ci-runner:canary" -n .github/workflows/build-test-deploy.yml

# Inspect cache key lines around where versions appear (e.g. line ~121)
rg -n "key:" -n .github/workflows/build-test-deploy.yml | sed -n '115,130p'

Length of output: 266


🏁 Script executed:

#!/bin/bash
# Show cache steps and keys with surrounding context
rg -n -C 5 'actions/cache@' .github/workflows/build-test-deploy.yml
# Find any explicit version strings (e.g., v25.5.0) in the workflow
rg -n 'v[0-9]\+\.[0-9]\+\.[0-9]\+' .github/workflows/build-test-deploy.yml

Length of output: 144


🏁 Script executed:

#!/bin/bash
# Extract lines 115–140 to inspect any cache key/version references
sed -n '115,140p' .github/workflows/build-test-deploy.yml

Length of output: 1533


Pin CI runner image and align cache version keys

The floating canary tag can silently pull breaking changes (PHP, Composer, PHPStan, etc.). Please:

  • Pin the CI runner image to a digest or introduce a version variable/input for explicit, reviewable upgrades
    • Locations:
    .github/workflows/build-test-deploy.yml:58–60, 168, 367
    • Example:
    - image: drevops/ci-runner:canary
    + image: drevops/ci-runner@sha256:<DIGEST>
  • Update the DB cache keys to match your pinned runner version (or make them version-agnostic)
    • Currently at .github/workflows/build-test-deploy.yml:115–120:
    key: v25.5.0-db11-${{ hashFiles('db_cache_branch') }}-…
    restore-keys: |
      v25.5.0-db11-${{ hashFiles('db_cache_branch') }}-
    • Sync v25.5.0 to your runner version or remove the hard-coded prefix so cache invalidation remains intentional.
🤖 Prompt for AI Agents
In .github/workflows/build-test-deploy.yml around lines 58 to 60, the CI runner
image uses a floating 'canary' tag which can cause unintentional breaking
changes. Fix this by pinning the image to a specific digest or by introducing a
version variable/input for the image tag to allow explicit and reviewable
upgrades. Additionally, update the database cache keys at lines 115 to 120 to
either match the pinned runner version or remove the hard-coded version prefix
to ensure cache invalidation is intentional and consistent with the runner
version.

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

♻️ Duplicate comments (2)
.docker/php.dockerfile (1)

11-14: Same unused-ARG / standalone-build breakage as in solr.dockerfile

Apply the same fix pattern to keep both hadolint happy and non-Compose builds working:

-ARG CLI_IMAGE
-# hadolint ignore=DL3006
-FROM cli_image AS cli
+ARG CLI_IMAGE=cli_image
+# hadolint ignore=DL3006
+FROM ${CLI_IMAGE} AS cli
.docker/nginx-drupal.dockerfile (1)

10-13: Align with the proposed fix – avoid unusable literal & unused ARG

Mirror the adjustment suggested for the other Dockerfiles:

-ARG CLI_IMAGE
-# hadolint ignore=DL3006
-FROM cli_image AS cli
+ARG CLI_IMAGE=cli_image
+# hadolint ignore=DL3006
+FROM ${CLI_IMAGE} AS cli
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a557daf and 629dbb9.

⛔ Files ignored due to path filters (5)
  • .vortex/installer/tests/Fixtures/install/_baseline/.docker/nginx-drupal.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/.docker/php.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/.docker/solr.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/version_replacement/baseline/php.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/version_replacement/expected/php.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (3)
  • .docker/nginx-drupal.dockerfile (1 hunks)
  • .docker/php.dockerfile (1 hunks)
  • .docker/solr.dockerfile (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Composer dependencies in Vortex Drupal projects are automatically updated with compatibility checks via RenovateBot; Node.js dependencies are updated in theme directories, and Docker images are updated for containers.
🪛 Checkov (3.2.334)
.docker/php.dockerfile

[LOW] 13-13: Ensure the base image uses a non latest version tag

(CKV_DOCKER_7)

.docker/solr.dockerfile

[LOW] 10-10: Ensure the base image uses a non latest version tag

(CKV_DOCKER_7)

.docker/nginx-drupal.dockerfile

[LOW] 12-12: Ensure the base image uses a non latest version tag

(CKV_DOCKER_7)

⏰ 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). (13)
  • GitHub Check: build (1)
  • GitHub Check: build (0)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-docs

Comment on lines 8 to 11
ARG CLI_IMAGE
# hadolint ignore=DL3006
FROM ${CLI_IMAGE:-cli} AS cli
FROM cli_image AS cli

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

ARG CLI_IMAGE is now unused & FROM cli_image will fail outside Compose

  1. ARG CLI_IMAGE is declared but never referenced – hadolint will raise DL3008 (ARG declared but not used).
  2. The literal cli_image only resolves when Docker Compose injects the additional_contexts.
    A plain docker build .docker/ run (e.g. in CI or during local debugging) will error with:
failed to resolve reference cli_image: pull access denied

Retain the new context alias while keeping the old override mechanism by defaulting the arg:

-ARG CLI_IMAGE
-# hadolint ignore=DL3006
-FROM cli_image AS cli
+ARG CLI_IMAGE=cli_image          # BuildKit context alias remains the default
+# hadolint ignore=DL3006
+FROM ${CLI_IMAGE} AS cli         # ← still overridable: `docker build --build-arg CLI_IMAGE=myregistry/cli:1.2`

This eliminates the unused-ARG warning and restores backwards compatibility without impacting the Compose-based build order feature.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ARG CLI_IMAGE
# hadolint ignore=DL3006
FROM ${CLI_IMAGE:-cli} AS cli
FROM cli_image AS cli
ARG CLI_IMAGE=cli_image # BuildKit context alias remains the default
# hadolint ignore=DL3006
FROM ${CLI_IMAGE} AS cli # ← still overridable: `docker build --build-arg CLI_IMAGE=myregistry/cli:1.2`
🧰 Tools
🪛 Checkov (3.2.334)

[LOW] 10-10: Ensure the base image uses a non latest version tag

(CKV_DOCKER_7)

🤖 Prompt for AI Agents
In .docker/solr.dockerfile around lines 8 to 11, the ARG CLI_IMAGE is declared
but not used, causing a hadolint warning, and the FROM cli_image line fails
outside Docker Compose because cli_image is not defined. Fix this by using the
ARG CLI_IMAGE in the FROM statement with a default value, like FROM
${CLI_IMAGE:-cli_image} AS cli, so the ARG is used and the build works both
inside and outside Compose.

@github-actions github-actions bot temporarily deployed to commit July 10, 2025 03:25 Inactive
@github-actions github-actions bot temporarily deployed to commit July 10, 2025 05:38 Inactive
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: 2

♻️ Duplicate comments (9)
.docker/solr.dockerfile (1)

9-9: Duplicate of earlier feedback – context alias still breaks plain builds

This issue was already pointed out in a previous review (see history). The recommended fix (keep ARG CLI_IMAGE=cli_image and reference ${CLI_IMAGE}) still applies.

.vortex/tests/bats/fixtures/docker-compose.env_mod.json (1)

227-230: Same compatibility check for additional_contexts applies here

Replicating the note on required Compose/BuildKit versions to avoid broken builds in environments that haven’t been upgraded yet.

Also applies to: 293-298, 356-361

.vortex/tests/bats/fixtures/docker-compose.env.json (2)

293-295: Same compatibility note applies here

See comment above – the PHP service will also fail to build on older Compose.


356-358: Same compatibility note applies here

See first comment.

docker-compose.yml (2)

144-146: Duplicate of the nginx note

The same version guard applies.


189-191: Duplicate of the nginx note

Same version guard applies.

.vortex/tests/bats/fixtures/docker-compose.env_local.json (3)

227-229: Compatibility reminder duplicated

See primary note in .vortex/tests/bats/fixtures/docker-compose.env.json.


293-295: Compatibility reminder duplicated

See primary note.


356-358: Compatibility reminder duplicated

See primary note.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 629dbb9 and 87b80c2.

⛔ Files ignored due to path filters (10)
  • .vortex/installer/tests/Fixtures/install/_baseline/.docker/nginx-drupal.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/.docker/php.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/.docker/solr.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/hosting_acquia/.docker/nginx-drupal.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/hosting_lagoon/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/services_no_clamav/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/services_no_solr/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/services_no_valkey/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/services_none/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (8)
  • .docker/nginx-drupal.dockerfile (1 hunks)
  • .docker/php.dockerfile (1 hunks)
  • .docker/solr.dockerfile (1 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env.json (3 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env_local.json (3 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env_mod.json (3 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.noenv.json (3 hunks)
  • docker-compose.yml (3 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Composer dependencies in Vortex Drupal projects are automatically updated with compatibility checks via RenovateBot; Node.js dependencies are updated in theme directories, and Docker images are updated for containers.
.vortex/tests/bats/fixtures/docker-compose.noenv.json (1)
Learnt from: AlexSkrypnyk
PR: drevops/vortex#0
File: :0-0
Timestamp: 2025-05-29T12:15:32.188Z
Learning: Do not review files in `.vortex/installer/tests/Fixtures/install` directory as they are test fixtures.
.vortex/tests/bats/fixtures/docker-compose.env_mod.json (1)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Composer dependencies in Vortex Drupal projects are automatically updated with compatibility checks via RenovateBot; Node.js dependencies are updated in theme directories, and Docker images are updated for containers.
.vortex/tests/bats/fixtures/docker-compose.env.json (2)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Composer dependencies in Vortex Drupal projects are automatically updated with compatibility checks via RenovateBot; Node.js dependencies are updated in theme directories, and Docker images are updated for containers.
Learnt from: AlexSkrypnyk
PR: drevops/vortex#0
File: :0-0
Timestamp: 2025-05-29T12:15:32.188Z
Learning: Do not review files in `.vortex/installer/tests/Fixtures/install` directory as they are test fixtures.
🪛 Checkov (3.2.334)
.docker/nginx-drupal.dockerfile

[LOW] 11-11: Ensure the base image uses a non latest version tag

(CKV_DOCKER_7)

.docker/solr.dockerfile

[LOW] 9-9: Ensure the base image uses a non latest version tag

(CKV_DOCKER_7)

.docker/php.dockerfile

[LOW] 12-12: Ensure the base image uses a non latest version tag

(CKV_DOCKER_7)

⏰ 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). (13)
  • GitHub Check: build (0)
  • GitHub Check: build (1)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-docs
🔇 Additional comments (3)
.vortex/tests/bats/fixtures/docker-compose.noenv.json (1)

225-230: Confirm Compose / BuildKit version supports additional_contexts

additional_contexts requires Docker Compose ≥ v2.22 & BuildKit. Make sure:

  1. Local dev containers & CI runners use a recent Compose release.
  2. DOCKER_BUILDKIT=1 is enabled in all environments.

If any consumer is still on Compose v1 or older v2, these services will fail to build.

Also applies to: 292-297, 355-360

.vortex/tests/bats/fixtures/docker-compose.env.json (1)

227-229: additional_contexts is correctly wired, but double-check CI/Compose plugin version

The new BuildKit feature requires Docker Compose v2.22+ (or CLI ≥ 24).
If CI or local developers are still on legacy docker-compose v1 they will hit an
unknown-field error and the entire build will bail out early.

Nothing to fix in the fixture itself, just ensure the minimum version gets enforced
(e.g. with an engine check in CI or a note in the docs/README).

docker-compose.yml (1)

119-123: BuildKit feature ok, but guard against older Compose in production pipelines

additional_contexts is valid YAML and properly quoted; however, production
clusters still running Compose v1 (or Swarm stacks) will choke on the field.
Consider:

+  # Requires docker compose v2.22+ / Engine 24+
+  # Remove this guard once all environments are upgraded.

or add a version check in your CI bootstrap.

@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/fix-docker-services-order branch from 87b80c2 to 2cbc55b Compare July 10, 2025 06:30
@github-actions github-actions bot temporarily deployed to commit July 10, 2025 06:32 Inactive
@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/fix-docker-services-order branch from 2cbc55b to 928053f Compare July 10, 2025 06:47
@github-actions github-actions bot temporarily deployed to commit July 10, 2025 06:49 Inactive
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

🔭 Outside diff range comments (1)
docker-compose.yml (1)

140-146: Anchor hygiene

If *cli-image is no longer referenced after dropping the CLI_IMAGE arg, remove the anchor to avoid dead YAML artifacts.

♻️ Duplicate comments (3)
.docker/solr.dockerfile (1)

8-10: ${CLI_IMAGE:-cli_image} may not parse in many Docker engines

Bash-style default expansion isn’t universally supported in FROM. Older/stock Docker (incl. most CI runners) will treat it literally and fail (invalid reference format).
Use an ARG default instead:

-ARG CLI_IMAGE
-# hadolint ignore=DL3006
-FROM ${CLI_IMAGE:-cli_image} AS cli
+ARG CLI_IMAGE=cli_image          # default matches the BuildKit context alias
+# hadolint ignore=DL3006
+FROM ${CLI_IMAGE} AS cli         # still overridable via --build-arg

Restores standalone docker build compatibility and silences hadolint DL3008.

.docker/php.dockerfile (1)

11-13: Portable default handling for CLI_IMAGE

Same concern as in the Solr Dockerfile: ${CLI_IMAGE:-cli_image} isn’t reliably expanded in FROM. Prefer an ARG with a default value:

-ARG CLI_IMAGE
-# hadolint ignore=DL3006
-FROM ${CLI_IMAGE:-cli_image} AS cli
+ARG CLI_IMAGE=cli_image
+# hadolint ignore=DL3006
+FROM ${CLI_IMAGE} AS cli
.docker/nginx-drupal.dockerfile (1)

10-12: Fallback expression can break standalone builds

Adopt the same safe pattern used above to keep builds working on engines lacking :- expansion:

-ARG CLI_IMAGE
-# hadolint ignore=DL3006
-FROM ${CLI_IMAGE:-cli_image} AS cli
+ARG CLI_IMAGE=cli_image
+# hadolint ignore=DL3006
+FROM ${CLI_IMAGE} AS cli
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2cbc55b and 928053f.

⛔ Files ignored due to path filters (5)
  • .vortex/installer/tests/Fixtures/install/_baseline/.docker/nginx-drupal.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/.docker/php.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/.docker/solr.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/version_replacement/baseline/php.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/version_replacement/expected/php.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (4)
  • .docker/nginx-drupal.dockerfile (1 hunks)
  • .docker/php.dockerfile (1 hunks)
  • .docker/solr.dockerfile (1 hunks)
  • docker-compose.yml (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-24T01:07:14.235Z
Learning: Composer dependencies in Vortex Drupal projects are automatically updated with compatibility checks via RenovateBot; Node.js dependencies are updated in theme directories, and Docker images are updated for containers.
⏰ 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). (13)
  • GitHub Check: build (1)
  • GitHub Check: build (0)
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-docs
🔇 Additional comments (1)
docker-compose.yml (1)

115-123: Ensure CI & docs require Compose V2 / BuildKit ≥ 0.11

additional_contexts is only recognised by recent Compose/BuildKit. Older runners silently ignore it, making cli_image unresolved. Verify your pipeline uses a modern Docker (or wrap with a version check).

Comment on lines 186 to 196
build:
context: .
dockerfile: .docker/solr.dockerfile
args:
CLI_IMAGE: *cli-image
additional_contexts:
cli_image: "service:cli"
environment:
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

DRY up repeated additional_contexts blocks

Consider a shared YAML anchor to avoid three nearly identical stanzas:

x-cli-context: &cli_context
  additional_contexts:
    cli_image: "service:cli"

nginx:
  build:
    <<: *cli_context
    #

php:
  build:
    <<: *cli_context
    #

solr:
  build:
    <<: *cli_context
    #

Reduces duplication and future edit surfaces.

🤖 Prompt for AI Agents
In docker-compose.yml around lines 186 to 191, the additional_contexts block
with cli_image: "service:cli" is repeated in multiple build sections. To fix
this, define a YAML anchor (e.g., x-cli-context) at the top level with the
additional_contexts block, then reference it in each build section using the
merge key (<<: *cli_context) to avoid duplication and simplify future edits.

@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/fix-docker-services-order branch from 3c1d46f to c88fb56 Compare July 11, 2025 22:22
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

♻️ Duplicate comments (3)
docker-compose.yml (3)

121-122: DRY up repeated additional_contexts blocks (see previous review).


144-146: DRY up repeated additional_contexts blocks (see previous review).


189-191: DRY up repeated additional_contexts blocks (see previous review).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 928053f and c88fb56.

⛔ Files ignored due to path filters (3)
  • .vortex/installer/tests/Fixtures/install/_baseline/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/services_no_solr/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/services_none/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (1)
  • docker-compose.yml (3 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). (11)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-docs
🔇 Additional comments (1)
docker-compose.yml (1)

115-123: Verified: No cli_image build stages in Dockerfiles

A search for FROM …cli_image returned zero results, so the additional_contexts: cli alias is consistent and there are no lingering cli_image stages. No changes needed here.

Comment on lines 119 to 124
args:
CLI_IMAGE: *cli-image
WEBROOT: "${WEBROOT:-web}"
additional_contexts:
cli: "service:cli"
<<: [*default-volumes, *default-user]
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Left-over single-value args: block can be inlined or removed.

With only WEBROOT remaining you can drop the args: wrapper and keep the stanza short:

-      args:
-        WEBROOT: "${WEBROOT:-web}"
+      args: { WEBROOT: "${WEBROOT:-web}" }

Purely cosmetic but keeps this section tidy.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
args:
CLI_IMAGE: *cli-image
WEBROOT: "${WEBROOT:-web}"
additional_contexts:
cli: "service:cli"
<<: [*default-volumes, *default-user]
args: { WEBROOT: "${WEBROOT:-web}" }
additional_contexts:
cli: "service:cli"
<<: [*default-volumes, *default-user]
🤖 Prompt for AI Agents
In docker-compose.yml around lines 119 to 123, the args block contains only a
single WEBROOT variable, making the args: wrapper unnecessary. Remove the args:
line and inline the WEBROOT variable directly at the same indentation level to
simplify and tidy the configuration.

@github-actions github-actions bot temporarily deployed to commit July 11, 2025 22:24 Inactive
@github-actions github-actions bot temporarily deployed to commit July 11, 2025 22:41 Inactive
@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/fix-docker-services-order branch from 70faea3 to b93db0e Compare July 11, 2025 22:46
@AlexSkrypnyk AlexSkrypnyk changed the title [#1779] Added additional_contexts for the Docker services build order. [#1779] Fixed Docker parallel build order. Jul 11, 2025
@github-actions github-actions bot temporarily deployed to commit July 11, 2025 22:48 Inactive
@AlexSkrypnyk AlexSkrypnyk merged commit fd8660b into develop Jul 12, 2025
30 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/fix-docker-services-order branch July 12, 2025 00:26
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Jul 12, 2025
@AlexSkrypnyk AlexSkrypnyk added this to the 25.7.0 milestone Jul 26, 2025
@AlexSkrypnyk AlexSkrypnyk moved this from Release queue to Released in 25.7.0 in Vortex Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Docker Compose Build Race Condition in Fresh Vortex Projects

2 participants