From 96e5a7cd20f1b213c2a1b522ff17c2288ec6dde8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Apr 2026 16:26:23 +0000 Subject: [PATCH 1/4] Initial plan From 1e99bf95cb2d14415b8b7b04ef5f1888a12beaf4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Apr 2026 16:29:21 +0000 Subject: [PATCH 2/4] Fix install.sh: restore COMMA_SEP_TARGET_FILES init and fix newline in ALIASES_BLOCK Agent-Logs-Url: https://github.com/microsoft/codespace-features/sessions/d5a37724-4cc0-4c89-878a-02399bf66982 Co-authored-by: markphip <933108+markphip@users.noreply.github.com> --- src/artifacts-helper/install.sh | 4 +++- test/artifacts-helper/test_shim_integration.sh | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/artifacts-helper/install.sh b/src/artifacts-helper/install.sh index 87655ae..3e362da 100755 --- a/src/artifacts-helper/install.sh +++ b/src/artifacts-helper/install.sh @@ -114,6 +114,8 @@ if command -v sudo >/dev/null 2>&1; then fi fi +COMMA_SEP_TARGET_FILES="${TARGETFILES:-"DEFAULT"}" + if [ "${COMMA_SEP_TARGET_FILES}" = "DEFAULT" ]; then if [ "${INSTALL_WITH_SUDO}" = "true" ]; then COMMA_SEP_TARGET_FILES="~/.bashrc,~/.zshrc" @@ -126,7 +128,7 @@ IFS=',' read -r -a TARGET_FILES_ARR <<< "$COMMA_SEP_TARGET_FILES" ALIASES_BLOCK="" for ALIAS in "${ALIASES_ARR[@]}"; do - ALIASES_BLOCK+="$ALIAS() { \"${SHIM_DIRECTORY}/$ALIAS\" \"\$@\"; }\n" + ALIASES_BLOCK+="$ALIAS() { \"${SHIM_DIRECTORY}/$ALIAS\" \"\$@\"; }"$'\n' done for TARGET_FILE in "${TARGET_FILES_ARR[@]}"; do diff --git a/test/artifacts-helper/test_shim_integration.sh b/test/artifacts-helper/test_shim_integration.sh index f09be98..e2493da 100755 --- a/test/artifacts-helper/test_shim_integration.sh +++ b/test/artifacts-helper/test_shim_integration.sh @@ -24,5 +24,17 @@ check "npm shim sources auth-ado.sh" grep -q "source.*auth-ado.sh" /usr/local/sh # Verify the shim directory is in PATH check "shim directory in PATH" bash -c '[[ ":$PATH:" == *":/usr/local/share/codespace-shims:"* ]]' +# Verify that shell function shims are written to rc files (not just shim scripts) +check "npm shell function written to bash.bashrc" grep -q "npm()" /etc/bash.bashrc +check "dotnet shell function written to bash.bashrc" grep -q "dotnet()" /etc/bash.bashrc +check "npm shell function on its own line in bash.bashrc" grep -q "^npm()" /etc/bash.bashrc + +# Verify newlines between shim definitions (each function should be on its own line) +check "each shim function is on its own line" bash -c ' + # Extract lines containing shim function definitions from bash.bashrc + # Each function should be on its own line (not all concatenated together) + grep -c "()" /etc/bash.bashrc | grep -qv "^0$" +' + # Report results reportResults From 9994d9d42f98293e6ba4aa03ac4401ea1e95d0d8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Apr 2026 16:30:11 +0000 Subject: [PATCH 3/4] Improve shim newline test to count line-start function definitions Agent-Logs-Url: https://github.com/microsoft/codespace-features/sessions/d5a37724-4cc0-4c89-878a-02399bf66982 Co-authored-by: markphip <933108+markphip@users.noreply.github.com> --- test/artifacts-helper/test_shim_integration.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/artifacts-helper/test_shim_integration.sh b/test/artifacts-helper/test_shim_integration.sh index e2493da..fff526a 100755 --- a/test/artifacts-helper/test_shim_integration.sh +++ b/test/artifacts-helper/test_shim_integration.sh @@ -31,9 +31,10 @@ check "npm shell function on its own line in bash.bashrc" grep -q "^npm()" /etc/ # Verify newlines between shim definitions (each function should be on its own line) check "each shim function is on its own line" bash -c ' - # Extract lines containing shim function definitions from bash.bashrc - # Each function should be on its own line (not all concatenated together) - grep -c "()" /etc/bash.bashrc | grep -qv "^0$" + # Count function definitions at line starts - with proper newlines each will start at column 0 + # The test_shim_integration scenario enables dotnet, npm, and nuget aliases (3 shims) + COUNT=$(grep -cE "^[a-z][-a-z]*\(\)" /etc/bash.bashrc) + [[ "$COUNT" -ge 3 ]] ' # Report results From aa8500872ba48be5e75902b227a094cd53ce726b Mon Sep 17 00:00:00 2001 From: Mark Phippard Date: Mon, 27 Apr 2026 12:36:58 -0400 Subject: [PATCH 4/4] Update version of Azure Artifacts Credential Helper --- src/artifacts-helper/devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/artifacts-helper/devcontainer-feature.json b/src/artifacts-helper/devcontainer-feature.json index d2e9441..3c8cfea 100644 --- a/src/artifacts-helper/devcontainer-feature.json +++ b/src/artifacts-helper/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "Azure Artifacts Credential Helper", "id": "artifacts-helper", - "version": "3.0.6", + "version": "3.0.7", "description": "Configures Codespace to authenticate with Azure Artifact feeds", "options": { "nugetURIPrefixes": {