1. 03 Jun, 2022 1 commit
  2. 01 Jun, 2022 2 commits
  3. 31 May, 2022 3 commits
  4. 25 May, 2022 1 commit
  5. 24 May, 2022 3 commits
    • Cristian Maglie's avatar
      [breaking] Implementation of sketch profiles (#1713) · 7e9e4cac
      Cristian Maglie authored
      * cosmetic: renamed import
      
      * Simplify function pm.DownloadPlatformRelease
      
      * Implementation of the Profiles parser
      
      * Added methods to get profiles from sketch
      
      * Added gRPC parameters to support profiles
      
      * Added function to load packages for profiles
      
      * Added support for profiles in compile command
      
      * Added progress callback and installMissing flag (stubs) in pm.PrepareLibrariesAndPackageManagersForProfile
      
      * Added auto-install procedures for profiles
      
      * Handle platform not found errors
      
      * Draft implementation of upload with profiles
      
      * Made packagemamager.loadToolsFromPackage public
      
      * Simplified callbacks in commands.Init
      
      * cosmetic: added shortcut variable for library manager
      
      * cosmetic: added shortcut variable for package manager; small readability improvement
      
      * Wiring profiles into arduino-cli and gRPC implementation
      
      * Made gRPC Init return a full Profile structure
      
      Makes it more future-proof in case of further expasion
      
      * (tech debt) Disable profiles if compiling with --libraries/--library
      
      * Fixed some linter warnings
      
      * Apply suggestions from code review
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      
      * Added profiles specification docs
      
      * Allow both sketch.yaml and .yml (with priority for .yaml)
      
      * Correctly handle nil return value
      
      * Apply suggestions from code review
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      
      * Apply suggestions from code review
      
      * Provide `core install` suggestions only when compiling without profiles
      
      * Remove stray comment
      
      * Fixed some comments in protoc files
      
      * Apply suggestions from code review
      
      * Apply suggestions from code review
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      
      * Implemented missing AsYaml methods and added tests
      
      * Apply suggestions from code review
      
      * run of prettier formatter
      
      * Preserve profiles ordering in profiles.yaml
      
      * Apply suggestions from code review
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      7e9e4cac
    • Cristian Maglie's avatar
      Fixed '--libraries' and '--library' flags description in compile command (#1732) · 48dd5c77
      Cristian Maglie authored
      * Fixed '--libraries' and '--library' flags description in compile command.
      
      * Apply suggestions from code review
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      48dd5c77
    • Cristian Maglie's avatar
      Allow downloading index and signature in a single tar.bz2 archive (#1734) · 652bcace
      Cristian Maglie authored
      * Allow downloading index and signature in a tar.bz2 archive
      
      * Make some configurations resilient to empty settings
      
      * Added tests
      
      * fix comment
      
      * Apply suggestions from code review
      Co-authored-by: default avatarUmberto Baldi <34278123+umbynos@users.noreply.github.com>
      
      * Allow .tar.bz2 package index URL
      
      * Fix errors in timeout checks
      
      * Fixed check for stale package_index.json files
      Co-authored-by: default avatarUmberto Baldi <34278123+umbynos@users.noreply.github.com>
      652bcace
  6. 23 May, 2022 1 commit
  7. 20 May, 2022 1 commit
  8. 12 May, 2022 2 commits
  9. 11 May, 2022 2 commits
    • Cristian Maglie's avatar
      Improved gRPC debug logger (#1730) · b6d36c6d
      Cristian Maglie authored
      Since many gRPC calls may happen together, to better understand what's
      happening now:
      
      - each call is identified by a sequence number (even if they are
        interleaved)
      - when a non-streaming calls ends a "CALL END" log is printed
      b6d36c6d
    • George White's avatar
      Use real names for libs in upgrade commands (#1725) · ca8c48a7
      George White authored
      The real name for a lib (the name stored in the library.properties)
      is required to find a library in the index. The installed name, which
      matches the diretory name, is not valid for looking up libraries in
      the index.
      
      Libraries that do not have a library.properties file, or where the
      name value in that file does not match the value in library_index.json,
      cannot be upgrade by the CLI.
      
      Also Fix tests for outdated libs
      
      The tests for update and outdated changed the library.properties
      file for an installed lib, but also wiped out the name field.
      Since we rely on that field to determine the library name when
      using the RealName property, the test's change was causing a failure
      outside the scope of the test itself.
      ca8c48a7
  10. 10 May, 2022 1 commit
    • per1234's avatar
      [skip changelog] Use form-based issue templates (#1729) · 554c49d3
      per1234 authored
      High quality feedback via GitHub issues is a very valuable contribution to the project. It is important to make the
      issue creation and management process as efficient as possible for the contributors, maintainers, and developers.
      
      Issue templates are helpful to the maintainers and developers because it establishes a standardized framework for the
      issues and encourages the contributors to provide the essential information.
      
      The contributor is now presented with a web form when creating an issue. This consists of multi-line input fields that
      have the same formatting, preview, and attachment capabilities as the standard GitHub Issue composer, in addition to
      menus and checkboxes where appropriate.
      
      The use of this form-based system should provide a much better experience for the contributors and also result in higher
      quality issues by establishing a standardized framework for the issues and encouraging contributors to provide the
      essential information.
      
      A template chooser allows the contributor to select the appropriate template type, redirects support requests to the
      appropriate communication channels via "Contact Links", and provides a prominent link to security policy to guide any
      vulnerability disclosures.
      
      The clear separation of the types of issues encourages the reporter to fit their report into a specific issue category,
      resulting in more clarity. Automatic labeling according to template choice allows the reporter to do the initial
      classification.
      554c49d3
  11. 05 May, 2022 2 commits
  12. 04 May, 2022 1 commit
  13. 03 May, 2022 1 commit
  14. 02 May, 2022 2 commits
  15. 28 Apr, 2022 1 commit
    • Mattia Pennasilico's avatar
      [skip-changelog] Secure boot docs update (#1716) · 7f2e750d
      Mattia Pennasilico authored
      * Fix typo
      
      * Rename custom keys filename to make more clear that private key is used to sign and public key is used for encryption
      
      * Update Security setting postbuild.cmd path
      
      * Update Security setting keychain path
      
      * Update Security setting default keys filename
      7f2e750d
  16. 15 Apr, 2022 2 commits
    • Cristian Maglie's avatar
      [skip-changelog] Some small refactorings (#1711) · 8375a6d7
      Cristian Maglie authored
      * Updated relaxed-semver library to v0.9.0
      
      * Fixed errors translations
      
      * Make architecture explicit in loadPlatform
      
      * Extracted subrotuine loadToolReleaseFromDirectory
      
      * Added cores.InstallPlatformInDirectory(..) helper function
      
      * legacy: allow using a preconfigured library manager in build
      8375a6d7
    • per1234's avatar
      [skip changelog] Detect unused dependency license metadata files (#1712) · 4a626a09
      per1234 authored
      The "Check Go Dependencies" GitHub Actions workflow checks for dependencies with incompatible or unapproved license
      types.
      
      The dependency license metadata consumed by the "Licensed" tool is cached in the project repository, in a dedicated file
      for each dependency.
      
      The `check-cache` job of the workflow checks whether that cache is in sync with the project's current dependencies. It
      does this by using the "Licensed" tool to update the cache and then a `git diff` command to check whether that resulted
      in any changes (which would indicate it is out of sync).
      
      Out of sync states could result from any of three distinct conditions:
      
      - Missing metadata file
      - Incorrect metadata file contents
      - Superfluous metadata file
      
      An incorrectly configured `git diff` command previously caused the last of these to be missed.
      
      My first take at this system was simply using `git diff --exit-code` alone. That detects the last two, but misses the
      first. I added the `git add --intent-to-add .` command to detect added files, but didn't realize that it caused the last
      to be missed.
      
      Superfluous files in the dependency license metadata cache won't actually interfere with its intended functionality, but
      it is still important to avoid an accumulation of unused files.
      
      The new commands will catch all three of the possible out of sync conditions by staging all changes that result from
      the metadata cache update to the repository and then comparing those against the `HEAD` commit.
      
      I considered an alternative approach which works just as well as the chosen one:
      
      ```
      git add .
      git diff --exit-code HEAD
      ```
      
      However, I feel that the `--cached` flag makes the `git diff` command more self-explanatory.
      4a626a09
  17. 14 Apr, 2022 1 commit
  18. 13 Apr, 2022 1 commit
    • Cristian Maglie's avatar
      [skip-changelog] [breaking] Refactoring of download subroutines (#1697) · eabf6934
      Cristian Maglie authored
      * Moved downloaders subroutines in 'resources' package
      
      * Moved function to the correct file
      
      * Merge Download subroutine for resources
      
      * Factored all download subroutines
      
      * Allow passing nil Config in resource.Download method
      
      * Moved some package in their appropriate place.
      
      httpclient is now under arduino/httpclient.
      Some configuration values have been moved under 'configuration' package,
      and the related subroutines have been refactored.
      
      * Created IndexResource and factored out all download utilities
      
      * Fix regression in unit-tests
      
      * Adjusted integration tests
      
      * Fixed linter problems
      
      * Moved DownloadFile from 'resources' package into 'httpclient'
      
      * Factored all progress reports callback definitions in the rpc package
      
      * Updated UPGRADING.md
      
      * Applied suggestions from code review
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      
      * Fixed typos
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      eabf6934
  19. 11 Apr, 2022 4 commits
  20. 06 Apr, 2022 1 commit
  21. 04 Apr, 2022 1 commit
  22. 01 Apr, 2022 2 commits
    • per1234's avatar
      [skip changelog] Remove unused GitHub release download stats workflow (#1702) · 0364ce35
      per1234 authored
      The "github-stats" GitHub Actions workflow periodically gathers GitHub release asset download statistics for Arduino CLI
      and pushes the results to Datadog.
      
      There are no known problems with this workflow. However, the companion "arduino-stats" workflow that did the same for
      the downloads of Arduino CLI from downloads.arduino.cc was broken and thus removed from the repository.
      
      The GitHub stats are not very valuable on their own as they only provide an unknown fraction of the total downloads of
      Arduino CLI. They have also not ended up being used. Since it doesn't provide any value and represents a maintenance
      burden, it is hereby removed from the repository.
      0364ce35
    • per1234's avatar
      [skip changelog] Remove broken download stats workflow (#1701) · 7bfa5fb9
      per1234 authored
      The "arduino-stats" GitHub Actions workflow was designed to periodically gather download statistics from Arduino CDN and
      push results to Datadog.
      
      The recorded stats showed a periodic decrease in total download count. Since this is patently impossible, it is clear
      that something was wrong with the system and that the recorded data was not usable. An investigation into the problem
      was never done.
      
      On 2022-03-14, the runs of the "arduino-stats" GitHub Actions workflow began to fail. Because there had not been any
      relevant change in the repository between the last successful run and the first failing run, it seems that some external
      change caused the breakage. Since the workflow was not ever working successfully and the lack of an investigation about
      that indicates that the stats are not of immediate importance, the best course of action is to simply remove the broken
      infrastructure from the repository rather than investing time into fixing something that isn't being used anyway.
      7bfa5fb9
  23. 28 Mar, 2022 1 commit
    • Cristian Maglie's avatar
      [skip-changelog] Some static-check fixes (#1700) · 38ebf641
      Cristian Maglie authored
      * Fixed some staticcheck warnings
      
      commands/core/search_test.go:24:2: package "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" is being imported more than once (ST1019)
              commands/core/search_test.go:25:2: other import of "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
      i18n/cmd/po/parser.go:34:2: should check returned error before deferring file.Close() (SA5001)
      i18n/cmd/po/parser.go:105:48: cutset contains duplicate characters (SA1024)
      
      * Fixed some staticcheck warnings
      
      arduino/libraries/librariesindex/json.go:33:38: unknown JSON option "required" (SA5008)
      arduino/libraries/librariesindex/json.go:34:38: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:39:37: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:40:37: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:44:37: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:45:37: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:51:51: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:53:51: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:57:51: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:58:51: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:59:51: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:69:34: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:70:34: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:71:34: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:88:36: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:89:36: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:90:36: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:95:30: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:96:30: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:97:30: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:98:30: unknown JSON option "required" (SA5008)
      arduino/cores/packageindex/index.go:99:30: unknown JSON option "required" (SA5008)
      arduino/cores/tools.go:30:35: unknown JSON option "required" (SA5008)
      arduino/cores/tools.go:37:36: unknown JSON option "required" (SA5008)
      arduino/cores/tools.go:45:18: unknown JSON option "required" (SA5008)
      arduino/sketch/sketch.go:51:14: unknown JSON option "required" (SA5008)
      arduino/sketch/sketch.go:53:14: unknown JSON option "omitepty" (SA5008)
      cli/lib/search.go:103:16: unknown JSON option "required" (SA5008)
      cli/lib/search.go:107:24: unknown JSON option "required" (SA5008)
      cli/lib/search.go:183:9: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
      
      * Fixed some staticcheck warnings
      
      arduino/builder/sketch.go:165:5: should use !bytes.Equal(existingBytes, source) instead (S1004)
      arduino/builder/sketch_test.go:133:2: this value of err is never used (SA4006)
      arduino/cores/board.go:125:3: the surrounding loop is unconditionally terminated (SA4004)
      arduino/cores/packagemanager/package_manager.go:432:4: should replace loop with platforms = append(platforms, platform.GetAllInstalled()...) (S1011)
      arduino/cores/status.go:191:28: func ToolDependency.extractTool is unused (U1000)
      arduino/cores/status.go:203:28: func ToolDependency.extractRelease is unused (U1000)
      arduino/libraries/librariesindex/json.go:141:9: empty branch (SA9003)
      
      * Fixed some staticcheck warnings
      
      arduino/monitors/null.go:48:14: should use time.Since instead of time.Now().Sub (S1012)
      arduino/resources/checksums.go:79:5: should use !bytes.Equal(algo.Sum(nil), digest) instead (S1004)
      arduino/resources/checksums.go:155:6: func createPackageFile is unused (U1000)
      arduino/resources/helpers.go:65:12: this condition occurs multiple times in this if/else if chain (SA4014)
      arduino/resources/helpers_test.go:40:24: unnecessary use of fmt.Sprintf (S1039)
      cli/feedback/feedback.go:187:12: should use String() instead of fmt.Sprintf (S1025)
      cli/globals/globals.go:31:2: var tr is unused (U1000)
      cli/lib/args.go:89:6: should use strings.EqualFold instead (SA6005)
      commands/daemon/monitor.go:176:6: this value of slots is never used (SA4006)
      38ebf641
  24. 24 Mar, 2022 1 commit
    • Umberto Baldi's avatar
      Add secure boot support for compile command. (#1686) · b86e5cf7
      Umberto Baldi authored
      * add flags to allow the override of the keys used to sign and encrypt a binary for the boards that support the secure boot
      
      * add integration test for ReplaceSecurityKeys() function
      
      * fix regression introduced: target platform could be nil so using before checking is not a good idea
      
      * apply suggestions from code review
      
      * rename of some flags (done to accommodate the proposed changes in platform.txt)
      
      * change approach: override keys using `builderCtx.CustomBuildProperties`
      
      * add check in the builder regarding the usage of "build.keys.type" properties
      
      * add secure boot to the platform specifications
      
      * Apply suggestions from code review
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      
      * modify the check on in the builder regarding the usage of "build.keys" properties:
      The "build.keys.type" is no longer mandatory, and the default is "public_keys"
      We also check if the secureboot keys are all defined or none of them is.
      
      * remove check on the flags specifying the keys, it's the tool responsibility to check if they are valid
      
      * move content to a guides section
      
      * add specifications regarding `build.keys` properties
      
      * Apply suggestions from code review
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      
      * add link to external resource to provide a quick explanation of the reason for an Arduino boards platform developer to add a "secure boot" capability
      
      * change `tools.imgtool.build.pattern` to `tools.imgtool.flags`
      
      The property had the same form as the special `tools.TOOL_NAME.ACTION.pattern` properties
      However, there is not a `build` action, the form of the property gives the impression that it is one that has special treatment by the build system.
      
      It looks like the convention is `*.flags`
      
      * add small section explaining why is recommended to use these prop names
      
      * Apply suggestions from code review
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      
      * Correct error message
      
      * Apply suggestions from code review
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      b86e5cf7
  25. 23 Mar, 2022 1 commit
  26. 22 Mar, 2022 1 commit
    • per1234's avatar
      [skip changelog] Disable internal anchor checks by link checker tool (#1692) · f470f407
      per1234 authored
      Validation of links to internal anchors was recently added to the markdown-link-check tool used to check for broken
      links in this project's documentation.
      
      Although a much needed feature, unfortunately it does not currently support anchors created by HTML anchor tags.
      
      For example, this is valid and common Markdown:
      
      [click here](#some-anchor)
      <a name="some-anchor"></a>
      
      but will fail the check:
      
      ERROR: 1 dead links found!
      [x] #some-anchor -> Status: 404
      
      This type of link markup is used by the protoc-gen-doc tool that generates the gRPC interface documentation, which
      causes a spurious failure of the link check.
      
      The solution is to configure markdown-link-check to skip these links (which was the behavior anyway with versions 3.8.7
      and older). That will be reverted whenever the tool is able to correctly validate internal anchor links.
      f470f407