Skip to content

Commit

Permalink
feat: renovate grafana dashboard revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
buroa committed Oct 17, 2023
1 parent 4b0649b commit 7ae99df
Show file tree
Hide file tree
Showing 13 changed files with 178 additions and 89 deletions.
8 changes: 6 additions & 2 deletions .github/labeler.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
---
area/github:
- ".github/**/*"
area/taskfiles:
- ".taskfiles/**/*"
area/kubernetes:
- "kubernetes/**/*"
area/hack:
- "hack/**/*"
area/talos:
- "talos/**/*"
area/terraform:
- "terraform/**/*"
14 changes: 8 additions & 6 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
# Area
- name: area/ansible
color: "72ccf3"
description: >-
Changes made in the ansible directory
- name: area/github
color: "72ccf3"
description: >-
Changes made in the github directory
- name: area/taskfiles
color: "72ccf3"
description: >-
Changes made in the taskfiles directory
- name: area/kubernetes
color: "72ccf3"
description: >-
Changes made in the kubernetes directory
- name: area/hack
- name: area/talos
color: "72ccf3"
description: >-
Changes made in the hack directory
Changes made in the talos directory
- name: area/terraform
color: "72ccf3"
description: >-
Expand All @@ -29,6 +29,8 @@
color: "ffc300"
- name: renovate/github-release
color: "ffc300"
- name: renovate/grafana-dashboard
color: "ffc300"
- name: renovate/helm
color: "ffc300"
- name: renovate/terraform
Expand Down
75 changes: 12 additions & 63 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
"github>buroa/k8s-gitops//.github/renovate/allowedVersions.json5",
"github>buroa/k8s-gitops//.github/renovate/autoMerge.json5",
"github>buroa/k8s-gitops//.github/renovate/commitMessage.json5",
"github>buroa/k8s-gitops//.github/renovate/customDatasources.json5",
"github>buroa/k8s-gitops//.github/renovate/customManagers.json5",
"github>buroa/k8s-gitops//.github/renovate/groups.json5",
"github>buroa/k8s-gitops//.github/renovate/labels.json5",
"github>buroa/k8s-gitops//.github/renovate/packageRules.json5",
"github>buroa/k8s-gitops//.github/renovate/semanticCommits.json5",
"helpers:pinGitHubActionDigests"
],
Expand All @@ -22,76 +25,22 @@
"dependencyDashboardTitle": "Renovate Dashboard 🤖",
"suppressNotifications": ["prIgnoreNotification"],
"flux": {
"fileMatch": ["(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"]
"fileMatch": [
"(^|/)talos/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
]
},
"helm-values": {
"fileMatch": ["(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"]
"fileMatch": [
"(^|/)talos/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
]
},
"kubernetes": {
"fileMatch": [
"(^|/)\\.taskfiles/.+\\.ya?ml(\\.j2)?$",
"(^|/)talos/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
]
},
"customManagers": [
{
"description": "Process Tekton dependencies",
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"depName=(?<depName>\\S+)?\n.*?(?<currentValue>v\\d+\\.\\d+\\.\\d+)"
],
"datasourceTemplate": "github-releases"
},
{
"description": "Process custom dependencies",
"fileMatch": [
"(^|/)talos/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
// Example: `version: "v1.27.3+k3s1"`
"datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>\\S+))?\n.*?\"(?<currentValue>.*)\"\n",
// Example: `- https://github.com/rancher/system-upgrade-controller/releases/download/v0.11.0/crd.yaml`
// `- https://github.com/argoproj/argo-cd/raw/v2.7.10/manifests/install.yaml`
// `- https://github.com/argoproj/argo-cd/raw/v2.7.10/manifests/ha/install.yaml`
// `- https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/21.1.1/kubernetes/kubernetes.yml`
"datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>\\S+))?\n.*?-\\s(.*?)\/(?<currentValue>(v|\\d)[^/]+)\/\\S+\n",
// Example: apiVersion=helm.cattle.io/v1 kind=HelmChart
"datasource=(?<datasource>\\S+)\n.*?repo: (?<registryUrl>\\S+)\n.*?chart: (?<depName>\\S+)\n.*?version: (?<currentValue>\\S+)\n"
],
"datasourceTemplate": "{{#if datasource}}{{{datasource}}}{{else}}github-releases{{/if}}",
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
},
{
"description": "Process CloudnativePG Postgresql version",
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"imageName: (?<depName>\\S+):(?<currentValue>.*\\-.*)"
],
"datasourceTemplate": "docker",
"versioningTemplate": "redhat"
}
],
"packageRules": [
{
"description": "Loose versioning for non-semver packages",
"matchDatasources": ["docker"],
"versioning": "loose",
"matchPackagePatterns": ["plex", "qbittorrent"]
},
{
"description": "Custom versioning for i915-ucode and intel-ucode",
"matchDatasources": ["docker"],
"versioning": "regex:^(?<major>\\d{4})(?<minor>\\d{2})(?<patch>\\d{2})\\.?(?<build>\\d+)?$",
"matchPackageNames": [
"ghcr.io/siderolabs/i915-ucode",
"ghcr.io/siderolabs/intel-ucode"
]
}
]
}
}
5 changes: 5 additions & 0 deletions .github/renovate/commitMessage.json5
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
{
"matchDatasources": ["docker"],
"commitMessageTopic": "image {{depName}}"
},
{
"matchDatasources": ["custom.grafana-dashboards"],
"commitMessageTopic": "dashboard {{depName}}",
"commitMessageExtra": "to v{{newVersion}}"
}
]
}
12 changes: 12 additions & 0 deletions .github/renovate/customDatasources.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customDatasources": {
"grafana-dashboards": {
"defaultRegistryUrlTemplate": "https://grafana.com/api/dashboards/{{packageName}}",
"format": "json",
"transformTemplates": [
"{\"releases\":[{\"version\": $string(revision)}]}"
]
}
}
}
58 changes: 58 additions & 0 deletions .github/renovate/customManagers.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customManagers": [
{
"description": "Process generic dependencies in YAML files",
"fileMatch": [
"(^|/)\\.taskfiles/.+\\.ya?ml(\\.j2)?$",
"(^|/)talos/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?)(?:\\s+extractVersion=(?<extractVersion>.+?))?(?:\\s+versioning=(?<versioning>.+?))?\\s+depName=(?<depName>.+?)?\\s(?:\\s+.*(?:[v|V]ersion):\\s+(?<currentValue>.*))?(?:\\s.*(?:[r|R]ef):\\s+(?<currentDigest>.*))?"
],
"versioningTemplate": "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}"
},
{
"description": "Process custom dependencies",
"fileMatch": [
"(^|/)talos/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
// Example: `- https://github.com/rancher/system-upgrade-controller/releases/download/v0.11.0/crd.yaml`
// `- https://github.com/argoproj/argo-cd/raw/v2.7.10/manifests/install.yaml`
// `- https://github.com/argoproj/argo-cd/raw/v2.7.10/manifests/ha/install.yaml`
// `- https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/21.1.1/kubernetes/kubernetes.yml`
"datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>\\S+))?\n.*?-\\s(.*?)\/(?<currentValue>(v|\\d)[^/]+)\/\\S+\n",
// Example: apiVersion=helm.cattle.io/v1 kind=HelmChart
"datasource=(?<datasource>\\S+)\n.*?repo: (?<registryUrl>\\S+)\n.*?chart: (?<depName>\\S+)\n.*?version: (?<currentValue>\\S+)\n"
],
"datasourceTemplate": "{{#if datasource}}{{{datasource}}}{{else}}github-releases{{/if}}",
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
},
{
"description": "Process Grafana dashboards",
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"#\\s+renovate:\\s+depName=\"(?<depName>.*)\"\\n\\s+gnetId:\\s+(?<packageName>.*?)\\n\\s+revision:\\s+(?<currentValue>.*)"
],
"customType": "regex",
"versioningTemplate": "regex:^(?<major>\\d+)$",
"datasourceTemplate": "custom.grafana-dashboards"
},
{
"description": "Process CloudnativePG Postgresql version",
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"imageName: (?<depName>\\S+):(?<currentValue>.*\\-.*)"
],
"datasourceTemplate": "docker",
"versioningTemplate": "redhat"
}
]
}
10 changes: 10 additions & 0 deletions .github/renovate/groups.json5
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
"commitMessageTopic": "{{{groupName}}} group"
},
"separateMinorPatch": true
},
{
"description": "Talos Group",
"groupName": "Talos",
"matchPackagePatterns": ["siderolabs/talos", "siderolabs/talosctl", "buroa/installer"],
"matchDatasources": ["docker", "github-releases"],
"group": {
"commitMessageTopic": "{{{groupName}}} group"
},
"separateMinorPatch": true
}
]
}
4 changes: 4 additions & 0 deletions .github/renovate/labels.json5
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
{
"matchDatasources": ["pypi"],
"addLabels": ["renovate/pip"]
},
{
"matchDatasources": ["grafana-dashboards", "custom.grafana-dashboards"],
"addLabels": ["renovate/grafana-dashboard"]
}
]
}
20 changes: 20 additions & 0 deletions .github/renovate/packageRules.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"packageRules": [
{
"description": "Loose versioning for non-semver packages",
"matchDatasources": ["docker"],
"versioning": "loose",
"matchPackagePatterns": ["plex", "qbittorrent"]
},
{
"description": "Custom versioning for i915-ucode and intel-ucode",
"matchDatasources": ["docker"],
"versioning": "regex:^(?<major>\\d{4})(?<minor>\\d{2})(?<patch>\\d{2})\\.?(?<build>\\d+)?$",
"matchPackageNames": [
"ghcr.io/siderolabs/i915-ucode",
"ghcr.io/siderolabs/intel-ucode"
]
}
]
}
5 changes: 5 additions & 0 deletions .github/renovate/semanticCommits.json5
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@
"matchUpdateTypes": ["patch"],
"semanticCommitType": "fix",
"semanticCommitScope": "github-action"
},
{
"matchDatasources": ["custom.grafana-dashboards"],
"matchUpdateTypes": ["major"],
"commitMessagePrefix": "feat(grafana-dashboard)!: "
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
annotations:
kustomize.toolkit.fluxcd.io/substitute: disabled
spec:
# renovate: datasource=github-releases depName=siderolabs/talos
# renovate: datasource=git-tag depName=ghcr.io/buroa/installer
version: v1.5.3
serviceAccountName: kube-system
secrets:
Expand Down
Loading

0 comments on commit 7ae99df

Please sign in to comment.