Skip to content

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Jul 18, 2025

Related to #1607

Summary by CodeRabbit

  • Chores
    • Added or updated the DRUPAL_THEME environment variable across multiple service configurations and test fixtures.
    • Adjusted Docker build process to conditionally install and build theme assets only when a theme is specified.
    • Updated default values for DRUPAL_THEME to improve configuration flexibility.
    • Fixed command syntax for installing front-end dependencies in the Drupal theme setup.

@coderabbitai
Copy link

coderabbitai bot commented Jul 18, 2025

"""

Walkthrough

The changes update Docker and Docker Compose configurations to standardize the handling of the DRUPAL_THEME environment variable. The Dockerfile now conditionally installs and builds theme assets only if DRUPAL_THEME is set. Fixture files and compose configurations are updated to consistently define this variable across all relevant services. Additionally, a command flag in .ahoy.yml was corrected.

Changes

File(s) Change Summary
.docker/cli.dockerfile Changed default DRUPAL_THEME to empty, consolidated and conditionalized theme asset steps.
.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
Added DRUPAL_THEME variable to all service environments and build args where missing.
.vortex/tests/bats/fixtures/docker-compose.noenv.json Added DRUPAL_THEME (empty) to chrome env and cli build args.
docker-compose.yml Added DRUPAL_THEME (empty) to cli service build args.
.ahoy.yml Fixed yarn install command flag from --frozen-lock to --frozen-lockfile in fei command.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Docker as Docker Build
    participant Theme as Theme Build Step

    Dev->>Docker: Build CLI image (with DRUPAL_THEME)
    alt DRUPAL_THEME is set
        Docker->>Theme: Install Node dependencies & build assets
        Theme-->>Docker: Assets built
    else DRUPAL_THEME is empty
        Docker-->>Docker: Skip theme build steps
    end
    Docker-->>Dev: CLI image ready
Loading

Suggested labels

Confirmed

Poem

In the warren of Docker, a theme hops in,
Now only built if you say where to begin.
Compose files in line, environment set,
No more stray carrots for the build to forget.
🐇 With logic so tidy and variables clear,
The rabbit approves—let’s give a cheer!


📜 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 db1e386 and d2061e2.

⛔ Files ignored due to path filters (13)
  • .vortex/installer/tests/Fixtures/install/_baseline/.ahoy.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/.docker/cli.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_lagoon/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/names/.docker/cli.dockerfile 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/**
  • .vortex/installer/tests/Fixtures/install/theme_absent/.ahoy.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/theme_absent/.docker/cli.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/theme_custom/.docker/cli.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (7)
  • .ahoy.yml (1 hunks)
  • .docker/cli.dockerfile (2 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env.json (1 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env_local.json (1 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env_mod.json (1 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.noenv.json (1 hunks)
  • docker-compose.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-12T00:26:22.700Z
Learning: Docker images should be updated for container base images
.ahoy.yml (1)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-12T00:26:22.700Z
Learning: Node.js dependencies should be updated in theme directories
.docker/cli.dockerfile (1)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-12T00:26:22.700Z
Learning: Node.js dependencies should be updated in theme directories
⏰ 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-workflow (0)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-docs
🔇 Additional comments (3)
.vortex/tests/bats/fixtures/docker-compose.env_mod.json (1)

118-124: Fixture value diverges from runtime default

DRUPAL_THEME is hard-coded to your_site_theme here, while the real compose file defaults to empty.
Double-check that test expectations still align with production behaviour.

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

118-124: Consistency between fixtures

As above, confirm that forcing DRUPAL_THEME in fixtures is deliberate and matches CI scenarios.

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

119-125: Build-time ARG mirrors run-time ENV – verify consistency

DRUPAL_THEME is now forwarded as a build argument.
Double-check that .docker/cli.dockerfile fails fast when this is intentionally left blank (it currently does not). Otherwise an empty string will bypass the theme build silently.


🪧 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 18, 2025 02:02 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

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

95-101: Quote build-arg to avoid YAML edge-cases

DRUPAL_THEME is the only build arg that is not wrapped in quotes.
Although most parsers will handle it, quoting is safer when the value can contain special characters (spaces, colons, #, etc.) and keeps the style consistent with the other args.

-        DRUPAL_THEME: ${DRUPAL_THEME:-}
+        DRUPAL_THEME: "${DRUPAL_THEME:-}"
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a0e703d and d68ce53.

⛔ Files ignored due to path filters (11)
  • .vortex/installer/tests/Fixtures/install/_baseline/.docker/cli.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_lagoon/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/names/.docker/cli.dockerfile 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/**
  • .vortex/installer/tests/Fixtures/install/theme_absent/.docker/cli.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/theme_custom/.docker/cli.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (6)
  • .docker/cli.dockerfile (2 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env.json (1 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env_local.json (1 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env_mod.json (1 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.noenv.json (1 hunks)
  • docker-compose.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-12T00:26:22.700Z
Learning: Docker images should be updated for container base images
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-12T00:26:22.700Z
Learning: Node.js dependencies should be updated in theme directories
.docker/cli.dockerfile (1)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-12T00:26:22.700Z
Learning: Node.js dependencies should be updated in theme directories
⏰ 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: build (1)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-workflow (2)
  • 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)
🔇 Additional comments (4)
.vortex/tests/bats/fixtures/docker-compose.env_mod.json (1)

30-37: Theme variable added consistently – looks good

The fixture now mirrors the compose file and Dockerfile logic by injecting DRUPAL_THEME in both build args and runtime envs. No issues spotted.

Also applies to: 90-97, 118-126

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

30-37: Fixtures aligned with new DRUPAL_THEME handling

All affected services include the variable, which will let the conditional build steps run during tests. LGTM.

Also applies to: 90-97, 118-126

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

30-37: Local-env fixture kept in sync

No functional concerns; addition keeps local fixture behaviour in line with others.

Also applies to: 90-97, 118-126

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

35-36: Edge-case coverage: empty theme value

Nice touch covering the “theme not set” path. Please make sure the CLI Dockerfile logic treats an empty string the same as an unset var (current ARG DRUPAL_THEME="" + if [ -n "$DRUPAL_THEME" ] pattern is fine).
No code changes required.

Also applies to: 123-124

Comment on lines +35 to 37
ARG DRUPAL_THEME=""
ENV DRUPAL_THEME=${DRUPAL_THEME}
#;> DRUPAL_THEME
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Defaulting DRUPAL_THEME to an empty string can mask mis-configuration

With an empty default the build silently skips the front-end step when the variable is forgotten.
Consider leaving the ARG unset (no default) and/or adding a validation guard so that a typo is surfaced early.

🤖 Prompt for AI Agents
In .docker/cli.dockerfile around lines 35 to 37, the ARG DRUPAL_THEME is
defaulted to an empty string, which can hide misconfigurations by silently
skipping the front-end step if the variable is forgotten. Remove the default
empty string from the ARG declaration so it is unset by default, and add a
validation step in the Dockerfile to check if DRUPAL_THEME is set, failing the
build early with a clear error message if it is missing or empty.

@codecov
Copy link

codecov bot commented Jul 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.68%. Comparing base (ba705c0) to head (d2061e2).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1804   +/-   ##
========================================
  Coverage    72.68%   72.68%           
========================================
  Files           84       84           
  Lines         4711     4711           
  Branches        35       35           
========================================
  Hits          3424     3424           
  Misses        1287     1287           

☔ 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.

@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/1607-conditional-fe-build branch from d68ce53 to db1e386 Compare July 18, 2025 02:25
@github-actions github-actions bot temporarily deployed to commit July 18, 2025 02:27 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 (3)
docker-compose.yml (1)

95-101: Build-arg addition looks good; ensure .env docs are updated

Passing DRUPAL_THEME explicitly to the CLI build solves the “ARG not defined” warning introduced in the Dockerfile refactor. 👍
Double-check that the variable is documented in your .env.example (or README) so newcomers know they must export it to trigger the FE build.

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

118-126: Fixture value duplicated in both build.args and environment

Mirroring the variable in both blocks is fine but brittle – if a test ever changes the theme name you’ll have to edit two locations for every service.
Consider trimming build.args.DRUPAL_THEME and relying on the run-time env only; the CLI Dockerfile already falls back to the env when the ARG is missing.

Also applies to: 132-149

.docker/cli.dockerfile (1)

77-91: Front-end build still breaks layer caching
COPY . /app precedes the (heavy) Yarn install, so any code change invalidates the cache for Node dependencies. Copy only the theme’s package.json / yarn.lock first, run yarn install, then copy the rest of the repo. This was flagged previously and remains unaddressed.

♻️ Duplicate comments (3)
.vortex/tests/bats/fixtures/docker-compose.env.json (1)

118-126: Same duplication pattern as other fixture

Same comment as above – drop one copy or add a helper in fixture generation to keep them in sync.

Also applies to: 132-149

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

118-126: Local-env fixture duplication

See earlier note on keeping ARG vs ENV in sync.

Also applies to: 132-149

.docker/cli.dockerfile (1)

34-37: Leaving DRUPAL_THEME default empty still masks mis-configuration
The default "" causes the step to be silently skipped when the arg is forgotten or misspelled. Either drop the default or fail early if it’s empty.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d68ce53 and db1e386.

⛔ Files ignored due to path filters (11)
  • .vortex/installer/tests/Fixtures/install/_baseline/.docker/cli.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_lagoon/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/names/.docker/cli.dockerfile 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/**
  • .vortex/installer/tests/Fixtures/install/theme_absent/.docker/cli.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/theme_custom/.docker/cli.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (6)
  • .docker/cli.dockerfile (2 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env.json (1 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env_local.json (1 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.env_mod.json (1 hunks)
  • .vortex/tests/bats/fixtures/docker-compose.noenv.json (1 hunks)
  • docker-compose.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-12T00:26:22.700Z
Learning: Docker images should be updated for container base images
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-12T00:26:22.700Z
Learning: Node.js dependencies should be updated in theme directories
.docker/cli.dockerfile (2)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-12T00:26:22.700Z
Learning: Docker images should be updated for container base images
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-12T00:26:22.700Z
Learning: Node.js dependencies should be updated in theme directories
⏰ 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-workflow (3)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-deployment (1)
  • 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
🔇 Additional comments (1)
.vortex/tests/bats/fixtures/docker-compose.noenv.json (1)

118-126: noenv fixture: blank value correctly disables theme build

Good catch setting the ARG to an empty string here – matches the intended “no theme” scenario.

Also applies to: 132-149

Comment on lines +86 to +91
RUN if [ -n "${DRUPAL_THEME}" ]; then \
theme_path="/app/${WEBROOT}/themes/custom/${DRUPAL_THEME}"; \
yarn --cwd="${theme_path}" install --frozen-lockfile --no-progress && \
yarn --cwd="${theme_path}" run build && \
yarn cache clean; \
fi
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Guard against missing theme directory & make Yarn fully non-interactive
If DRUPAL_THEME is set but the directory is absent the build will error mid-way; bail out explicitly. Also add --non-interactive to avoid hanging CI pipelines.

 RUN if [ -n "${DRUPAL_THEME}" ]; then \
       theme_path="/app/${WEBROOT}/themes/custom/${DRUPAL_THEME}"; \
+      if [ ! -d "${theme_path}" ]; then \
+        echo "Theme directory '${theme_path}' does not exist." >&2; exit 1; \
+      fi && \
-      yarn --cwd="${theme_path}" install --frozen-lockfile --no-progress && \
+      yarn --cwd="${theme_path}" install --frozen-lockfile --non-interactive --no-progress && \
       yarn --cwd="${theme_path}" run build && \
       yarn cache clean; \
     fi
📝 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
RUN if [ -n "${DRUPAL_THEME}" ]; then \
theme_path="/app/${WEBROOT}/themes/custom/${DRUPAL_THEME}"; \
yarn --cwd="${theme_path}" install --frozen-lockfile --no-progress && \
yarn --cwd="${theme_path}" run build && \
yarn cache clean; \
fi
RUN if [ -n "${DRUPAL_THEME}" ]; then \
theme_path="/app/${WEBROOT}/themes/custom/${DRUPAL_THEME}"; \
if [ ! -d "${theme_path}" ]; then \
echo "Theme directory '${theme_path}' does not exist." >&2; exit 1; \
fi && \
yarn --cwd="${theme_path}" install --frozen-lockfile --non-interactive --no-progress && \
yarn --cwd="${theme_path}" run build && \
yarn cache clean; \
fi
🤖 Prompt for AI Agents
In .docker/cli.dockerfile around lines 86 to 91, the current script assumes the
theme directory exists if DRUPAL_THEME is set, which can cause errors if the
directory is missing. Modify the RUN command to first check if the theme
directory exists before running yarn commands, and add the --non-interactive
flag to all yarn commands to prevent hanging in CI environments.

@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/1607-conditional-fe-build branch from db1e386 to d2061e2 Compare July 18, 2025 05:06
@github-actions github-actions bot temporarily deployed to commit July 18, 2025 05:08 Inactive
@AlexSkrypnyk AlexSkrypnyk merged commit bf45da2 into develop Jul 18, 2025
44 of 46 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/1607-conditional-fe-build branch July 18, 2025 07:40
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Jul 18, 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.

2 participants