Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c73062d
feat: add command to copy files from vendor to theme
dermatz Feb 12, 2026
c38d3b5
feat: add method to retrieve theme by code
dermatz Feb 12, 2026
b1a8107
fix: return proper CLI constants for failure and success cases
dermatz Feb 12, 2026
f7e1026
feat: enhance theme path resolution using ComponentRegistrar
dermatz Feb 12, 2026
fc622d8
feat: add PHPUnit workflow and unit tests for VendorFileMapper
dermatz Feb 12, 2026
cb1e356
feat: improve file copy command with error handling and path normaliz…
dermatz Feb 12, 2026
3ac3898
refactor: remove unused filesystem dependency and update type casting
dermatz Feb 12, 2026
6eb5c46
feat: add tests for copy from vendor functionality in workflows
dermatz Feb 13, 2026
60c302c
feat: add ES_SKIP_CGROUPS_CHECK environment variable for Elasticsearch
dermatz Feb 13, 2026
9125d31
fix: update Elasticsearch configuration for health checks
dermatz Feb 13, 2026
e57c1ba
feat: update Elasticsearch version and add new theme copy commands
dermatz Feb 13, 2026
6cb362f
feat: add dry-run option to copy-from-vendor command for previews
dermatz Feb 13, 2026
7606204
feat: update test for theme copy from vendor with real module template
dermatz Feb 13, 2026
9d057bd
feat: simplify test for copy from vendor command in functional tests
dermatz Feb 13, 2026
cee2180
refactor: reorder detection patterns in VendorFileMapper for clarity
dermatz Feb 16, 2026
959d9ec
Apply suggestion from @Copilot
dermatz Feb 16, 2026
3bd238d
Update src/Console/Command/Theme/CopyFromVendorCommand.php
dermatz Feb 16, 2026
98b88f7
Update .github/workflows/functional-tests.yml
dermatz Feb 16, 2026
2da462a
Update src/Service/VendorFileMapper.php
dermatz Feb 16, 2026
dcb88c9
Update src/Console/Command/Theme/CopyFromVendorCommand.php
dermatz Feb 16, 2026
50b4f16
feat: add method to retrieve theme by code in ThemeList
dermatz Feb 16, 2026
e97c0fc
feat: enhance VendorFileMapper with theme area validation and extraction
dermatz Feb 16, 2026
3885c0e
feat: implement copy command tests and update VendorFileMapper
dermatz Feb 16, 2026
03911ed
docs: update testing guide for copy command with new test cases
dermatz Feb 16, 2026
3300938
test: enhance copy command tests with dynamic file discovery
dermatz Feb 16, 2026
c6d52ea
feat: enhance file copy confirmation with improved prompt handling
dermatz Feb 17, 2026
b7637e5
feat: add Hyva compatibility module mapping to VendorFileMapper
dermatz Feb 20, 2026
0a73a1b
feat: enhance VendorFileMapper with area emulation for compatibility
dermatz Feb 20, 2026
789396b
feat: add Hyva compatibility module retrieval with fallback parsing
dermatz Feb 20, 2026
203d83f
feat: enhance compatibility module parsing with robust XML handling
dermatz Feb 20, 2026
24a38f1
feat: enhance VendorFileMapper and CopyFromVendorCommand with file ha…
dermatz Feb 25, 2026
110cc92
feat: refactor DI file handling for compatibility module registration
dermatz Feb 25, 2026
d84ec1e
feat: enhance VendorFileMapper with type hinting for registry handling
dermatz Feb 25, 2026
d40b3c5
feat: improve theme selection handling in CopyFromVendorCommand
dermatz Feb 25, 2026
4c2d843
Update src/Console/Command/Theme/CopyFromVendorCommand.php
dermatz Feb 25, 2026
0d61b55
Update src/Console/Command/Theme/CopyFromVendorCommand.php
dermatz Feb 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ jobs:
bin/magento mageforge:hyva:compatibility:check --show-all

echo "Third party only:"
bin/magento m:h:c:c --third-party-only
bin/magento mageforge:hyva:compatibility:check --third-party-only

echo "Detailed output:"
bin/magento m:h:c:c --show-all --detailed
bin/magento mageforge:hyva:compatibility:check --show-all --detailed

- name: Test Theme Cleaner
working-directory: magento2
Expand All @@ -139,7 +139,6 @@ jobs:
bin/magento mageforge:theme:clean --all --dry-run

echo "Test aliases:"
bin/magento m:t:c --help
bin/magento frontend:clean --help

- name: Test Theme Name Suggestions
Expand All @@ -155,11 +154,24 @@ jobs:
echo "CleanCommand with invalid name:"
bin/magento mageforge:theme:clean Magent/lum --dry-run || echo "Expected failure - suggestions shown"

- name: Test Inspector Status
- name: Test Copy From Vendor
working-directory: magento2
run: |
echo "=== Inspector Tests ==="
bin/magento mageforge:theme:inspector status
echo "=== Copy From Vendor Tests ==="

