Skip to content

Commit

Permalink
Group Dependabot version updates together
Browse files Browse the repository at this point in the history
in order to reduce the number of open pull requests. See
https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups

Needed to update how sanity check scripts work as well.
  • Loading branch information
atodorov committed Sep 13, 2024
1 parent cf801b1 commit 92fec93
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 129 deletions.
14 changes: 4 additions & 10 deletions .github/check-for-missing-Cargo-toml-in-Dependabot-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,17 @@

DEPENDABOT_YAML=".github/dependabot.yml"

CARGO_FILES_IN_DEPENDABOT_YAML=$(grep package-ecosystem -A1 "$DEPENDABOT_YAML" | grep -A1 cargo | grep directory | cut -f2 -d'"' | sort | while IFS= read -r DIR; do echo ".$DIR/Cargo.toml" | tr -s "//"; done)
echo "INFO: Cargo.toml files found in $DEPENDABOT_YAML"
echo "$CARGO_FILES_IN_DEPENDABOT_YAML"
echo "----- END -----"
echo
echo
CARGO_FILES_IN_SOURCE_CODE=$(find ./ -name Cargo.toml | sort)
CARGO_FILES_IN_SOURCE_CODE=$(find ./ -name Cargo.toml | grep -v "./target/" | grep -v "/node_modules/" | sort)
echo "INFO: Cargo.toml files found in source code"
echo "$CARGO_FILES_IN_SOURCE_CODE"
echo "----- END -----"
echo
echo

MISSING_FILES=0
for FILE in $CARGO_FILES_IN_SOURCE_CODE; do
if [[ $CARGO_FILES_IN_DEPENDABOT_YAML = *$FILE* ]]; then
PARENT_DIR=$(dirname "$FILE" | sed "s|^\.|/|" | tr -s "/")
if grep -q "\- \"$PARENT_DIR\"" "$DEPENDABOT_YAML"
then
echo "PASS: $FILE is accounted for in $DEPENDABOT_YAML"
else
echo "FAIL: $FILE is NOT accounted for in $DEPENDABOT_YAML"
Expand Down
12 changes: 3 additions & 9 deletions .github/check-for-missing-package-json-in-Dependabot-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,17 @@

DEPENDABOT_YAML=".github/dependabot.yml"

PACKAGE_JSON_FILES_IN_DEPENDABOT_YAML=$(grep package-ecosystem -A1 "$DEPENDABOT_YAML" | grep -A1 npm | grep directory | cut -f2 -d'"' | sort | while IFS= read -r DIR; do echo ".$DIR/package.json" | tr -s "//"; done)
echo "INFO: package.json files found in $DEPENDABOT_YAML"
echo "$PACKAGE_JSON_FILES_IN_DEPENDABOT_YAML"
echo "----- END -----"
echo
echo
PACKAGE_JSON_FILES_IN_SOURCE_CODE=$(find ./ -name package.json | grep -v node_modules | sort)
echo "INFO: package.json files found in source code"
echo "$PACKAGE_JSON_FILES_IN_SOURCE_CODE"
echo "----- END -----"
echo
echo

MISSING_FILES=0
for FILE in $PACKAGE_JSON_FILES_IN_SOURCE_CODE; do
if [[ $PACKAGE_JSON_FILES_IN_DEPENDABOT_YAML = *$FILE* ]]; then
PARENT_DIR=$(dirname "$FILE" | sed "s|^\.|/|" | tr -s "/")
if grep -q "\- \"$PARENT_DIR\"" "$DEPENDABOT_YAML"
then
echo "PASS: $FILE is accounted for in $DEPENDABOT_YAML"
else
echo "FAIL: $FILE is NOT accounted for in $DEPENDABOT_YAML"
Expand Down
148 changes: 38 additions & 110 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,122 +20,50 @@ updates:
# Maintain dependencies for Rust
# Note: Dependabot can't recursively search directories at the moment
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/node"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/runtime"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/runtime/generate-bags"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/client/evm-tracing"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/client/rpc-core/debug"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/client/rpc-core/trace"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/client/rpc-core/types"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/client/rpc/debug"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/client/rpc/trace"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/node/cli-opt"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/precompiles/substrate-transfer"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/primitives/account"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/primitives/core"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/primitives/ext"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/primitives/rpc/debug"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/primitives/rpc/evm-tracing-events"
schedule:
interval: "monthly"

- package-ecosystem: "cargo"
directory: "/runtime/evm_tracer"
directories:
- "/"
- "/client/evm-tracing"
- "/client/rpc-core/debug"
- "/client/rpc-core/trace"
- "/client/rpc-core/types"
- "/client/rpc/debug"
- "/client/rpc/trace"
- "/node"
- "/node/cli-opt"
- "/precompiles/substrate-transfer"
- "/primitives/account"
- "/primitives/core"
- "/primitives/ext"
- "/primitives/rpc/debug"
- "/primitives/rpc/evm-tracing-events"
- "/runtime"
- "/runtime/evm_tracer"
- "/runtime/generate-bags"
groups:
prod-dependencies:
dependency-type: "production"
applies-to: version-updates
dev-dependencies:
dependency-type: "development"
applies-to: version-updates
schedule:
interval: "monthly"

# Maintain dependencies for Node.js
- package-ecosystem: "npm"
directory: "/testing"
schedule:
interval: "monthly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]

- package-ecosystem: "npm"
directory: "/cli"
schedule:
interval: "monthly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]

- package-ecosystem: "npm"
directory: "/docs/smart-contract-development/with-hardhat"
schedule:
interval: "monthly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
directories:
- "/cli"
- "/docs/smart-contract-development/with-hardhat"
- "/docs/smart-contract-development/with-ethers.js"
- "/testing"
groups:
prod-dependencies:
dependency-type: "production"
applies-to: version-updates
dev-dependencies:
dependency-type: "development"
applies-to: version-updates

- package-ecosystem: "npm"
directory: "/docs/smart-contract-development/with-ethers.js"
schedule:
interval: "monthly"
ignore:
Expand Down

0 comments on commit 92fec93

Please sign in to comment.