diff --git a/.github/workflows/on-pr.yaml b/.github/workflows/on-pr.yaml index 048b835..4bbf259 100644 --- a/.github/workflows/on-pr.yaml +++ b/.github/workflows/on-pr.yaml @@ -10,6 +10,7 @@ on: - reopened - synchronize paths: + - 'renovate.json' - '.github/workflows/on-pr.yaml' - '.gitops/**' - 'apis/**' diff --git a/renovate.json b/renovate.json index a92fb2e..598e169 100644 --- a/renovate.json +++ b/renovate.json @@ -12,35 +12,62 @@ }, "packageRules": [ { - "description": "Automerge minor and patch updates that pass all checks", - "matchUpdateTypes": ["minor", "patch"], - "automerge": true + "description": "Require manual merge until an e2e suite exists", + "matchUpdateTypes": [ + "major", + "minor", + "patch" + ], + "automerge": false }, { "description": "Disable automatic updates for all hops-ops Docker images", - "matchDatasources": ["docker"], + "matchDatasources": [ + "docker" + ], "enabled": false, - "matchPackageNames": ["/^hops-ops//"] + "matchPackageNames": [ + "/^hops-ops//" + ] }, { - "description": "Group all AWS provider packages together for batched updates", + "description": "Group AWS provider-family packages", "matchPackageNames": [ "/provider-family-aws/", "/provider-aws-.*/" ], "groupName": "aws-providers" }, + { + "description": "Use feat(deps): commit prefix for hops-ops Crossplane packages (github-releases datasource)", + "matchManagers": [ + "custom.regex" + ], + "matchDatasources": [ + "github-releases" + ], + "semanticCommitType": "feat", + "semanticCommitScope": "deps" + }, { "description": "Use feat(deps): commit prefix for hops-ops Crossplane packages", - "matchManagers": ["custom.regex"], - "matchDatasources": ["github-releases"], + "matchManagers": [ + "custom.regex" + ], + "matchDatasources": [ + "github-releases" + ], "semanticCommitType": "feat", "semanticCommitScope": "deps" }, { "description": "Use feat(deps): commit prefix for other Crossplane packages", - "matchManagers": ["custom.regex"], - "matchDatasources": ["docker"], + "matchManagers": [ + "custom.regex" + ], + "matchDatasources": [ + "docker" + ], "semanticCommitType": "feat", "semanticCommitScope": "deps" } @@ -48,35 +75,75 @@ "customManagers": [ { "customType": "regex", - "description": "hops-ops Crossplane configurations", - "managerFilePatterns": ["upbound.yaml"], + "description": "hops-ops Crossplane configurations (tracked via GitHub Releases)", + "matchStringsStrategy": "recursive", + "managerFilePatterns": [ + "apis/**/configuration.yaml", + "upbound.yaml" + ], "matchStrings": [ - "\\s*(configuration|function|package|provider):\\s*ghcr\\.io/hops-ops/(?.*?)\\s*version:\\s*(\"|')>=(?.*?)(\"|')\\s*" + "\\s*(configuration|function|package|provider):\\s*ghcr\\.io/hops-ops/(?.*?)\\s*version:\\s*(\"|')\\^v?[0-9]+(\"|')\\s*", + "(?\\^v?[0-9]+)" ], "datasourceTemplate": "github-releases", - "packageNameTemplate": "hops-ops/{{depName}}" + "versioningTemplate": "npm", + "packageNameTemplate": "hops-ops/{{depName}}", + "autoReplaceStringTemplate": "^v{{{newMajor}}}" }, { "customType": "regex", - "description": "hops-ops packages in E2E tests", - "managerFilePatterns": ["tests/**/main.k"], + "description": "Crossplane packages from xpkg registries (tracked via Docker tags)", + "matchStringsStrategy": "recursive", + "managerFilePatterns": [ + "apis/**/configuration.yaml", + "upbound.yaml" + ], "matchStrings": [ - "package\\s*=\\s*\"ghcr\\.io/(?hops-ops/[^:]+):v?(?[^\"]+)\"" + "\\s*(configuration|function|package|provider):\\s*(?xpkg\\.[^/]+)\\/(?[^/]+)\\/(?[^/\\s]+)\\s*version:\\s*(\"|')\\^v?[0-9]+(\"|')\\s*", + "(?\\^v?[0-9]+)" ], - "datasourceTemplate": "github-releases", - "packageNameTemplate": "{{depName}}" + "datasourceTemplate": "docker", + "versioningTemplate": "npm", + "registryUrlTemplate": "https://{{registryUrl}}", + "depNameTemplate": "{{orgName}}/{{repoName}}", + "packageNameTemplate": "{{orgName}}/{{repoName}}", + "autoReplaceStringTemplate": "^v{{{newMajor}}}" + }, + { + "customType": "regex", + "description": "Annotated runtime dependencies in schemas, templates, examples, and tests", + "managerFilePatterns": [ + "apis/**/*.yaml", + "examples/**/*.yaml", + "functions/**/*.yaml.gotmpl", + "tests/**/*.k" + ], + "matchStrings": [ + "# renovate: datasource=(?\\S+) depName=(?\\S+)(?: registryUrl=(?\\S+))?\\s+[^\\n]*?(?:default\\s+|:=\\s*|[\"']?(?:version|chartVersion|tag|default)[\"']?\\s*(?:[=:]\\s*|\\s+))[\"']?(?v?[0-9][^\\s\"'}]*)", + "# renovate: datasource=(?\\S+) depName=(?\\S+)(?: registryUrl=(?\\S+))?\\s+[^\\n]*?(?:default\\s*:\\s*|[\"']?image[\"']?\\s*[=:]\\s*)[\"']?[A-Za-z0-9._/-]+:(?v?[A-Za-z0-9][^\\s\"'}]*)", + "# renovate: datasource=(?\\S+) depName=(?\\S+)(?: registryUrl=(?\\S+))?\\s+[^\\n]*?package\\s*=\\s*\"xpkg\\.[^/]+/[^\"]+:(?[^\"]+)\"" + ] }, { "customType": "regex", - "description": "Crossplane packages from other registries", - "managerFilePatterns": ["upbound.yaml"], + "description": "hops-ops packages in E2E tests", + "managerFilePatterns": [ + "tests/**/main.k" + ], "matchStrings": [ - "\\s*(configuration|function|package|provider):\\s*(?[^/]+)\\/(?[^/]+)\\/(?[^/\\s]+)\\s*version:\\s*(\"|')>=(?.*?)(\"|')\\s*" + "package\\s*=\\s*\"ghcr\\.io/(?hops-ops/[^:]+):v?(?[^\"]+)\"" ], - "datasourceTemplate": "docker", - "registryUrlTemplate": "https://{{registryUrl}}", - "depNameTemplate": "{{orgName}}/{{repoName}}", - "packageNameTemplate": "{{orgName}}/{{repoName}}" + "datasourceTemplate": "github-releases", + "packageNameTemplate": "{{depName}}" } + ], + "ignorePaths": [ + "**/node_modules/**", + "**/bower_components/**", + "**/vendor/**", + "**/__tests__/**", + "**/test/**", + "**/__fixtures__/**", + "**/fixtures/**" ] } diff --git a/tests/e2etest-efsstoragestack/main.k b/tests/e2etest-efsstoragestack/main.k index 832955f..4424426 100644 --- a/tests/e2etest-efsstoragestack/main.k +++ b/tests/e2etest-efsstoragestack/main.k @@ -218,6 +218,7 @@ _items = [ containers = [ { name = "writer" + # renovate: datasource=docker depName=library/busybox registryUrl=https://index.docker.io image = "busybox:1.37.0" command = ["sh", "-c", "echo " + _probe + " > /data/probe.txt && sync"] volumeMounts = [ @@ -277,6 +278,7 @@ _items = [ containers = [ { name = "reader" + # renovate: datasource=docker depName=library/busybox registryUrl=https://index.docker.io image = "busybox:1.37.0" command = [ "sh" diff --git a/tests/test-render/main.k b/tests/test-render/main.k index 9cb9404..2f7cdaf 100644 --- a/tests/test-render/main.k +++ b/tests/test-render/main.k @@ -11,6 +11,7 @@ _observed_file_system = { kind = "FileSystem" metadata = { name = "gitkb" + namespace = "default" annotations = {"crossplane.io/composition-resource-name" = "file-system"} } status = { @@ -29,6 +30,7 @@ _observed_security_group = { kind = "SecurityGroup" metadata = { name = "gitkb-mt" + namespace = "default" annotations = {"crossplane.io/composition-resource-name" = "security-group"} } status = { @@ -45,6 +47,7 @@ _observed_pod_identity = { kind = "PodIdentity" metadata = { name = "gitkb-efs-csi" + namespace = "default" annotations = {"crossplane.io/composition-resource-name" = "csi-pod-identity"} } status = { diff --git a/upbound.yaml b/upbound.yaml index aced6de..8a88428 100644 --- a/upbound.yaml +++ b/upbound.yaml @@ -7,27 +7,27 @@ spec: - apiVersion: pkg.crossplane.io/v1 kind: Function package: xpkg.crossplane.io/crossplane-contrib/function-auto-ready - version: '>=v0.6.4' + version: '^v0' - apiVersion: pkg.crossplane.io/v1 kind: Provider package: xpkg.crossplane.io/crossplane-contrib/provider-aws-efs - version: '>=v2.5.0' + version: '^v2' - apiVersion: pkg.crossplane.io/v1 kind: Provider package: xpkg.crossplane.io/crossplane-contrib/provider-aws-ec2 - version: '>=v2.5.0' + version: '^v2' - apiVersion: pkg.crossplane.io/v1 kind: Provider package: xpkg.crossplane.io/crossplane-contrib/provider-aws-eks - version: '>=v2.5.0' + version: '^v2' - apiVersion: pkg.crossplane.io/v1 kind: Provider package: xpkg.crossplane.io/crossplane-contrib/provider-kubernetes - version: '>=v1' + version: '^v1' - apiVersion: pkg.crossplane.io/v1 kind: Configuration package: ghcr.io/hops-ops/aws-pod-identity - version: '>=v0.12.0' + version: '^v0' description: EFS shared file storage, EKS CSI integration, and RWX StorageClasses. license: Apache-2.0 maintainer: Patrick Lee Scott