// https://docs.renovatebot.com/configuration-options/
// https://www.augmentedmind.de/2023/07/30/renovate-bot-cheat-sheet/
// https://medium.com/@superseb/maintenance-free-renovate-using-github-actions-workflows-d91d32ad854a
// sample: https://github.com/renovatebot/helm-charts/blob/main/renovate.json
{
  $schema: "https://docs.renovatebot.com/renovate-schema.json",
  //TODO create a centralized & shared config for renovate to avoid duplication and reduce maintenance effort on updates
  extends: ["config:recommended"],
  additionalReviewers: ["davidB"],
  baseBranches: ["main"],
  rebaseWhen: "conflicted",
  labels: ["dependencies"],
  prHourlyLimit: 2,
  lockFileMaintenance: { enabled: false },
  ignorePaths: [".github/workflows/release.yml"],
  packageRules: [
    {
      // Do not look at Cargo.lock
      "matchFileNames": ["**/Cargo.toml"],
      "labels": ["cargo"]
    },
    {
      matchUpdateTypes: ["patch", "pin", "digest"],
      enabled: false,
    },
    {
      "matchManagers": ["github-actions"],
      "matchUpdateTypes": ["minor", "patch"],
      "automerge": true,
      // "pinDigests": true,
      "schedule": ["every weekend after 4am"]
    },
    {
      matchPackageNames: ["helm"],
      automerge: true,
      // Force Renovate to not create a PR (but merge its branches directly), to avoid PR-related email spam
      automergeType: "branch",
    },
    {
      matchPackageNames: ["/opentelemetry/"],
      groupName: "opentelemetry",
    },
    {
      matchPackageNames: ["kube", "k8s-openapi"],
      groupName: "kube-rs",
    },
    {
      matchPackageNames: ["/testcontainers/"],
      groupName: "testcontainers",
    },
    {
      matchPackageNames: ["/reqwest/"],
      groupName: "reqwest",
    },
    {
      matchPackageNames: ["hmac", "sha2", "digest"],
      groupName: "crypto",
    },
  ],
}