echo "Test help command:"
bin/magento mageforge:theme:copy-from-vendor --help

echo "Test alias help:"
bin/magento theme:copy --help

echo "Test dry-run without required arguments (expect validation failure but command should execute):"
bin/magento mageforge:theme:copy-from-vendor --dry-run || echo "Expected failure - missing or invalid arguments for copy-from-vendor"

echo "Test alias dry-run without required arguments (expect validation failure but alias should execute):"
bin/magento theme:copy --dry-run || echo "Expected failure - missing or invalid arguments for theme:copy alias"

echo "✓ Copy from vendor command and alias available and basic execution paths exercised"

- name: Test Inspector Functionality
working-directory: magento2
Expand Down Expand Up @@ -496,7 +508,6 @@ jobs:
bin/magento mageforge:theme:build Magento/blank --verbose || echo "Build attempted (may need additional setup)"

echo "Test build aliases:"
bin/magento m:t:b --help
bin/magento frontend:build --help

- name: Test Summary
Expand Down
204 changes: 183 additions & 21 deletions .github/workflows/magento-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ jobs:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

opensearch:
image: opensearchproject/opensearch:2.11.0
ports:
- 9200:9200
elasticsearch:
image: elasticsearch:7.17.25
env:
discovery.type: single-node
plugins.security.disabled: true
OPENSEARCH_JAVA_OPTS: -Xms512m -Xmx512m
options: --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
xpack.security.enabled: false
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
ports:
- 9200:9200
options: --health-cmd="curl -s http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
Comment on lines +35 to +43
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The job/matrix still configures Magento with --search-engine=opensearch and opensearch host/port, but the service container was switched to elasticsearch:7.17.25. This mismatch is very likely to break the workflow. Either keep the OpenSearch service for opensearch runs, or change the matrix/search-engine-name and setup:install flags to match Elasticsearch (and adjust host/port option names accordingly).

Copilot uses AI. Check for mistakes.

steps:
- name: Checkout code
Expand Down Expand Up @@ -136,22 +136,103 @@ jobs:
bin/magento mageforge:theme:inspector --help
bin/magento mageforge:hyva:compatibility:check --help
bin/magento mageforge:hyva:tokens --help
bin/magento mageforge:theme:copy-from-vendor --help

echo "Verify command aliases work:"
bin/magento m:s:v --help
bin/magento m:s:c --help
bin/magento m:t:l --help
bin/magento m:t:b --help
bin/magento m:t:w --help
bin/magento m:t:c --help
bin/magento m:h:c:c --help
bin/magento frontend:list --help
bin/magento frontend:build --help
bin/magento frontend:watch --help
bin/magento frontend:clean --help
bin/magento theme:copy --help
bin/magento hyva:check --help
bin/magento hyva:tokens --help

- name: Test Copy Command Functionality
working-directory: magento2
run: |
echo "Finding available test files..."

# Find a frontend template file from any core module
FRONTEND_FILE=$(find vendor/magento/module-*/view/frontend/templates -type f -name "*.phtml" 2>/dev/null | head -1)
if [ -z "$FRONTEND_FILE" ]; then
echo "No frontend template files found, trying layout files..."
FRONTEND_FILE=$(find vendor/magento/module-*/view/frontend/layout -type f -name "*.xml" 2>/dev/null | head -1)
fi

# Find a base template file
BASE_FILE=$(find vendor/magento/module-*/view/base/templates -type f -name "*.phtml" 2>/dev/null | head -1)
if [ -z "$BASE_FILE" ]; then
echo "No base template files found, trying web files..."
BASE_FILE=$(find vendor/magento/module-*/view/base/web -type f \( -name "*.js" -o -name "*.css" \) 2>/dev/null | head -1)
fi

# Find an etc file for negative test
ETC_FILE=$(find vendor/magento/module-catalog/etc -type f -name "*.xml" 2>/dev/null | head -1)

echo "Test files found:"
echo "Frontend: $FRONTEND_FILE"
echo "Base: $BASE_FILE"
echo "Etc: $ETC_FILE"
echo ""

if [ -n "$FRONTEND_FILE" ]; then
echo "Test 1: Copy frontend file to frontend theme (dry-run):"
bin/magento mageforge:theme:copy-from-vendor \
"$FRONTEND_FILE" \
Magento/luma \
--dry-run
echo "✓ Frontend to frontend mapping works"
echo ""
else
echo "Warning: No frontend file found for testing"
fi

if [ -n "$BASE_FILE" ]; then
echo "Test 2: Copy base file to frontend theme (dry-run):"
bin/magento mageforge:theme:copy-from-vendor \
"$BASE_FILE" \
Magento/blank \
--dry-run
echo "✓ Base to frontend mapping works"
echo ""
else
echo "Warning: No base file found for testing"
fi

