Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(asdf): Add support for more ASDF plugins #21942

Merged
merged 6 commits into from May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
81 changes: 80 additions & 1 deletion lib/modules/manager/asdf/extract.spec.ts
Expand Up @@ -43,10 +43,13 @@ describe('modules/manager/asdf/extract', () => {

it('can handle multiple tools in one file', () => {
const res = extractPackageFile(
codeBlock`argocd 2.5.4
codeBlock`
adr-tools 3.0.0
argocd 2.5.4
awscli 2.8.6
bun 0.2.2
cargo-make 0.36.2
checkov 2.3.3
clojure 1.11.1.1182
crystal 1.6.1
dart 2.19.3
Expand All @@ -58,9 +61,12 @@ elixir 1.14.1
elm 0.19.1
erlang 25.1.2
flutter 3.7.6
flux2 0.41.2
gauche 0.9.12
gohugo extended_0.104.3
golang 1.19.2
golangci-lint 1.52.2
hadolint 2.12.0
haskell 9.4.2
helm 3.10.1
helmfile 0.147.0
Expand All @@ -70,6 +76,7 @@ java adoptopenjdk-16.0.0+36
julia 1.8.2
just 1.7.0
kotlin 1.7.20
kubectl 1.26.3
kustomize 4.5.7
lua 5.4.4
nim 1.6.8
Expand All @@ -79,6 +86,7 @@ perl 5.37.5
php 8.1.12
pnpm 7.26.2
poetry 1.3.2
pre-commit 3.3.1
pulumi 3.57.1
python 3.11.0
ruby 3.1.2
Expand All @@ -87,7 +95,10 @@ scala 3.2.1
shellcheck 0.8.0
shfmt 3.5.1
terraform 1.3.3
terraform-docs 0.16.0
terragrunt 0.43.2
tflint 0.44.1
tfsec 1.28.1
trivy 0.33.0
zig 0.9.1
maestro 1.24.0
Expand All @@ -98,6 +109,12 @@ dummy 1.2.3
);
expect(res).toEqual({
deps: [
{
currentValue: '3.0.0',
datasource: 'github-tags',
packageName: 'npryce/adr-tools',
depName: 'adr-tools',
},
{
currentValue: '2.5.4',
datasource: 'github-releases',
Expand All @@ -124,6 +141,12 @@ dummy 1.2.3
packageName: 'sagiegurari/cargo-make',
depName: 'cargo-make',
},
{
currentValue: '2.3.3',
datasource: 'github-tags',
packageName: 'bridgecrewio/checkov',
depName: 'checkov',
},
{
currentValue: '1.11.1.1182',
datasource: 'github-tags',
Expand Down Expand Up @@ -195,6 +218,13 @@ dummy 1.2.3
datasource: 'flutter-version',
depName: 'flutter',
},
{
currentValue: '0.41.2',
datasource: 'github-tags',
packageName: 'fluxcd/flux2',
depName: 'flux2',
extractVersion: '^v(?<version>.+)',
},
{
currentValue: '0.9.12',
datasource: 'docker',
Expand All @@ -215,6 +245,20 @@ dummy 1.2.3
depName: 'golang',
extractVersion: '^go(?<version>\\S+)',
},
{
currentValue: '1.52.2',
datasource: 'github-tags',
packageName: 'golangci/golangci-lint',
depName: 'golangci-lint',
extractVersion: '^v(?<version>.+)',
},
{
currentValue: '2.12.0',
datasource: 'github-tags',
packageName: 'hadolint/hadolint',
depName: 'hadolint',
extractVersion: '^v(?<version>.+)',
},
{
currentValue: '9.4.2',
datasource: 'github-tags',
Expand Down Expand Up @@ -276,6 +320,13 @@ dummy 1.2.3
depName: 'kotlin',
extractVersion: '^(Kotlin |v)(?<version>\\S+)',
},
{
currentValue: '1.26.3',
datasource: 'github-tags',
packageName: 'kubernetes/kubernetes',
depName: 'kubectl',
extractVersion: '^v(?<version>.+)',
},
{
currentValue: '4.5.7',
datasource: 'github-releases',
Expand Down Expand Up @@ -335,6 +386,13 @@ dummy 1.2.3
packageName: 'poetry',
depName: 'poetry',
},
{
currentValue: '3.3.1',
datasource: 'github-tags',
packageName: 'pre-commit/pre-commit',
depName: 'pre-commit',
extractVersion: '^v(?<version>.+)',
},
{
currentValue: '3.57.1',
datasource: 'github-releases',
Expand Down Expand Up @@ -389,13 +447,34 @@ dummy 1.2.3
depName: 'terraform',
extractVersion: '^v(?<version>\\S+)',
},
{
currentValue: '0.16.0',
datasource: 'github-tags',
packageName: 'terraform-docs/terraform-docs',
depName: 'terraform-docs',
extractVersion: '^v(?<version>.+)',
},
{
currentValue: '0.43.2',
datasource: 'github-releases',
packageName: 'gruntwork-io/terragrunt',
depName: 'terragrunt',
extractVersion: '^v(?<version>\\S+)',
},
{
currentValue: '0.44.1',
datasource: 'github-tags',
packageName: 'terraform-linters/tflint',
depName: 'tflint',
extractVersion: '^v(?<version>.+)',
},
{
currentValue: '1.28.1',
datasource: 'github-tags',
packageName: 'aquasecurity/tfsec',
depName: 'tfsec',
extractVersion: '^v(?<version>.+)',
},
{
currentValue: '0.33.0',
datasource: 'github-releases',
Expand Down
78 changes: 78 additions & 0 deletions lib/modules/manager/asdf/upgradeable-tooling.ts
Expand Up @@ -38,6 +38,13 @@ const hugoDefinition: ToolingDefinition = {
};

export const upgradeableTooling: Record<string, ToolingDefinition> = {
'adr-tools': {
asdfPluginUrl: 'https://gitlab.com/td7x/asdf/adr-tools.git',
config: {
datasource: GithubTagsDatasource.id,
packageName: 'npryce/adr-tools',
},
},
argocd: {
asdfPluginUrl: 'https://github.com/beardix/asdf-argocd',
config: {
Expand Down Expand Up @@ -68,6 +75,13 @@ export const upgradeableTooling: Record<string, ToolingDefinition> = {
packageName: 'sagiegurari/cargo-make',
},
},
checkov: {
asdfPluginUrl: 'https://github.com/bosmak/asdf-checkov.git',
config: {
datasource: GithubTagsDatasource.id,
packageName: 'bridgecrewio/checkov',
},
},
clojure: {
asdfPluginUrl: 'https://github.com/asdf-community/asdf-clojure',
config: {
Expand Down Expand Up @@ -148,6 +162,14 @@ export const upgradeableTooling: Record<string, ToolingDefinition> = {
datasource: FlutterVersionDatasource.id,
},
},
flux2: {
asdfPluginUrl: 'https://github.com/tablexi/asdf-flux2.git',
config: {
datasource: GithubTagsDatasource.id,
packageName: 'fluxcd/flux2',
extractVersion: '^v(?<version>.+)',
},
},
gauche: {
asdfPluginUrl: 'https://github.com/sakuro/asdf-gauche',
config: {
Expand All @@ -164,6 +186,22 @@ export const upgradeableTooling: Record<string, ToolingDefinition> = {
extractVersion: '^go(?<version>\\S+)',
},
},
'golangci-lint': {
asdfPluginUrl: 'https://github.com/hypnoglow/asdf-golangci-lint.git',
config: {
datasource: GithubTagsDatasource.id,
packageName: 'golangci/golangci-lint',
extractVersion: '^v(?<version>.+)',
},
},
hadolint: {
asdfPluginUrl: 'https://github.com/looztra/asdf-hadolint.git',
config: {
datasource: GithubTagsDatasource.id,
packageName: 'hadolint/hadolint',
extractVersion: '^v(?<version>.+)',
},
},
haskell: {
asdfPluginUrl: 'https://github.com/asdf-community/asdf-haskell',
config: {
Expand Down Expand Up @@ -247,6 +285,14 @@ export const upgradeableTooling: Record<string, ToolingDefinition> = {
extractVersion: '^(Kotlin |v)(?<version>\\S+)',
},
},
kubectl: {
asdfPluginUrl: 'https://github.com/Banno/asdf-kubectl.git',
config: {
datasource: GithubTagsDatasource.id,
packageName: 'kubernetes/kubernetes',
extractVersion: '^v(?<version>.+)',
},
},
kustomize: {
asdfPluginUrl: 'https://github.com/Banno/asdf-kustomize',
config: {
Expand Down Expand Up @@ -316,6 +362,14 @@ export const upgradeableTooling: Record<string, ToolingDefinition> = {
packageName: 'poetry',
},
},
'pre-commit': {
asdfPluginUrl: 'https://github.com/jonathanmorley/asdf-pre-commit.git',
config: {
datasource: GithubTagsDatasource.id,
packageName: 'pre-commit/pre-commit',
extractVersion: '^v(?<version>.+)',
},
},
pulumi: {
asdfPluginUrl: 'https://github.com/canha/asdf-pulumi.git',
config: {
Expand Down Expand Up @@ -399,6 +453,14 @@ export const upgradeableTooling: Record<string, ToolingDefinition> = {
extractVersion: '^v(?<version>\\S+)',
},
},
'terraform-docs': {
asdfPluginUrl: 'https://github.com/looztra/asdf-terraform-docs.git',
config: {
datasource: GithubTagsDatasource.id,
packageName: 'terraform-docs/terraform-docs',
extractVersion: '^v(?<version>.+)',
},
},
terragrunt: {
asdfPluginUrl: 'https://github.com/ohmer/asdf-terragrunt',
config: {
Expand All @@ -407,6 +469,22 @@ export const upgradeableTooling: Record<string, ToolingDefinition> = {
extractVersion: '^v(?<version>\\S+)',
},
},
tflint: {
asdfPluginUrl: 'https://github.com/skyzyx/asdf-tflint.git',
config: {
datasource: GithubTagsDatasource.id,
packageName: 'terraform-linters/tflint',
extractVersion: '^v(?<version>.+)',
},
},
tfsec: {
asdfPluginUrl: 'https://github.com/woneill/asdf-tfsec.git',
config: {
datasource: GithubTagsDatasource.id,
packageName: 'aquasecurity/tfsec',
extractVersion: '^v(?<version>.+)',
},
},
trivy: {
asdfPluginUrl: 'https://github.com/zufardhiyaulhaq/asdf-trivy',
config: {
Expand Down