Fix Maven FileUpdater "No files changed!" RuntimeError#14885
Draft
Fix Maven FileUpdater "No files changed!" RuntimeError#14885
Conversation
Contributor
There was a problem hiding this comment.
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!"withDependabot::DependencyFileContentNotChangedand 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
yeikel
reviewed
May 1, 2026
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>
2ba1c80 to
9042467
Compare
Co-authored-by: Yeikel Santana <email@yeikel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
When the
FileUpdatercannot apply changes (e.g., version managed via a BOM or parent POM), it raises a bareRuntimeError: "No files changed!"producing a noisy full stack trace in logs.This replaces it with the existing
DependencyFileContentNotChangederror class, resulting in a clean single-line log entry instead. For example, Apache Camel'sgoogle-auth-library-oauth2-httptriggers 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.DependencyFileContentNotChangedis 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