diff --git a/lib/fish/deployer.fish b/lib/fish/deployer.fish index f47b2b1..f3a480d 100644 --- a/lib/fish/deployer.fish +++ b/lib/fish/deployer.fish @@ -45,17 +45,10 @@ function deployer-deploy-module fedpunk-config-init end - # Normalize git URLs to module names for consistent config storage - # git@gitlab.com:org/thinkpad-fans.git -> thinkpad-fans - set -l module_name "$module_ref" - if module-ref-is-url "$module_ref" - # Extract repo name from URL (same logic as external-module-get-storage-path) - set module_name (string replace -r '\.git$' '' "$module_ref") - set module_name (string replace -r '^.*[/:]' '' "$module_name") - end - - # Add normalized module name to config - fedpunk-config-add-module "$module_name" + # Add module reference to config (URL for external modules, name for local) + # This ensures param-save-to-config can find the module later + # Previously normalized URLs to names, causing duplicate entries when params were added + fedpunk-config-add-module "$module_ref" # Use existing fedpunk-module deploy (already handles local + git) if fedpunk-module deploy "$module_ref" diff --git a/test/ci/test-external-module-params-no-duplicate.sh b/test/ci/test-external-module-params-no-duplicate.sh index 67ca74f..47de3cc 100755 --- a/test/ci/test-external-module-params-no-duplicate.sh +++ b/test/ci/test-external-module-params-no-duplicate.sh @@ -112,16 +112,14 @@ echo "" # # Test 2: Simulate the bug scenario - deployer-deploy-module with params # -echo "=== Test 2: Simulate deployer-deploy-module bug scenario ===" +echo "=== Test 2: Deploy module with parameters (testing fix) ===" # Initialize config run_fish "fedpunk-config-init" 2>&1 || true -# Simulate the buggy behavior: -# Step 1: deployer-deploy-module adds NORMALIZED NAME (line 58) -NORMALIZED_NAME="test-params-ext-module" -run_fish "fedpunk-config-add-module '$NORMALIZED_NAME'" 2>&1 || true -echo " Step 1: Added normalized name to config: $NORMALIZED_NAME" +# Step 1: deployer-deploy-module adds module URL (FIXED behavior) +run_fish "fedpunk-config-add-module '$TEST_MODULE_URL'" 2>&1 || true +echo " Step 1: Added module URL to config: $TEST_MODULE_URL" # Step 2: param-save-to-config tries to find using URL (not name) # This is what happens when fedpunk-module deploy calls param-prompt-required @@ -131,7 +129,7 @@ param-save-to-config '$TEST_MODULE_URL' 'auth_mode' 'enabled' " 2>&1 || true echo " Step 2: Saved params using URL: $TEST_MODULE_URL" -echo " (This is where the duplicate gets created if bug exists)" +echo " (Should update existing entry, not create duplicate)" echo "" #