Improve error messages for provide conflicts#4608
Open
Phantomical wants to merge 7 commits into
Open
Conversation
Coverage Report for CI Build 25575170102Coverage decreased (-0.09%) to 87.502%Details
Uncovered Changes
Coverage Regressions9 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
Author
|
Okay, this should be good to go now. Changes:
In practice none of the stuff stored in |
8d2964f to
b8c3371
Compare
Author
|
I think this covers all the possible error cases now:
It still special cases provides conflicts a little bit because I think having the context that "this error is happening through a provides relationship" is useful, but other than that the pathways are pretty much the same. |
d65890f to
b56b511
Compare
Currently, if you try to install a mod that provides X, but there is
some other mod already installed that also provides X, then you get an
error message that looks like
Unsatisfied dependency Y needed for: ...
This tells the users nothing about what is wrong or how to fix it. This
commit is an attempt to improve the error message here.
This commit changes:
* Instead of just getting a dependency chain,
DependenciesNotSatisfiedKraken now takes a list of
UnsatisfiedRelation. These also optionally store a reason that the
relation could not be satisfied, which can then be used for better
error messages.
* ResolvedRelationshipsTree.Candidates now explicitly checks for
provides conflicts and records unresolved relations accordingly.
* In cases where there are no candidates and no unresolved relations
then we redo the lookup without filtering in order to find modules
that could have satisfied the relation, under different conditions.
* DependenciesNotSatisfiedKraken now takes the ProviderRejection into
account when coming up with the error message.
I have also added some test cases that validate that the correct error
message is emitted.
We don't really want to store these fields where in the relationship tree, by instead capturing them in the relationship itself we can keep the tree clean, while still having the context we need later on.
b56b511 to
1ba4ce9
Compare
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.
Currently, if you try to install a mod that provides X, but there is some other mod already installed that also provides X, then you get an error message that looks like
This tells the users nothing about what is wrong or how to fix it. This commit is an attempt to improve the error message here. The new error message is now
This commit changes:
I have also added some test cases that validate that the correct error message is emitted under a number of different conditions.
I'm not sure that this necessarily the right approach. It feels like I am pulling stuff into
ResolvedRelationshipTreethat isn't really supposed to be there. On the other hand the "if error then re-resolve to get unsatisfied candidates" bit does actually feel right to me, so I'm not sure what the correct balance is here.