From 58f9c55fad65df21f9f337d32e560371e9ea3db8 Mon Sep 17 00:00:00 2001 From: Nikos Date: Mon, 28 Aug 2023 12:52:29 +0300 Subject: [PATCH 1/7] ci: update renovate config --- .github/workflows/renovate-approve.yaml | 18 ++++++++++ .github/workflows/renovate.yaml | 18 ++++++++++ renovate-config.js | 10 ++++++ renovate.json | 46 +++++++++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 .github/workflows/renovate-approve.yaml create mode 100644 .github/workflows/renovate.yaml create mode 100644 renovate-config.js create mode 100644 renovate.json diff --git a/.github/workflows/renovate-approve.yaml b/.github/workflows/renovate-approve.yaml new file mode 100644 index 00000000..c70e7910 --- /dev/null +++ b/.github/workflows/renovate-approve.yaml @@ -0,0 +1,18 @@ +name: renovate-approve +run-name: CI for approving renovate PRs + +on: + push: + branches: + - "renovate/**" + +jobs: + autoapprove: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Approve PR + run: | + gh pr review --approve || true + env: + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml new file mode 100644 index 00000000..cf772756 --- /dev/null +++ b/.github/workflows/renovate.yaml @@ -0,0 +1,18 @@ +# workflow for checking package versions and opening PRs to bump +name: Renovate +on: + workflow_dispatch: + workflow_call: + +jobs: + renovate: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Self-hosted Renovate + uses: renovatebot/github-action@23a02fe7be9e93f857a953cc8162e57d2c8401ef # v39.0.1 + with: + configurationFile: renovate-config.js + token: ${{ secrets.PAT_TOKEN }} diff --git a/renovate-config.js b/renovate-config.js new file mode 100644 index 00000000..8c127a85 --- /dev/null +++ b/renovate-config.js @@ -0,0 +1,10 @@ +module.exports = { + branchPrefix: 'renovate/', + dryRun: null, + username: 'renovate-release', + gitAuthor: 'Renovate Bot ', + onboarding: true, + platform: 'github', + includeForks: true, + repositories: ['canonical/glauth-k8s-operator'], +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..2d330d23 --- /dev/null +++ b/renovate.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base", + ":disableDependencyDashboard", + ":automergeDigest", + ":automergePatch", + ":automergeMinor", + ":rebaseStalePrs", + ":semanticCommits", + ":semanticCommitScope(deps)", + "helpers:pinGitHubActionDigests" + ], + "automergeType": "pr", + "rebaseWhen": "behind-base-branch", + "baseBranches": ["IAM-414"], + "packageRules": [ + { + "groupName": "github actions", + "matchManagers": ["github-actions"], + "matchUpdateTypes": ["major", "minor", "patch", "pin", "digest"], + "automerge": true, + "schedule": ["at any time"] + }, + { + "groupName": "Pip", + "matchManagers": ["pip_requirements"], + "matchUpdateTypes": ["major", "minor", "patch", "pin", "digest"], + "schedule": ["at any time"] + }, + { + "groupName": "testing deps", + "matchFiles": ["tox.ini"], + "matchUpdateTypes": ["major", "minor", "patch", "pin", "digest"], + "automerge": true, + "schedule": ["on monday"] + }, + { + "groupName": "renovate packages", + "matchSourceUrlPrefixes": ["https://github.com/renovatebot/"], + "matchUpdateTypes": ["major", "minor", "patch", "pin", "digest"], + "automerge": true, + "schedule": ["at any time"] + } + ] +} From bf89c90b5ab14fd9c71d3c89ef9fd9650bc535c6 Mon Sep 17 00:00:00 2001 From: Nikos Date: Mon, 28 Aug 2023 12:56:05 +0300 Subject: [PATCH 2/7] ci: add lint deps --- lint-requirements.txt | 9 +++++++++ tox.ini | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 lint-requirements.txt diff --git a/lint-requirements.txt b/lint-requirements.txt new file mode 100644 index 00000000..5b62c153 --- /dev/null +++ b/lint-requirements.txt @@ -0,0 +1,9 @@ +black +flake8==6.0.0 +flake8-docstrings +flake8-copyright +flake8-builtins +pyproject-flake8 +pep8-naming +isort +codespell diff --git a/tox.ini b/tox.ini index 93a9a392..b9db448a 100644 --- a/tox.ini +++ b/tox.ini @@ -35,9 +35,7 @@ commands = [testenv:lint] description = Check code against coding style standards deps = - black - ruff - codespell + -r{toxinidir}/lint-requirements.txt commands = # if this charm owns a lib, uncomment "lib_path" variable # and uncomment the following line From a015b5f60fc5d899e68cc494359ab2ec21448385 Mon Sep 17 00:00:00 2001 From: Nikos Date: Mon, 28 Aug 2023 12:59:25 +0300 Subject: [PATCH 3/7] ci: add lint deps --- .github/workflows/renovate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index cf772756..646b2127 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -15,4 +15,4 @@ jobs: uses: renovatebot/github-action@23a02fe7be9e93f857a953cc8162e57d2c8401ef # v39.0.1 with: configurationFile: renovate-config.js - token: ${{ secrets.PAT_TOKEN }} + token: ${{ github.token }} From da914cb27d12369931e6d26fad429aedc13d66d4 Mon Sep 17 00:00:00 2001 From: Nikos Date: Mon, 28 Aug 2023 13:06:20 +0300 Subject: [PATCH 4/7] ci: add lint deps --- lint-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lint-requirements.txt b/lint-requirements.txt index 5b62c153..42762898 100644 --- a/lint-requirements.txt +++ b/lint-requirements.txt @@ -1,4 +1,4 @@ -black +black==23.3.0 flake8==6.0.0 flake8-docstrings flake8-copyright From a067c68c72baf5fc536d79671c4b1f1373d7a809 Mon Sep 17 00:00:00 2001 From: Nikos Date: Mon, 28 Aug 2023 13:08:43 +0300 Subject: [PATCH 5/7] ci: add lint deps --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index aaa16b15..cae32927 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,3 @@ ops >= 2.2.0 +requests==2.30.0 + From e186368707d47097fe4bc4f779f9c05ae08f9950 Mon Sep 17 00:00:00 2001 From: Nikos Date: Mon, 28 Aug 2023 13:14:44 +0300 Subject: [PATCH 6/7] ci: add lint deps --- renovate.json | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/renovate.json b/renovate.json index 2d330d23..aae8d49e 100644 --- a/renovate.json +++ b/renovate.json @@ -13,7 +13,6 @@ ], "automergeType": "pr", "rebaseWhen": "behind-base-branch", - "baseBranches": ["IAM-414"], "packageRules": [ { "groupName": "github actions", @@ -23,10 +22,22 @@ "schedule": ["at any time"] }, { - "groupName": "Pip", + "groupName": "operator pip deps", "matchManagers": ["pip_requirements"], + "fileMatch": ["requirements\\.txt$"], "matchUpdateTypes": ["major", "minor", "patch", "pin", "digest"], - "schedule": ["at any time"] + "automerge": false, + "schedule": ["at any time"], + "prPriority": 5 + }, + }, + { + "groupName": "pip deps", + "matchManagers": ["pip_requirements"], + "matchUpdateTypes": ["major", "minor", "patch", "pin", "digest"], + "automerge": true, + "schedule": ["at any time"], + "prPriority": 4 }, { "groupName": "testing deps", From 6a6d1fa36a13fe25be65bea0fd233911a120411f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 10:15:34 +0000 Subject: [PATCH 7/7] chore(deps): update pip --- lint-requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lint-requirements.txt b/lint-requirements.txt index 42762898..ed304879 100644 --- a/lint-requirements.txt +++ b/lint-requirements.txt @@ -1,5 +1,5 @@ -black==23.3.0 -flake8==6.0.0 +black==23.7.0 +flake8==6.1.0 flake8-docstrings flake8-copyright flake8-builtins