if [ -n "$ETC_FILE" ]; then
echo "Test 3: Verify non-view file is rejected:"
if bin/magento mageforge:theme:copy-from-vendor \
"$ETC_FILE" \
Magento/luma \
--dry-run 2>&1 | grep -q "not under a view"; then
echo "✓ Non-view file correctly rejected"
else
echo "✗ Non-view file validation failed"
exit 1
fi
echo ""
else
echo "Warning: No etc file found for negative testing"
fi

if [ -n "$FRONTEND_FILE" ]; then
echo "Test 4: Verify cross-area mapping is rejected (frontend -> adminhtml):"
if bin/magento mageforge:theme:copy-from-vendor \
"$FRONTEND_FILE" \
Magento/backend \
--dry-run 2>&1 | grep -q "Cannot map file from area"; then
echo "✓ Cross-area mapping correctly rejected"
else
echo "✗ Cross-area validation failed"
exit 1
fi
echo ""
else
echo "Warning: No frontend file found for cross-area testing"
fi

echo "✓ All copy command tests passed!"

- name: Test Summary
run: |
echo "MageForge module compatibility test with Magento ${{ matrix.magento-version }} completed"
Expand Down Expand Up @@ -274,22 +355,103 @@ jobs:
bin/magento mageforge:theme:inspector --help
bin/magento mageforge:hyva:compatibility:check --help
bin/magento mageforge:hyva:tokens --help
bin/magento mageforge:theme:copy-from-vendor --help

echo "Verify command aliases work:"
bin/magento m:s:v --help
bin/magento m:s:c --help
bin/magento m:t:l --help
bin/magento m:t:b --help
bin/magento m:t:w --help
bin/magento m:t:c --help
bin/magento m:h:c:c --help
bin/magento frontend:list --help
bin/magento frontend:build --help
bin/magento frontend:watch --help
bin/magento frontend:clean --help
bin/magento theme:copy --help
bin/magento hyva:check --help
bin/magento hyva:tokens --help

- name: Test Copy Command Functionality
working-directory: magento2
run: |
echo "Finding available test files..."

# Find a frontend template file from any core module
FRONTEND_FILE=$(find vendor/magento/module-*/view/frontend/templates -type f -name "*.phtml" 2>/dev/null | head -1)
if [ -z "$FRONTEND_FILE" ]; then
echo "No frontend template files found, trying layout files..."
FRONTEND_FILE=$(find vendor/magento/module-*/view/frontend/layout -type f -name "*.xml" 2>/dev/null | head -1)
fi

# Find a base template file
BASE_FILE=$(find vendor/magento/module-*/view/base/templates -type f -name "*.phtml" 2>/dev/null | head -1)
if [ -z "$BASE_FILE" ]; then
echo "No base template files found, trying web files..."
BASE_FILE=$(find vendor/magento/module-*/view/base/web -type f \( -name "*.js" -o -name "*.css" \) 2>/dev/null | head -1)
fi

# Find an etc file for negative test
ETC_FILE=$(find vendor/magento/module-catalog/etc -type f -name "*.xml" 2>/dev/null | head -1)

echo "Test files found:"
echo "Frontend: $FRONTEND_FILE"
echo "Base: $BASE_FILE"
echo "Etc: $ETC_FILE"
echo ""

if [ -n "$FRONTEND_FILE" ]; then
echo "Test 1: Copy frontend file to frontend theme (dry-run):"
bin/magento mageforge:theme:copy-from-vendor \
"$FRONTEND_FILE" \
Magento/luma \
--dry-run
echo "✓ Frontend to frontend mapping works"
echo ""
else
echo "Warning: No frontend file found for testing"
fi

if [ -n "$BASE_FILE" ]; then
echo "Test 2: Copy base file to frontend theme (dry-run):"
bin/magento mageforge:theme:copy-from-vendor \
"$BASE_FILE" \
Magento/blank \
--dry-run
echo "✓ Base to frontend mapping works"
echo ""
else
echo "Warning: No base file found for testing"
fi

if [ -n "$ETC_FILE" ]; then
echo "Test 3: Verify non-view file is rejected:"
if bin/magento mageforge:theme:copy-from-vendor \
"$ETC_FILE" \
Magento/luma \
--dry-run 2>&1 | grep -q "not under a view"; then
echo "✓ Non-view file correctly rejected"
else
echo "✗ Non-view file validation failed"
exit 1
fi
echo ""
else
echo "Warning: No etc file found for negative testing"
fi

if [ -n "$FRONTEND_FILE" ]; then
echo "Test 4: Verify cross-area mapping is rejected (frontend -> adminhtml):"
if bin/magento mageforge:theme:copy-from-vendor \
"$FRONTEND_FILE" \
Magento/backend \
--dry-run 2>&1 | grep -q "Cannot map file from area"; then
echo "✓ Cross-area mapping correctly rejected"
else
echo "✗ Cross-area validation failed"
exit 1
fi
echo ""
else
echo "Warning: No frontend file found for cross-area testing"
fi

echo "✓ All copy command tests passed!"

- name: Test Summary
run: |
echo "MageForge module compatibility test with Magento 2.4.8 completed"
Loading
Loading