From a207f6bd45d3cfd61307432376504e9abd725483 Mon Sep 17 00:00:00 2001 From: axeII <13370338+axeII@users.noreply.github.com> Date: Sat, 13 Jan 2024 17:54:58 +0100 Subject: [PATCH] refactors: github actions and renovate configuration --- .github/labeler.yaml | 27 ++ .github/labels.yaml | 37 +++ .github/release.yaml | 4 + .github/renovate.json5 | 370 +++++++++++++++++++++++-- .github/renovate/allowedVersions.json5 | 10 - .github/renovate/autoMerge.json5 | 23 -- .github/renovate/commitMessage.json5 | 16 -- .github/renovate/groups.json5 | 66 ----- .github/renovate/labels.json5 | 49 ---- .github/renovate/semanticCommits.json5 | 115 -------- 10 files changed, 414 insertions(+), 303 deletions(-) create mode 100644 .github/labeler.yaml create mode 100644 .github/labels.yaml create mode 100644 .github/release.yaml delete mode 100644 .github/renovate/allowedVersions.json5 delete mode 100644 .github/renovate/autoMerge.json5 delete mode 100644 .github/renovate/commitMessage.json5 delete mode 100644 .github/renovate/groups.json5 delete mode 100644 .github/renovate/labels.json5 delete mode 100644 .github/renovate/semanticCommits.json5 diff --git a/.github/labeler.yaml b/.github/labeler.yaml new file mode 100644 index 000000000..d103a7c13 --- /dev/null +++ b/.github/labeler.yaml @@ -0,0 +1,27 @@ +--- +area/addons: + - changed-files: + - any-glob-to-any-file: bootstrap/templates/addons/**/* + - any-glob-to-any-file: bootstrap/tasks/addons/**/* + - any-glob-to-any-file: bootstrap/vars/addons.sample.yaml +area/ansible: + - changed-files: + - any-glob-to-any-file: ansible/**/* + - any-glob-to-any-file: bootstrap/templates/ansible/**/* + - any-glob-to-any-file: bootstrap/tasks/ansible/**/* +area/bootstrap: + - changed-files: + - any-glob-to-any-file: bootstrap/**/* + - any-glob-to-any-file: bootstrap/configure.yaml +area/github: + - changed-files: + - any-glob-to-any-file: .github/**/* +area/kubernetes: + - changed-files: + - any-glob-to-any-file: kubernetes/**/* + - any-glob-to-any-file: bootstrap/templates/kubernetes/**/* + - any-glob-to-any-file: bootstrap/tasks/kubernetes/**/* +area/taskfile: + - changed-files: + - any-glob-to-any-file: .taskfiles/**/* + - any-glob-to-any-file: Taskfile* diff --git a/.github/labels.yaml b/.github/labels.yaml new file mode 100644 index 000000000..d55e4789c --- /dev/null +++ b/.github/labels.yaml @@ -0,0 +1,37 @@ +--- +# Area +- name: area/addons + color: "0e8a16" +- name: area/ansible + color: "0e8a16" +- name: area/bootstrap + color: "0e8a16" +- name: area/github + color: "0e8a16" +- name: area/kubernetes + color: "0e8a16" +- name: area/taskfile + color: "0e8a16" +# Renovate +- name: renovate/ansible + color: "027fa0" +- name: renovate/container + color: "027fa0" +- name: renovate/github-action + color: "027fa0" +- name: renovate/github-release + color: "027fa0" +- name: renovate/helm + color: "027fa0" +# Semantic Type +- name: type/patch + color: "ffec19" +- name: type/minor + color: "ff9800" +- name: type/major + color: "f6412d" +- name: type/break + color: "f6412d" +# Uncategorized +- name: hold/upstream + color: "ee0701" diff --git a/.github/release.yaml b/.github/release.yaml new file mode 100644 index 000000000..1598e66bf --- /dev/null +++ b/.github/release.yaml @@ -0,0 +1,4 @@ +changelog: + exclude: + authors: + - renovate diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 5128c7268..6fdea00fe 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -6,48 +6,370 @@ ":disableRateLimiting", ":dependencyDashboard", ":semanticCommits", - ":enablePreCommit", - ":automergeDigest", - ":automergeBranch", - "github>axeII/home-ops//.github/renovate/autoMerge.json5", - "github>axeII/home-ops//.github/renovate/commitMessage.json5", - "github>axeII/home-ops//.github/renovate/groups.json5", - "github>axeII/home-ops//.github/renovate/labels.json5", - "github>axeII/home-ops//.github/renovate/semanticCommits.json5", - "helpers:pinGitHubActionDigests" + ":automergeBranch" ], "dependencyDashboard": true, "dependencyDashboardTitle": "Renovate Dashboard 🤖", - "suppressNotifications": ["prIgnoreNotification"], - "ignorePaths": [ - "**archive/**" + "suppressNotifications": [ + "prEditedNotification", + "prIgnoreNotification" ], "rebaseWhen": "conflicted", - "schedule": ["every saturday"], - "pre-commit": { - "enabled": true - }, + "schedule": [ + "on saturday" + ], "flux": { - "fileMatch": ["kubernetes/.+\\.ya?ml$"] + "fileMatch": [ + "(^|/)addons/.+\\.ya?ml(\\.j2)?(\\.j2)?$", + "(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$", + "(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$" + ] }, "helm-values": { - "fileMatch": ["kubernetes/.+\\.ya?ml$"] + "fileMatch": [ + "(^|/)addons/.+\\.ya?ml(\\.j2)?(\\.j2)?$", + "(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$", + "(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$" + ] }, "kubernetes": { "fileMatch": [ - "ansible/.+\\.ya?ml(\\.j2)?$", - "kubernetes/.+\\.ya?ml$" + "(^|/)addons/.+\\.ya?ml(\\.j2)?(\\.j2)?$", + "(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$", + "(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$" ] }, - "regexManagers": [ + "kustomize": { + "fileMatch": [ + "(^|/)kustomization\\.ya?ml(\\.j2)?(\\.j2)?$" + ] + }, + // commit message topics + "commitMessageTopic": "{{depName}}", + "commitMessageExtra": "to {{newVersion}}", + "commitMessageSuffix": "", + // package rules + "packageRules": [ + // automerge + { + "description": "Auto merge Github Actions", + "matchManagers": [ + "github-actions" + ], + "automerge": true, + "automergeType": "branch", + "ignoreTests": true, + "matchUpdateTypes": [ + "minor", + "patch" + ] + }, + // groups + { + "description": "Flux Group", + "groupName": "Flux", + "matchPackagePatterns": [ + "flux" + ], + "matchDatasources": [ + "docker", + "github-tags" + ], + "versioning": "semver", + "group": { + "commitMessageTopic": "{{{groupName}}} group" + }, + "separateMinorPatch": true + }, + { + "description": "System Upgrade Controller Group", + "groupName": "System Upgrade Controller", + "matchPackagePatterns": [ + "rancher/system-upgrade-controller" + ], + "matchDatasources": [ + "docker", + "github-releases" + ], + "group": { + "commitMessageTopic": "{{{groupName}}} group" + }, + "separateMinorPatch": true + }, + // custom versioning + { + "description": "Use custom versioning for k0s/k3s", + "matchDatasources": [ + "github-releases" + ], + "versioning": "regex:^v(?\\d+)\\.(?\\d+)\\.(?\\d+)(?\\+k.s)\\.?(?\\d+)$", + "matchPackagePatterns": [ + "k0s", + "k3s" + ] + }, + // commit message topics + { + "matchDatasources": [ + "helm" + ], + "commitMessageTopic": "chart {{depName}}" + }, + { + "matchDatasources": [ + "docker" + ], + "commitMessageTopic": "image {{depName}}" + }, + // commit messages + { + "matchDatasources": [ + "docker" + ], + "matchUpdateTypes": [ + "major" + ], + "commitMessagePrefix": "feat(container)!: " + }, + { + "matchDatasources": [ + "docker" + ], + "matchUpdateTypes": [ + "minor" + ], + "semanticCommitType": "feat", + "semanticCommitScope": "container" + }, + { + "matchDatasources": [ + "docker" + ], + "matchUpdateTypes": [ + "patch" + ], + "semanticCommitType": "fix", + "semanticCommitScope": "container" + }, + { + "matchDatasources": [ + "docker" + ], + "matchUpdateTypes": [ + "digest" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "container" + }, + { + "matchDatasources": [ + "helm" + ], + "matchUpdateTypes": [ + "major" + ], + "commitMessagePrefix": "feat(helm)!: " + }, + { + "matchDatasources": [ + "helm" + ], + "matchUpdateTypes": [ + "minor" + ], + "semanticCommitType": "feat", + "semanticCommitScope": "helm" + }, + { + "matchDatasources": [ + "helm" + ], + "matchUpdateTypes": [ + "patch" + ], + "semanticCommitType": "fix", + "semanticCommitScope": "helm" + }, + { + "matchDatasources": [ + "galaxy", + "galaxy-collection" + ], + "matchUpdateTypes": [ + "major" + ], + "commitMessagePrefix": "feat(ansible)!: " + }, + { + "matchDatasources": [ + "galaxy", + "galaxy-collection" + ], + "matchUpdateTypes": [ + "minor" + ], + "semanticCommitType": "feat", + "semanticCommitScope": "ansible" + }, + { + "matchDatasources": [ + "galaxy", + "galaxy-collection" + ], + "matchUpdateTypes": [ + "patch" + ], + "semanticCommitType": "fix", + "semanticCommitScope": "ansible" + }, + { + "matchDatasources": [ + "github-releases", + "github-tags" + ], + "matchUpdateTypes": [ + "major" + ], + "commitMessagePrefix": "feat(github-release)!: " + }, + { + "matchDatasources": [ + "github-releases", + "github-tags" + ], + "matchUpdateTypes": [ + "minor" + ], + "semanticCommitType": "feat", + "semanticCommitScope": "github-release" + }, + { + "matchDatasources": [ + "github-releases", + "github-tags" + ], + "matchUpdateTypes": [ + "patch" + ], + "semanticCommitType": "fix", + "semanticCommitScope": "github-release" + }, + { + "matchManagers": [ + "github-actions" + ], + "matchUpdateTypes": [ + "major" + ], + "commitMessagePrefix": "feat(github-action)!: " + }, + { + "matchManagers": [ + "github-actions" + ], + "matchUpdateTypes": [ + "minor" + ], + "semanticCommitType": "feat", + "semanticCommitScope": "github-action" + }, + { + "matchManagers": [ + "github-actions" + ], + "matchUpdateTypes": [ + "patch" + ], + "semanticCommitType": "fix", + "semanticCommitScope": "github-action" + }, + // labels + { + "matchUpdateTypes": [ + "major" + ], + "labels": [ + "type/major" + ] + }, + { + "matchUpdateTypes": [ + "minor" + ], + "labels": [ + "type/minor" + ] + }, + { + "matchUpdateTypes": [ + "patch" + ], + "labels": [ + "type/patch" + ] + }, + { + "matchDatasources": [ + "docker" + ], + "addLabels": [ + "renovate/container" + ] + }, + { + "matchDatasources": [ + "helm" + ], + "addLabels": [ + "renovate/helm" + ] + }, + { + "matchDatasources": [ + "galaxy", + "galaxy-collection" + ], + "addLabels": [ + "renovate/ansible" + ] + }, + { + "matchDatasources": [ + "github-releases", + "github-tags" + ], + "addLabels": [ + "renovate/github-release" + ] + }, + { + "matchManagers": [ + "github-actions" + ], + "addLabels": [ + "renovate/github-action" + ] + } + ], + // custom managers + "customManagers": [ { + "customType": "regex", "description": "Process various other dependencies", "fileMatch": [ - "ansible/.+\\.ya?ml(\\.j2)?$", - "kubernetes/.+\\.ya?ml$" + "(^|/).taskfiles/.+\\.ya?ml$", + "(^|/)addons/.+\\.ya?ml(\\.j2)?(\\.j2)?$", + "(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$", + "(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$", + "(^|/)k0s-config.ya?ml(\\.j2)?(\\.j2)?$" ], "matchStrings": [ - "datasource=(?\\S+) depName=(?\\S+)( versioning=(?\\S+))?\n.*?\"(?.*)\"\n" + // Example: `k3s_release_version: "v1.27.3+k3s1"` + "datasource=(?\\S+) depName=(?\\S+)( versioning=(?\\S+))?\n.*?\"(?.*)\"\n", + // Example: `- https://github.com/rancher/system-upgrade-controller/releases/download/v0.11.0/crd.yaml` + "datasource=(?\\S+) depName=(?\\S+)( versioning=(?\\S+))?\n.*?-\\s(.*?)\/(?[^/]+)\/[^/]+\n", + // Example: apiVersion=helm.cattle.io/v1 kind=HelmChart + "datasource=(?\\S+)\n.*?repo: (?\\S+)\n.*?chart: (?\\S+)\n.*?version: (?\\S+)\n" ], "datasourceTemplate": "{{#if datasource}}{{{datasource}}}{{else}}github-releases{{/if}}", "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}" diff --git a/.github/renovate/allowedVersions.json5 b/.github/renovate/allowedVersions.json5 deleted file mode 100644 index 4f3529aa4..000000000 --- a/.github/renovate/allowedVersions.json5 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "packageRules": [ - { - "matchDatasources": ["docker"], - "matchPackagePatterns": ["kopia"], - "allowedVersions": "<10" - } - ] -} diff --git a/.github/renovate/autoMerge.json5 b/.github/renovate/autoMerge.json5 deleted file mode 100644 index fe21dcd93..000000000 --- a/.github/renovate/autoMerge.json5 +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "packageRules": [ - { - "description": "Auto merge container digests", - "matchDatasources": ["docker"], - "automerge": true, - "ignoreTests": true, - "automergeType": "branch", - "matchUpdateTypes": ["digest"], - "matchPackagePattern": ["ghcr.io/onedr0p"] - }, - { - "description": "Auto merge GitHub Actions", - "matchManagers": ["github-actions"], - "matchDatasources": ["github-tags"], - "automerge": true, - "ignoreTests": true, - "automergeType": "branch", - "matchUpdateTypes": ["minor", "patch"] - } - ] -} diff --git a/.github/renovate/commitMessage.json5 b/.github/renovate/commitMessage.json5 deleted file mode 100644 index 3fea62872..000000000 --- a/.github/renovate/commitMessage.json5 +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "commitMessageTopic": "{{depName}}", - "commitMessageExtra": "to {{newVersion}}", - "commitMessageSuffix": "", - "packageRules": [ - { - "matchDatasources": ["helm"], - "commitMessageTopic": "chart {{depName}}" - }, - { - "matchDatasources": ["docker"], - "commitMessageTopic": "image {{depName}}" - } - ] -} diff --git a/.github/renovate/groups.json5 b/.github/renovate/groups.json5 deleted file mode 100644 index 535ac0856..000000000 --- a/.github/renovate/groups.json5 +++ /dev/null @@ -1,66 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "packageRules": [ - { - "description": "1Password Group", - "groupName": "1Password", - "matchPackagePatterns": ["1password"], - "matchDatasources": ["docker"], - "group": { - "commitMessageTopic": "{{{groupName}}} group" - }, - "separateMinorPatch": true - }, - { - "description": "Flux Group", - "groupName": "Flux", - "matchPackagePatterns": ["flux"], - "matchDatasources": ["docker", "github-tags"], - "group": { - "commitMessageTopic": "{{{groupName}}} group" - }, - "separateMinorPatch": true - }, - { - "description": "Immich Group", - "groupName": "Immich", - "matchPackagePatterns": ["immich"], - "matchDatasources": ["docker"], - "group": { - "commitMessageTopic": "{{{groupName}}} group" - }, - "separateMinorPatch": true - }, - { - "description": "Rook-Ceph Group", - "groupName": "Rook-Ceph", - "matchPackagePatterns": ["rook.ceph"], - "matchDatasources": ["helm"], - "group": { - "commitMessageTopic": "{{{groupName}}} group" - }, - "separateMinorPatch": true - }, - { - "description": "External Snapshotter Group", - "groupName": "External Snapshotter", - "matchPackageNames": ["snapshot-controller", "snapshot-validation-webhook"], - "matchDatasources": ["helm"], - "group": { - "commitMessageTopic": "{{{groupName}}} group" - }, - "separateMinorPatch": true - }, - { - "description": "Tekton Group", - "groupName": "Tekton", - "matchPackagePatterns": ["tektoncd"], - "matchDatasources": ["github-releases"], - "matchUpdateTypes": ["minor", "patch"], - "group": { - "commitMessageTopic": "{{{groupName}}} group" - }, - "separateMinorPatch": false - } - ] -} diff --git a/.github/renovate/labels.json5 b/.github/renovate/labels.json5 deleted file mode 100644 index e359566bd..000000000 --- a/.github/renovate/labels.json5 +++ /dev/null @@ -1,49 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "packageRules": [ - { - "matchUpdateTypes": ["major"], - "labels": ["type/major"] - }, - { - "matchUpdateTypes": ["minor"], - "labels": ["type/minor"] - }, - { - "matchUpdateTypes": ["patch"], - "labels": ["type/patch"] - }, - { - "matchUpdateTypes": ["digest"], - "labels": ["type/digest"] - }, - { - "matchDatasources": ["docker"], - "addLabels": ["renovate/container"] - }, - { - "matchDatasources": ["helm"], - "addLabels": ["renovate/helm"] - }, - { - "matchDatasources": ["galaxy", "galaxy-collection"], - "addLabels": ["renovate/ansible"] - }, - { - "matchDatasources": ["terraform-provider"], - "addLabels": ["renovate/terraform"] - }, - { - "matchDatasources": ["github-releases", "github-tags"], - "addLabels": ["renovate/github-release"] - }, - { - "matchManagers": ["github-actions"], - "addLabels": ["renovate/github-action"] - }, - { - "matchDatasources": ["pypi"], - "addLabels": ["renovate/pip"] - } - ] -} diff --git a/.github/renovate/semanticCommits.json5 b/.github/renovate/semanticCommits.json5 deleted file mode 100644 index 62a3d7c01..000000000 --- a/.github/renovate/semanticCommits.json5 +++ /dev/null @@ -1,115 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "packageRules": [ - { - "matchDatasources": ["docker"], - "matchUpdateTypes": ["major"], - "commitMessagePrefix": "feat(container)!: " - }, - { - "matchDatasources": ["docker"], - "matchUpdateTypes": ["minor"], - "semanticCommitType": "feat", - "semanticCommitScope": "container" - }, - { - "matchDatasources": ["docker"], - "matchUpdateTypes": ["patch"], - "semanticCommitType": "fix", - "semanticCommitScope": "container" - }, - { - "matchDatasources": ["docker"], - "matchUpdateTypes": ["digest"], - "semanticCommitType": "chore", - "semanticCommitScope": "container" - }, - { - "matchDatasources": ["helm"], - "matchUpdateTypes": ["major"], - "commitMessagePrefix": "feat(helm)!: " - }, - { - "matchDatasources": ["helm"], - "matchUpdateTypes": ["minor"], - "semanticCommitType": "feat", - "semanticCommitScope": "helm" - }, - - { - "matchDatasources": ["helm"], - "matchUpdateTypes": ["patch"], - "semanticCommitType": "fix", - "semanticCommitScope": "helm" - }, - { - "matchDatasources": ["galaxy", "galaxy-collection"], - "matchUpdateTypes": ["major"], - "commitMessagePrefix": "feat(ansible)!: " - }, - { - "matchDatasources": ["galaxy", "galaxy-collection"], - "matchUpdateTypes": ["minor"], - "semanticCommitType": "feat", - "semanticCommitScope": "ansible" - }, - - { - "matchDatasources": ["galaxy", "galaxy-collection"], - "matchUpdateTypes": ["patch"], - "semanticCommitType": "fix", - "semanticCommitScope": "ansible" - }, - { - "matchDatasources": ["terraform-provider"], - "matchUpdateTypes": ["major"], - "commitMessagePrefix": "feat(terraform)!: " - }, - { - "matchDatasources": ["terraform-provider"], - "matchUpdateTypes": ["minor"], - "semanticCommitType": "feat", - "semanticCommitScope": "terraform" - }, - { - "matchDatasources": ["terraform-provider"], - "matchUpdateTypes": ["patch"], - "semanticCommitType": "fix", - "semanticCommitScope": "terraform" - }, - { - "matchDatasources": ["github-releases", "github-tags"], - "matchUpdateTypes": ["major"], - "commitMessagePrefix": "feat(github-release)!: " - }, - { - "matchDatasources": ["github-releases", "github-tags"], - "matchUpdateTypes": ["minor"], - "semanticCommitType": "feat", - "semanticCommitScope": "github-release" - }, - { - "matchDatasources": ["github-releases", "github-tags"], - "matchUpdateTypes": ["patch"], - "semanticCommitType": "fix", - "semanticCommitScope": "github-release" - }, - { - "matchManagers": ["github-actions"], - "matchUpdateTypes": ["major"], - "commitMessagePrefix": "feat(github-action)!: " - }, - { - "matchManagers": ["github-actions"], - "matchUpdateTypes": ["minor"], - "semanticCommitType": "feat", - "semanticCommitScope": "github-action" - }, - { - "matchManagers": ["github-actions"], - "matchUpdateTypes": ["patch"], - "semanticCommitType": "fix", - "semanticCommitScope": "github-action" - } - ] -}