Skip to content

[#2261] Fixed Acquia settings to allow DRUPAL_CONFIG_PATH override independently of config_vcs_directory.#2263

Merged
AlexSkrypnyk merged 1 commit intomainfrom
feature/2261-acquia-config-path
Feb 9, 2026
Merged

[#2261] Fixed Acquia settings to allow DRUPAL_CONFIG_PATH override independently of config_vcs_directory.#2263
AlexSkrypnyk merged 1 commit intomainfrom
feature/2261-acquia-config-path

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Feb 9, 2026

Closes #2261

Summary by CodeRabbit

  • Tests

    • Added test coverage for configuration path override behavior in Acquia environments.
  • Refactor

    • Reorganized configuration sync directory and automatic htaccess handling for clearer, consolidated initialization while preserving existing behavior.

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

Walkthrough

Adds a unit test for DRUPAL_CONFIG_PATH overriding and reorders/centralizes DRUPAL_CONFIG_PATH handling and htaccess creation in Acquia-specific settings to apply the environment variable regardless of config_vcs_directory presence.

Changes

Cohort / File(s) Summary
Test Coverage
tests/phpunit/Drupal/EnvironmentSettingsTest.php
Added testEnvironmentAcquiaConfigPathOverride() to assert DRUPAL_CONFIG_PATH overrides Acquia config_sync_directory and that related paths (config_vcs_directory fallback, environment-specific values) are set as expected.
Acquia Settings Logic
web/sites/default/includes/providers/settings.acquia.php
Moved and consolidated DRUPAL_CONFIG_PATH override to a post-switch block so the env var sets config_sync_directory when present (falling back to config_vcs_directory if not) and re-enabled automatic htaccess creation in the same block.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Confirmed

Poem

🐰
A bunny hops through config lanes,
DRUPAL_CONFIG_PATH breaks old chains,
Tests hopped in to check the way,
Paths now follow what envs convey,
🎉✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: fixing Acquia settings to allow DRUPAL_CONFIG_PATH to override config_sync_directory independently of config_vcs_directory.
Linked Issues check ✅ Passed The code changes implement the exact requirement from issue #2261: allowing DRUPAL_CONFIG_PATH to override config_sync_directory regardless of whether config_vcs_directory is set, with proper fallback logic.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue objective. The test addition validates the new behavior, and the settings file modification implements the required override logic without unrelated alterations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/2261-acquia-config-path

No actionable comments were generated in the recent review. 🎉


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

🤖 Fix all issues with AI agents
In `@tests/phpunit/Drupal/EnvironmentSettingsTest.php`:
- Around line 781-785: Add a new unit test (or extend
testEnvironmentAcquiaConfigPathOverride) to verify the fallback to
config_vcs_directory when DRUPAL_CONFIG_PATH is not set: clear/unset
DRUPAL_CONFIG_PATH in the environment, pre-populate/mock the settings array key
$settings['config_vcs_directory'] to a test path before including/loading the
Acquia settings logic, then assert that the resulting config path resolution
uses that $settings['config_vcs_directory'] value; reference the existing
testEnvironmentAcquiaConfigPathOverride behavior and the
$settings['config_vcs_directory'] symbol when implementing the mock and
assertions.

Comment on lines +781 to +785
public function testEnvironmentAcquiaConfigPathOverride(): void {
$this->setEnvVars([
'AH_SITE_ENVIRONMENT' => 1,
'DRUPAL_CONFIG_PATH' => 'custom_acquia_config',
]);
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider adding a test for the config_vcs_directory fallback path.

The test covers the DRUPAL_CONFIG_PATH override scenario but doesn't verify the fallback to config_vcs_directory when DRUPAL_CONFIG_PATH is absent. While the Acquia settings file that sets config_vcs_directory is excluded from coverage (due to file system dependencies), you could potentially mock this by pre-setting $settings['config_vcs_directory'] before including the settings file, if the test harness supports it.

🤖 Prompt for AI Agents
In `@tests/phpunit/Drupal/EnvironmentSettingsTest.php` around lines 781 - 785, Add
a new unit test (or extend testEnvironmentAcquiaConfigPathOverride) to verify
the fallback to config_vcs_directory when DRUPAL_CONFIG_PATH is not set:
clear/unset DRUPAL_CONFIG_PATH in the environment, pre-populate/mock the
settings array key $settings['config_vcs_directory'] to a test path before
including/loading the Acquia settings logic, then assert that the resulting
config path resolution uses that $settings['config_vcs_directory'] value;
reference the existing testEnvironmentAcquiaConfigPathOverride behavior and the
$settings['config_vcs_directory'] symbol when implementing the mock and
assertions.

…independently of `config_vcs_directory`.
@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/2261-acquia-config-path branch from 6b526b5 to 2eec47f Compare February 9, 2026 11:47
@github-actions
Copy link

github-actions bot commented Feb 9, 2026

Code Coverage Report:
  2026-02-09 11:53:16

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.02% (173/184)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 11:53:21

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.02% (173/184)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 11:56:19

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.02% (173/184)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 11:56:54

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.02% (173/184)

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.44%. Comparing base (72e6150) to head (2eec47f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2263      +/-   ##
==========================================
- Coverage   77.05%   76.44%   -0.61%     
==========================================
  Files         114      107       -7     
  Lines        5988     5829     -159     
  Branches       44        0      -44     
==========================================
- Hits         4614     4456     -158     
+ Misses       1374     1373       -1     

☔ 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 merged commit 79bc146 into main Feb 9, 2026
28 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/2261-acquia-config-path branch February 9, 2026 12:12
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Feb 9, 2026
@AlexSkrypnyk AlexSkrypnyk added this to the 1.36.0 milestone Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Release queue

Development

Successfully merging this pull request may close these issues.

Acquia settings allow to override config_sync_directory with DRUPAL_CONFIG_PATH only if $settings['config_vcs_directory'] is set, but should not.

1 participant