-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add command to copy files from vendor to theme (#133) #133
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
base: main
Are you sure you want to change the base?
Changes from all commits
c73062d
c38d3b5
b1a8107
f7e1026
fc622d8
cb1e356
3ac3898
6eb5c46
60c302c
9125d31
e57c1ba
6cb362f
7606204
9d057bd
cee2180
959d9ec
3bd238d
98b88f7
2da462a
dcb88c9
50b4f16
e97c0fc
3885c0e
03911ed
3300938
c6d52ea
b7637e5
0a73a1b
789396b
203d83f
24a38f1
110cc92
d84ec1e
d40b3c5
4c2d843
0d61b55
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 |
|---|---|---|
|
|
@@ -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 | ||
dermatz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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
|
||
|
|
||
| steps: | ||
| - name: Checkout code | ||
|
|
@@ -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" | ||
|
|
@@ -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" | ||
Uh oh!
There was an error while loading. Please reload this page.