Skip to content

[#2374] Added opt-in repeated configuration import after initial import.#2417

Merged
AlexSkrypnyk merged 2 commits intomainfrom
feature/repeat-config-import
Mar 24, 2026
Merged

[#2374] Added opt-in repeated configuration import after initial import.#2417
AlexSkrypnyk merged 2 commits intomainfrom
feature/repeat-config-import

Conversation

@AlexSkrypnyk
Copy link
Copy Markdown
Member

@AlexSkrypnyk AlexSkrypnyk commented Mar 24, 2026

Closes #2374

Summary

Added an opt-in VORTEX_PROVISION_CONFIG_IMPORT_REPEAT variable to the provision script that, when set to 1, triggers a second drush config:import run immediately after the initial configuration import. This addresses edge cases where database update hooks introduce new configuration (e.g., new config_split settings) that only takes effect on a subsequent import. The feature is disabled by default to preserve existing behavior.

Changes

Provision script (scripts/vortex/provision.sh)

  • Added VORTEX_PROVISION_CONFIG_IMPORT_REPEAT variable (default 0) with descriptive comment explaining use case.
  • Added conditional block after initial config import: when the variable is 1, runs drush config:import a second time with task/pass logging messages.

Documentation (.vortex/docs/content/drupal/provision.mdx)

  • Added step 9 in the provisioning flow diagram for the optional repeated config import.
  • Renumbered the former step 9 (DB sanitization) to step 10.
  • Added entry for VORTEX_PROVISION_CONFIG_IMPORT_REPEAT=1 in the environment variables reference section.

Variables reference (.vortex/docs/content/development/variables.mdx)

  • Added row for VORTEX_PROVISION_CONFIG_IMPORT_REPEAT in the auto-generated variables table.

Tests (.vortex/tests/bats/unit/provision.bats)

  • Added new Bats test Provision: DB; no site; config import repeat that exercises the full provision flow with VORTEX_PROVISION_CONFIG_IMPORT_REPEAT=1 and asserts the repeated import step is executed.
  • Updated two existing assert_provision_info step arrays to include the "- Repeating configuration import." and "- Completed repeated configuration import." expectations so they remain accurate.

Before / After

Before:
┌──────────────────────────────────────┐
│  Import configuration                │
│    drush config:import               │
│            │                         │
│            ▼                         │
│  Import config_split (if installed)  │
│            │                         │
│            ▼                         │
│  Rebuild caches                      │
└──────────────────────────────────────┘

After:
┌──────────────────────────────────────────────────────────┐
│  Import configuration                                    │
│    drush config:import                                   │
│            │                                             │
│            ▼                                             │
│  [opt-in] Repeat configuration import                    │
│    VORTEX_PROVISION_CONFIG_IMPORT_REPEAT=1               │
│    drush config:import  (runs only when variable is 1)   │
│            │                                             │
│            ▼                                             │
│  Import config_split (if installed)                      │
│            │                                             │
│            ▼                                             │
│  Rebuild caches                                          │
└──────────────────────────────────────────────────────────┘

Summary by CodeRabbit

  • New Features

    • Added an optional environment variable to enable a second configuration import during provisioning.
  • Documentation

    • Updated provisioning flow diagram and environment variable reference to reflect the optional repeat step and renumbered downstream steps.
  • Tests

    • Added unit tests and expected logs covering the provisioning flow with the configuration-import repeat enabled.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: efe18601-67d0-47ff-9045-c6859b3b86a3

📥 Commits

Reviewing files that changed from the base of the PR and between c57a3c6 and 6357e67.

📒 Files selected for processing (1)
  • .vortex/docs/content/development/variables.mdx

Walkthrough

Added an opt-in environment variable VORTEX_PROVISION_CONFIG_IMPORT_REPEAT and logic to run a second drush config:import during provisioning; documentation, unit tests, and provisioning script were updated to reflect and validate the new optional repeat-import step.

Changes

Cohort / File(s) Summary
Documentation
.vortex/docs/content/development/variables.mdx, .vortex/docs/content/drupal/provision.mdx
Documented new VORTEX_PROVISION_CONFIG_IMPORT_REPEAT (default 0) and inserted an optional "Repeat configuration import" step in the provisioning flow diagram; adjusted step numbering and env var list.
Implementation
scripts/vortex/provision.sh
Added env-controlled branch: when VORTEX_PROVISION_CONFIG_IMPORT_REPEAT=1 and site config present, run drush config:import a second time with task/pass logging.
Tests
.vortex/tests/bats/unit/provision.bats
Added test case and expected log assertions verifying the repeated configuration import and associated messages.

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant ProvisionScript as "provision.sh"
  participant Drush
  participant Database
  participant Hooks

  Operator->>ProvisionScript: start provisioning
  ProvisionScript->>Drush: drush config:import (initial)
  Drush->>Database: apply config changes
  Database-->>Drush: success
  alt VORTEX_PROVISION_CONFIG_IMPORT_REPEAT=1
    ProvisionScript->>Drush: drush config:import (repeat)
    Drush->>Database: apply additional changes
    Database-->>Drush: success
  end
  ProvisionScript->>Hooks: run deployment & cache rebuild hooks
  Hooks-->>ProvisionScript: complete
  ProvisionScript-->>Operator: provisioning finished
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

PR: Needs review

Poem

🐰 I hopped through docs and scripts today,
A repeat import clears the way,
If hooks add config mid-provision play,
I run once more and save the day! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR implements the repeated config import requirement from issue #2374. However, the issue also requests a conditional cache rebuild feature, which is not addressed in this changeset—only the repeated config import is implemented. Implement the conditional cache rebuild feature to fully address issue #2374's requirement for both 'conditional cache rebuild and double config import'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title '[#2374] Added opt-in repeated configuration import after initial import' accurately summarizes the main change—adding an opt-in environment variable to repeat configuration import after the initial import to handle edge cases with database update hooks.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the repeated config import feature: environment variable addition, documentation updates, and unit tests. No extraneous or unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/repeat-config-import

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

@github-actions

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

2 similar comments
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.95%. Comparing base (271488b) to head (6357e67).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2417      +/-   ##
==========================================
- Coverage   79.42%   78.95%   -0.47%     
==========================================
  Files         126      119       -7     
  Lines        6730     6577     -153     
  Branches       44        0      -44     
==========================================
- Hits         5345     5193     -152     
+ Misses       1385     1384       -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.

@github-actions
Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (189/189)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk

This comment has been minimized.

2 similar comments
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk
Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (189/189)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk AlexSkrypnyk merged commit 1283c79 into main Mar 24, 2026
30 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/repeat-config-import branch March 24, 2026 22:14
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Mar 24, 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.

Add conditional cache rebuild and double config import to provision

1 participant