Skip to content

Expose Go API functions for loading library registry data files #57

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 3 commits into from
Jul 15, 2021
Merged

Expose Go API functions for loading library registry data files #57

merged 3 commits into from
Jul 15, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jul 15, 2021

Since they were intended only for use in the "sync_libraries" application, the module's packages were made internal to clearly communicate that they are not part of a public API so that we will not need to be concerned with unintentional impacts on other projects if breaking changes to the internal API are required in the course of development on the code base.

Selected parts of the API may be exposed externally as they are determined to be useful for other projects. Such a case has arisen with the need to validate the library registry data file format:

https://github.com/arduino/library-registry/tree/production/.github/workflows/assets/validate-registry

In order to facilitate the use of this project as a dependency in Go programs via the Go modules system, the module path was renamed from arduino.cc/repository to github.com/arduino/libraries-repository-engine. The previous module path only served as an arbitrary identifier, but did not have the expected support for go get/go install:

$ go get arduino.cc/repository
go get arduino.cc/repository: unrecognized import path "arduino.cc/repository": reading https://arduino.cc/repository?go-get=1: 404 Not Found

Although the module path renaming would generally be considered a breaking change, since the API of the project was previously only considered to be:

  • Configuration file data format
  • Library registry data format
  • Command line interface
  • Library index data format

none of which are affected by this change, I'm not sure that we need to consider the path change breaking at this stage but this PR adds a Go API to the project's supported public interfaces and after it is released we will recognize it as such.

per1234 added 3 commits July 15, 2021 00:26
Access to this function from outside the package is needed for validating the registry data file.
Since they were intended only for use in the "sync_libraries" application, the module's packages were made `internal` to
clearly communicate that they are not part of a public API so that we will not need to be concerned with unintentional
impacts on other projects if breaking changes to the internal API are required in the course of development on the code base.

Select parts of the API may be exposed externally as they are determined to be useful for other projects. Such a case has
arisen with the need to validate the library registry data file format.
The previous module path `arduino.cc/repository` only served as an arbitrary identifier, but did not have the expected support for `go get`/`go install`:

```
$ go get arduino.cc/repository
go get arduino.cc/repository: unrecognized import path "arduino.cc/repository": reading https://arduino.cc/repository?go-get=1: 404 Not Found
```
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jul 15, 2021
@per1234 per1234 requested review from cmaglie and silvanocerza July 15, 2021 11:38
@per1234 per1234 merged commit 710946e into arduino:main Jul 15, 2021
@per1234 per1234 deleted the registry-validation-capabilities branch July 15, 2021 16:06
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants