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

Command config add for additional URLs does not check presence of URL in board_manager tree #1437

Closed
ubidefeo opened this issue Sep 8, 2021 · 4 comments · Fixed by #1902
Closed
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@ubidefeo
Copy link

ubidefeo commented Sep 8, 2021

Describe the bug
When manually adding an additional url via arduino-cli config add ... the command does not check for existing matching entries in the list, hence generating multiple entries for the same URL

To Reproduce
Steps to reproduce the behavior:

  1. arduino-cli config add board_manager.additional_urls https://my.url/package_mycustom_index.json
  2. arduino-cli config dump
  3. verify that our URL is at the end of the board_manager group of additional_urls
  4. arduino-cli config add board_manager.additional_urls https://my.url/package_mycustom_index.json
  5. arduino-cli config dump
  6. verify that the URL is twice at the end of the board_manager group of additional_urls
  7. arduino-cli config remove board_manager.additional_urls https://my.url/package_mycustom_index.json
  8. remove will remove any istance of said URL

Expected behavior
The command should check for the presence of said URL and not add it if already there

Screenshots
n/a

Desktop (please complete the following information):

  • OS: Mac OS
  • Version: 11.5.2

Additional context
n/a

@per1234
Copy link
Contributor

per1234 commented Sep 8, 2021

Hi @ubidefeo. Shouldn't this issue be in the arduino/arduino-cli repository?

@silvanocerza
Copy link
Contributor

It certainly should. Moving it.

@silvanocerza silvanocerza transferred this issue from arduino/arduino-ide Sep 8, 2021
@ubidefeo
Copy link
Author

@per1234 @silvanocerza
of course it was :D

@fstasi fstasi removed the type: bug label Sep 16, 2021
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
@henrygab
Copy link
Contributor

henrygab commented Oct 2, 2022

Almost a year. I also hit this.

Question: If a PR was presented to fix this, what is the preferred fix?

Option #1. Apply this only to board manager URLs
Option #2. Apply this to any configuration setting that is a list
Option #3. Create a new sub-command for config, such as ensure

Looks like the place to add the logic (for first two options, or replicate for option 3) would be here:

v = append(v, args[1:]...)

@per1234 per1234 added conclusion: resolved Issue was resolved topic: code Related to content of the project itself labels Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants