-
-
Notifications
You must be signed in to change notification settings - Fork 29
[#1580] Allow to choose tools in the installer. #1935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,12 +80,12 @@ commands: | |
| usage: Show container logs for services. | ||
| cmd: docker compose logs "$@" | ||
|
|
||
| # Drop into a shell if no arguments are supplied, otherwise run the command. | ||
| # Environment variables are passed from the host and filtered by prefix. | ||
| # Use \" (slash followed by a double quote) to escape double quotes in | ||
| # arguments that contain spaces. | ||
| cli: | ||
| usage: Start a shell or run a command inside the CLI service container. | ||
| # Drop into a shell if no arguments are supplied, otherwise run the command. | ||
| # Environment variables are passed from the host and filtered by prefix. | ||
| # Use \" (slash followed by a double quote) to escape double quotes in | ||
| # arguments that contain spaces. | ||
| cmd: | | ||
| if [ "${#}" -ne 0 ]; then | ||
| docker compose exec $(env | cut -f1 -d= | grep "TERM\|COMPOSE_\|GITHUB_\|PACKAGE_\|DOCKER_\|DRUPAL_\|VORTEX_" | sed 's/^/-e /') cli bash -c "$*" | ||
|
|
@@ -122,7 +122,7 @@ commands: | |
| #;< !PROVISION_TYPE_PROFILE | ||
| download-db: | ||
| usage: Download database. Run with "--no-cache" option to force fresh database backup. | ||
| aliases: ['fetch-db'] | ||
| aliases: [fetch-db] | ||
| cmd: | | ||
| case " $* " in *" --no-cache "*) export VORTEX_DB_DOWNLOAD_NO_CACHE=1;; esac | ||
| ./scripts/vortex/download-db.sh | ||
|
|
@@ -158,7 +158,7 @@ commands: | |
| cmd: \[ -n "${VORTEX_DB_IMAGE}" \] && docker pull ${VORTEX_DB_IMAGE} || true | ||
|
|
||
| reset: | ||
| usage: "Remove containers, all build files. Use with `hard` to reset repository to the last commit." | ||
| usage: Remove containers, all build files. Use with `hard` to reset repository to the last commit. | ||
| cmd: | | ||
| ahoy confirm "All containers and build files will be removed. Proceed?" || exit 0 | ||
| AHOY_CONFIRM_RESPONSE=y ahoy down | ||
|
|
@@ -190,7 +190,10 @@ commands: | |
|
|
||
| lint: | ||
| usage: Lint back-end and front-end code. | ||
| cmd: ahoy lint-be && ahoy lint-fe && ahoy lint-tests | ||
| cmd: | | ||
| ahoy lint-be | ||
| ahoy lint-fe | ||
| ahoy lint-tests | ||
|
|
||
| lint-be: | ||
| usage: Lint back-end code. | ||
|
|
@@ -211,11 +214,14 @@ commands: | |
|
|
||
| lint-tests: | ||
| usage: Lint tests code. | ||
| cmd: ahoy cli vendor/bin/gherkinlint lint tests/behat/features | ||
| cmd: | | ||
| ahoy cli vendor/bin/gherkinlint lint tests/behat/features | ||
|
|
||
| lint-fix: | ||
| usage: Fix lint issues of back-end and front-end code. | ||
| cmd: ahoy lint-be-fix && ahoy lint-fe-fix | ||
| cmd: | | ||
| ahoy lint-be-fix | ||
| ahoy lint-fe-fix | ||
|
|
||
| lint-be-fix: | ||
| usage: Fix lint issues of back-end code. | ||
|
|
@@ -234,7 +240,11 @@ commands: | |
|
|
||
| test: | ||
| usage: Run all tests. | ||
| cmd: ahoy test-unit && ahoy test-kernel && ahoy test-functional && ahoy test-bdd | ||
| cmd: | | ||
| ahoy test-unit | ||
| ahoy test-kernel | ||
| ahoy test-functional | ||
| ahoy test-bdd | ||
|
|
||
| test-unit: | ||
| usage: Run PHPUnit unit tests. | ||
|
|
@@ -250,7 +260,7 @@ commands: | |
|
|
||
| test-bdd: | ||
| usage: Run BDD tests. | ||
| aliases: ['test-behat'] | ||
| aliases: [test-behat] | ||
| cmd: ahoy cli php -d memory_limit=-1 vendor/bin/behat --colors "$@" | ||
|
|
||
| debug: | ||
|
|
@@ -274,8 +284,7 @@ commands: | |
| local: | ||
| usage: Custom local commands. See `ahoy local help`. | ||
| optional: true | ||
| imports: | ||
| - .ahoy.local.yml | ||
| imports: [.ahoy.local.yml] | ||
|
|
||
| # ---------------------------------------------------------------------------- | ||
| # Utilities. | ||
|
|
@@ -307,15 +316,14 @@ commands: | |
| hide: true | ||
|
|
||
| # Override entrypoint to alter default behavior of Ahoy. | ||
| # 1. Exit the script if any statement returns a non-true return value. | ||
| # 2. Read variables from .env file (while respecting existing values) to load | ||
| # and pass updated environment variables' values into already running | ||
| # containers. | ||
|
Comment on lines
+319
to
+322
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Entry-point comment removal is OK; make sure behavior remains documented You moved the explanatory comment up near 🤖 Prompt for AI Agents |
||
| entrypoint: | ||
| - bash | ||
| - -c | ||
| # Exit the script if any statement returns a non-true return value. | ||
| - -e | ||
| # Read variables from .env file, respecting existing values. | ||
| # - Used to load and pass updated environment variables' values into already | ||
| # running containers. | ||
| # - Use `ahoy up cli` in cases when changes require container restart. | ||
| - | | ||
| t=$(mktemp) && export -p > "$t" && set -a && . ./.env && if [ -f ./.env.local ];then . ./.env.local;fi && set +a && . "$t" && rm "$t" && unset t | ||
| bash -e -c "$0" "$@" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -269,35 +269,45 @@ jobs: | |
| run: docker compose exec -T cli composer normalize --dry-run | ||
| continue-on-error: ${{ vars.VORTEX_CI_COMPOSER_NORMALIZE_IGNORE_FAILURE == '1' }} | ||
|
|
||
| #;< TOOL_PHPCS | ||
| - name: Lint code with PHPCS | ||
| if: ${{ matrix.instance == 0 || strategy.job-total == 1 }} | ||
| run: docker compose exec -T cli vendor/bin/phpcs | ||
| continue-on-error: ${{ vars.VORTEX_CI_PHPCS_IGNORE_FAILURE == '1' }} | ||
| #;> TOOL_PHPCS | ||
|
|
||
|
Comment on lines
+272
to
278
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainTool block markers are well-scoped; add guardrails to ensure they stay balanced The new internal markers around PHPCS, PHPStan, Rector, PHPMD, Gherkin Lint (Behat), PHPUnit, and Behat look consistent and non-invasive. This will help the installer strip or retain steps based on selections. Add a quick CI check (dev-only) to ensure every “#;< TOOL_” has a matching “#;> TOOL_” across both CI configs: Also applies to: 279-285, 286-292, 293-299, 305-311, 333-338, 339-352 🏁 Script executed: #!/bin/bash
set -euo pipefail
files=(.github/workflows/build-test-deploy.yml .circleci/config.yml)
for f in "${files[@]}"; do
echo "Checking tool markers in $f"
starts=$(rg -n '^#;<\s+TOOL_([A-Z_]+)\s*$' "$f" -r '$1' | sort)
ends=$(rg -n '^#;>\s+TOOL_([A-Z_]+)\s*$' "$f" -r '$1' | sort)
diff -u <(echo "$starts") <(echo "$ends") && echo "OK: balanced markers in $f"
doneLength of output: 357 🏁 Script executed: #!/bin/bash
set -eu
files=(.github/workflows/build-test-deploy.yml .circleci/config.yml)
for f in "${files[@]}"; do
echo "Checking tool markers in $f"
# Gather start markers, ignore errors if none found
starts=$(grep -E '^\s*#;<\s+TOOL_[A-Z_]+' "$f" || true | sed -E 's/^\s*#;<\s+TOOL_([A-Z_]+).*/\1/' | sort)
# Gather end markers, ignore errors if none found
ends=$(grep -E '^\s*#;>\s+TOOL_[A-Z_]+' "$f" || true | sed -E 's/^\s*#;>\s+TOOL_([A-Z_]+).*/\1/' | sort)
echo "Starts:"
echo "$starts"
echo "Ends:"
echo "$ends"
if diff -u <(echo "$starts") <(echo "$ends") > /dev/null; then
echo "OK: balanced markers in $f"
else
echo "ERROR: unbalanced tool markers in $f"
diff -u <(echo "$starts") <(echo "$ends")
fi
doneLength of output: 2433 🏁 Script executed: #!/bin/bash
set -eu
files=(.github/workflows/build-test-deploy.yml .circleci/config.yml)
for f in "${files[@]}"; do
echo "Checking tool markers in $f"
# Gather start markers
starts=$(grep -E '^\s*#;<\s+TOOL_[A-Z_]+' "$f" || true | sed -E 's/^\s*#;<\s+TOOL_([A-Z_]+).*/\1/' | sort)
# Gather end markers
ends=$(grep -E '^\s*#;>\s+TOOL_[A-Z_]+' "$f" || true | sed -E 's/^\s*#;>\s+TOOL_([A-Z_]+).*/\1/' | sort)
# Write to temp files for reliable diff
tmp_start=$(mktemp)
tmp_end=$(mktemp)
echo "$starts" > "$tmp_start"
echo "$ends" > "$tmp_end"
echo "Starts:"
cat "$tmp_start"
echo "Ends:"
cat "$tmp_end"
if diff -u "$tmp_start" "$tmp_end" > /dev/null; then
echo "OK: balanced markers in $f"
else
echo "ERROR: unbalanced tool markers in $f"
diff -u "$tmp_start" "$tmp_end"
fi
rm -f "$tmp_start" "$tmp_end"
doneLength of output: 2233 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
files=(.github/workflows/build-test-deploy.yml .circleci/config.yml)
for f in "${files[@]}"; do
echo "Checking tool markers in $f"
# Extract just the marker names (e.g., TOOL_PHPCS)
starts=$(grep -E '^\s*#;<\s+TOOL_[A-Z_]+' "$f" | sed -En 's/^\s*#;<\s+(TOOL_[A-Z_]+).*/\1/p' | sort)
ends=$(grep -E '^\s*#;>\s+TOOL_[A-Z_]+' "$f" | sed -En 's/^\s*#;>\s+(TOOL_[A-Z_]+).*/\1/p' | sort)
echo "Start markers:"
echo "${starts:-<none>}"
echo "End markers:"
echo "${ends:-<none>}"
# Compare lists
missing_starts=$(comm -23 <(echo "$ends") <(echo "$starts") || true)
missing_ends=$(comm -13 <(echo "$ends") <(echo "$starts") || true)
if [[ -z "$missing_starts" && -z "$missing_ends" ]]; then
echo "OK: balanced markers in $f"
else
echo "ERROR: unbalanced markers in $f"
[[ -n "$missing_starts" ]] && echo " Missing start marker for: $missing_starts"
[[ -n "$missing_ends" ]] && echo " Missing end marker for: $missing_ends"
fi
doneLength of output: 3522 Tool markers verified as balanced across CI configs
No missing or extra markers were found, so the current blocks are correctly scoped. • Optional: To prevent future drift, consider adding the following dev-only CI guardrail that fails if any tool block is unbalanced: #!/bin/bash
set -euo pipefail
files=(.github/workflows/build-test-deploy.yml .circleci/config.yml)
for f in "${files[@]}"; do
echo "Verifying markers in $f"
starts=$(grep -E '^\s*#;<\s+TOOL_[A-Z_]+' "$f" | sed -E 's/^\s*#;<\s+(TOOL_[A-Z_]+).*/\1/' | sort)
ends=$(grep -E '^\s*#;>\s+TOOL_[A-Z_]+' "$f" | sed -E 's/^\s*#;>\s+(TOOL_[A-Z_]+).*/\1/' | sort)
if ! diff -u <(echo "$starts") <(echo "$ends"); then
echo "❌ Unbalanced tool markers in $f" && exit 1
fi
done
echo "✅ All tool markers balanced"This will ensure that any future edits keep the markers in sync. 🤖 Prompt for AI Agents |
||
| #;< TOOL_PHPSTAN | ||
| - name: Lint code with PHPStan | ||
| if: ${{ matrix.instance == 0 || strategy.job-total == 1 }} | ||
| run: docker compose exec -T cli vendor/bin/phpstan | ||
| continue-on-error: ${{ vars.VORTEX_CI_PHPSTAN_IGNORE_FAILURE == '1' }} | ||
| #;> TOOL_PHPSTAN | ||
|
|
||
| #;< TOOL_RECTOR | ||
| - name: Lint code with Rector | ||
| if: ${{ matrix.instance == 0 || strategy.job-total == 1 }} | ||
| run: docker compose exec -T cli vendor/bin/rector --clear-cache --dry-run | ||
| continue-on-error: ${{ vars.VORTEX_CI_RECTOR_IGNORE_FAILURE == '1' }} | ||
| #;> TOOL_RECTOR | ||
|
|
||
| #;< TOOL_PHPMD | ||
| - name: Lint code with PHPMD | ||
| if: ${{ matrix.instance == 0 || strategy.job-total == 1 }} | ||
| run: docker compose exec -T cli vendor/bin/phpmd . text phpmd.xml | ||
| continue-on-error: ${{ vars.VORTEX_CI_PHPMD_IGNORE_FAILURE == '1' }} | ||
| #;> TOOL_PHPMD | ||
|
|
||
| - name: Lint code with Twig CS Fixer | ||
| if: ${{ matrix.instance == 0 || strategy.job-total == 1 }} | ||
| run: docker compose exec -T cli vendor/bin/twig-cs-fixer | ||
| continue-on-error: ${{ vars.VORTEX_CI_TWIG_CS_FIXER_IGNORE_FAILURE == '1' }} | ||
|
|
||
| #;< TOOL_BEHAT | ||
| - name: Lint code with Gherkin Lint | ||
| if: ${{ matrix.instance == 0 || strategy.job-total == 1 }} | ||
| run: docker compose exec -T cli vendor/bin/gherkinlint lint tests/behat/features | ||
| continue-on-error: ${{ vars.VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE == '1' }} | ||
| #;> TOOL_BEHAT | ||
|
|
||
| - name: Lint module code with NodeJS linters | ||
| if: ${{ matrix.instance == 0 || strategy.job-total == 1 }} | ||
|
|
@@ -320,10 +330,13 @@ jobs: | |
| docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli ./scripts/vortex/provision.sh | ||
| timeout-minutes: 30 | ||
|
|
||
| #;< TOOL_PHPUNIT | ||
| - name: Test with PHPUnit | ||
| run: docker compose exec -T cli vendor/bin/phpunit | ||
| continue-on-error: ${{ vars.VORTEX_CI_PHPUNIT_IGNORE_FAILURE == '1' }} | ||
| #;> TOOL_PHPUNIT | ||
|
|
||
| #;< TOOL_BEHAT | ||
| - name: Test with Behat | ||
| run: | | ||
| # shellcheck disable=SC2170 | ||
|
|
@@ -335,6 +348,7 @@ jobs: | |
| VORTEX_CI_BEHAT_PROFILE: ${{ vars.VORTEX_CI_BEHAT_PROFILE }} | ||
| continue-on-error: ${{ vars.VORTEX_CI_BEHAT_IGNORE_FAILURE == '1' }} | ||
| timeout-minutes: 30 | ||
| #;> TOOL_BEHAT | ||
|
|
||
| - name: Process test logs and artifacts | ||
| if: always() | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -37,6 +37,10 @@ jobs: | |||||||||||||
| run: composer install | ||||||||||||||
| working-directory: .vortex/installer | ||||||||||||||
|
|
||||||||||||||
| - name: Validate Composer configuration is normalized | ||||||||||||||
| run: composer normalize --dry-run | ||||||||||||||
| working-directory: .vortex/installer | ||||||||||||||
|
|
||||||||||||||
|
Comment on lines
+40
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Nice: add composer-normalize to CI; consider showing diffs for clarity Dry-run is good. Adding --diff prints the normalized diff when the step fails, which speeds debugging. - run: composer normalize --dry-run
+ run: composer normalize --dry-run --diff📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| - name: Check coding standards | ||||||||||||||
| run: composer lint | ||||||||||||||
| working-directory: .vortex/installer | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,11 +18,13 @@ | |||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| "require": { | ||||||||||||||||||||||||
| "php": ">=8.2", | ||||||||||||||||||||||||
| "alexskrypnyk/file": "^0.8.0", | ||||||||||||||||||||||||
| "alexskrypnyk/file": "^0.9", | ||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Bump to alexskrypnyk/file ^0.9 — verify BC across usages This library is used transitively by File utilities (per previous learnings). Please verify no BC breaks affecting ExtendedSplFileInfo and any inherited helpers you rely on. I can generate a quick grep-based check to list methods you call from this package across the repo if helpful. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| "alexskrypnyk/str2name": "^1.4", | ||||||||||||||||||||||||
| "composer/composer": "^2.8", | ||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Adding composer/composer as a runtime dependency can bloat the installer PHAR Using Composer\Json\JsonManipulator requires composer/composer, which is a large package. Consider alternatives:
If keeping it in require, ensure Box excludes unnecessary files to keep the PHAR lean. Would you like a PR-ready Box config snippet to trim composer/composer from the PHAR? 🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| "cweagans/composer-patches": "^1.7", | ||||||||||||||||||||||||
| "czproject/git-php": "^4.3", | ||||||||||||||||||||||||
| "laravel/prompts": "^0.3.5", | ||||||||||||||||||||||||
| "nikic/iter": "^2.4", | ||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Confirm nikic/iter is actually used If not used, drop it to keep the dependency tree minimal. If used only in tests, move to require-dev. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| "sebastian/diff": "*", | ||||||||||||||||||||||||
| "symfony/console": "^7.3", | ||||||||||||||||||||||||
| "symfony/filesystem": "^7.2", | ||||||||||||||||||||||||
|
|
@@ -48,8 +50,8 @@ | |||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| "autoload-dev": { | ||||||||||||||||||||||||
| "psr-4": { | ||||||||||||||||||||||||
| "DrevOps\\VortexInstaller\\Tests\\": "tests", | ||||||||||||||||||||||||
| "AlexSkrypnyk\\File\\Tests\\": "vendor/alexskrypnyk/file/tests" | ||||||||||||||||||||||||
| "AlexSkrypnyk\\File\\Tests\\": "vendor/alexskrypnyk/file/tests", | ||||||||||||||||||||||||
| "DrevOps\\VortexInstaller\\Tests\\": "tests" | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
|
Comment on lines
+53
to
55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Avoid autoloading vendor tests via PSR-4 Mapping vendor/alexskrypnyk/file/tests in autoload-dev couples your tests to vendor internals and slows composer dump-autoload. Prefer your test namespace only; import vendor fixtures explicitly if needed. "autoload-dev": {
"psr-4": {
- "AlexSkrypnyk\\File\\Tests\\": "vendor/alexskrypnyk/file/tests",
"DrevOps\\VortexInstaller\\Tests\\": "tests"
},
"classmap": [
"tests"
]
},📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| "classmap": [ | ||||||||||||||||||||||||
| "tests" | ||||||||||||||||||||||||
|
|
@@ -92,6 +94,7 @@ | |||||||||||||||||||||||
| ], | ||||||||||||||||||||||||
| "reset": "rm -Rf vendor vendor-bin", | ||||||||||||||||||||||||
| "test": "phpunit --no-coverage", | ||||||||||||||||||||||||
| "test-baseline": "UPDATE_FIXTURES=1 phpunit --no-coverage --filter=testInstall@baseline || UPDATE_FIXTURES=1 phpunit --no-coverage --filter=testInstall@baseline", | ||||||||||||||||||||||||
| "test-coverage": "php -d pcov.directory=. vendor/bin/phpunit", | ||||||||||||||||||||||||
| "test-fixtures": "UPDATE_FIXTURES=1 phpunit --no-coverage --filter=testInstall" | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Minor doc typo: it’s a backslash, not a slash
“Use " (slash followed by a double quote)” → “Use " (backslash followed by a double quote)”.
📝 Committable suggestion
🤖 Prompt for AI Agents