[#2719] Added a platform-agnostic 'task' runner for hosting operations.#2721
Conversation
WalkthroughA central ChangesAcquia task router
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.vortex/tooling/tests/unit/task.bats:
- Line 33: Rename the existing task test to match what it actually covers: the
scenario in task.bats removes the execute bit and validates a non-executable
sibling script, not a missing script. Update the test name around the `@test`
block for the Task sibling-script case so it reflects the non-executable sibling
behavior, and keep the test body unchanged.
- Around line 33-42: Rename the test case in task.bats so its name reflects the
actual scenario being exercised, since it disables execute permissions on
task-copy-db-acquia rather than testing a missing script. Update the `@test`
description in the Task: missing sibling script block to match the
permission/non-executable case, keeping the test body and assertions as-is.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 774c0bf9-42f6-4b4b-abbb-651c8d816fca
⛔ Files ignored due to path filters (6)
.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/hooks/library/copy-db.shis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/hooks/library/copy-files.shis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/hooks/library/purge-cache.shis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/hooks/library/copy-db.shis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/hooks/library/copy-files.shis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/hooks/library/purge-cache.shis excluded by!.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (5)
.vortex/tooling/src/task.vortex/tooling/tests/unit/task.batshooks/library/copy-db.shhooks/library/copy-files.shhooks/library/purge-cache.sh
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2721 +/- ##
==========================================
- Coverage 86.67% 86.22% -0.45%
==========================================
Files 96 89 -7
Lines 4719 4560 -159
Branches 47 3 -44
==========================================
- Hits 4090 3932 -158
+ Misses 629 628 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
📖 Documentation preview for this pull request has been deployed to Netlify: https://6a3caf0c4e402bee241deab4--vortex-docs.netlify.app This preview is rebuilt on every commit and is not the production documentation site. |
|
Code coverage (threshold: 90%) Per-class coverage |
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
|
Code coverage (threshold: 90%) Per-class coverage |
Closes #2719
Summary
Introduces a single, platform-agnostic
taskrunner atvendor/drevops/vortex-tooling/src/taskso the Acquia Cloud hooks dispatch operations through one entrypoint -task <operation>- instead of calling the individualtask-*-acquiascripts directly. This unblocks #2715 (exposing the tooling scripts asvendor/bin/binaries), wheretaskbecomes the public entrypoint and the platform-specifictask-*-acquiascripts stay internal.The runner resolves a platform-agnostic operation to the implementation for the configured hosting platform -
task-<operation>-<platform>- reusing the existingnotifyrouter pattern. The platform is read fromVORTEX_TASK_PLATFORM, falling back toVORTEX_PLATFORM; the Acquia hooks exportVORTEX_PLATFORM=acquia. Both the operation and the platform are validated against whitelists before the sibling path is built, and the sibling is required to be executable, so only approved scripts can run.Changes
Task runner
.vortex/tooling/src/taskdispatchestask <operation> [args...]totask-<operation>-<platform>. It validates the operation (copy-db,copy-files,purge-cache) and the platform (acquia,lagoon) against whitelists, requires the resolved sibling script to be executable, and forwards trailing arguments. It fails with a clear message on a missing or unknown operation, a missing or unsupported platform, or an operation that the platform does not implement.task-*-acquiascripts are unchanged - they become internal platform implementations reached only through the router, so behaviour (environment variables, output, exit codes) is identical.Acquia hooks
hooks/library/copy-db.sh,hooks/library/copy-files.sh, andhooks/library/purge-cache.shnowexport VORTEX_PLATFORM=acquiaand calltask <operation>instead oftask-<operation>-acquia. A duplicate#!/usr/bin/env bashshebang was removed frompurge-cache.sh.Tests
.vortex/tooling/tests/unit/task.batswith 9 cases covering operation validation, platform resolution (VORTEX_PLATFORM, theVORTEX_TASK_PLATFORMoverride and its precedence), the missing-platform, unsupported-platform and unsupported-operation-on-platform errors, and dispatch of each operation.Documentation
.vortex/docs/content/hosting/acquia.mdxgains a "Run a hosting task" section documenting thetask <operation>DX, the operation table, and platform selection viaVORTEX_PLATFORM/VORTEX_TASK_PLATFORM.Fixtures
.vortex/installer/tests/Fixtures/handler_process/.Before / After