feat: record failure reasons in modernization metadata#1708
Open
ap44444 wants to merge 1 commit into
Open
Conversation
54c2b6c to
adb1587
Compare
jonesbusy
reviewed
Apr 18, 2026
| * Reasons why the migration failed, if any. | ||
| * Null when migration succeeded (omitted from JSON). | ||
| */ | ||
| private List<String> failureReasons; |
Collaborator
There was a problem hiding this comment.
I'm not sure a list is enough. Each execution will clear result.
I'm wonder if we need a Map<String, String> instea (recipe/failure)
I need to think more about it
Contributor
Author
There was a problem hiding this comment.
Thank you, I think that would be helpful too, but I chose a list because the current codebase does not have error tracking for each recipe. The error models 'PreconditionError and PluginProcessingException' returns lists of errors for each plugin, but do not specify to which sub-recipe. A map may require changes to how the errors are tracked.
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.
When a plugin migration fails, the tool writes "migrationStatus": "fail" to the modernization metadata JSON but provides no explanation. So 46% of all records in the metadata repository are failures with no descriptive information and maintainers cannot tell whether the failure was due to a precondition (e.g. parent POM 1.x, HTTP repositories) or runtime build error.
This PR adds a failureReasons field to ModernizationMetadata that takes the error messages at the time of failure. Precondition errors (e.g. "Found parent version starting with 1. in pom file preventing modernization") are recorded first, and then any runtime exception messages. This field is not there in JSON entirely when the migration succeeds, so existing successful records will not be affected.
Testing done
Two unit tests added to PluginModernizerTest:
Submitter checklist