Skip to content

Fix Maven FileUpdater "No files changed!" RuntimeError#14885

Draft
kbukum1 wants to merge 3 commits intomainfrom
kbukum1/fix-maven-file-updater-no-files-changed-error
Draft

Fix Maven FileUpdater "No files changed!" RuntimeError#14885
kbukum1 wants to merge 3 commits intomainfrom
kbukum1/fix-maven-file-updater-no-files-changed-error

Conversation

@kbukum1
Copy link
Copy Markdown
Contributor

@kbukum1 kbukum1 commented May 1, 2026

What are you trying to accomplish?

When the FileUpdater cannot apply changes (e.g., version managed via a BOM or parent POM), it raises a bare RuntimeError: "No files changed!" producing a noisy full stack trace in logs.

This replaces it with the existing DependencyFileContentNotChanged error class, resulting in a clean single-line log entry instead. For example, Apache Camel's google-auth-library-oauth2-http triggers this when its version is managed by a parent POM property.

Fixes #14848

Anything you want to highlight for special attention from reviewers?

  • requirement_unchanged? extracts an existing check with no business logic change — only adds diagnostic logging.
  • DependencyFileContentNotChanged is already registered in the error handler, so no additional plumbing needed.

How will you know you have accomplished your goal?

All 49 Maven FileUpdater tests pass, plus a new test covering this scenario. Rubocop clean.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

Copilot AI review requested due to automatic review settings May 1, 2026 04:20
@kbukum1 kbukum1 requested a review from a team as a code owner May 1, 2026 04:20
@github-actions github-actions Bot added the L: java:maven Maven packages via Maven label May 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Maven’s FileUpdater to treat “no files changed” as a handled/registered Dependabot error instead of a bare RuntimeError, reducing noisy stack traces when updates can’t be applied due to externally-managed versions (e.g., BOM/parent POM).

Changes:

  • Replace raise "No files changed!" with Dependabot::DependencyFileContentNotChanged and a more descriptive message.
  • Extract the “requirement unchanged” check into requirement_unchanged? and add diagnostic logging for that case.
  • Add an RSpec example covering the “no files changed” scenario.
Show a summary per file
File Description
maven/lib/dependabot/maven/file_updater.rb Raises a registered error when no dependency files change; adds helper + logging for unchanged requirements.
maven/spec/dependabot/maven/file_updater_spec.rb Adds test ensuring DependencyFileContentNotChanged is raised with a descriptive message when no files change.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread maven/lib/dependabot/maven/file_updater.rb Outdated
Comment thread maven/lib/dependabot/maven/file_updater.rb Outdated
@kbukum1 kbukum1 marked this pull request as draft May 1, 2026 04:46
Comment thread maven/lib/dependabot/maven/file_updater.rb Outdated
kbukum1 and others added 2 commits May 5, 2026 12:30
Replace bare RuntimeError with Dependabot::DependencyFileContentNotChanged,
a properly registered error class that the error handling system recognizes.

This prevents noisy stack traces in user-facing logs when the FileUpdater
cannot apply version changes (e.g., when dependency versions are managed
via a BOM import or parent POM not directly editable by Dependabot).

Changes:
- Use DependencyFileContentNotChanged with a descriptive message including
  dependency names and likely cause
- Extract requirement_unchanged? helper with diagnostic logging (no business
  logic change — same check existed before, just adds logging)
- Add test covering the no-files-changed scenario

Fixes #14848

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace T.must(old_req) with explicit nil guard
- Change log level from info to debug to reduce noise
- Handle nil new_req[:file] by falling back to metadata pom_file

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kbukum1 kbukum1 force-pushed the kbukum1/fix-maven-file-updater-no-files-changed-error branch from 2ba1c80 to 9042467 Compare May 5, 2026 17:30
Co-authored-by: Yeikel Santana <email@yeikel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L: java:maven Maven packages via Maven

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error processing XXX(RuntimeError) - file_updater.rb:36:in 'Dependabot::Maven::FileUpdater#updated_dependency_files'

3 participants