From 0bda39957ceffb61fa61d051270e91c9eb93554f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 29 Jul 2025 17:24:32 +0000 Subject: [PATCH 01/12] Initial plan From 506092fc9ea60d3490029a6aef99792da264219e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 29 Jul 2025 17:35:41 +0000 Subject: [PATCH 02/12] Add GitHub workflow for Copilot coding agent environment setup Co-authored-by: RickWinter <4430337+RickWinter@users.noreply.github.com> --- .github/workflows/copilot-environment.yml | 111 ++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 .github/workflows/copilot-environment.yml diff --git a/.github/workflows/copilot-environment.yml b/.github/workflows/copilot-environment.yml new file mode 100644 index 0000000000..361fc4c432 --- /dev/null +++ b/.github/workflows/copilot-environment.yml @@ -0,0 +1,111 @@ +name: Copilot Environment Setup + +# This workflow sets up the development environment for GitHub Copilot coding agent +# It ensures all necessary tools and dependencies are available for automated coding tasks + +on: + workflow_dispatch: # Allow manual triggering + schedule: + # Run weekly to keep the environment fresh + - cron: '0 2 * * 1' # Monday at 2 AM UTC + push: + branches: [main] + paths: + - 'rust-toolchain.toml' + - 'Cargo.toml' + - '.github/workflows/copilot-environment.yml' + +jobs: + setup-environment: + name: Setup Copilot Coding Agent Environment + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Rust toolchain from rust-toolchain.toml + uses: dtolnay/rust-toolchain@stable + # This action automatically reads rust-toolchain.toml and installs the specified components + + - name: Verify Rust installation + run: | + # Verify installations + rustc --version + cargo --version + rustfmt --version + cargo clippy --version + rust-analyzer --version || echo "rust-analyzer available through rustup" + + - name: Cache Cargo dependencies + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Install additional development tools + run: | + # Install tools commonly needed for Rust development and Azure SDK + cargo install cargo-audit || echo "cargo-audit already installed or failed to install" + cargo install cargo-outdated || echo "cargo-outdated already installed or failed to install" + + # Install system dependencies that might be needed for Azure SDK + sudo apt-get update + sudo apt-get install -y build-essential pkg-config libssl-dev + + - name: Azure SDK specific setup + run: | + # Check that we can work with Azure SDK specific dependencies + echo "Checking OpenSSL version for Azure connections:" + openssl version + + # Verify important system libraries are available + pkg-config --exists openssl || echo "OpenSSL pkg-config not found" + + # Check that we have necessary build tools + which make + which gcc || which clang + + - name: Verify workspace setup + run: | + # Verify the workspace can be built + cargo check --workspace --all-targets + + # Run basic linting + cargo clippy --workspace --all-targets -- -D warnings + + # Check formatting + cargo fmt --all -- --check + + - name: Setup environment variables + run: | + echo "RUST_BACKTRACE=1" >> $GITHUB_ENV + echo "CARGO_TERM_COLOR=always" >> $GITHUB_ENV + echo "RUSTFLAGS=-D warnings" >> $GITHUB_ENV + + - name: Test basic functionality + run: | + # Test that we can run basic cargo commands + cargo --version + cargo tree --workspace | head -20 + + # Verify that tests can be discovered + cargo test --workspace --no-run + + - name: Environment summary + run: | + echo "=== Rust Environment Summary ===" + rustc --version + cargo --version + echo "=== Installed Components ===" + rustup component list --installed + echo "=== Workspace Structure ===" + find . -name "Cargo.toml" | head -10 + echo "=== Environment Ready for Copilot Coding Agent ===" \ No newline at end of file From 26824d519ca1337a8180b023aeb3073b6675a623 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 29 Jul 2025 17:39:51 +0000 Subject: [PATCH 03/12] Enhance workflow documentation and comments for Copilot environment setup Co-authored-by: RickWinter <4430337+RickWinter@users.noreply.github.com> --- .github/workflows/copilot-environment.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/copilot-environment.yml b/.github/workflows/copilot-environment.yml index 361fc4c432..d3d39c9148 100644 --- a/.github/workflows/copilot-environment.yml +++ b/.github/workflows/copilot-environment.yml @@ -2,6 +2,19 @@ name: Copilot Environment Setup # This workflow sets up the development environment for GitHub Copilot coding agent # It ensures all necessary tools and dependencies are available for automated coding tasks +# +# The workflow: +# - Sets up Rust toolchain as specified in rust-toolchain.toml +# - Installs and caches Cargo dependencies +# - Installs additional development tools (cargo-audit, cargo-outdated) +# - Verifies Azure SDK specific system dependencies (OpenSSL, build tools) +# - Runs comprehensive workspace verification (check, clippy, fmt) +# - Tests basic functionality to ensure the environment is ready +# +# Triggers: +# - Manual execution via workflow_dispatch +# - Weekly scheduled runs to keep environment fresh +# - Automatic runs when key configuration files change on: workflow_dispatch: # Allow manual triggering From dd05c695d4e100e9cfed77c4e1be658013545560 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 29 Jul 2025 19:22:08 +0000 Subject: [PATCH 04/12] Fix spelling errors in copilot-environment workflow Co-authored-by: LarryOsterman <8220172+LarryOsterman@users.noreply.github.com> --- .vscode/cspell.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 334529b6dc..9464e2947e 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -45,6 +45,7 @@ "dotenv", "downcasted", "downcasting", + "dtolnay", "entra", "etag", "eventhub", @@ -153,6 +154,12 @@ "rust-custom" ] }, + { + "filename": ".github/workflows/*.yml", + "dictionaries": [ + "rust-custom" + ] + }, { "filename": "sdk/core/azure_core_amqp/**", "dictionaries": [ From b5d21e409d34df7928abbc02175fbbdb3aefceb7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 29 Jul 2025 20:08:42 +0000 Subject: [PATCH 05/12] Refactor workflow to use devcontainer and remove duplicate version output Co-authored-by: heaths <1532486+heaths@users.noreply.github.com> --- .github/workflows/copilot-environment.yml | 71 +++++++++++------------ 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/.github/workflows/copilot-environment.yml b/.github/workflows/copilot-environment.yml index d3d39c9148..22d5022f39 100644 --- a/.github/workflows/copilot-environment.yml +++ b/.github/workflows/copilot-environment.yml @@ -1,16 +1,20 @@ name: Copilot Environment Setup # This workflow sets up the development environment for GitHub Copilot coding agent -# It ensures all necessary tools and dependencies are available for automated coding tasks +# It leverages the existing devcontainer configuration to ensure consistency +# with the development environment and avoid duplication of tooling setup # # The workflow: -# - Sets up Rust toolchain as specified in rust-toolchain.toml -# - Installs and caches Cargo dependencies -# - Installs additional development tools (cargo-audit, cargo-outdated) -# - Verifies Azure SDK specific system dependencies (OpenSSL, build tools) +# - Uses the same base container image as the devcontainer (mcr.microsoft.com/devcontainers/rust) +# - Runs the devcontainer post-create script for environment setup +# - Installs the same development tools specified in the devcontainer +# - Caches Cargo dependencies for improved performance # - Runs comprehensive workspace verification (check, clippy, fmt) # - Tests basic functionality to ensure the environment is ready # +# This approach maintains consistency with the existing devcontainer setup +# and avoids maintaining duplicate tool installation logic +# # Triggers: # - Manual execution via workflow_dispatch # - Weekly scheduled runs to keep environment fresh @@ -26,29 +30,35 @@ on: paths: - 'rust-toolchain.toml' - 'Cargo.toml' + - '.devcontainer/**' - '.github/workflows/copilot-environment.yml' jobs: setup-environment: name: Setup Copilot Coding Agent Environment runs-on: ubuntu-latest + container: + image: mcr.microsoft.com/devcontainers/rust:1-1-bullseye steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Rust toolchain from rust-toolchain.toml - uses: dtolnay/rust-toolchain@stable - # This action automatically reads rust-toolchain.toml and installs the specified components + - name: Setup development environment using devcontainer configuration + run: | + # Run the devcontainer post-create script to set up the environment + # This uses the same setup as the existing devcontainer + chmod +x .devcontainer/oncreate + ./.devcontainer/oncreate - - name: Verify Rust installation + - name: Install additional tools from devcontainer run: | - # Verify installations - rustc --version - cargo --version - rustfmt --version - cargo clippy --version - rust-analyzer --version || echo "rust-analyzer available through rustup" + # Install the same tools as specified in the devcontainer Dockerfile + cargo install cargo-watch http-server + + # Install tools commonly needed for Rust development and Azure SDK + cargo install cargo-audit || echo "cargo-audit already installed or failed to install" + cargo install cargo-outdated || echo "cargo-outdated already installed or failed to install" - name: Cache Cargo dependencies uses: actions/cache@v4 @@ -63,29 +73,6 @@ jobs: restore-keys: | ${{ runner.os }}-cargo- - - name: Install additional development tools - run: | - # Install tools commonly needed for Rust development and Azure SDK - cargo install cargo-audit || echo "cargo-audit already installed or failed to install" - cargo install cargo-outdated || echo "cargo-outdated already installed or failed to install" - - # Install system dependencies that might be needed for Azure SDK - sudo apt-get update - sudo apt-get install -y build-essential pkg-config libssl-dev - - - name: Azure SDK specific setup - run: | - # Check that we can work with Azure SDK specific dependencies - echo "Checking OpenSSL version for Azure connections:" - openssl version - - # Verify important system libraries are available - pkg-config --exists openssl || echo "OpenSSL pkg-config not found" - - # Check that we have necessary build tools - which make - which gcc || which clang - - name: Verify workspace setup run: | # Verify the workspace can be built @@ -119,6 +106,14 @@ jobs: cargo --version echo "=== Installed Components ===" rustup component list --installed + echo "=== Available Tools ===" + which cargo-audit && cargo-audit --version || echo "cargo-audit not available" + which cargo-outdated && cargo-outdated --version || echo "cargo-outdated not available" + which cargo-watch && cargo-watch --version || echo "cargo-watch not available" + which http-server && http-server --version || echo "http-server not available" + echo "=== System Dependencies ===" + openssl version + pkg-config --exists openssl && echo "OpenSSL pkg-config: OK" || echo "OpenSSL pkg-config: NOT FOUND" echo "=== Workspace Structure ===" find . -name "Cargo.toml" | head -10 echo "=== Environment Ready for Copilot Coding Agent ===" \ No newline at end of file From db114c1c760da1d49361b0e07881be20645a709a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 29 Jul 2025 23:32:39 +0000 Subject: [PATCH 06/12] Remove unnecessary dtolnay entry from cspell and fix remaining spelling errors Co-authored-by: heaths <1532486+heaths@users.noreply.github.com> --- .vscode/cspell.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 9464e2947e..dcc50e06b6 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -39,13 +39,13 @@ "cppvsdbg", "datalake", "datetime", + "devcontainers", "devicecode", "docsrs", "doctest", "dotenv", "downcasted", "downcasting", - "dtolnay", "entra", "etag", "eventhub", @@ -60,6 +60,7 @@ "msrv", "newtonsoft", "oidc", + "oncreate", "otel", "opentelemetry", "pageable", From 0655f097ecace86688e46a241b652fa2f6cc5955 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Wed, 13 Aug 2025 19:10:37 +0000 Subject: [PATCH 07/12] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/copilot-environment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/copilot-environment.yml b/.github/workflows/copilot-environment.yml index 22d5022f39..e26720d49a 100644 --- a/.github/workflows/copilot-environment.yml +++ b/.github/workflows/copilot-environment.yml @@ -64,7 +64,6 @@ jobs: uses: actions/cache@v4 with: path: | - ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ From 7b5fd4ce819a4bdfce9f82a2bb61ed8c00ff1c61 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 Aug 2025 22:41:46 +0000 Subject: [PATCH 08/12] Rename workflow file to copilot-setup-steps.yml and fix review comments Co-authored-by: ronniegeraghty <28957151+ronniegeraghty@users.noreply.github.com> --- ...opilot-environment.yml => copilot-setup-steps.yml} | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) rename .github/workflows/{copilot-environment.yml => copilot-setup-steps.yml} (91%) diff --git a/.github/workflows/copilot-environment.yml b/.github/workflows/copilot-setup-steps.yml similarity index 91% rename from .github/workflows/copilot-environment.yml rename to .github/workflows/copilot-setup-steps.yml index e26720d49a..051137fb79 100644 --- a/.github/workflows/copilot-environment.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -31,7 +31,7 @@ on: - 'rust-toolchain.toml' - 'Cargo.toml' - '.devcontainer/**' - - '.github/workflows/copilot-environment.yml' + - '.github/workflows/copilot-setup-steps.yml' jobs: setup-environment: @@ -46,17 +46,14 @@ jobs: - name: Setup development environment using devcontainer configuration run: | - # Run the devcontainer post-create script to set up the environment - # This uses the same setup as the existing devcontainer + # Run the devcontainer post-create script to set up additional toolchains chmod +x .devcontainer/oncreate ./.devcontainer/oncreate - - name: Install additional tools from devcontainer + - name: Install additional tools for Azure SDK development run: | - # Install the same tools as specified in the devcontainer Dockerfile - cargo install cargo-watch http-server - # Install tools commonly needed for Rust development and Azure SDK + # Note: cargo-watch and http-server are already installed in the container cargo install cargo-audit || echo "cargo-audit already installed or failed to install" cargo install cargo-outdated || echo "cargo-outdated already installed or failed to install" From bd9b965aee54521249a9bf9a8f81537f5caaf593 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 Aug 2025 23:00:13 +0000 Subject: [PATCH 09/12] Move GitHub workflow files to ignoredPaths in cspell config Co-authored-by: heaths <1532486+heaths@users.noreply.github.com> --- .vscode/cspell.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index dcc50e06b6..c9ccdfcb5e 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -13,6 +13,7 @@ ".devcontainer/oncreate", ".github/CODEOWNERS", ".github/dependabot.yml", + ".github/workflows/*.yml", ".vscode/cspell.json", ".vscode/extensions.json", ".vscode/settings.json", @@ -155,12 +156,6 @@ "rust-custom" ] }, - { - "filename": ".github/workflows/*.yml", - "dictionaries": [ - "rust-custom" - ] - }, { "filename": "sdk/core/azure_core_amqp/**", "dictionaries": [ From 111d910ae19e65a4e1436d84f5018ab47b34f496 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 Aug 2025 21:06:59 +0000 Subject: [PATCH 10/12] Update workflow name to "Copilot Setup Steps" and add pull_request trigger Co-authored-by: ronniegeraghty <28957151+ronniegeraghty@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 051137fb79..b24a174422 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -1,4 +1,4 @@ -name: Copilot Environment Setup +name: Copilot Setup Steps # This workflow sets up the development environment for GitHub Copilot coding agent # It leverages the existing devcontainer configuration to ensure consistency @@ -32,6 +32,12 @@ on: - 'Cargo.toml' - '.devcontainer/**' - '.github/workflows/copilot-setup-steps.yml' + pull_request: + paths: + - 'rust-toolchain.toml' + - 'Cargo.toml' + - '.devcontainer/**' + - '.github/workflows/copilot-setup-steps.yml' jobs: setup-environment: From b81f597cf7dcb40922a025ed54631f536226851a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 Aug 2025 22:47:13 +0000 Subject: [PATCH 11/12] Update workflow with required job name, permissions, and environment settings Co-authored-by: ronniegeraghty <28957151+ronniegeraghty@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index b24a174422..aac0f06d03 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -39,10 +39,18 @@ on: - '.devcontainer/**' - '.github/workflows/copilot-setup-steps.yml' +permissions: + id-token: write + contents: read + jobs: - setup-environment: + copilot-setup-steps: name: Setup Copilot Coding Agent Environment runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + environment: Copilot container: image: mcr.microsoft.com/devcontainers/rust:1-1-bullseye From 93ea99ca108edcd63c1252a3cdf8e9c52230b092 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 15 Aug 2025 00:53:55 +0000 Subject: [PATCH 12/12] Use heaths/azure-sdk-for-rust:latest container with volume mapping and remove unnecessary setup steps Co-authored-by: heaths <1532486+heaths@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 32 +++++++---------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index aac0f06d03..b10efc5d6a 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -1,19 +1,17 @@ name: Copilot Setup Steps # This workflow sets up the development environment for GitHub Copilot coding agent -# It leverages the existing devcontainer configuration to ensure consistency -# with the development environment and avoid duplication of tooling setup +# It uses a pre-built container image with all the necessary tools already installed # # The workflow: -# - Uses the same base container image as the devcontainer (mcr.microsoft.com/devcontainers/rust) -# - Runs the devcontainer post-create script for environment setup -# - Installs the same development tools specified in the devcontainer +# - Uses the heaths/azure-sdk-for-rust:latest container image with all dependencies +# - Maps the repository into the standard devcontainer workspace location # - Caches Cargo dependencies for improved performance # - Runs comprehensive workspace verification (check, clippy, fmt) # - Tests basic functionality to ensure the environment is ready # -# This approach maintains consistency with the existing devcontainer setup -# and avoids maintaining duplicate tool installation logic +# This approach leverages a pre-built image that contains all the tools from +# the devcontainer configuration, avoiding the need to install tools at runtime # # Triggers: # - Manual execution via workflow_dispatch @@ -52,25 +50,15 @@ jobs: contents: read environment: Copilot container: - image: mcr.microsoft.com/devcontainers/rust:1-1-bullseye + image: heaths/azure-sdk-for-rust:latest + volumes: + - ${{ github.workspace }}:/workspaces/azure-sdk-for-rust + options: --workdir /workspaces/azure-sdk-for-rust steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup development environment using devcontainer configuration - run: | - # Run the devcontainer post-create script to set up additional toolchains - chmod +x .devcontainer/oncreate - ./.devcontainer/oncreate - - - name: Install additional tools for Azure SDK development - run: | - # Install tools commonly needed for Rust development and Azure SDK - # Note: cargo-watch and http-server are already installed in the container - cargo install cargo-audit || echo "cargo-audit already installed or failed to install" - cargo install cargo-outdated || echo "cargo-outdated already installed or failed to install" - - name: Cache Cargo dependencies uses: actions/cache@v4 with: @@ -117,8 +105,6 @@ jobs: echo "=== Installed Components ===" rustup component list --installed echo "=== Available Tools ===" - which cargo-audit && cargo-audit --version || echo "cargo-audit not available" - which cargo-outdated && cargo-outdated --version || echo "cargo-outdated not available" which cargo-watch && cargo-watch --version || echo "cargo-watch not available" which http-server && http-server --version || echo "http-server not available" echo "=== System Dependencies ==="