From cd079b2746a903a683b14abdc5ee8b7cbf66227e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 07:21:19 +0000 Subject: [PATCH 1/5] Initial plan From 5a15b808518683c1ffcdb6146c17f8d1a3ba6cc1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 07:38:58 +0000 Subject: [PATCH 2/5] feat: add Copilot agent environment setup workflow Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 53 +++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/copilot-setup-steps.yml diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 00000000..5ae8cad0 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,53 @@ +name: "Copilot Setup Steps" + +# Automatically run the setup steps when they are changed to allow for easy validation, +# and allow manual testing through the repository's "Actions" tab +on: + workflow_dispatch: + push: + paths: + - .github/workflows/copilot-setup-steps.yml + pull_request: + paths: + - .github/workflows/copilot-setup-steps.yml + +jobs: + # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. + copilot-setup-steps: + runs-on: ubuntu-latest + + # Set the permissions to the lowest permissions possible needed for your steps. + # Copilot will be given its own token for its operations. + permissions: + # We need to clone the repository to build and run the dependency-installer binary + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + + - name: Enable Rust cache + uses: Swatinem/rust-cache@v2 + + - name: Build dependency-installer binary + run: | + cd packages/dependency-installer + cargo build --release --bin dependency-installer + + - name: Install all development dependencies + run: | + # Use the binary we just built to install all dependencies + sudo packages/dependency-installer/target/release/dependency-installer install + env: + # Ensure non-interactive installation + DEBIAN_FRONTEND: noninteractive + + - name: Verify installations + run: | + # Verify all tools are installed correctly + packages/dependency-installer/target/release/dependency-installer check From 270ecbf3d9c8bc8352e82f3c77fc65bfed76f55c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 07:41:25 +0000 Subject: [PATCH 3/5] fix: correct binary path in Copilot setup workflow Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 5ae8cad0..d7f4bf6e 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -36,13 +36,12 @@ jobs: - name: Build dependency-installer binary run: | - cd packages/dependency-installer - cargo build --release --bin dependency-installer + cargo build --release -p torrust-dependency-installer --bin dependency-installer - name: Install all development dependencies run: | # Use the binary we just built to install all dependencies - sudo packages/dependency-installer/target/release/dependency-installer install + sudo target/release/dependency-installer install env: # Ensure non-interactive installation DEBIAN_FRONTEND: noninteractive @@ -50,4 +49,4 @@ jobs: - name: Verify installations run: | # Verify all tools are installed correctly - packages/dependency-installer/target/release/dependency-installer check + target/release/dependency-installer check From fdae8485d200188d1d6a11ebd0920e2532e9344b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 07:46:40 +0000 Subject: [PATCH 4/5] refactor: improve Copilot workflow based on code review Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index d7f4bf6e..32f36001 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -15,6 +15,7 @@ jobs: # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. copilot-setup-steps: runs-on: ubuntu-latest + timeout-minutes: 30 # Set the permissions to the lowest permissions possible needed for your steps. # Copilot will be given its own token for its operations. @@ -28,8 +29,6 @@ jobs: - name: Set up Rust toolchain uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - name: Enable Rust cache uses: Swatinem/rust-cache@v2 From ca533d51193999df88c4f957904e08dee02d4ea6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 08:26:13 +0000 Subject: [PATCH 5/5] fix: remove sudo from dependency installer invocation The installer binary handles sudo internally for dependencies that require it (OpenTofu, Ansible, LXD). Running the entire binary with sudo causes cargo-machete installation to fail because cargo is not in sudo's PATH. cargo-machete is installed via 'cargo install' and doesn't need sudo. Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 32f36001..d2a71cad 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -40,7 +40,8 @@ jobs: - name: Install all development dependencies run: | # Use the binary we just built to install all dependencies - sudo target/release/dependency-installer install + # Note: The binary handles sudo internally for dependencies that need it + target/release/dependency-installer install env: # Ensure non-interactive installation DEBIAN_FRONTEND: noninteractive