Skip to content

Commit

Permalink
chore(ci): add renovate for golangci-lint, go and node version (#20236)
Browse files Browse the repository at this point in the history
Signed-off-by: ggjulio <[email protected]>
  • Loading branch information
ggjulio authored Oct 5, 2024
1 parent 52d5653 commit d17aafd
Show file tree
Hide file tree
Showing 14 changed files with 179 additions and 166 deletions.
3 changes: 1 addition & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ updates:
interval: "daily"
ignore:
# We use consistent go and node versions across a lot of different files, and updating via dependabot would cause
# drift among those files.
# Use `make update-go` and `make update-node` to update these versions.
# drift among those files, instead we let renovate bot handle them.
- dependency-name: "library/golang"
- dependency-name: "library/node"

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:

env:
# Golang version to use across CI steps
# renovate: datasource=golang-version packageName=golang
GOLANG_VERSION: '1.23.1'

concurrency:
Expand Down Expand Up @@ -110,6 +111,7 @@ jobs:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
# renovate: datasource=go packageName=github.com/golangci/golangci-lint versioning=regex:^v(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)?$
version: v1.61.0
args: --verbose

Expand Down Expand Up @@ -305,6 +307,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
# renovate: datasource=node-version packageName=node versioning=node
node-version: '22.8.0'
- name: Restore node dependency cache
id: cache-dependencies
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
uses: ./.github/workflows/image-reuse.yaml
with:
# Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations)
# renovate: datasource=golang-version packageName=golang
go-version: 1.23.1
platforms: ${{ needs.set-vars.outputs.platforms }}
push: false
Expand All @@ -68,6 +69,7 @@ jobs:
quay_image_name: quay.io/argoproj/argocd:latest
ghcr_image_name: ghcr.io/argoproj/argo-cd/argocd:${{ needs.set-vars.outputs.image-tag }}
# Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations)
# renovate: datasource=golang-version packageName=golang
go-version: 1.23.1
platforms: ${{ needs.set-vars.outputs.platforms }}
push: true
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
permissions: {}

env:
# renovate: datasource=golang-version packageName=golang
GOLANG_VERSION: '1.23.1' # Note: go-version must also be set in job argocd-image.with.go-version

jobs:
Expand All @@ -23,6 +24,7 @@ jobs:
with:
quay_image_name: quay.io/argoproj/argocd:${{ github.ref_name }}
# Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations)
# renovate: datasource=golang-version packageName=golang
go-version: 1.23.1
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
push: true
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/update-go.yaml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/update-node.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -631,14 +631,6 @@ snyk-non-container-tests:
snyk-report:
./hack/snyk-report.sh $(target_branch)

.PHONY: update-go
update-go:
./hack/update-go.sh

.PHONY: update-node
update-node:
./hack/update-node.sh

.PHONY: help
help:
@echo 'Note: Generally an item w/ (-local) will run inside docker unless you use the -local variant'
Expand Down
5 changes: 4 additions & 1 deletion hack/installers/install-lint-tools.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
set -eux -o pipefail

GO111MODULE=on go install github.com/golangci/golangci-lint/cmd/[email protected]
# renovate: datasource=go packageName=github.com/golangci/golangci-lint
GOLANGCI_LINT_VERSION=1.61.0

GO111MODULE=on go install "github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}"
38 changes: 0 additions & 38 deletions hack/update-go.sh

This file was deleted.

33 changes: 0 additions & 33 deletions hack/update-node.sh

This file was deleted.

16 changes: 16 additions & 0 deletions renovate-presets/custom-managers/shell.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customManagers": [
{
"description": "A generic custom manager for updating any shell scripts.",
"customType": "regex",
"fileMatch": [
".+\\.(?:bash|sh|ksh)$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?)(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>.*?))?(?: extractVersion=(?<extractVersion>.*?))?\\s.+?_VERSION\\s*=\\s*(?:'|\")(?<currentValue>[^(?:'|\")]+)(?:'|\")",
"# renovate: datasource=(?<datasource>.*?)(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>.*?))?(?: extractVersion=(?<extractVersion>.*?))?\\s.+?_VERSION\\s*=\\s*(?<currentValue>[^'\"\\s]+)"
]
}
]
}
16 changes: 16 additions & 0 deletions renovate-presets/custom-managers/yaml.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customManagers": [
{
"description": "A generic custom manager for updating any yaml fields ending by *version: case incensitive",
"customType": "regex",
"fileMatch": [
".github\\/workflows.+\\.(?:yml|yaml)$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?)(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>.*?))?(?: extractVersion=(?<extractVersion>.*?))?\\s.+?((?i)VERSION)\\s*:\\s*(?:'|\")(?<currentValue>[^(?:'|\")]+)(?:'|\")",
"# renovate: datasource=(?<datasource>.*?)(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>.*?))?(?: extractVersion=(?<extractVersion>.*?))?\\s.+?((?i)VERSION)\\s*:\\s*(?<currentValue>[^'\"\\s]+)"
]
}
]
}
22 changes: 22 additions & 0 deletions renovate-presets/fix/openssf-merge-confidence-columns.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"description": "Merge the output of mergeConfidence:all-badges and security:openssf-scorecard. See https://github.com/renovatebot/renovate/discussions/25125 for rationale.",
"packageRules": [
{
"matchPackagePatterns": [
".*"
],
"prBodyColumns": [
"Package",
"Type",
"Update",
"Change",
"Age",
"Adoption",
"Passing",
"Confidence",
"OpenSSF"
]
}
]
}
Loading

0 comments on commit d17aafd

Please sign in to comment.