Show resolved URL in duplicate submission error message when relevant #229
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.
library-registry-submission-parser resolves redirects in the submitted URLs and validates the request for that resolved URL.
One of the validations is checking whether the submitted URL is already in the repositories list. If so, the validation fails and the bot makes a comment on the pull request. In the case where the resolved URL is different from the submitted URL, this failure can be confusing, since the duplicate will not be found in a search for the submitted URL. Previously, the comment from the bot only mentioned the submitted URL.
An example of such a situation can be seen here:
arduino/library-registry#6059 (comment)
The submitted URL
https://github.com/styropyr0/SSD1306
is not present in the repository list, which makes this comment from the bot seem to be incorrect. However, the submitted URL resolved tohttps://github.com/styropyr0/oled.h
, and that URL is present in the list.The communication about the validation failure under these conditions is hereby improved by using a different error message that explains it is the resolved URL that was found in the list, and states that URL.
In the example above, this change will cause the bot to instead comment: