Skip to content

security: add dependabot config for automated dependency updates#169

Open
charantejguniganti wants to merge 1 commit into
PSMRI:mainfrom
charantejguniganti:security/add-dependabot-config
Open

security: add dependabot config for automated dependency updates#169
charantejguniganti wants to merge 1 commit into
PSMRI:mainfrom
charantejguniganti:security/add-dependabot-config

Conversation

@charantejguniganti
Copy link
Copy Markdown

@charantejguniganti charantejguniganti commented May 16, 2026

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

  • Chores
    • Configured automated dependency updates across npm, Maven, and GitHub Actions ecosystems with weekly scheduling.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

📝 Walkthrough

Walkthrough

This 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 main branch, with ecosystem-specific labels and limits on concurrent update requests.

Changes

Dependabot Configuration

Layer / File(s) Summary
Dependabot ecosystem configuration
.github/dependabot.yml
Configures automated dependency updates for npm (root), Maven (root), and GitHub Actions (root) with weekly schedules, PR limits, grouped minor/patch updates, and ecosystem-specific labels.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Hop, skip, and a package update!
Dependencies fresh, the schedule is set,
Weekly they'll spring with labels so neat,
Npm, Maven, and Actions complete!
No stale packages here, just automation's beat. 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'security: add dependabot config for automated dependency updates' accurately summarizes the main change, which is adding a Dependabot configuration file for automated dependency management.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/dependabot.yml (1)

3-62: ⚡ Quick win

Consider adding reviewers and assignees for better PR workflow.

The configuration is functional, but you might want to enhance it with:

  1. Auto-assign reviewers: Automatically assign team members to review dependency updates
  2. Commit message customization: Add prefixes to make automated commits easier to identify
  3. 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

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 34c25979-5bc3-42df-914c-9fcab93f0de4

📥 Commits

Reviewing files that changed from the base of the PR and between 4f3a2f6 and 16282fd.

📒 Files selected for processing (1)
  • .github/dependabot.yml

Comment thread .github/dependabot.yml
Comment on lines +6 to +22
- 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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 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"
fi

Repository: PSMRI/AMRIT

Length of output: 144


🏁 Script executed:

cat -n .github/dependabot.yml

Repository: 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 build

Repository: 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.

Comment thread .github/dependabot.yml
Comment on lines +26 to +42
- 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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 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
fi

Repository: 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:

  1. Remove this Maven entry if this is not a Maven-based project
  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant