Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show resolved URL in duplicate submission error message when relevant #229

Merged
merged 1 commit into from
Mar 16, 2025

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Mar 16, 2025

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)

A problem was found with your submission https://github.com/styropyr0/SSD1306

ERROR: Submission URL is already in the Library Manager index.

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 to https://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:

A problem was found with your submission https://github.com/styropyr0/SSD1306

ERROR: Resolved URL https://github.com/styropyr0/oled.h.git is already in the Library Manager index.

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.

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.
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Mar 16, 2025
@per1234 per1234 self-assigned this Mar 16, 2025
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 24.68%. Comparing base (4252282) to head (bbe9570).
Report is 90 commits behind head on main.

Files with missing lines Patch % Lines
main.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #229      +/-   ##
==========================================
- Coverage   29.15%   24.68%   -4.47%     
==========================================
  Files           1        1              
  Lines         271      320      +49     
==========================================
  Hits           79       79              
- Misses        188      237      +49     
  Partials        4        4              
Flag Coverage Δ
unit 24.68% <0.00%> (-4.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@per1234 per1234 merged commit 346378a into arduino:main Mar 16, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants