From 0c2685dbeea286a6ecf32bc3fd47d6202970164f Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 19 Jul 2021 13:01:52 -0700 Subject: [PATCH 1/4] Add duplicate name check to registry data file validator The registry data file must be manually edited when a library name change request is received. Each library must have a unique name, so it's important to verify that no duplicates are introduced through these edits. --- .github/workflows/assets/validate-registry/main.go | 11 ++++++++++- .../assets/validate-registry/tests/test_all.py | 1 + .../tests/testdata/duplicate-name.txt | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/assets/validate-registry/tests/testdata/duplicate-name.txt diff --git a/.github/workflows/assets/validate-registry/main.go b/.github/workflows/assets/validate-registry/main.go index 54410814..52acb177 100644 --- a/.github/workflows/assets/validate-registry/main.go +++ b/.github/workflows/assets/validate-registry/main.go @@ -39,7 +39,16 @@ func main() { } if !reflect.DeepEqual(rawRepos, filteredRepos) { - fmt.Fprintln(os.Stderr, "error: Registry data file contains duplicate entries") + fmt.Fprintln(os.Stderr, "error: Registry data file contains duplicate URLs") os.Exit(1) } + + nameMap := make(map[string]bool) + for _, entry := range rawRepos { + if _, found := nameMap[entry.LibraryName]; found { + fmt.Fprintf(os.Stderr, "error: Registry data file contains duplicates of name %s\n", entry.LibraryName) + os.Exit(1) + } + nameMap[entry.LibraryName] = true + } } diff --git a/.github/workflows/assets/validate-registry/tests/test_all.py b/.github/workflows/assets/validate-registry/tests/test_all.py index 91a1bdec..8b86851a 100644 --- a/.github/workflows/assets/validate-registry/tests/test_all.py +++ b/.github/workflows/assets/validate-registry/tests/test_all.py @@ -31,6 +31,7 @@ test_data_path = pathlib.Path(__file__).resolve().parent.joinpath("testdata") ("invalid-data-format.txt", False), ("invalid-url-format.txt", False), ("duplicate-url.txt", False), + ("duplicate-name.txt", False), ("valid.txt", True), ], ) diff --git a/.github/workflows/assets/validate-registry/tests/testdata/duplicate-name.txt b/.github/workflows/assets/validate-registry/tests/testdata/duplicate-name.txt new file mode 100644 index 00000000..389a0988 --- /dev/null +++ b/.github/workflows/assets/validate-registry/tests/testdata/duplicate-name.txt @@ -0,0 +1,4 @@ +https://github.com/arduino-libraries/Scheduler.git|Arduino|Scheduler +https://github.com/arduino-libraries/SD.git|Partner|SD +https://github.com/arduino-libraries/Servo.git|Recommended|Servo +https://github.com/arduino-libraries/Foo.git|Contributed|SD From a34b8613469f1f840a7ee85e754840b647ef4c93 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 19 Jul 2021 13:08:43 -0700 Subject: [PATCH 2/4] Remove duplicate of "Firmata" This entry is for a fork of the real repo, which is redundant and pointless. Since it causes the data file validation to fail, it must be removed. --- registry.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/registry.txt b/registry.txt index bf2e067a..fcdf05c2 100644 --- a/registry.txt +++ b/registry.txt @@ -7,7 +7,6 @@ https://github.com/arduino-libraries/AudioZero.git|Arduino|AudioZero https://github.com/arduino-libraries/Bridge.git|Arduino|Bridge https://github.com/arduino-libraries/Esplora.git|Arduino|Esplora https://github.com/arduino-libraries/Ethernet.git|Arduino|Ethernet -https://github.com/arduino-libraries/Firmata-Old.git|Arduino|Firmata https://github.com/arduino-libraries/GSM.git|Arduino|GSM https://github.com/arduino-libraries/LiquidCrystal.git|Arduino|LiquidCrystal https://github.com/arduino-libraries/Robot_Control.git|Arduino|Robot Control From f7c97d808b848dad5de85c4418a1b1d663a51a96 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 19 Jul 2021 13:17:55 -0700 Subject: [PATCH 3/4] Remove duplicate of "ROKduino" The other entry is the one in the index. This repository has no tags, so never had a chance of being indexed even if it wasn't a duplicate. --- registry.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/registry.txt b/registry.txt index fcdf05c2..3cf2ffae 100644 --- a/registry.txt +++ b/registry.txt @@ -701,7 +701,6 @@ https://github.com/finson-release/FirmataWithDeviceFeature.git|Contributed|Firma https://github.com/iotpipe/esp8266-arduino-iotpipe.git|Contributed|IoT Pipe https://github.com/olikraus/U8g2_Arduino.git|Contributed|U8g2 https://github.com/abderraouf-adjal/ArduinoSpritzCipher.git|Contributed|SpritzCipher -https://github.com/EscaVic/ROKduino.git|Contributed|ROKduino https://github.com/dxinteractive/ResponsiveAnalogRead.git|Contributed|ResponsiveAnalogRead https://github.com/FaBoPlatform/FaBoBLE-BLE113-Library.git|Contributed|FaBo 301 BLE SiliconLabs From bc5790a267ef01f18eae965a65270157fd82c5a5 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 19 Jul 2021 13:32:02 -0700 Subject: [PATCH 4/4] Update name of "ArcPID" The library somehow made it into the registry under the duplicate name "PID". Fortunately, the name has since been changed to the unique "ArcPID", allowing the two libraries to coexist in the index once the registry entry is updated: https://github.com/ettoreleandrotognoli/ArcPID/blob/0.0.3/library.properties#L1 --- registry.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry.txt b/registry.txt index 3cf2ffae..9223c524 100644 --- a/registry.txt +++ b/registry.txt @@ -1595,7 +1595,7 @@ https://github.com/elhayra/Strober.git|Contributed|Strober https://github.com/elhayra/SandTimer.git|Contributed|SandTimer https://github.com/elhayra/MilliStopper.git|Contributed|MilliStopper https://github.com/mike-matera/FastPID.git|Contributed|FastPID -https://github.com/ettoreleandrotognoli/ArcPID.git|Contributed|PID +https://github.com/ettoreleandrotognoli/ArcPID.git|Contributed|ArcPID https://github.com/nathanRamaNoodles/MusicWithoutDelay-LIbrary.git|Contributed|MusicWithoutDelay https://github.com/eagleSIA/eBoard.git|Contributed|eBoard shackle the Arduino https://github.com/ssilverman/TeensyDMX.git|Contributed|TeensyDMX