1. 29 Sep, 2021 1 commit
  2. 27 Sep, 2021 3 commits
    • per1234's avatar
      [skip changelog] Temporarily full pin Python in all GitHub Actions workflows (#1478) · 4708cde8
      per1234 authored
      A bug introduced in the 3.9.7 release of Python causes a spurious failure of the
      `test\test_lib.py::test_install_git_invalid_library` integration test:
      https://bugs.python.org/issue45121
      
      As a workaround, the last working version of Python must be used: 3.9.6. In order to ensure this is done when running the
      integration tests locally, this version is specified in the Poetry configuration. Even though only the integration tests
      require this version limitation, the Poetry configuration change affects all processes that use Poetry. Since only the
      integration test workflow was adjusted accordingly, the other workflows using Poetry continued to explicitely install
      a version of Python that did not fulfill the version constraints specified in the Poetry configuration. It seems it was
      possible for Poetry to find a compatible version on the runner:
      
      > The currently activated Python version 3.9.7 is not supported by the project (>=3.8, <3.9.7).
      > Trying to find and use a compatible version.
      > Using python3.8 (3.8.10)
      
      but this additional output caused a failure of the "Deploy Website" workflow due to expecting only valid JSON as the
      output from the siteversion.py script:
      
      ```
      Error: The template is not valid. Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: T. Path '', line 0, position 0.
      ```
      
      Even though the other workflows were able to continue to work with the discovered Python 3.8.10, it seems safest avoid
      reliance on whatever Python the runner happens to have installed and instead explicitly install the Python version we
      want to be used. So the full pin of Python is done in all workflows that use Poetry.
      
      Since it is convenient to get automatic updates for Python patch releases, this full pin should be reverted back to the
      "3.9" minor version pin once a new version of Python is released with the bug fixed and added to versions available for
      installation via the `actions/setup-python` GitHub Actions action.
      4708cde8
    • Silvano Cerza's avatar
    • Silvano Cerza's avatar
  3. 24 Sep, 2021 5 commits
  4. 23 Sep, 2021 5 commits
  5. 22 Sep, 2021 2 commits
  6. 17 Sep, 2021 1 commit
  7. 15 Sep, 2021 1 commit
  8. 13 Sep, 2021 3 commits
  9. 10 Sep, 2021 2 commits
  10. 07 Sep, 2021 2 commits
    • Cristian Maglie's avatar
      [skip-changelog] Removed unnecessary `fmt.*printf` before `tr(...)` / Fixed... · 7415e269
      Cristian Maglie authored
      [skip-changelog] Removed unnecessary `fmt.*printf` before `tr(...)` / Fixed i18n early static initialization problem (#1425)
      
      * Removed unnecessary fmt.*printf
      
      * removed unused variable
      
      * Fixed i18n early static initialization problem
      
      https://github.com/arduino/arduino-cli/pull/1425#discussion_r701014277
      
      these particular strings are not correctly handled by the i18n package because
      they are declared at package level before the call to i18n.Init(), and so are
      just returned as-is.
      
      * Fix lint errors and use error.Is instead of direct comparison
      
      * Revert "guard" in Tr function
      
      otherwise the unit-tests will fail:
      
      === RUN   TestBoardOptions
      --- FAIL: TestBoardOptions (0.00s)
      panic: i18n.Tr called before i18n.Init() [recovered]
      	panic: i18n.Tr called before i18n.Init()
      
      goroutine 9 [running]:
      testing.tRunner.func1.2(0xc56e00, 0xeaee20)
      	/opt/hostedtoolcache/go/1.16.7/x64/src/testing/testing.go:1143 +0x332
      testing.tRunner.func1(0xc0002a2f00)
      	/opt/hostedtoolcache/go/1.16.7/x64/src/testing/testing.go:1146 +0x4b6
      panic(0xc56e00, 0xeaee20)
      	/opt/hostedtoolcache/go/1.16.7/x64/src/runtime/panic.go:965 +0x1b9
      github.com/arduino/arduino-cli/i18n.Tr(0xdceacd, 0x28, 0x0, 0x0, 0x0, 0x0, 0x1)
      	/home/runner/work/arduino-cli/arduino-cli/i18n/i18n.go:54 +0xd9
      github.com/arduino/arduino-cli/arduino/cores.(*Board).GetBuildProperties(0x13bf060, 0xc0003b6150, 0xc000339400, 0x0, 0x0)
      	/home/runner/work/arduino-cli/arduino-cli/arduino/cores/board.go:109 +0x69d
      github.com/arduino/arduino-cli/arduino/cores.(*Board).GeneratePropertiesForConfiguration(0x13bf060, 0xdb5f54, 0xe, 0xc000309ef0, 0xc911e0, 0xc0003b6000)
      	/home/runner/work/arduino-cli/arduino-cli/arduino/cores/board.go:141 +0x28f
      github.com/arduino/arduino-cli/arduino/cores.TestBoardOptions(0xc0002a2f00)
      	/home/runner/work/arduino-cli/arduino-cli/arduino/cores/board_test.go:298 +0x4bd
      testing.tRunner(0xc0002a2f00, 0xe052a8)
      	/opt/hostedtoolcache/go/1.16.7/x64/src/testing/testing.go:1193 +0xef
      created by testing.(*T).Run
      	/opt/hostedtoolcache/go/1.16.7/x64/src/testing/testing.go:1238 +0x2b3
      FAIL	github.com/arduino/arduino-cli/arduino/cores	0.021s
      === RUN   TestIndexParsing
      --- FAIL: TestIndexParsing (0.00s)
      panic: i18n.Tr called before i18n.Init() [recovered]
      	panic: i18n.Tr called before i18n.Init()
      
      * Apply suggestions from code review
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      7415e269
    • Silvano Cerza's avatar
      [skip changelog] Fix Windows integration tests (#1432) · 15e24526
      Silvano Cerza authored
      * [skip changelog] Fix Windows integration tests
      
      * Update test/test_sketch.py
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      15e24526
  11. 03 Sep, 2021 2 commits
  12. 02 Sep, 2021 4 commits
  13. 01 Sep, 2021 2 commits
  14. 31 Aug, 2021 4 commits
  15. 30 Aug, 2021 2 commits
    • Silvano Cerza's avatar
      Enhance handling of colored output (#1418) · ff4eb92a
      Silvano Cerza authored
      ff4eb92a
    • Cristian Maglie's avatar
      [skip-changleog] Better gRPC error handling (#1251) · 75b9760c
      Cristian Maglie authored
      * Proper gRPC error handling
      
      * Update gRPC API of board command to return status.Status instead of error
      
      * Update gRPC API of remaining commands to return status.Status instead of error
      
      * Replace custom error with protobuf message
      
      Previously, a custom error was returned when attempting to upgrade a platform that was already at the latest available
      version. There is dedicated code for handling this specific error.
      
      Now that the function has been changed to return a status.Status instead of error, the previous check for the return
      being this error is no longer possible. The capability is restored by replacing the error with a protocol buffer message.
      
      * Handle details of any type in `core.PlatformUpgrade()` status
      
      The status details of the function are used to identify the specific cause of a non-nil status. This is done via a type
      assertion. Previously, this type assertion was configured such that a details of any type other than the expected would
      result in a panic. At the moment, that will not occur because we only add details of one type. However, the whole point
      of the type assertion is to support details of multiple types, and if other types are added a panic will not be the
      appropriate behavior.
      
      A better approach is to check the result of the type assertion, handling the non-nil status as a generic error if its
      details are of a different type.
      
      * Return nil on program action if an error occurred
      
      * Refactoring 'upload' commands
      
      * Refactoring 'board' commands
      
      * Refactoring 'compile' commands
      
      * Refactoring 'core' commands
      
      * Refactoring 'debug' commands
      
      * Refactoring 'lib' commands
      
      * Refactoring 'sketch' commands
      
      * Refactoring 'commands' commands
      
      * updated tests and fixed some error wording
      
      * fixed go lint warnings
      
      * Apply suggestions from code review
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      
      * Apply changes from code review
      Co-authored-by: default avatarSilvano Cerza <3314350+silvanocerza@users.noreply.github.com>
      
      * fix i18n
      Co-authored-by: default avatarper1234 <accounts@perglass.com>
      Co-authored-by: default avatarSilvano Cerza <3314350+silvanocerza@users.noreply.github.com>
      75b9760c
  16. 27 Aug, 2021 1 commit