Skip to content

Provide package indexes from file paths using "additional-paths" flag #1093

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 7 commits into from
Dec 1, 2020

Conversation

giulcioffi
Copy link
Contributor

@giulcioffi giulcioffi commented Dec 1, 2020

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce?
    It introduces a new flag additional-paths that allows to provide package indexes from absolute file paths. In this case, the signature will not be checked. This can be useful for third party cores, since they will not be requested to upload their package indexes to a server. However it can also be useful for Arduino internal usage during testing phases.
  • What is the current behavior?
    Package indexes can be downloaded only from URL. In case of Arduino cores, the signature is always checked and if a valid signature is not found, the core installation fails. There is no way to test a new Arduino package index that has no signature yet.
  • What is the new behavior?
    Package indexes can be provided also from the absolute file path and the signature will not be checked. An Arduino package index without a signature can be provided in this way.
  • Does this PR introduce a breaking change?
    No, it does not. It introduces a new feature that should not impact on the already implemented ones.
  • Other information:
    This PR will be needed for the Arduino core release automation workflow. Tests on the core with arduino-cli will need to run when there is no signature yet.

See how to contribute

@CLAassistant
Copy link

CLAassistant commented Dec 1, 2020

CLA assistant check
All committers have signed the CLA.

@@ -104,6 +104,7 @@ func createCliCommandTree(cmd *cobra.Command) {
cmd.PersistentFlags().StringVar(&outputFormat, "format", "text", "The output format, can be {text|json}.")
cmd.PersistentFlags().StringVar(&configFile, "config-file", "", "The custom config file (if not specified the default will be used).")
cmd.PersistentFlags().StringSlice("additional-urls", []string{}, "Comma-separated list of additional URLs for the Boards Manager.")
cmd.PersistentFlags().StringSlice("additional-paths", []string{}, "Comma-separated list of additional file paths for the Boards Manager.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add this new key also in cli/config/validate.go, otherwise you won't be able to edit from the CLI.
See #1082

jsonPaths := []string{}
jsonPaths = append(jsonPaths, configuration.Settings.GetStringSlice("board_manager.additional_paths")...)

for _, x := range jsonPaths {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not using jsonPaths anywhere else other than the for, you could do this to simplify:

for _, x := range configuration.Settings.GetStringSlice("board_manager.additional_paths") {

Same thing for the other in createInstance().

Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some small changes to make but overall the PR is good.

Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@giulcioffi giulcioffi merged commit d67fad9 into arduino:master Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants