Skip to content

[#2597] Replaced post-provision scripts with deploy steps via the 'drupal/deploy_steps' module.#2606

Open
AlexSkrypnyk wants to merge 38 commits into
2.xfrom
feature/2597-ys-deploy-module
Open

[#2597] Replaced post-provision scripts with deploy steps via the 'drupal/deploy_steps' module.#2606
AlexSkrypnyk wants to merge 38 commits into
2.xfrom
feature/2597-ys-deploy-module

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented Jun 10, 2026

Copy link
Copy Markdown
Member

Closes #2597

Summary

Replaces the bespoke post-provision shell scripts with Drupal-native "run on every deploy" logic built on the drupal/deploy_steps contributed module. The two example provision scripts become DeployStep plugins - the development/demo environment setup (ys_base) and the content migration (ys_migrate) - discovered and run by deploy_steps around every drush deploy:hook, grouped by phase (pre/post), ordered by weight, each gated by an explicit, logged skip reason.

deploy_steps was extracted from this work into a standalone contrib module; Vortex now consumes it as a Composer dependency rather than shipping the mechanism in-repo. The provision-*.sh discovery loop is removed from the provision orchestrator, which now enables the module and the site modules before deploy:hook so their plugins and run-once hook_deploy_NAME() run in the same pass.

Changes

Dependency

  • composer require drupal/deploy_steps with an explicit ^1.0.0-alpha1 constraint (the module's current release; the explicit alpha suffix is required because the project is minimum-stability: stable).
  • A scoped config.audit.ignore for two guzzlehttp/psr7 advisories (GHSA-34xg-wgjx-8xph, GHSA-hq7v-mx3g-29hw) - a transitive dependency of drupal/core-recommended that block-insecure rejects until an upstream release moves off the affected 2.8.x. Temporary; remove when resolved upstream.

Deploy step plugins (consumers)

  • web/modules/custom/ys_base/src/Plugin/DeployStep/DevelopmentSetup.php - the provision-10-example.sh logic (PRE phase, non-production): set the site name and install the contrib/service/ys_search/ys_demo modules. Installer service/module tokens preserved as PHP-comment fences. Running in the PRE phase means the modules it enables have their run-once deploy hooks fired by the deploy:hook body.
  • web/modules/custom/ys_migrate/src/Plugin/DeployStep/MigrateContent.php - the provision-20-migration.sh logic (POST phase, non-production): a migrate:import shaped by DRUPAL_MIGRATION_* variables, plus a guard that loads the db2.sql source database into the migrate connection when it is not already populated.
  • Both plugins compose the module's opt-in traits (DrushTrait, EnvTrait, EnvironmentTrait) and use skip() for conditional, logged skips.
  • Both modules declare a deploy_steps dependency; the install profile depends on it too.
  • scripts/provision-10-example.sh and scripts/provision-20-migration.sh removed.

Provision orchestrator (.vortex/tooling/src/provision)

  • Removed the for file in provision-*.sh discovery loop and the VORTEX_PROVISION_SCRIPTS_DIR variable.
  • Before deploy:hook, enable deploy_steps and the always-on site modules (resolved by glob *_base/*_migrate, since the installer renames them).

Tooling, tests, docs

  • rector.php: skip PrivatizeFinalClassConstantRector, RenamePropertyToMatchTypeRector, and RenameForeachValueVariableToMatchMethodCallReturnTypeRector, beside the privatization/rename rules the config already excludes; class constants carry explicit types.
  • SUT assertions, BATS (provision-migration.bats removed, provision.bats trimmed), MigrationHandlerProcessTest, and the Modules / Migration installer handlers updated to the plugin model.
  • docs/deployment.md, the docs-site provision.mdx / migrations.mdx, scripts/README.md, and .vortex/tooling/README.md document the deploy-step model; the orphaned provision-example.sh doc asset removed.
  • Installer/test snapshots regenerated.

Before / After

BEFORE
  provision orchestrator
    ├─ drush deploy:hook ─────────> hook_deploy_NAME()   [run-once]
    └─ for scripts/provision-*.sh:
         ├─ provision-10-example.sh    (dev/demo setup, shell)
         └─ provision-20-migration.sh  (migration, shell)

AFTER  (deploy steps discovered by the drupal/deploy_steps contrib module)
  provision orchestrator
    ├─ drush pm:install deploy_steps  *_base  *_migrate
    └─ drush deploy:hook
         ├─ PRE   ─> DevelopmentSetup  (ys_base,   non-prod) ─ enables dev/demo/contrib modules
         ├─ body  ─> hook_deploy_NAME()  [run-once, incl. the just-enabled modules]
         └─ POST  ─> MigrateContent    (ys_migrate, non-prod)

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • project/2.x

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d1432247-9544-487d-a54b-67d3b2784b7e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/2597-ys-deploy-module

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

@AlexSkrypnyk AlexSkrypnyk added this to the 2.0 milestone Jun 10, 2026
@AlexSkrypnyk AlexSkrypnyk added the A1 Board worker 1 label Jun 10, 2026
@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.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

📖 Documentation preview for this pull request has been deployed to Netlify:

https://6a2e5f7d03b4015735467740--vortex-docs.netlify.app

This preview is rebuilt on every commit and is not the production documentation site.

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

@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

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.97%. Comparing base (5bf00ef) to head (51e02c8).

Additional details and impacted files
@@            Coverage Diff             @@
##              2.x    #2606      +/-   ##
==========================================
- Coverage   86.24%   85.97%   -0.27%     
==========================================
  Files          88       86       -2     
  Lines        4537     4415     -122     
  Branches        3        3              
==========================================
- Hits         3913     3796     -117     
+ Misses        624      619       -5     

☔ View full report in Codecov by Harness.
📢 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 added the Needs review Pull request needs a review from assigned developers label Jun 10, 2026
@AlexSkrypnyk

This comment has been minimized.

2 similar comments
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

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

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

@AlexSkrypnyk AlexSkrypnyk changed the title [#2597] Replaced provision scripts with a generic 'persistent_deploy' plugin module. [#2597] Replaced post-provision scripts with deploy steps via the 'drupal/deploy_steps' module. Jun 14, 2026
@github-actions

This comment has been minimized.

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

@github-actions

Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.56% (205/208)
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

Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

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

@AlexSkrypnyk

Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

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

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

Labels

A1 Board worker 1 Needs review Pull request needs a review from assigned developers

Projects

Status: BACKLOG

Development

Successfully merging this pull request may close these issues.

1 participant