Skip to content

[#1968] Added VORTEX_PROVISION_FALLBACK_TO_PROFILE flag to provision script.#2294

Open
AlexSkrypnyk wants to merge 1 commit intomainfrom
feature/1968-provision-fallback
Open

[#1968] Added VORTEX_PROVISION_FALLBACK_TO_PROFILE flag to provision script.#2294
AlexSkrypnyk wants to merge 1 commit intomainfrom
feature/1968-provision-fallback

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Feb 16, 2026

Closes #1968

Summary by CodeRabbit

  • New Features

    • Added a configurable provisioning fallback: when a database dump is unavailable, the site can optionally fall back to profile-based installation via a new environment flag.
  • Documentation

    • Updated provisioning flow and environment-variable docs to describe the new fallback behavior and reordered related options.
  • Tests

    • Added unit tests covering fallback-to-profile scenarios and updated provisioning output assertions.

@github-project-automation github-project-automation bot moved this to BACKLOG in Vortex Feb 16, 2026
@AlexSkrypnyk AlexSkrypnyk added this to the 1.36.0 milestone Feb 16, 2026
@AlexSkrypnyk AlexSkrypnyk moved this from BACKLOG to In progress in Vortex Feb 16, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

Walkthrough

Adds VORTEX_PROVISION_FALLBACK_TO_PROFILE (default 0) and implements logic to fall back to profile installation when a DB dump or DB image is unavailable; updates .env, documentation, tests, and provisioning script status/output.

Changes

Cohort / File(s) Summary
Configuration
.env
Added VORTEX_PROVISION_FALLBACK_TO_PROFILE in PROVISION section (default 0).
Documentation
.vortex/docs/content/development/variables.mdx, .vortex/docs/content/drupal/provision.mdx
Documented the new fallback variable; replaced diagram with ASCII flow in provision docs and reordered/updated env-var descriptions to reflect fallback behavior.
Implementation
scripts/vortex/provision.sh
Added handling for VORTEX_PROVISION_FALLBACK_TO_PROFILE: when dump or image is missing and flag=1, log and provision from profile; set VORTEX_PROVISION_OVERRIDE_DB where appropriate; updated status output.
Tests
.vortex/tests/bats/unit/provision.bats
Added unit tests covering fallback-to-profile scenarios (no dump, with/without container image, and no-fallback failure cases); updated assertions to include fallback status message.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ProvisionScript as Provision Script
    participant DBDump as DB Dump (file)
    participant DBImage as DB Image (container)
    participant Profile as Profile Installer

    User->>ProvisionScript: start provisioning (type=database)
    ProvisionScript->>DBDump: check for dump file
    alt dump exists
        ProvisionScript->>DBDump: restore dump
        ProvisionScript->>User: success
    else dump missing
        ProvisionScript->>DBImage: check for DB image
        alt image exists
            ProvisionScript->>DBImage: attempt import
            alt import ok
                ProvisionScript->>User: success
            else import fails
                alt VORTEX_PROVISION_FALLBACK_TO_PROFILE = 1
                    ProvisionScript->>Profile: install from profile
                    ProvisionScript->>User: success (fallback)
                else
                    ProvisionScript->>User: fail (corrupt/missing DB)
                end
            end
        else image missing
            alt VORTEX_PROVISION_FALLBACK_TO_PROFILE = 1
                ProvisionScript->>Profile: install from profile
                ProvisionScript->>User: success (fallback)
            else
                ProvisionScript->>User: fail (no dump/image)
            end
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

PR: Needs review

Poem

🐰 I hopped through code and docs with glee,
When dumps were missing, I chose to see —
A flag, a fallback, profiles take flight,
Sites rise anew in the soft moonlight.
Hooray for tidy installs tonight! 🥕

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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: adding the VORTEX_PROVISION_FALLBACK_TO_PROFILE flag to the provision script, which is the core purpose of this PR.
Linked Issues check ✅ Passed The PR fully implements the requested feature from #1968: adds a flag enabling fallback to profile installation when DB dump is unavailable, with proper documentation and comprehensive test coverage for all specified conditions.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the VORTEX_PROVISION_FALLBACK_TO_PROFILE feature: configuration variable declaration, documentation updates, implementation in provision.sh, and test coverage. No extraneous changes detected.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ 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/1968-provision-fallback

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
Verify each finding against the current code and only fix it if needed.


In @.vortex/docs/content/drupal/provision.mdx:
- Around line 153-159: Update the VORTEX_PROVISION_FALLBACK_TO_PROFILE
description to explicitly state that the fallback is only evaluated when
VORTEX_PROVISION_TYPE is set to "database" (i.e., it will not trigger when
VORTEX_PROVISION_TYPE=profile); modify the prose for that bullet so it reads
that fallback to installing from profile occurs only if the provisioning type is
database and the DB dump or image is unavailable, to avoid confusion for users
who set VORTEX_PROVISION_TYPE=profile.

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-17 00:04:26

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@github-actions

This comment has been minimized.

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-17 00:08:07

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-17 00:08:19

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.12%. Comparing base (ff8ecd6) to head (c0b14e3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2294      +/-   ##
==========================================
- Coverage   77.49%   77.12%   -0.38%     
==========================================
  Files         117      110       -7     
  Lines        6164     6015     -149     
  Branches       44        0      -44     
==========================================
- Hits         4777     4639     -138     
+ Misses       1387     1376      -11     

☔ 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/1968-provision-fallback branch from baeb1ab to 2109a95 Compare February 17, 2026 00:38
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.vortex/docs/content/development/variables.mdx:
- Line 392: Update the VORTEX_PROVISION_FALLBACK_TO_PROFILE doc entry to
explicitly state it is a boolean expecting values "1" (enabled) and "0"
(disabled), and clarify that when the variable is unset the default behavior is
disabled (effectively treated as "0"); reference the variable name
VORTEX_PROVISION_FALLBACK_TO_PROFILE and the related usage in .env and
scripts/vortex/provision.sh so readers know where it is configured and consumed.

---

Duplicate comments:
In @.vortex/docs/content/drupal/provision.mdx:
- Around line 153-159: Update the VORTEX_PROVISION_FALLBACK_TO_PROFILE
description to explicitly state that the fallback is evaluated only during
database-based provisioning (i.e., when VORTEX_PROVISION_TYPE is not set to
"profile" or when importing a DB dump/container image); reword the line for
VORTEX_PROVISION_FALLBACK_TO_PROFILE so it clarifies it will only trigger when
attempting to provision from a database dump or image and not when
VORTEX_PROVISION_TYPE=profile, referencing the
VORTEX_PROVISION_FALLBACK_TO_PROFILE and VORTEX_PROVISION_TYPE variables and
ensuring the example phrasing signals the conditional behavior.

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-17 00:45:06

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@github-actions

This comment has been minimized.

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-17 00:48:19

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-17 00:48:25

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/1968-provision-fallback branch from 2109a95 to c0b14e3 Compare February 17, 2026 02:07
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.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.vortex/docs/content/drupal/provision.mdx:
- Around line 154-159: Update the prose for VORTEX_PROVISION_FALLBACK_TO_PROFILE
to explicitly state that the fallback behavior only applies when
VORTEX_PROVISION_TYPE is set to "database" (i.e., when you intended to import a
DB dump); clarify that if VORTEX_PROVISION_TYPE=profile the fallback is
irrelevant, and keep the current explanation about falling back to profile when
the database dump or image is unavailable. Reference
VORTEX_PROVISION_FALLBACK_TO_PROFILE and VORTEX_PROVISION_TYPE in the sentence
so readers who skip the flow diagram see the constraint.

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-17 02:13:30

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@github-actions
Copy link

Code Coverage Report:
  2026-02-17 02:13:39

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-17 02:17:00

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-17 02:17:21

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Add flag to provision script to allow installing from profile if DB dump is not available

1 participant