From 48b36d96234f2327e2600e1523c3376c24c5ab85 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sat, 23 Mar 2024 17:49:23 +0000 Subject: [PATCH 1/2] chore: udpate configuration for renovate Signed-off-by: ivan katliarchuk --- .envrc | 4 +++- .github/release-drafter.yml | 4 ++-- Makefile | 4 ++-- renovate/config.js | 41 +++++++++++++++++++++++++------------ 4 files changed, 35 insertions(+), 18 deletions(-) diff --git a/.envrc b/.envrc index 96129c0d..41d16e0f 100644 --- a/.envrc +++ b/.envrc @@ -1,6 +1,8 @@ # macOs only https://github.com/sorah/envchain +# https://github.com/settings/tokens # envchain --set --noecho github RENOVATE_TOKEN -# envchain --set --noecho github DOCKER_HUB_USERNAME +# https://hub.docker.com/settings/security?generateToken=true +# envchain --set github DOCKER_HUB_USERNAME # envchain --set --noecho github DOCKER_HUB_TOKEN export RENOVATE_TOKEN=$(envchain github env | grep RENOVATE_TOKEN | cut -d'=' -f2) export RENOVATE_DOCKER_HUB_USERNAME=$(envchain github env | grep DOCKER_HUB_USERNAME | cut -d'=' -f2) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 64880484..e5a72b83 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -125,9 +125,9 @@ exclude-labels: - invalid - '[skip-changelog]' - '[skip-ci]' - - 'plugin' + - 'skip-ci' + - 'skip-release' # group them - - 'github-action' - 'pre-commit' autolabeler: diff --git a/Makefile b/Makefile index f5db62af..55f166a0 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ SHELL := /bin/bash MAKEFLAGS += --warn-undefined-variables MAKEFLAGS += --no-builtin-rules -CI_RENOVATE_IMAGE := renovate/renovate:37.125.2-slim +CI_RENOVATE_IMAGE := renovate/renovate:37.267.0-slim RENOVATE_REPOSITORIES := $(shell cat ./renovate/repositories.json | jq -r '. | join(",")') RENOVATE_DRY_RUN := false LOG_LEVEL := debug @@ -20,7 +20,7 @@ hooks: ## Setup pre commit. validate: ## Validate files with pre-commit hooks @pre-commit run --all-files -deps: ## Run renovate locally +run: ## Run renovate locally docker run --rm -it \ -w /tmp \ -v ${PWD}/renovate/config.js:/ren/renovate-config.js \ diff --git a/renovate/config.js b/renovate/config.js index c09b4fa9..eef54eaf 100644 --- a/renovate/config.js +++ b/renovate/config.js @@ -45,7 +45,12 @@ module.exports = { "pre-commit": { "enabled": true }, - "labels": ["renovate", "deps", "{{depType}}", "datasource::{{datasource}}", "type::{{updateType}}", "manager:{{manager}}"] + "labels": ["renovate", "deps", "{{depType}}", "datasource::{{datasource}}", "type::{{updateType}}", "manager:{{manager}}"], + "ignorePaths": [ + "examples/**", + "k8s/sandbox/**", + "**/tests/**", + ], "vulnerabilityAlerts": { "enabled": true, "addLabels": ["vulnerability"] @@ -78,21 +83,17 @@ module.exports = { "separateMultipleMajor": true, "groupName": "{{datasource}}", "addLabels": ["rule::4"], - "addLabels": ["{{datasource}}", "{{updateType}}"] + "addLabels": ["rule::4", "{{datasource}}", "{{updateType}}"] }, { - "matchPackageNames": ["actions/*"], + "automerge": false, "matchManagers": ["github-actions"], "additionalBranchPrefix": "{{packageFileDir}}-", "separateMajorMinor": true, "separateMinorPatch": true, "separateMultipleMajor": true, "groupName": "{{datasource}} {{depType}} {{packageFile}}", - "addLabels": ["rule::4", "github-action"] - }, - { - "matchManagers": ["github-actions"], - "addLabels": ["rule::4.1", "github-action"] + "addLabels": ["rule::4.2", "github-action", "skip-release"] }, { "automerge": false, @@ -128,9 +129,11 @@ module.exports = { "addLabels": ["rule::8"] }, { + "automerge": true, "groupName": "pre-commit", "matchManagers": ["pre-commit"], - "addLabels": ["rule::10", "pre-commit"] + "commitMessageSuffix": "[skip ci]", + "addLabels": ["rule::10", "pre-commit", "skip-release", "skip-ci"] }, // legacy { @@ -247,14 +250,14 @@ module.exports = { }, { "customType": "regex", - fileMatch: [ + "fileMatch": [ "^Dockerfile$", "Dockerfile$", ], - matchStrings: [ + "matchStrings": [ "#\\s*renovate:\\s*datasource=(?.*?) depName=(?.*?)( versioning=(?.*?))?\\s(ARG|ENV) .*?_VERSION(=|\\s)(?.*)\\s" ], - versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}" + "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}" }, { "customType": "regex", @@ -299,6 +302,18 @@ module.exports = { ], "datasourceTemplate": "docker", "versioningTemplate": "docker" - } + }, + { + "customType": "regex", + "description": "Update .tflint.hcl dependencies", + "fileMatch": [ + ".tflint.hcl" + ], + "matchStrings": [ + "plugin \"aws\" {\\n\\s*enabled\\s*=\\s*true\\n\\s*version\\s=\\s*\"(?[a-z.]+)\"\\n\\s * source\\s*=\\s*\"github.com\\/(?.*?)\"\\n}" + ], + "datasourceTemplate": "github-tags", + "versioningTemplate": "semver" + }, ] }; From 502c356801e0585d60aa2cfea29ca5ca70fa436e Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Sat, 23 Mar 2024 17:55:46 +0000 Subject: [PATCH 2/2] chore: udpate configuration for renovate Signed-off-by: ivan katliarchuk --- renovate/config.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/renovate/config.js b/renovate/config.js index eef54eaf..ace334ec 100644 --- a/renovate/config.js +++ b/renovate/config.js @@ -75,25 +75,26 @@ module.exports = { "enabled": false }, { - "automerge": false, + "automerge": true, "major": { "enabled": true }, "separateMajorMinor": true, "separateMinorPatch": true, "matchDatasources": ["docker"], "separateMultipleMajor": true, "groupName": "{{datasource}}", - "addLabels": ["rule::4"], - "addLabels": ["rule::4", "{{datasource}}", "{{updateType}}"] + "addLabels": ["rule::4"] }, { - "automerge": false, + "automerge": true, + // https://docs.renovatebot.com/configuration-options/#excluderepositories + "excludeRepositories": ["ivankatliarchuk/.github", "**/*-archived"], "matchManagers": ["github-actions"], "additionalBranchPrefix": "{{packageFileDir}}-", "separateMajorMinor": true, "separateMinorPatch": true, "separateMultipleMajor": true, "groupName": "{{datasource}} {{depType}} {{packageFile}}", - "addLabels": ["rule::4.2", "github-action", "skip-release"] + "addLabels": ["rule::4.1", "github-action", "skip-release"] }, { "automerge": false, @@ -140,7 +141,7 @@ module.exports = { "versioning": "regex:^v(?\\d+)(\\.(?\\d+))?(\\.(?\\d+))?", "groupName": "actions", "matchPackageNames": ["actions/*"], - "addLabels": ["rule::4.2", "github-action"] + "addLabels": ["rule::4.21", "github-action"] }, { "versioning": "semver",