monorepo-dependabot-config

Crates.iomonorepo-dependabot-config
lib.rsmonorepo-dependabot-config
version0.1.3
sourcesrc
created_at2024-01-12 18:51:34.833089
updated_at2024-05-06 20:15:23.701619
descriptionA tool to generate Dependabot configuration for a monorepo with multiple languages
homepage
repository
max_upload_size
id1097955
size31,711
Matei (mateimicu)

documentation

README

monorepo-dependabot-config

Problem: Dependabot configuration files are hard to maintain in a monorepo. It can't auto discover the different package ecosystems in the monorepo. Solution: A tool that can auto generate dependabot configuration files based on the package ecosystems in the monorepo.

Features

  • Generate dependabot configuration files based on the package ecosystems
  • Detect package ecosystems based on the files in the monorepo
  • Have a configuration file to specify extra rules
  • [~] Have default rules for common package ecosystems

Quick Star

Just run the monorepo-dependabot-config . command in the root of your monorepo. It will generate a dependabot configuration file based on the package ecosystems it finds in the monorepo.

You can also run this in CI to validate no package/project is left behind.

How to install

Install from crates.io

cargo install monorepo-dependabot-config

Build from source

After cloning the repository run:

cargo run

How to Run

  1. Generate a config file for a new repository
monorepo-dependabot-config --enable-default-rules .

Will generate all the possible dependabot rules it can find.

  1. Configure specific rules
monorepo-dependabot-config --extra-configuration-file=extra-config.yml .

where the configuration is

# extra-config.yml
generators:
- detector:
    type: DIRECOTRY_HAS_FILE_FILE_MATCHING
    config:
      regex: ".*.tf"
  generated_block:
    package-ecosystem: terraform
    schedule:
      interval: daily
- detector:
    type: DIRECOTRY_HAS_FILE_FILE_MATCHING
    config:
      regex: ".*.hcl"
  generated_block:
    package-ecosystem: terraform
    schedule:
      interval: daily

Other detectors

We could also have some detectors detectors:

generators:
- detector:
    type: HAS_FILE
    config:
      file_names:
      match_type: ALL | ANY

generators:
- detector:
    type: HAS_FILE_WITH_CONTENT_MATCHING
    config:
      regex: "a-regex"

Alternative usage

The config file could have

generate:
- detector:
  direcotry-has-file-file-matching:
    regex: "aaa"
  generated_block:
    TBD
Commit count: 0

cargo fmt