security: add dependabot config for automated dependency updates#169
security: add dependabot config for automated dependency updates#169charantejguniganti wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThis PR adds Dependabot configuration to automate dependency updates across the repository. The setup enables weekly pull requests for npm, Maven, and GitHub Actions dependencies targeting the ChangesDependabot Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/dependabot.yml (1)
3-62: ⚡ Quick winConsider adding reviewers and assignees for better PR workflow.
The configuration is functional, but you might want to enhance it with:
- Auto-assign reviewers: Automatically assign team members to review dependency updates
- Commit message customization: Add prefixes to make automated commits easier to identify
- Ignore specific dependencies: Pin dependencies you don't want updated
📋 Example enhancements
- package-ecosystem: "npm" directory: "/" schedule: interval: "weekly" day: "monday" target-branch: "main" open-pull-requests-limit: 10 + reviewers: + - "team-lead-username" + - "security-team" + assignees: + - "maintainer-username" + commit-message: + prefix: "npm" + include: "scope" groups: npm-minor-and-patch: patterns: - "*" update-types: - "minor" - "patch" labels: - "dependencies" - "javascript"You can apply similar enhancements to the Maven and GitHub Actions configurations. See Dependabot documentation for all available options.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/dependabot.yml around lines 3 - 62, Update the Dependabot entries for package-ecosystem "npm", "maven" and "github-actions" (and their groups npm-minor-and-patch, maven-minor-and-patch, actions-minor-and-patch) to include reviewer and assignee defaults, a commit-message configuration (e.g., prefix like "[deps] {{package-name}}") and an ignore section for any pinned dependencies; specifically add reviewers: and assignees: arrays under each package-ecosystem block, add a commit-message: format string to control PR titles/commits, and add ignore: entries listing dependency-name and versions to pin; apply the same pattern to all three package-ecosystem blocks so Dependabot auto-assigns reviewers, produces consistent commit messages, and skips specified dependencies.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/dependabot.yml:
- Around line 26-42: The Dependabot entry for package-ecosystem: "maven" (the
block containing package-ecosystem: "maven", directory: "/", and group
maven-minor-and-patch) is invalid because there are no Maven project files;
either remove that entire Maven block from .github/dependabot.yml or add a root
Maven project (at minimum a root pom.xml) and place any Maven modules under the
configured directory so Dependabot can detect them; if you choose removal,
delete the package-ecosystem: "maven" block and its associated groups/labels,
otherwise add a valid pom.xml at the repository root and ensure directory: "/"
correctly points to your Maven project.
- Around line 6-22: The dependabot config contains a non-functional npm entry
(the block starting with package-ecosystem: "npm" and its
directory/schedule/target-branch/groups/labels settings) which should be removed
from this central repo; either delete that entire npm block from the
.github/dependabot.yml or move an equivalent dependabot config into each
frontend repo (Inventory-UI, MMU-UI, TM-UI, HWC-UI, etc.) so each UI has its own
package-ecosystem: "npm" configuration and monitors its own package.json files.
---
Nitpick comments:
In @.github/dependabot.yml:
- Around line 3-62: Update the Dependabot entries for package-ecosystem "npm",
"maven" and "github-actions" (and their groups npm-minor-and-patch,
maven-minor-and-patch, actions-minor-and-patch) to include reviewer and assignee
defaults, a commit-message configuration (e.g., prefix like "[deps]
{{package-name}}") and an ignore section for any pinned dependencies;
specifically add reviewers: and assignees: arrays under each package-ecosystem
block, add a commit-message: format string to control PR titles/commits, and add
ignore: entries listing dependency-name and versions to pin; apply the same
pattern to all three package-ecosystem blocks so Dependabot auto-assigns
reviewers, produces consistent commit messages, and skips specified
dependencies.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| - package-ecosystem: "npm" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| target-branch: "main" | ||
| open-pull-requests-limit: 10 | ||
| groups: | ||
| npm-minor-and-patch: | ||
| patterns: | ||
| - "*" | ||
| update-types: | ||
| - "minor" | ||
| - "patch" | ||
| labels: | ||
| - "dependencies" | ||
| - "javascript" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify npm package.json locations in the repository
# Check for package.json at root
if [ -f "package.json" ]; then
echo "✓ Found package.json at root"
else
echo "✗ No package.json at root - npm configuration will not work"
fi
# Find all package.json files to identify monorepo structure
echo -e "\nAll package.json locations:"
fd -t f '^package\.json$' -x echo " {}"
# Count subdirectory package.json files (excluding node_modules)
subdir_count=$(fd -t f '^package\.json$' -E node_modules -E dist -E build | grep -v '^package.json$' | wc -l)
if [ "$subdir_count" -gt 0 ]; then
echo -e "\n⚠ Found $subdir_count package.json file(s) in subdirectories"
echo "Consider adding separate Dependabot entries for each subdirectory"
fiRepository: PSMRI/AMRIT
Length of output: 144
🏁 Script executed:
cat -n .github/dependabot.ymlRepository: PSMRI/AMRIT
Length of output: 2007
🏁 Script executed:
head -50 README.md 2>/dev/null || echo "No README found at root"Repository: PSMRI/AMRIT
Length of output: 4861
🏁 Script executed:
# Check what package ecosystems exist in the repo
fd -e 'package-lock.json|yarn.lock|Gemfile|pom.xml|requirements.txt|go.sum|pubspec.yaml|Cargo.lock' --type f -E node_modules -E dist -E buildRepository: PSMRI/AMRIT
Length of output: 37
Remove the non-functional npm configuration or relocate it to individual UI repositories.
This central hub repository contains no package.json files, making the npm Dependabot configuration (lines 6-22) non-functional. The comment states it "Covers all Angular / React frontend UI repositories," but those repositories (Inventory-UI, MMU-UI, TM-UI, HWC-UI, etc.) are separate GitHub repositories listed in the README, not subdirectories of this repo.
Each frontend repository should have its own .github/dependabot.yml configured to monitor npm dependencies. Remove the npm entry from this central hub repository unless you plan to move the actual frontend code here.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/dependabot.yml around lines 6 - 22, The dependabot config contains a
non-functional npm entry (the block starting with package-ecosystem: "npm" and
its directory/schedule/target-branch/groups/labels settings) which should be
removed from this central repo; either delete that entire npm block from the
.github/dependabot.yml or move an equivalent dependabot config into each
frontend repo (Inventory-UI, MMU-UI, TM-UI, HWC-UI, etc.) so each UI has its own
package-ecosystem: "npm" configuration and monitors its own package.json files.
| - package-ecosystem: "maven" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| target-branch: "main" | ||
| open-pull-requests-limit: 10 | ||
| groups: | ||
| maven-minor-and-patch: | ||
| patterns: | ||
| - "*" | ||
| update-types: | ||
| - "minor" | ||
| - "patch" | ||
| labels: | ||
| - "dependencies" | ||
| - "java" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify Maven pom.xml locations in the repository
# Check for pom.xml at root
if [ -f "pom.xml" ]; then
echo "✓ Found pom.xml at root"
# Check if it's a parent POM with modules
if grep -q "<modules>" pom.xml; then
echo " → Root pom.xml appears to be a parent POM with modules"
echo " → Dependabot should automatically detect child modules"
fi
else
echo "✗ No pom.xml at root - Maven configuration will not work"
fi
# Find all pom.xml files
echo -e "\nAll pom.xml locations:"
fd -t f '^pom\.xml$' -x echo " {}"
# Check for standalone Maven projects in subdirectories
subdir_poms=$(fd -t f '^pom\.xml$' -E target | grep -v '^pom.xml$')
if [ -n "$subdir_poms" ]; then
standalone_count=0
echo -e "$subdir_poms" | while read -r pom; do
parent_ref=$(grep -c "<parent>" "$pom" || true)
if [ "$parent_ref" -eq 0 ]; then
echo "⚠ Standalone pom.xml (no parent): $pom"
((standalone_count++)) || true
fi
done
fiRepository: PSMRI/AMRIT
Length of output: 136
Remove the Maven ecosystem configuration or add Maven project files.
The Maven configuration in this Dependabot entry will not function: there is no pom.xml file at the repository root, and no Maven projects were found anywhere in the repository. Either:
- Remove this Maven entry if this is not a Maven-based project
- Add Maven project files (at least a root
pom.xml) if Maven dependencies should be monitored
The current configuration monitors the root directory ("/") for Maven dependencies that do not exist, making this configuration ineffective.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/dependabot.yml around lines 26 - 42, The Dependabot entry for
package-ecosystem: "maven" (the block containing package-ecosystem: "maven",
directory: "/", and group maven-minor-and-patch) is invalid because there are no
Maven project files; either remove that entire Maven block from
.github/dependabot.yml or add a root Maven project (at minimum a root pom.xml)
and place any Maven modules under the configured directory so Dependabot can
detect them; if you choose removal, delete the package-ecosystem: "maven" block
and its associated groups/labels, otherwise add a valid pom.xml at the
repository root and ensure directory: "/" correctly points to your Maven
project.
AMRIT's security policy recommends keeping dependencies updated, but there's no automated mechanism to do this. This adds a Dependabot config to automatically open PRs for outdated npm, Maven, and GitHub Actions dependencies on a weekly schedule. Minor and patch updates are grouped to reduce noise, with a limit of 10 open PRs for npm/Maven and 5 for Actions.
Summary by CodeRabbit