From 71e3cd2607e8247bfb83e77b466bde7a7208b4b9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 03:00:02 +0000 Subject: [PATCH 01/14] Initial plan From 0b9a43c93e9361803ad4b1fc823ced0742116a8f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 03:06:02 +0000 Subject: [PATCH 02/14] Replace git reference injection with wheel artifacts in charm test workflows Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/build-wheels.yaml | 38 ++++++++++++++ .github/workflows/charmcraft-pack.yaml | 24 +++------ .github/workflows/db-charm-tests.yaml | 12 ++++- .github/workflows/hello-charm-tests.yaml | 12 ++++- .../workflows/observability-charm-tests.yaml | 16 ++++-- .github/workflows/published-charms-tests.yaml | 49 +++++++++++++------ 6 files changed, 115 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/build-wheels.yaml diff --git a/.github/workflows/build-wheels.yaml b/.github/workflows/build-wheels.yaml new file mode 100644 index 000000000..eb1cb8047 --- /dev/null +++ b/.github/workflows/build-wheels.yaml @@ -0,0 +1,38 @@ +name: Build Operator Wheels + +on: + workflow_call: + outputs: + artifact-name: + description: "Name of the artifact containing the wheels" + value: ${{ jobs.build-wheels.outputs.artifact-name }} + +permissions: {} + +jobs: + build-wheels: + runs-on: ubuntu-latest + outputs: + artifact-name: ${{ steps.artifact-name.outputs.name }} + steps: + - name: Checkout the operator repository + uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Set up uv + uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4 + + - name: Build wheels + run: uv build --all + + - name: Set artifact name + id: artifact-name + run: echo "name=operator-wheels-${{ github.sha }}" >> "$GITHUB_OUTPUT" + + - name: Upload wheels as artifact + uses: actions/upload-artifact@v5 + with: + name: ${{ steps.artifact-name.outputs.name }} + path: dist/*.whl + retention-days: 1 diff --git a/.github/workflows/charmcraft-pack.yaml b/.github/workflows/charmcraft-pack.yaml index 9b013c5a4..567ad959b 100644 --- a/.github/workflows/charmcraft-pack.yaml +++ b/.github/workflows/charmcraft-pack.yaml @@ -20,35 +20,25 @@ jobs: - name: Set up uv uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4 + - name: Build operator wheels + run: uv build --all + - name: Update 'ops' dependency in test charm to latest run: | - if [ -z "$CLONE_SHA" ] - then - ops_source="ops @ git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" - else - # If on a PR, we need to reference the PR branch's repo and commit (not the GITHUB_SHA - # temporary merge commit), because charmcraft pack does a git checkout which - # can't see the temporary merge commit. - ops_source="ops @ git+$CLONE_URL@$CLONE_SHA#egg=ops" - fi cd examples/httpbin-demo - uv add "$ops_source" + ops_wheel="$(realpath ../../dist/ops-*.whl)" + uv add "$ops_wheel" cat pyproject.toml - env: - CLONE_URL: ${{ github.event.pull_request.head.repo.clone_url }} - CLONE_SHA: ${{ github.event.pull_request.head.sha }} - name: Install yq run: sudo snap install yq - - name: Add 'git' as a build package + - name: Remove 'git' from build packages (no longer needed) run: | cd examples/httpbin-demo if yq --exit-status '.parts.charm | has("build-packages")' charmcraft.yaml; then - echo "'parts.charm.build-packages' already exists in charmcraft.yaml" - exit 1 + yq --inplace 'del(.parts.charm.build-packages[] | select(. == "git"))' charmcraft.yaml fi - yq --inplace '.parts.charm.build-packages = ["git"]' charmcraft.yaml cat charmcraft.yaml - name: Set up LXD diff --git a/.github/workflows/db-charm-tests.yaml b/.github/workflows/db-charm-tests.yaml index 0a1f0f395..4880acbb8 100644 --- a/.github/workflows/db-charm-tests.yaml +++ b/.github/workflows/db-charm-tests.yaml @@ -10,8 +10,12 @@ on: permissions: {} jobs: + build-wheels: + uses: ./.github/workflows/build-wheels.yaml + db-charm-tests: runs-on: ubuntu-latest + needs: build-wheels strategy: fail-fast: false matrix: @@ -32,6 +36,12 @@ jobs: persist-credentials: false ref: ${{ matrix.commit }} + - name: Download operator wheels + uses: actions/download-artifact@v5 + with: + name: ${{ needs.build-wheels.outputs.artifact-name }} + path: operator-wheels + - name: Checkout the operator repository uses: actions/checkout@v6 with: @@ -45,7 +55,7 @@ jobs: run: | if [ -e "requirements.txt" ]; then sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt - echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" >> requirements.txt + echo -e "\n$(realpath operator-wheels/ops-*.whl)" >> requirements.txt else sed -i -e "s/^ops[ ><=].*/ops = {path = \"myops\"}/" pyproject.toml poetry lock diff --git a/.github/workflows/hello-charm-tests.yaml b/.github/workflows/hello-charm-tests.yaml index 05f4ff6f9..af5105118 100644 --- a/.github/workflows/hello-charm-tests.yaml +++ b/.github/workflows/hello-charm-tests.yaml @@ -10,8 +10,12 @@ on: permissions: {} jobs: + build-wheels: + uses: ./.github/workflows/build-wheels.yaml + hello-charm-tests: runs-on: ubuntu-latest + needs: build-wheels strategy: matrix: @@ -33,10 +37,16 @@ jobs: persist-credentials: false ref: ${{ matrix.commit }} + - name: Download operator wheels + uses: actions/download-artifact@v5 + with: + name: ${{ needs.build-wheels.outputs.artifact-name }} + path: operator-wheels + - name: Remove 'ops' from charm requirements.txt run: | sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt - TEST_OPS="git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" + TEST_OPS="$(realpath operator-wheels/ops-*.whl)" echo -e "\n${TEST_OPS}" >> requirements.txt - name: Install dependencies diff --git a/.github/workflows/observability-charm-tests.yaml b/.github/workflows/observability-charm-tests.yaml index f149e7007..afdb5ae82 100644 --- a/.github/workflows/observability-charm-tests.yaml +++ b/.github/workflows/observability-charm-tests.yaml @@ -11,8 +11,12 @@ on: permissions: {} jobs: + build-wheels: + uses: ./.github/workflows/build-wheels.yaml + o11y-charm-tests: runs-on: ubuntu-latest + needs: build-wheels strategy: fail-fast: false @@ -32,6 +36,12 @@ jobs: persist-credentials: false ref: ${{ matrix.commit }} + - name: Download operator wheels + uses: actions/download-artifact@v5 + with: + name: ${{ needs.build-wheels.outputs.artifact-name }} + path: operator-wheels + - name: Install dependencies run: pip install tox~=4.2 uv~=0.6 @@ -44,9 +54,9 @@ jobs: uv remove ops --frozen sed -i 's/requires-python = "~=3.8"/requires-python = "~=3.10"/g' pyproject.toml sed -i 's/pythonVersion = "3\.[89]"/pythonVersion = "3.10"/g' pyproject.toml - uv add git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#subdirectory=testing --optional dev --raw-sources --prerelease=if-necessary-or-explicit - uv add git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#subdirectory=tracing --raw-sources --prerelease=if-necessary-or-explicit - uv add git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA --raw-sources --prerelease=if-necessary-or-explicit + uv add operator-wheels/ops-*.whl --optional dev --raw-sources --prerelease=if-necessary-or-explicit + uv add operator-wheels/ops_scenario-*.whl --optional dev --raw-sources --prerelease=if-necessary-or-explicit + uv add operator-wheels/ops_tracing-*.whl --raw-sources --prerelease=if-necessary-or-explicit else echo "Error: no uv.lock file found" exit 1 diff --git a/.github/workflows/published-charms-tests.yaml b/.github/workflows/published-charms-tests.yaml index 7c783f7f4..fe1daba2b 100644 --- a/.github/workflows/published-charms-tests.yaml +++ b/.github/workflows/published-charms-tests.yaml @@ -11,8 +11,12 @@ on: permissions: {} jobs: + build-wheels: + uses: ./.github/workflows/build-wheels.yaml + charm-tests: runs-on: ubuntu-latest + needs: build-wheels strategy: fail-fast: false matrix: @@ -192,6 +196,12 @@ jobs: repository: ${{ matrix.charm-repo }} persist-credentials: false + - name: Download operator wheels + uses: actions/download-artifact@v5 + with: + name: ${{ needs.build-wheels.outputs.artifact-name }} + path: operator-wheels + - name: Install patch dependencies run: pip install poetry~=2.0 uv~=0.6 tox-uv~=1.2 @@ -199,29 +209,31 @@ jobs: working-directory: ${{ matrix.charm-root }} run: | set -xueo pipefail + ops_wheel="$(realpath ../operator-wheels/ops-*.whl)" + ops_scenario_wheel="$(realpath ../operator-wheels/ops_scenario-*.whl)" if [ -e "test-requirements.txt" ]; then sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" test-requirements.txt - echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" >> test-requirements.txt + echo -e "\n${ops_wheel}" >> test-requirements.txt sed -i -e "/^ops-scenario[ ><=]/d" -e "/^ops\[testing\][ ><=]/d" test-requirements.txt - echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops-scenario&subdirectory=testing" >> test-requirements.txt + echo -e "\n${ops_scenario_wheel}" >> test-requirements.txt fi if [ -e "requirements-charmcraft.txt" ]; then sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements-charmcraft.txt - echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" >> requirements-charmcraft.txt + echo -e "\n${ops_wheel}" >> requirements-charmcraft.txt sed -i -e "/^ops-scenario[ ><=]/d" -e "/^ops\[testing\][ ><=]/d" requirements-charmcraft.txt - echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops-scenario&subdirectory=testing" >> requirements-charmcraft.txt + echo -e "\n${ops_scenario_wheel}" >> requirements-charmcraft.txt fi if [ -e "requirements.txt" ]; then sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt - echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" >> requirements.txt + echo -e "\n${ops_wheel}" >> requirements.txt sed -i -e "/^ops-scenario[ ><=]/d" -e "/^ops\[testing\][ ><=]/d" requirements.txt - echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops-scenario&subdirectory=testing" >> requirements.txt + echo -e "\n${ops_scenario_wheel}" >> requirements.txt elif [ -e "poetry.lock" ]; then - poetry add git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA --lock - poetry add git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#subdirectory=testing --lock + poetry add "${ops_wheel}" --lock + poetry add "${ops_scenario_wheel}" --lock elif [ -e "uv.lock" ]; then - uv add --frozen --raw-sources git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#subdirectory=testing - uv add --frozen --raw-sources git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA + uv add --frozen --raw-sources "${ops_scenario_wheel}" + uv add --frozen --raw-sources "${ops_wheel}" uv lock else echo "Error: No requirements.txt or poetry.lock or uv.lock file found" @@ -259,6 +271,7 @@ jobs: charmcraft-profile-tests: runs-on: ubuntu-latest + needs: build-wheels strategy: fail-fast: false matrix: @@ -274,22 +287,30 @@ jobs: - name: Charmcraft init run: charmcraft init --profile=${{ matrix.profile }} --author=charm-tech + - name: Download operator wheels + uses: actions/download-artifact@v5 + with: + name: ${{ needs.build-wheels.outputs.artifact-name }} + path: operator-wheels + - name: Install dependencies run: pip install tox~=4.2 uv~=0.9 tox-uv~=1.29 - name: Update 'ops' and 'ops-scenario' dependencies in test charm to latest run: | set -xueo pipefail + ops_wheel="$(realpath operator-wheels/ops-*.whl)" + ops_scenario_wheel="$(realpath operator-wheels/ops_scenario-*.whl)" if [ -e "requirements.txt" ]; then sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt sed -i -e "/^ops-scenario[ ><=]/d" -e "/^ops\[testing\][ ><=]/d" requirements.txt - echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" >> requirements.txt - echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops-scenario&subdirectory=testing" >> requirements.txt + echo -e "\n${ops_wheel}" >> requirements.txt + echo -e "\n${ops_scenario_wheel}" >> requirements.txt elif [ -e "uv.lock" ]; then uv remove ops[testing] --group unit --frozen uv remove ops --frozen - uv add git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#subdirectory=testing --group unit --raw-sources --prerelease=if-necessary-or-explicit - uv add git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA --raw-sources --prerelease=if-necessary-or-explicit + uv add "${ops_scenario_wheel}" --group unit --raw-sources --prerelease=if-necessary-or-explicit + uv add "${ops_wheel}" --raw-sources --prerelease=if-necessary-or-explicit else echo "Error: no uv.lock file found" exit 1 From 2738a52fc1c8bc90b84fc53d276e086b19d1ea3f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 03:09:06 +0000 Subject: [PATCH 03/14] Fix wheel path resolution in workflows using echo command expansion Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/charmcraft-pack.yaml | 2 +- .github/workflows/db-charm-tests.yaml | 3 ++- .github/workflows/hello-charm-tests.yaml | 2 +- .github/workflows/observability-charm-tests.yaml | 7 ++++--- .github/workflows/published-charms-tests.yaml | 14 ++++++++------ 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/charmcraft-pack.yaml b/.github/workflows/charmcraft-pack.yaml index 567ad959b..33bf54e35 100644 --- a/.github/workflows/charmcraft-pack.yaml +++ b/.github/workflows/charmcraft-pack.yaml @@ -26,7 +26,7 @@ jobs: - name: Update 'ops' dependency in test charm to latest run: | cd examples/httpbin-demo - ops_wheel="$(realpath ../../dist/ops-*.whl)" + ops_wheel="$(echo "$(pwd)/../../dist/ops-*.whl")" uv add "$ops_wheel" cat pyproject.toml diff --git a/.github/workflows/db-charm-tests.yaml b/.github/workflows/db-charm-tests.yaml index 4880acbb8..deef7c695 100644 --- a/.github/workflows/db-charm-tests.yaml +++ b/.github/workflows/db-charm-tests.yaml @@ -53,9 +53,10 @@ jobs: - name: Update 'ops' dependency in test charm to latest run: | + ops_wheel="$(echo "$(pwd)/operator-wheels/ops-*.whl")" if [ -e "requirements.txt" ]; then sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt - echo -e "\n$(realpath operator-wheels/ops-*.whl)" >> requirements.txt + echo -e "\n${ops_wheel}" >> requirements.txt else sed -i -e "s/^ops[ ><=].*/ops = {path = \"myops\"}/" pyproject.toml poetry lock diff --git a/.github/workflows/hello-charm-tests.yaml b/.github/workflows/hello-charm-tests.yaml index af5105118..9940a08e0 100644 --- a/.github/workflows/hello-charm-tests.yaml +++ b/.github/workflows/hello-charm-tests.yaml @@ -46,7 +46,7 @@ jobs: - name: Remove 'ops' from charm requirements.txt run: | sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt - TEST_OPS="$(realpath operator-wheels/ops-*.whl)" + TEST_OPS="$(echo "$(pwd)/operator-wheels/ops-*.whl")" echo -e "\n${TEST_OPS}" >> requirements.txt - name: Install dependencies diff --git a/.github/workflows/observability-charm-tests.yaml b/.github/workflows/observability-charm-tests.yaml index afdb5ae82..070de5d7e 100644 --- a/.github/workflows/observability-charm-tests.yaml +++ b/.github/workflows/observability-charm-tests.yaml @@ -54,9 +54,10 @@ jobs: uv remove ops --frozen sed -i 's/requires-python = "~=3.8"/requires-python = "~=3.10"/g' pyproject.toml sed -i 's/pythonVersion = "3\.[89]"/pythonVersion = "3.10"/g' pyproject.toml - uv add operator-wheels/ops-*.whl --optional dev --raw-sources --prerelease=if-necessary-or-explicit - uv add operator-wheels/ops_scenario-*.whl --optional dev --raw-sources --prerelease=if-necessary-or-explicit - uv add operator-wheels/ops_tracing-*.whl --raw-sources --prerelease=if-necessary-or-explicit + # Add ops first, then ops-scenario (for testing), then ops-tracing + uv add "$(echo operator-wheels/ops-*.whl)" --raw-sources --prerelease=if-necessary-or-explicit + uv add "$(echo operator-wheels/ops_scenario-*.whl)" --optional dev --raw-sources --prerelease=if-necessary-or-explicit + uv add "$(echo operator-wheels/ops_tracing-*.whl)" --raw-sources --prerelease=if-necessary-or-explicit else echo "Error: no uv.lock file found" exit 1 diff --git a/.github/workflows/published-charms-tests.yaml b/.github/workflows/published-charms-tests.yaml index fe1daba2b..20eec3b1e 100644 --- a/.github/workflows/published-charms-tests.yaml +++ b/.github/workflows/published-charms-tests.yaml @@ -209,8 +209,9 @@ jobs: working-directory: ${{ matrix.charm-root }} run: | set -xueo pipefail - ops_wheel="$(realpath ../operator-wheels/ops-*.whl)" - ops_scenario_wheel="$(realpath ../operator-wheels/ops_scenario-*.whl)" + # Get the absolute paths to the wheels + ops_wheel="$(cd .. && echo "$(pwd)/operator-wheels/ops-*.whl")" + ops_scenario_wheel="$(cd .. && echo "$(pwd)/operator-wheels/ops_scenario-*.whl")" if [ -e "test-requirements.txt" ]; then sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" test-requirements.txt echo -e "\n${ops_wheel}" >> test-requirements.txt @@ -232,8 +233,8 @@ jobs: poetry add "${ops_wheel}" --lock poetry add "${ops_scenario_wheel}" --lock elif [ -e "uv.lock" ]; then - uv add --frozen --raw-sources "${ops_scenario_wheel}" uv add --frozen --raw-sources "${ops_wheel}" + uv add --frozen --raw-sources "${ops_scenario_wheel}" uv lock else echo "Error: No requirements.txt or poetry.lock or uv.lock file found" @@ -299,8 +300,9 @@ jobs: - name: Update 'ops' and 'ops-scenario' dependencies in test charm to latest run: | set -xueo pipefail - ops_wheel="$(realpath operator-wheels/ops-*.whl)" - ops_scenario_wheel="$(realpath operator-wheels/ops_scenario-*.whl)" + # Get the absolute paths to the wheels + ops_wheel="$(echo "$(pwd)/operator-wheels/ops-*.whl")" + ops_scenario_wheel="$(echo "$(pwd)/operator-wheels/ops_scenario-*.whl")" if [ -e "requirements.txt" ]; then sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt sed -i -e "/^ops-scenario[ ><=]/d" -e "/^ops\[testing\][ ><=]/d" requirements.txt @@ -309,8 +311,8 @@ jobs: elif [ -e "uv.lock" ]; then uv remove ops[testing] --group unit --frozen uv remove ops --frozen - uv add "${ops_scenario_wheel}" --group unit --raw-sources --prerelease=if-necessary-or-explicit uv add "${ops_wheel}" --raw-sources --prerelease=if-necessary-or-explicit + uv add "${ops_scenario_wheel}" --group unit --raw-sources --prerelease=if-necessary-or-explicit else echo "Error: no uv.lock file found" exit 1 From 205a864af0cde8d58d0f1c0cd4d36132828b2065 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 03:10:44 +0000 Subject: [PATCH 04/14] Make path resolution consistent across all workflows Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/observability-charm-tests.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/observability-charm-tests.yaml b/.github/workflows/observability-charm-tests.yaml index 070de5d7e..ff79dde3d 100644 --- a/.github/workflows/observability-charm-tests.yaml +++ b/.github/workflows/observability-charm-tests.yaml @@ -54,10 +54,14 @@ jobs: uv remove ops --frozen sed -i 's/requires-python = "~=3.8"/requires-python = "~=3.10"/g' pyproject.toml sed -i 's/pythonVersion = "3\.[89]"/pythonVersion = "3.10"/g' pyproject.toml + # Get absolute paths to the wheels + ops_wheel="$(echo "$(pwd)/operator-wheels/ops-*.whl")" + ops_scenario_wheel="$(echo "$(pwd)/operator-wheels/ops_scenario-*.whl")" + ops_tracing_wheel="$(echo "$(pwd)/operator-wheels/ops_tracing-*.whl")" # Add ops first, then ops-scenario (for testing), then ops-tracing - uv add "$(echo operator-wheels/ops-*.whl)" --raw-sources --prerelease=if-necessary-or-explicit - uv add "$(echo operator-wheels/ops_scenario-*.whl)" --optional dev --raw-sources --prerelease=if-necessary-or-explicit - uv add "$(echo operator-wheels/ops_tracing-*.whl)" --raw-sources --prerelease=if-necessary-or-explicit + uv add "${ops_wheel}" --raw-sources --prerelease=if-necessary-or-explicit + uv add "${ops_scenario_wheel}" --optional dev --raw-sources --prerelease=if-necessary-or-explicit + uv add "${ops_tracing_wheel}" --raw-sources --prerelease=if-necessary-or-explicit else echo "Error: no uv.lock file found" exit 1 From d012d43918a03b2c92696de7c4e41266b2d72724 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 05:31:16 +0000 Subject: [PATCH 05/14] Revert charmcraft-pack.yaml changes - pack runs in sandboxed environment Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/charmcraft-pack.yaml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/charmcraft-pack.yaml b/.github/workflows/charmcraft-pack.yaml index 33bf54e35..9b013c5a4 100644 --- a/.github/workflows/charmcraft-pack.yaml +++ b/.github/workflows/charmcraft-pack.yaml @@ -20,25 +20,35 @@ jobs: - name: Set up uv uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4 - - name: Build operator wheels - run: uv build --all - - name: Update 'ops' dependency in test charm to latest run: | + if [ -z "$CLONE_SHA" ] + then + ops_source="ops @ git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" + else + # If on a PR, we need to reference the PR branch's repo and commit (not the GITHUB_SHA + # temporary merge commit), because charmcraft pack does a git checkout which + # can't see the temporary merge commit. + ops_source="ops @ git+$CLONE_URL@$CLONE_SHA#egg=ops" + fi cd examples/httpbin-demo - ops_wheel="$(echo "$(pwd)/../../dist/ops-*.whl")" - uv add "$ops_wheel" + uv add "$ops_source" cat pyproject.toml + env: + CLONE_URL: ${{ github.event.pull_request.head.repo.clone_url }} + CLONE_SHA: ${{ github.event.pull_request.head.sha }} - name: Install yq run: sudo snap install yq - - name: Remove 'git' from build packages (no longer needed) + - name: Add 'git' as a build package run: | cd examples/httpbin-demo if yq --exit-status '.parts.charm | has("build-packages")' charmcraft.yaml; then - yq --inplace 'del(.parts.charm.build-packages[] | select(. == "git"))' charmcraft.yaml + echo "'parts.charm.build-packages' already exists in charmcraft.yaml" + exit 1 fi + yq --inplace '.parts.charm.build-packages = ["git"]' charmcraft.yaml cat charmcraft.yaml - name: Set up LXD From 9d95fe4062ebbfffbef5a3f55c52ec33ee37bb4d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 05:39:02 +0000 Subject: [PATCH 06/14] Rename build-wheels.yaml to _build-wheels.yaml to indicate it's internal Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/{build-wheels.yaml => _build-wheels.yaml} | 0 .github/workflows/db-charm-tests.yaml | 2 +- .github/workflows/hello-charm-tests.yaml | 2 +- .github/workflows/observability-charm-tests.yaml | 2 +- .github/workflows/published-charms-tests.yaml | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{build-wheels.yaml => _build-wheels.yaml} (100%) diff --git a/.github/workflows/build-wheels.yaml b/.github/workflows/_build-wheels.yaml similarity index 100% rename from .github/workflows/build-wheels.yaml rename to .github/workflows/_build-wheels.yaml diff --git a/.github/workflows/db-charm-tests.yaml b/.github/workflows/db-charm-tests.yaml index deef7c695..05096912e 100644 --- a/.github/workflows/db-charm-tests.yaml +++ b/.github/workflows/db-charm-tests.yaml @@ -11,7 +11,7 @@ permissions: {} jobs: build-wheels: - uses: ./.github/workflows/build-wheels.yaml + uses: ./.github/workflows/_build-wheels.yaml db-charm-tests: runs-on: ubuntu-latest diff --git a/.github/workflows/hello-charm-tests.yaml b/.github/workflows/hello-charm-tests.yaml index 9940a08e0..e67d008cf 100644 --- a/.github/workflows/hello-charm-tests.yaml +++ b/.github/workflows/hello-charm-tests.yaml @@ -11,7 +11,7 @@ permissions: {} jobs: build-wheels: - uses: ./.github/workflows/build-wheels.yaml + uses: ./.github/workflows/_build-wheels.yaml hello-charm-tests: runs-on: ubuntu-latest diff --git a/.github/workflows/observability-charm-tests.yaml b/.github/workflows/observability-charm-tests.yaml index ff79dde3d..e6722ee6e 100644 --- a/.github/workflows/observability-charm-tests.yaml +++ b/.github/workflows/observability-charm-tests.yaml @@ -12,7 +12,7 @@ permissions: {} jobs: build-wheels: - uses: ./.github/workflows/build-wheels.yaml + uses: ./.github/workflows/_build-wheels.yaml o11y-charm-tests: runs-on: ubuntu-latest diff --git a/.github/workflows/published-charms-tests.yaml b/.github/workflows/published-charms-tests.yaml index 20eec3b1e..94e94267f 100644 --- a/.github/workflows/published-charms-tests.yaml +++ b/.github/workflows/published-charms-tests.yaml @@ -12,7 +12,7 @@ permissions: {} jobs: build-wheels: - uses: ./.github/workflows/build-wheels.yaml + uses: ./.github/workflows/_build-wheels.yaml charm-tests: runs-on: ubuntu-latest From 6d4a6876344d6f63c20aed192966f5562c19694c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 02:36:29 +0000 Subject: [PATCH 07/14] Use more explicit pattern to match only ops wheel in hello-charm-tests Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/hello-charm-tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hello-charm-tests.yaml b/.github/workflows/hello-charm-tests.yaml index e67d008cf..39b7ebfd3 100644 --- a/.github/workflows/hello-charm-tests.yaml +++ b/.github/workflows/hello-charm-tests.yaml @@ -46,7 +46,8 @@ jobs: - name: Remove 'ops' from charm requirements.txt run: | sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt - TEST_OPS="$(echo "$(pwd)/operator-wheels/ops-*.whl")" + # Find the ops wheel (not ops_scenario or ops_tracing) + TEST_OPS="$(ls operator-wheels/ops-[0-9]*.whl)" echo -e "\n${TEST_OPS}" >> requirements.txt - name: Install dependencies From d184690333b0467512d6fca2fb25b4c3121c6441 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 02:42:30 +0000 Subject: [PATCH 08/14] Fix wheel glob expansion - use ls instead of echo to expand patterns Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/db-charm-tests.yaml | 2 +- .github/workflows/observability-charm-tests.yaml | 6 +++--- .github/workflows/published-charms-tests.yaml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/db-charm-tests.yaml b/.github/workflows/db-charm-tests.yaml index 05096912e..c3c970a33 100644 --- a/.github/workflows/db-charm-tests.yaml +++ b/.github/workflows/db-charm-tests.yaml @@ -53,7 +53,7 @@ jobs: - name: Update 'ops' dependency in test charm to latest run: | - ops_wheel="$(echo "$(pwd)/operator-wheels/ops-*.whl")" + ops_wheel="$(ls operator-wheels/ops-[0-9]*.whl)" if [ -e "requirements.txt" ]; then sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt echo -e "\n${ops_wheel}" >> requirements.txt diff --git a/.github/workflows/observability-charm-tests.yaml b/.github/workflows/observability-charm-tests.yaml index e6722ee6e..bff9aa73a 100644 --- a/.github/workflows/observability-charm-tests.yaml +++ b/.github/workflows/observability-charm-tests.yaml @@ -55,9 +55,9 @@ jobs: sed -i 's/requires-python = "~=3.8"/requires-python = "~=3.10"/g' pyproject.toml sed -i 's/pythonVersion = "3\.[89]"/pythonVersion = "3.10"/g' pyproject.toml # Get absolute paths to the wheels - ops_wheel="$(echo "$(pwd)/operator-wheels/ops-*.whl")" - ops_scenario_wheel="$(echo "$(pwd)/operator-wheels/ops_scenario-*.whl")" - ops_tracing_wheel="$(echo "$(pwd)/operator-wheels/ops_tracing-*.whl")" + ops_wheel="$(ls operator-wheels/ops-[0-9]*.whl)" + ops_scenario_wheel="$(ls operator-wheels/ops_scenario-*.whl)" + ops_tracing_wheel="$(ls operator-wheels/ops_tracing-*.whl)" # Add ops first, then ops-scenario (for testing), then ops-tracing uv add "${ops_wheel}" --raw-sources --prerelease=if-necessary-or-explicit uv add "${ops_scenario_wheel}" --optional dev --raw-sources --prerelease=if-necessary-or-explicit diff --git a/.github/workflows/published-charms-tests.yaml b/.github/workflows/published-charms-tests.yaml index 94e94267f..69ceb0ad0 100644 --- a/.github/workflows/published-charms-tests.yaml +++ b/.github/workflows/published-charms-tests.yaml @@ -210,8 +210,8 @@ jobs: run: | set -xueo pipefail # Get the absolute paths to the wheels - ops_wheel="$(cd .. && echo "$(pwd)/operator-wheels/ops-*.whl")" - ops_scenario_wheel="$(cd .. && echo "$(pwd)/operator-wheels/ops_scenario-*.whl")" + ops_wheel="$(cd .. && ls "$(pwd)/operator-wheels/ops-[0-9]"*.whl)" + ops_scenario_wheel="$(cd .. && ls "$(pwd)/operator-wheels/ops_scenario-"*.whl)" if [ -e "test-requirements.txt" ]; then sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" test-requirements.txt echo -e "\n${ops_wheel}" >> test-requirements.txt @@ -301,8 +301,8 @@ jobs: run: | set -xueo pipefail # Get the absolute paths to the wheels - ops_wheel="$(echo "$(pwd)/operator-wheels/ops-*.whl")" - ops_scenario_wheel="$(echo "$(pwd)/operator-wheels/ops_scenario-*.whl")" + ops_wheel="$(ls operator-wheels/ops-[0-9]*.whl)" + ops_scenario_wheel="$(ls operator-wheels/ops_scenario-*.whl)" if [ -e "requirements.txt" ]; then sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt sed -i -e "/^ops-scenario[ ><=]/d" -e "/^ops\[testing\][ ><=]/d" requirements.txt From e4d195bdfb39f08f031e6bea0f43af3594fc626c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 02:44:14 +0000 Subject: [PATCH 09/14] Fix quote placement in glob patterns for published-charms-tests Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/published-charms-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/published-charms-tests.yaml b/.github/workflows/published-charms-tests.yaml index 69ceb0ad0..d22c12e2b 100644 --- a/.github/workflows/published-charms-tests.yaml +++ b/.github/workflows/published-charms-tests.yaml @@ -210,8 +210,8 @@ jobs: run: | set -xueo pipefail # Get the absolute paths to the wheels - ops_wheel="$(cd .. && ls "$(pwd)/operator-wheels/ops-[0-9]"*.whl)" - ops_scenario_wheel="$(cd .. && ls "$(pwd)/operator-wheels/ops_scenario-"*.whl)" + ops_wheel="$(cd .. && ls $(pwd)/operator-wheels/ops-[0-9]*.whl)" + ops_scenario_wheel="$(cd .. && ls $(pwd)/operator-wheels/ops_scenario-*.whl)" if [ -e "test-requirements.txt" ]; then sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" test-requirements.txt echo -e "\n${ops_wheel}" >> test-requirements.txt From 5347bffaab34ff7ea72f4a69c15e56e43481d67b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 03:02:30 +0000 Subject: [PATCH 10/14] feat: add debugging steps to show installed package versions in charm test workflows Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/db-charm-tests.yaml | 10 ++++++++++ .github/workflows/hello-charm-tests.yaml | 13 +++++++++++++ .github/workflows/observability-charm-tests.yaml | 12 ++++++++++++ .github/workflows/published-charms-tests.yaml | 12 ++++++++++++ 4 files changed, 47 insertions(+) diff --git a/.github/workflows/db-charm-tests.yaml b/.github/workflows/db-charm-tests.yaml index c3c970a33..b02996613 100644 --- a/.github/workflows/db-charm-tests.yaml +++ b/.github/workflows/db-charm-tests.yaml @@ -62,6 +62,16 @@ jobs: poetry lock fi + - name: Show installed ops package versions + run: | + echo "=== Wheel files downloaded ===" + ls -lh operator-wheels/*.whl || echo "No wheel files found" + echo "" + echo "=== Updated requirements.txt ===" + cat requirements.txt | tail -n 10 || echo "No requirements.txt" + echo "" + echo "=== Installed ops package version (after tox install) will be checked during test run ===" + - name: Install dependencies run: pip install tox~=4.2 diff --git a/.github/workflows/hello-charm-tests.yaml b/.github/workflows/hello-charm-tests.yaml index 39b7ebfd3..8898a3cb0 100644 --- a/.github/workflows/hello-charm-tests.yaml +++ b/.github/workflows/hello-charm-tests.yaml @@ -50,9 +50,22 @@ jobs: TEST_OPS="$(ls operator-wheels/ops-[0-9]*.whl)" echo -e "\n${TEST_OPS}" >> requirements.txt + - name: Show installed ops package versions + run: | + echo "=== Wheel files downloaded ===" + ls -lh operator-wheels/*.whl || echo "No wheel files found" + echo "" + echo "=== Updated requirements.txt ===" + cat requirements.txt | tail -n 10 || echo "No requirements.txt" + - name: Install dependencies run: pip install -r requirements-dev.txt + - name: Show installed package versions after install + run: | + echo "=== Installed ops package version ===" + pip list | grep -E "(ops|scenario|tracing)" || echo "No ops packages found" + - name: Run the charm tests run: | export PYTHONPATH="lib:src:$PYTHONPATH" diff --git a/.github/workflows/observability-charm-tests.yaml b/.github/workflows/observability-charm-tests.yaml index bff9aa73a..0b68bcd6c 100644 --- a/.github/workflows/observability-charm-tests.yaml +++ b/.github/workflows/observability-charm-tests.yaml @@ -67,6 +67,18 @@ jobs: exit 1 fi + - name: Show installed ops package versions + if: ${{ !(matrix.disabled) }} + run: | + echo "=== Installed ops-related packages ===" + uv pip list | grep -E "(ops|scenario|tracing)" || echo "No ops packages found" + echo "" + echo "=== Wheel files downloaded ===" + ls -lh operator-wheels/*.whl || echo "No wheel files found" + echo "" + echo "=== Package versions from pyproject.toml ===" + grep -A 5 "dependencies =" pyproject.toml || echo "No dependencies section found" + - name: Run the charm's unit tests if: ${{ !(matrix.disabled) }} run: tox -vve unit diff --git a/.github/workflows/published-charms-tests.yaml b/.github/workflows/published-charms-tests.yaml index d22c12e2b..42ebc0816 100644 --- a/.github/workflows/published-charms-tests.yaml +++ b/.github/workflows/published-charms-tests.yaml @@ -241,6 +241,18 @@ jobs: exit 1 fi + - name: Show installed ops package versions + working-directory: ${{ matrix.charm-root }} + run: | + echo "=== Wheel files downloaded ===" + ls -lh ../operator-wheels/*.whl || echo "No wheel files found" + echo "" + echo "=== Updated requirements files ===" + [ -f requirements.txt ] && (echo "requirements.txt:" && tail -n 10 requirements.txt) || echo "No requirements.txt" + [ -f test-requirements.txt ] && (echo "test-requirements.txt:" && tail -n 10 test-requirements.txt) || echo "No test-requirements.txt" + echo "" + echo "=== Installed ops package version (after tox install) will be checked during test run ===" + - name: Install dependencies id: deps run: pip install tox~=4.2 From 08749c20bc02852a1d14905537e0e746132cc143 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 03:14:01 +0000 Subject: [PATCH 11/14] feat: show all installed dependencies in test environments to identify conflicts Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/db-charm-tests.yaml | 6 ++++++ .github/workflows/hello-charm-tests.yaml | 3 +++ .github/workflows/observability-charm-tests.yaml | 6 ++++++ .github/workflows/published-charms-tests.yaml | 7 +++++++ 4 files changed, 22 insertions(+) diff --git a/.github/workflows/db-charm-tests.yaml b/.github/workflows/db-charm-tests.yaml index b02996613..86cc323db 100644 --- a/.github/workflows/db-charm-tests.yaml +++ b/.github/workflows/db-charm-tests.yaml @@ -77,3 +77,9 @@ jobs: - name: Run the charm's unit tests run: tox -vve unit + + - name: Show all installed dependencies in test environment + if: ${{ !cancelled() }} + run: | + echo "=== All installed packages in tox unit environment ===" + .tox/unit/bin/pip list || echo "Could not list packages from tox environment" diff --git a/.github/workflows/hello-charm-tests.yaml b/.github/workflows/hello-charm-tests.yaml index 8898a3cb0..bf6fc8e65 100644 --- a/.github/workflows/hello-charm-tests.yaml +++ b/.github/workflows/hello-charm-tests.yaml @@ -65,6 +65,9 @@ jobs: run: | echo "=== Installed ops package version ===" pip list | grep -E "(ops|scenario|tracing)" || echo "No ops packages found" + echo "" + echo "=== All installed packages ===" + pip list - name: Run the charm tests run: | diff --git a/.github/workflows/observability-charm-tests.yaml b/.github/workflows/observability-charm-tests.yaml index 0b68bcd6c..c0eb44327 100644 --- a/.github/workflows/observability-charm-tests.yaml +++ b/.github/workflows/observability-charm-tests.yaml @@ -83,6 +83,12 @@ jobs: if: ${{ !(matrix.disabled) }} run: tox -vve unit + - name: Show all installed dependencies in test environment + if: ${{ !(matrix.disabled) && !cancelled() }} + run: | + echo "=== All installed packages in tox unit environment ===" + .tox/unit/bin/pip list || echo "Could not list packages from tox environment" + - name: Check if 'scenario' tox environment exists id: check-tox-env-scenario run: | diff --git a/.github/workflows/published-charms-tests.yaml b/.github/workflows/published-charms-tests.yaml index 42ebc0816..d446d7e95 100644 --- a/.github/workflows/published-charms-tests.yaml +++ b/.github/workflows/published-charms-tests.yaml @@ -264,6 +264,13 @@ jobs: working-directory: ${{ matrix.charm-root }} run: tox -vve unit + - name: Show all installed dependencies in test environment + if: ${{ !cancelled() && steps.deps.outcome == 'success' }} + working-directory: ${{ matrix.charm-root }} + run: | + echo "=== All installed packages in tox unit environment ===" + .tox/unit/bin/pip list || echo "Could not list packages from tox environment" + - name: Check for tox static environment id: has-static if: ${{ !cancelled() && steps.deps.outcome == 'success' }} From d1701db25cae438787f073e86183789619dc96bd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 03:53:53 +0000 Subject: [PATCH 12/14] fix: use uv pip freeze to show installed dependencies in uv-based test environments Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/db-charm-tests.yaml | 4 ++-- .github/workflows/observability-charm-tests.yaml | 4 ++-- .github/workflows/published-charms-tests.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/db-charm-tests.yaml b/.github/workflows/db-charm-tests.yaml index 86cc323db..de1bf6768 100644 --- a/.github/workflows/db-charm-tests.yaml +++ b/.github/workflows/db-charm-tests.yaml @@ -81,5 +81,5 @@ jobs: - name: Show all installed dependencies in test environment if: ${{ !cancelled() }} run: | - echo "=== All installed packages in tox unit environment ===" - .tox/unit/bin/pip list || echo "Could not list packages from tox environment" + echo "=== All installed packages in unit test environment ===" + uv pip freeze --python .tox/unit/bin/python || .tox/unit/bin/pip list || echo "Could not list packages from test environment" diff --git a/.github/workflows/observability-charm-tests.yaml b/.github/workflows/observability-charm-tests.yaml index c0eb44327..adb4c5623 100644 --- a/.github/workflows/observability-charm-tests.yaml +++ b/.github/workflows/observability-charm-tests.yaml @@ -86,8 +86,8 @@ jobs: - name: Show all installed dependencies in test environment if: ${{ !(matrix.disabled) && !cancelled() }} run: | - echo "=== All installed packages in tox unit environment ===" - .tox/unit/bin/pip list || echo "Could not list packages from tox environment" + echo "=== All installed packages in unit test environment ===" + uv pip freeze --python .tox/unit/bin/python || .tox/unit/bin/pip list || echo "Could not list packages from test environment" - name: Check if 'scenario' tox environment exists id: check-tox-env-scenario diff --git a/.github/workflows/published-charms-tests.yaml b/.github/workflows/published-charms-tests.yaml index d446d7e95..886cea9ac 100644 --- a/.github/workflows/published-charms-tests.yaml +++ b/.github/workflows/published-charms-tests.yaml @@ -268,8 +268,8 @@ jobs: if: ${{ !cancelled() && steps.deps.outcome == 'success' }} working-directory: ${{ matrix.charm-root }} run: | - echo "=== All installed packages in tox unit environment ===" - .tox/unit/bin/pip list || echo "Could not list packages from tox environment" + echo "=== All installed packages in unit test environment ===" + uv pip freeze --python .tox/unit/bin/python || .tox/unit/bin/pip list || echo "Could not list packages from test environment" - name: Check for tox static environment id: has-static From 2bbca3248fcda055068f56d65ed5f83489d61e61 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Dec 2025 04:34:49 +0000 Subject: [PATCH 13/14] fix: use uv pip freeze without specifying Python to use uv-managed environment Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/db-charm-tests.yaml | 2 +- .github/workflows/observability-charm-tests.yaml | 2 +- .github/workflows/published-charms-tests.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/db-charm-tests.yaml b/.github/workflows/db-charm-tests.yaml index de1bf6768..b06c000cc 100644 --- a/.github/workflows/db-charm-tests.yaml +++ b/.github/workflows/db-charm-tests.yaml @@ -82,4 +82,4 @@ jobs: if: ${{ !cancelled() }} run: | echo "=== All installed packages in unit test environment ===" - uv pip freeze --python .tox/unit/bin/python || .tox/unit/bin/pip list || echo "Could not list packages from test environment" + uv pip freeze || .tox/unit/bin/pip list || echo "Could not list packages from test environment" diff --git a/.github/workflows/observability-charm-tests.yaml b/.github/workflows/observability-charm-tests.yaml index adb4c5623..aed37cb12 100644 --- a/.github/workflows/observability-charm-tests.yaml +++ b/.github/workflows/observability-charm-tests.yaml @@ -87,7 +87,7 @@ jobs: if: ${{ !(matrix.disabled) && !cancelled() }} run: | echo "=== All installed packages in unit test environment ===" - uv pip freeze --python .tox/unit/bin/python || .tox/unit/bin/pip list || echo "Could not list packages from test environment" + uv pip freeze || .tox/unit/bin/pip list || echo "Could not list packages from test environment" - name: Check if 'scenario' tox environment exists id: check-tox-env-scenario diff --git a/.github/workflows/published-charms-tests.yaml b/.github/workflows/published-charms-tests.yaml index 886cea9ac..4bd5f84d1 100644 --- a/.github/workflows/published-charms-tests.yaml +++ b/.github/workflows/published-charms-tests.yaml @@ -269,7 +269,7 @@ jobs: working-directory: ${{ matrix.charm-root }} run: | echo "=== All installed packages in unit test environment ===" - uv pip freeze --python .tox/unit/bin/python || .tox/unit/bin/pip list || echo "Could not list packages from test environment" + uv pip freeze || .tox/unit/bin/pip list || echo "Could not list packages from test environment" - name: Check for tox static environment id: has-static From c5f97df5114c4b449bbf2ea435a70b30af382c84 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Dec 2025 05:00:39 +0000 Subject: [PATCH 14/14] fix: force upgrade pytest-interface-tester to >=3.4 in observability tests Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com> --- .github/workflows/observability-charm-tests.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/observability-charm-tests.yaml b/.github/workflows/observability-charm-tests.yaml index aed37cb12..f1e67d8d7 100644 --- a/.github/workflows/observability-charm-tests.yaml +++ b/.github/workflows/observability-charm-tests.yaml @@ -67,6 +67,14 @@ jobs: exit 1 fi + - name: Force upgrade pytest-interface-tester to fix compatibility + if: ${{ !(matrix.disabled) }} + run: | + if [ -e "uv.lock" ]; then + echo "Upgrading pytest-interface-tester to >=3.4 to ensure compatibility" + uv add "pytest-interface-tester>=3.4" --optional dev --upgrade || echo "Could not upgrade pytest-interface-tester" + fi + - name: Show installed ops package versions if: ${{ !(matrix.disabled) }} run: |