From 215b88365ff8be59c1ea1c6c16501b42ed149928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Mon, 20 Nov 2023 11:38:36 +0100 Subject: [PATCH 1/5] Use desktop engineering's diff detection instead of ours --- .github/workflows/auto-updates.yaml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/auto-updates.yaml b/.github/workflows/auto-updates.yaml index a2a3b3703..dad4ef996 100644 --- a/.github/workflows/auto-updates.yaml +++ b/.github/workflows/auto-updates.yaml @@ -143,19 +143,17 @@ jobs: uses: ./.github/actions/update-workspace-dependencies with: module: wsl-pro-service - - name: Detect modifications - shell: bash + - name: Detect changes id: check-diff - run: | - hasModif="false" - MODIFIED=$(git status --porcelain --untracked-files=no) - if [ -n "$MODIFIED" ]; then - hasModif="true" - fi - echo "modified=${hasModif}" >> $GITHUB_OUTPUT + uses: canonical/desktop-engineering/gh-actions/common/has-diff@main + with: + working-directory: wsl-pro-service + # Go workflow files tend to update when no one is asking + paths-to-ignore: 'go.work.sum' + fail-on-diff: false - name: Create Pull Request uses: peter-evans/create-pull-request@v5 - if: steps.check-diff.outputs.modified == 'true' + if: steps.check-diff.outputs.diff == 'true' with: commit-message: Auto update internal dependencies title: 'deps(wsl-pro-service): Auto update WSL-Pro-Service dependencies' @@ -164,6 +162,6 @@ jobs: branch: auto-updates/update-internal-dependencies token: ${{ secrets.GITHUB_TOKEN }} - name: Push branch - if: steps.check-diff.outputs.modified == 'true' + if: steps.check-diff.outputs.diff == 'true' run: | git push origin auto-updates/update-internal-dependencies:main From 9870360e01079d47a77eda8a4e60f4c5319403ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Mon, 20 Nov 2023 11:39:21 +0100 Subject: [PATCH 2/5] Run go mod tidy after updating dependencies --- .github/actions/update-workspace-dependencies/action.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/update-workspace-dependencies/action.yaml b/.github/actions/update-workspace-dependencies/action.yaml index 5f33fba5a..fb6f4414c 100644 --- a/.github/actions/update-workspace-dependencies/action.yaml +++ b/.github/actions/update-workspace-dependencies/action.yaml @@ -19,4 +19,7 @@ runs: run: | chmod +x ${{ github.action_path }}/update-workspace-dependencies.sh ${{ github.action_path }}/update-workspace-dependencies.sh "${{ github.repository }}" "wsl-pro-service" - + - name: Update module + shell: bash + working-directory: ${{ inputs.module }} + run: go mod tidy From 1ee27942e089e8d0370f72b6e36852f504d2553d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Mon, 20 Nov 2023 11:45:28 +0100 Subject: [PATCH 3/5] Fix: update-workspace-depenencies was using hard-coded module It was ignoring the input and using WSL-Pro-Service. --- .github/actions/update-workspace-dependencies/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/update-workspace-dependencies/action.yaml b/.github/actions/update-workspace-dependencies/action.yaml index fb6f4414c..700e07044 100644 --- a/.github/actions/update-workspace-dependencies/action.yaml +++ b/.github/actions/update-workspace-dependencies/action.yaml @@ -18,7 +18,7 @@ runs: shell: bash run: | chmod +x ${{ github.action_path }}/update-workspace-dependencies.sh - ${{ github.action_path }}/update-workspace-dependencies.sh "${{ github.repository }}" "wsl-pro-service" + ${{ github.action_path }}/update-workspace-dependencies.sh "${{ github.repository }}" "${{ inputs.module }}" - name: Update module shell: bash working-directory: ${{ inputs.module }} From 9159f53f90dd78a65bbae625fe5a51b4427fba54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Mon, 20 Nov 2023 12:18:36 +0100 Subject: [PATCH 4/5] Tidy WSL-Pro-Service This fixes the WSL Pro Service which was broken by the action being fixed here. It was broken in https://github.com/canonical/ubuntu-pro-for-windows/pull/410. --- wsl-pro-service/go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/wsl-pro-service/go.sum b/wsl-pro-service/go.sum index b38beace1..28fcb1dfc 100644 --- a/wsl-pro-service/go.sum +++ b/wsl-pro-service/go.sum @@ -38,8 +38,6 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/canonical/ubuntu-pro-for-windows/agentapi v0.0.0-20231113084350-57c6acdb2d5b h1:RvQ13IIoGm/JsPQYZA7hOvjX0rWIDqLH4DKXq6SW+L0= -github.com/canonical/ubuntu-pro-for-windows/agentapi v0.0.0-20231113084350-57c6acdb2d5b/go.mod h1:btQ/eVeGFXdXdifpHRo4V05VmmnhyhWWkecmVnvUbfQ= github.com/canonical/ubuntu-pro-for-windows/agentapi v0.0.0-20231120095032-972ad3e1f0c4 h1:dm4fQMsklc51D+7N9qYoB6QbbMmubexTj//En/IQIO8= github.com/canonical/ubuntu-pro-for-windows/agentapi v0.0.0-20231120095032-972ad3e1f0c4/go.mod h1:btQ/eVeGFXdXdifpHRo4V05VmmnhyhWWkecmVnvUbfQ= github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20231113084350-57c6acdb2d5b h1:e/2jgQO5wxcvIJBqQwD+hw40H0ytJAFRdOhnV+lQkUU= From 17ef6c6d4b0dadd65aae433642dabc74db81671b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Mon, 20 Nov 2023 14:45:22 +0100 Subject: [PATCH 5/5] Fixup: correct comment --- .github/workflows/auto-updates.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-updates.yaml b/.github/workflows/auto-updates.yaml index dad4ef996..c991fba39 100644 --- a/.github/workflows/auto-updates.yaml +++ b/.github/workflows/auto-updates.yaml @@ -148,7 +148,7 @@ jobs: uses: canonical/desktop-engineering/gh-actions/common/has-diff@main with: working-directory: wsl-pro-service - # Go workflow files tend to update when no one is asking + # Go workspace checksum files tend to update when no one is asking paths-to-ignore: 'go.work.sum' fail-on-diff: false - name: Create Pull Request