Skip to content

Support new Arduino CLI JSON output keys #20

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 1 commit into from
Apr 1, 2021
Merged

Support new Arduino CLI JSON output keys #20

merged 1 commit into from
Apr 1, 2021

Conversation

per1234
Copy link
Collaborator

@per1234 per1234 commented Apr 1, 2021

A breaking change was made to the key names of Arduino CLI's JSON output in its 0.18.0 release (arduino/arduino-cli#1223). This action was dependent on some of the keys that changed, which caused it to fail when installing platforms from the local path.

Example:

Running command: /home/runner/bin/arduino-cli core install arduino:samd --log-level warn --verbose 
Installing platform from path: .
Traceback (most recent call last):
  File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 1621, in <module>
    main()  # pragma: no cover
  File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 54, in main
    compile_sketches.compile_sketches()
  File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 196, in compile_sketches
    self.install_platforms()
  File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 309, in install_platforms
    self.install_platforms_from_path(platform_list=platform_list.path)
  File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 491, in install_platforms_from_path
    platform_installation_path = self.get_platform_installation_path(platform=platform)
  File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 530, in get_platform_installation_path
    if installed_platform["ID"] == platform[self.dependency_name_key]:
KeyError: 'ID'
Error: Process completed with exit code 1.

Because the action has a cli-version input that allows it to be used with any Arduino CLI version, it is necessary to support both interface styles. Even though there is not currently extensive use of the interface, it seemed best to set up a translation system to support all usage of the interface rather than just doing a spot fix at the site of the current breakage.

A breaking change was made to the key names of Arduino CLI's JSON output in its 0.18.0 release. This action was dependent
on some of the keys that changed.

Because the action has a `cli-version` input that allows it to be used with any Arduino CLI version, it is necessary to
support both interface styles. Even though there is not currently extensive use of the interface, it seemed best to set
up a translation system to support all usage of the interface rather than just doing a spot fix at the site of the
current breakage.
@per1234 per1234 added priority: high Resolution is a high priority topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Apr 1, 2021
@per1234 per1234 merged commit b8a778e into arduino:main Apr 1, 2021
per1234 referenced this pull request in arduino/ArduinoCore-mbed Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high Resolution is a high priority topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant