Skip to content

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

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

Merged
merged 1 commit into from
Mar 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,12 @@ func populateSubmission(submissionURL string, listPath *paths.Path, accessList [

normalizedListURLObject := normalizeURL(listURLObject)
if normalizedListURLObject.String() == normalizedURLObject.String() {
submission.Error = "Submission URL is already in the Library Manager index."
normalizedSubmissionURLObject := normalizeURL(submissionURLObject)
if normalizedURLObject.String() == normalizedSubmissionURLObject.String() {
submission.Error = "Submission URL is already in the Library Manager index."
} else {
submission.Error = fmt.Sprintf("Resolved URL %s is already in the Library Manager index.", normalizedURLObject.String())
}
return submission, "", true
}
}
Expand Down
21 changes: 21 additions & 0 deletions tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,27 @@
"",
"http://downloads.arduino.cc/libraries/logs/github.com/arduino-libraries/Servo/",
),
(
"resolved-already-in-library-manager",
"FooUser",
"",
"submission",
"",
[
{
"submissionURL": "https://github.com/arduino-org/WiFi_for_UNOWiFi_rev1",
"normalizedURL": "https://github.com/arduino-libraries/WiFi_for_UNOWiFi_rev1.git",
"repositoryName": "WiFi_for_UNOWiFi_rev1",
"name": "",
"official": False,
"tag": "",
"error": "Resolved URL https://github.com/arduino-libraries/WiFi_for_UNOWiFi_rev1.git is already in"
" the Library Manager index.",
}
],
"",
"http://downloads.arduino.cc/libraries/logs/github.com/arduino-libraries/WiFi_for_UNOWiFi_rev1/",
),
(
"type-arduino",
"FooUser",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
8 changes: 8 additions & 0 deletions tests/testdata/resolved-already-in-library-manager/diff.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
diff --git a/repositories.txt b/repositories.txt
index c080a7a..1194257 100644
--- a/repositories.txt
+++ b/repositories.txt
@@ -1,2 +1,3 @@
+https://github.com/arduino-org/WiFi_for_UNOWiFi_rev1
https://github.com/arduino-libraries/WiFi_for_UNOWiFi_rev1
https://github.com/arduino-libraries/Stepper
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/arduino-libraries/WiFi_for_UNOWiFi_rev1
https://github.com/arduino-libraries/Stepper