From ea5a5661b67fcf0221eb8479b27a072413a015e3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Mar 2026 10:06:13 +0000 Subject: [PATCH 1/3] Fix powershell preview/RC version installation failure - Add -rc. version checks alongside preview checks in routing conditions so RC versions go directly to GitHub install instead of apt/dnf - Update find_preview_version_from_git_tags() to match -rc.X git tags - Fix typo googlegit_cmd_name -> git_cmd_name - Update preview test scripts to match both preview and rc.X patterns Co-authored-by: Kaniska244 <186041440+Kaniska244@users.noreply.github.com> Agent-Logs-Url: https://github.com/devcontainers/features/sessions/03fd0565-a230-4bd9-80f7-92b8ce74a1bb --- src/powershell/install.sh | 23 +++++++++++-------- test/powershell/powershell_preview_version.sh | 2 +- .../powershell_preview_version_almalinux.sh | 2 +- .../powershell_preview_version_debian.sh | 2 +- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/powershell/install.sh b/src/powershell/install.sh index 40308c32e..cabd2cbb4 100755 --- a/src/powershell/install.sh +++ b/src/powershell/install.sh @@ -126,7 +126,7 @@ find_preview_version_from_git_tags() { local requested_version=${!variable_name} local repository_url=$2 - if [ -z "${googlegit_cmd_name}" ]; then + if [ -z "${git_cmd_name}" ]; then if type git > /dev/null 2>&1; then git_cmd_name="git" else @@ -135,22 +135,22 @@ find_preview_version_from_git_tags() { fi fi - # Fetch tags from remote repository + # Fetch tags from remote repository (match both -preview.X and -rc.X tags) local tags - tags=$(git ls-remote --tags "${repository_url}" 2>/dev/null | grep -oP 'refs/tags/v\K[0-9]+\.[0-9]+\.[0-9]+-preview\.[0-9]+' | sort -V) + tags=$(git ls-remote --tags "${repository_url}" 2>/dev/null | grep -oP 'refs/tags/v\K[0-9]+\.[0-9]+\.[0-9]+-(preview|rc)\.[0-9]+' | sort -V) if [ -z "${tags}" ]; then - echo "No preview tags found in repository." + echo "No preview/rc tags found in repository." return 1 fi local version="" if [ "${requested_version}" = "preview" ] || [ "${requested_version}" = "latest" ]; then - # Get the latest preview version + # Get the latest preview/rc version version=$(echo "${tags}" | tail -n 1) elif [[ "${requested_version}" =~ ^[0-9]+\.[0-9]+$ ]]; then - # Partial version provided (e.g., "7.6"), find latest preview matching that major.minor + # Partial version provided (e.g., "7.6"), find latest preview/rc matching that major.minor version=$(echo "${tags}" | grep "^${requested_version}\." | tail -n 1) elif [[ "${requested_version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-preview$ ]]; then # Version like "7.6.0-preview" provided, find latest preview for that version @@ -161,6 +161,11 @@ find_preview_version_from_git_tags() { if echo "${tags}" | grep -q "^${requested_version}$"; then version="${requested_version}" fi + elif [[ "${requested_version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$ ]]; then + # Exact RC version provided, verify it exists + if echo "${tags}" | grep -q "^${requested_version}$"; then + version="${requested_version}" + fi fi if [ -z "${version}" ]; then @@ -382,7 +387,7 @@ install_using_github() { fi pwsh_url="https://github.com/PowerShell/PowerShell" # Check if we need to find a preview version or stable version - if [[ "${POWERSHELL_VERSION}" == *"preview"* ]] || [ "${POWERSHELL_VERSION}" = "preview" ]; then + if [[ "${POWERSHELL_VERSION}" == *"preview"* ]] || [ "${POWERSHELL_VERSION}" = "preview" ] || [[ "${POWERSHELL_VERSION}" == *"-rc."* ]]; then echo "Finding preview version..." find_preview_version_from_git_tags POWERSHELL_VERSION "${pwsh_url}" else @@ -446,9 +451,9 @@ if ! type pwsh >/dev/null 2>&1; then POWERSHELL_ARCHIVE_ARCHITECTURES="${POWERSHELL_ARCHIVE_ARCHITECTURES_ALMALINUX}" fi - if [[ "${POWERSHELL_ARCHIVE_ARCHITECTURES}" = *"${POWERSHELL_ARCHIVE_ARCHITECTURES_UBUNTU}"* ]] && [[ "${POWERSHELL_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]] && [[ "${POWERSHELL_VERSION}" != *"preview"* ]]; then + if [[ "${POWERSHELL_ARCHIVE_ARCHITECTURES}" = *"${POWERSHELL_ARCHIVE_ARCHITECTURES_UBUNTU}"* ]] && [[ "${POWERSHELL_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]] && [[ "${POWERSHELL_VERSION}" != *"preview"* ]] && [[ "${POWERSHELL_VERSION}" != *"-rc."* ]]; then install_using_apt || use_github="true" - elif [[ "${POWERSHELL_ARCHIVE_ARCHITECTURES}" = *"${POWERSHELL_ARCHIVE_ARCHITECTURES_ALMALINUX}"* ]] && [[ "${POWERSHELL_VERSION}" != *"preview"* ]]; then + elif [[ "${POWERSHELL_ARCHIVE_ARCHITECTURES}" = *"${POWERSHELL_ARCHIVE_ARCHITECTURES_ALMALINUX}"* ]] && [[ "${POWERSHELL_VERSION}" != *"preview"* ]] && [[ "${POWERSHELL_VERSION}" != *"-rc."* ]]; then install_using_dnf && install_powershell_dnf || use_github="true" else use_github="true" diff --git a/test/powershell/powershell_preview_version.sh b/test/powershell/powershell_preview_version.sh index 7e49ded9e..91238e794 100755 --- a/test/powershell/powershell_preview_version.sh +++ b/test/powershell/powershell_preview_version.sh @@ -7,7 +7,7 @@ source dev-container-features-test-lib # Test preview version installation check "pwsh is installed" bash -c "command -v pwsh" -check "pwsh version is preview" bash -c "pwsh --version | grep -i 'preview'" +check "pwsh version is preview" bash -c "pwsh --version | grep -iE 'preview|rc\.[0-9]+'" check "pwsh can execute basic command" bash -c "pwsh -Command 'Write-Output Hello'" # Report result diff --git a/test/powershell/powershell_preview_version_almalinux.sh b/test/powershell/powershell_preview_version_almalinux.sh index 3a8128209..806dbf324 100755 --- a/test/powershell/powershell_preview_version_almalinux.sh +++ b/test/powershell/powershell_preview_version_almalinux.sh @@ -7,7 +7,7 @@ source dev-container-features-test-lib # Test preview version installation on AlmaLinux check "pwsh is installed" bash -c "command -v pwsh" -check "pwsh version is preview" bash -c "pwsh --version | grep -i 'preview'" +check "pwsh version is preview" bash -c "pwsh --version | grep -iE 'preview|rc\.[0-9]+'" check "pwsh can execute basic command" bash -c "pwsh -Command 'Write-Output Hello'" # Report result diff --git a/test/powershell/powershell_preview_version_debian.sh b/test/powershell/powershell_preview_version_debian.sh index 316017cf7..1d8ba4e36 100755 --- a/test/powershell/powershell_preview_version_debian.sh +++ b/test/powershell/powershell_preview_version_debian.sh @@ -7,7 +7,7 @@ source dev-container-features-test-lib # Test preview version installation on Debian check "pwsh is installed" bash -c "command -v pwsh" -check "pwsh version is preview" bash -c "pwsh --version | grep -i 'preview'" +check "pwsh version is preview" bash -c "pwsh --version | grep -iE 'preview|rc\.[0-9]+'" check "pwsh can execute basic command" bash -c "pwsh -Command 'Write-Output Hello'" # Report result From 980e9f013c0086ec8a89fb6acb09ebccb6f07d71 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Mar 2026 10:15:19 +0000 Subject: [PATCH 2/3] =?UTF-8?q?Version=20bump:=20powershell=20feature=202.?= =?UTF-8?q?0.1=20=E2=86=92=202.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kaniska244 <186041440+Kaniska244@users.noreply.github.com> Agent-Logs-Url: https://github.com/devcontainers/features/sessions/98f1f7bd-4d93-4641-85d8-287b218c1eb8 --- src/powershell/devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/powershell/devcontainer-feature.json b/src/powershell/devcontainer-feature.json index 3b500608d..009f4c238 100644 --- a/src/powershell/devcontainer-feature.json +++ b/src/powershell/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "powershell", - "version": "2.0.1", + "version": "2.0.2", "name": "PowerShell", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/powershell", "description": "Installs PowerShell along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.", From e9cb169749ba28f28e22b4b9b3ed91fbfa07456c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 15:40:48 +0000 Subject: [PATCH 3/3] Remove ubuntu:focal and debian:11 from arm64 test matrix PowerShell 7.6.0 requires GLIBC_2.33+ which is unavailable on these older platforms. ubuntu:focal is already obsolete and debian:11 reaches EOL in Aug 2026. Agent-Logs-Url: https://github.com/devcontainers/features/sessions/6a803744-ae1d-4c84-8e04-5bb2c0df1523 Co-authored-by: Kaniska244 <186041440+Kaniska244@users.noreply.github.com> --- .github/workflows/test-pr-arm64.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-pr-arm64.yaml b/.github/workflows/test-pr-arm64.yaml index ea745345d..9280f2129 100644 --- a/.github/workflows/test-pr-arm64.yaml +++ b/.github/workflows/test-pr-arm64.yaml @@ -33,9 +33,7 @@ jobs: features: ${{ fromJSON(needs.detect-changes.outputs.features) }} baseImage: [ - "ubuntu:focal", "ubuntu:jammy", - "debian:11", "debian:12", "mcr.microsoft.com/devcontainers/base:ubuntu", "mcr.microsoft.com/devcontainers/base:debian",