1
0
mirror of https://github.com/arduino/library-registry.git synced 2025-07-23 17:21:01 +03:00
Commit Graph

39 Commits

Author SHA1 Message Date
2c7a15f702 Bump liskin/gh-problem-matcher-wrap from 1 to 2
Bumps [liskin/gh-problem-matcher-wrap](https://github.com/liskin/gh-problem-matcher-wrap) from 1 to 2.
- [Release notes](https://github.com/liskin/gh-problem-matcher-wrap/releases)
- [Commits](https://github.com/liskin/gh-problem-matcher-wrap/compare/v1...v2)

---
updated-dependencies:
- dependency-name: liskin/gh-problem-matcher-wrap
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 01:45:18 +00:00
557a84d7c9 Bump carlosperate/download-file-action from 1 to 2
Bumps [carlosperate/download-file-action](https://github.com/carlosperate/download-file-action) from 1 to 2.
- [Release notes](https://github.com/carlosperate/download-file-action/releases)
- [Commits](https://github.com/carlosperate/download-file-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: carlosperate/download-file-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 01:19:48 +00:00
6dbc452029 Bump github.com/arduino/libraries-repository-engine
Bumps [github.com/arduino/libraries-repository-engine](https://github.com/arduino/libraries-repository-engine) from 1.1.2 to 1.1.3.
- [Release notes](https://github.com/arduino/libraries-repository-engine/releases)
- [Commits](https://github.com/arduino/libraries-repository-engine/compare/v1.1.2...v1.1.3)

---
updated-dependencies:
- dependency-name: github.com/arduino/libraries-repository-engine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 15:20:07 +00:00
2dbd3a41bd Use non-version specific reference URLs for tool version workflow variables
GitHub Actions actions are used by the workflows to set up development tools in the runner workspace.

In order to facilitate updates to new versions of these tools, we set the version to be set up via environment variables
at the top of the workflow.

Since this variable definition is separate from the step using the action, it might not be immediately apparent to the
maintainer which version syntaxes are supported. For this reason, comments were added with the URL to the relevant
section of the consuming action's documentation. Previously, these URLs were made to point to the version of the
documentation that matched the version of the action in use by the workflow. Since we only use a major version ref, the
expectation was that this would only need to be updated rarely. However, it turned out that the major version bump cycle
is significantly shorter than expected. In addition, it is easy to forget the update because action version update PRs
are provided by Dependabot, which obviously won't update the URLs in the comments.

So it will be best to use a URL that points to the documentation at the tip of the default branch of the action
repository. The likelihood of the documentation provided by this URL not matching the behavior of the release version of
the action in use is likely less than it is for an outdated URL.
2022-06-14 09:31:54 -07:00
4e90dca441 Bump actions/setup-python from 3 to 4
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-09 01:17:16 +00:00
554a76a590 Run "Check Go Dependencies" workflow on release branch creation
The trunk-based development strategy is used by some tooling projects. Their release branches may contain a subset of
the history of the default branch.

The status of the GitHub Actions workflows should be evaluated before making a release. However, this is not so simple
as checking the status of the commit at the tip of the branch in the project using that strategy. The reason is that,
for the sake of efficiency, the workflow is configured to run only when the processes are relevant to the trigger event
(e.g., no need to run it for a change to the readme).

In the case of the default branch, you can simply set the workflow runs filter to that branch and then check the result
of the latest run of each workflow of interest. However, that was not possible to do with the release branch since it
might be that the workflow was never run in that branch. The status of the latest run of the workflow in the default
branch might not match the status for the release branch if the release branch does not contain the full history.

For this reason, it will be helpful to trigger the workflow on the creation of a release branch. This will ensure that
the workflow will always have at least one run in the release branch. Subsequent commits pushed to the branch can run
based on their usual trigger filters and the status of the latest run of the workflow in the branch will provide an
accurate indication of the state of that branch.

Branches are created for purposes other than releases, most notably feature branches to stage work for a pull request.
Because the collection of workflows in a Tooling project are often very comprehensive, it would not be convenient or
efficient to run them on the creation of every feature branch.

Unfortunately, GitHub Actions does not support filters on the `create` event of branch creation like it does for the
`push` and `pull_request` events. There is support for a `branches` filter of the `push` event, but that filter is an AND
to the `paths` filter and this application requires an OR. For this reason, the workflows must be triggered by the
creation of any branch. The unwanted job runs are prevented by adding a `run-determination` job with the branch filter
handled by Bash commands. The other jobs of the workflow use this `run-determination` job as a dependency, only running
when it indicates they should via a job output. Because this minimal `run-determination` job runs very quickly, it is
roughly equivalent to the workflow having been skipped entirely for non-release branch creations. This approach has been
in use for some time already in other workflows.
2022-05-02 22:41:08 -07:00
91cf1f803a Add schedule trigger to "Check Go Dependencies" workflow
The workflow is configured to run whenever any relevant file in the repository is changed. However, the results of the
workflow run are also dependent on the external environment it runs in, which include:

- The software running on the GitHub hosted GitHub Actions runner machines
- The GitHub Actions actions used by the workflow
- The dependencies that are installed by the workflow directly or via the GitHub Actions actions it uses

The workflow does not fully pin to a specific version of external tools. This was done in the interest of reducing the
maintenance burden of keeping the systems up to date. However, it also means that a new release of one of those tools
can cause the workflow runs to start failing (which might happen through an enhancement to that resource resolving a
false negative, or a defect causing a false negative).

When the repository file path trigger is used by itself, this sort of external breakage is only revealed when an
unrelated change triggers the workflow. That can be distracting even to a dedicated member of the project development
team, as well as confusing and discouraging to any contributor.

This type of change can be caught by adding a `schedule` event trigger that causes the workflow to run periodically in
addition to the other on-demand triggers. This allows the problem to be identified and resolved at the maintainer's
convenience, separate from the unrelated development work.
2022-05-02 22:40:50 -07:00
492cd278fe Detect unused dependency license metadata files
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.
2022-05-02 22:40:37 -07:00
331ed91e9a Update reference URLs in "Check Go Dependencies" workflow
- Use correct `actions/setup-go` reference for version in use
- Update redirecting GitHub docs URL to new location
- Configure GitHub docs URL to allow localization where available
2022-05-02 22:40:23 -07:00
e0f349f257 Merge pull request #1288 from arduino/dependabot/github_actions/production/actions/setup-go-3
Bump actions/setup-go from 2 to 3
2022-04-11 03:54:58 -07:00
60b9ccf5f7 Bump actions/upload-artifact from 2 to 3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-11 01:30:29 +00:00
526972e926 Bump actions/setup-go from 2 to 3
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-11 01:30:24 +00:00
112543673c Bump github.com/arduino/libraries-repository-engine to v1.1.2
At the time the dependency on `github.com/arduino/libraries-repository-engine` was added to the project, there was not a
release version available with the correct "v"-prefixed tag name, so it was necessary to use a "pseudo-version" instead.

A new release of `github.com/arduino/libraries-repository-engine` has now been made with the standard tag format
required by the Go module system. This offers the opportunity for more effective management of the dependency through
automated update offers generated by Dependabot.

Keeping this dependency updated is especially important because the latest release of
`github.com/arduino/libraries-repository-engine` is always used by the backend process, and the registry validator must
match its requirements.
2022-03-21 07:56:06 -07:00
01af260957 Update to using Go 1.17 for registry validator tool
1.17 is now the preferred Go version for Arduino tooling projects.
2022-03-12 07:16:41 -08:00
aca1103945 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 01:20:52 +00:00
fe2ac0a12c Bump actions/setup-python from 2 to 3
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 3.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 01:38:50 +00:00
07baa4cea9 Use major version ref of carlosperate/download-file-action
The `carlosperate/download-file-action` action is used by GitHub Actions workflows as a convenient way to download
external resources.

A major version ref has been added to that repository. It will always point to the latest release of the "1" major
version series. This means it is no longer necessary to do a full pin of the action version in use as before.

Use of the major version ref will cause the workflow to use a stable version of the action, while also benefiting from
ongoing development to the action up until such time as a new major release of an action is made. At that time we would
need to evaluate whether any changes to the workflow are required by the breaking change that triggered the major
release before manually updating the major ref (e.g., uses: `carlosperate/download-file-action@v2`). I think this
approach strikes the right balance between stability and maintainability for these workflows.
2021-12-19 20:10:50 -08:00
3b10690471 Add CI workflow to check for unapproved Go dependency licenses
A task and GitHub Actions workflow are provided here for checking the license types of Go project dependencies.

On every push and pull request that affects relevant files, the CI workflow will check:

- If the dependency licenses cache is up to date
- If any of the project's dependencies have an unapproved license type.

Approval can be based on:

- Universally allowed license type
- Individual dependency
2021-10-12 18:06:53 -07:00
b8abf347d4 License the registry validation tool as AGPL 3.0 (or later)
I neglected to document the licensing of the tool used to validate the registry file. This is now remedied and the
"Check License" workflow has been configured to also verify its license file is machine readable as AGPL 3.0.
2021-10-11 17:37:10 -07:00
b3f5b32428 Merge pull request #358 from per1234/extendable-check-go
Make "Check Go" workflow module path support extendable
2021-08-13 01:26:46 -07:00
a6634af0c7 Make "Check Go" workflow module path support extendable
Since it is not a primary component of the project, I puth the registry validator Go module in a subfolder of the
repository. The standardized Arduino tooling project "assets" at that time were designed for the more common project
structure of the module in the repository root. This meant some small modifications to the assets were required in order
to make them applicable to this repository's structure.

Since that time, the standardized assets have been improved so they can support arbitrary Go module locations, as is
needed here. A different approach was taken in order to also support any number of modules. Although this particular
repository is not likely to gain multiple modules, that is needed by other projects, and so it is a better approach in
general.
2021-08-12 19:03:58 -07:00
afd37f5924 Fix formatting of license header comment text
It looks like the formatting of the license header comments in Python files was corrupted at some point by the file being
formatted as a different language (likely Go).
2021-08-12 17:05:33 -07:00
74dd4052ee Use workflow variables for tool versions in "Check YAML" workflow
Placement of this information at the top of the file, where it is easy to find and edit, facilitates updates to the
workflows as the tool version used for project development are bumped periodically.
2021-08-12 16:46:13 -07:00
3cfbbcff7d Use standardized step name in "Test Integration" workflow
These are the naming conventions established in the standardized template workflow.

The application's name is "Task", with "taskfile" being its configuration file. So the previous "Install Taskfile" step
name was inaccurate.
2021-08-12 16:46:13 -07:00
be8b1a06f4 Use Go 1.16 for registry validator
1.16 is now the preferred Go version for all Arduino tooling projects.

The update from Go 1.14 to 1.16 broke the task that runs golint. The good news is that the new `go install` command
eliminates the need for the workaround of running the `go get golang.org/x/lint/golint` command from outside the project
path.

The bad news is the `go list` command used to get the path of the golint installation does not work in the "module-aware
mode" that is now the default. In the end, I gave up on making the task work as before. I think it's better to require
the user to install golint and put the installation in the system `PATH`, displaying a helpful message when this has not
been done.
2021-08-11 04:16:38 -07:00
fd85f873f3 Add library type check to registry data file validator
There was previously no validation of this field.
2021-07-23 14:12:14 -07:00
0c2685dbee Add duplicate name check to registry data file validator
The registry data file must be manually edited when a library name change request is received. Each library must have a
unique name, so it's important to verify that no duplicates are introduced through these edits.
2021-07-20 02:01:25 -07:00
fff8959316 Merge pull request #202 from per1234/validate-registry-path-filter
Add data file to "Check Registry Data File" workflow's paths filter
2021-07-18 23:56:35 -07:00
c315bd903d Add data file to "Check Registry Data File" workflow's path filter
GitHub Actions workflows can be configured to run only when files under specific paths are modified. This makes the CI
system more efficient by avoiding pointless workflow runs. The path filter must be carefully configured to cover all
relevant files. In this case, the file that is the whole point of the workflow's existence was missing from the list!
2021-07-16 02:45:50 -07:00
a9de0f781e Add CI workflow to check the license file
Whenever one of the recognized license file names are modified in the repository, the workflow runs to check whether the
license can be recognized and whether it is of the expected type.

GitHub has a useful automated license detection system that determines the license type used by a repository, and
surfaces that information in the repository home page, the search web interface, and the GitHub API. This license
detection system requires that the license be defined by a dedicated file with one of several standardized filenames and
paths.

GitHub's license detection system uses the popular licensee tool, so this file also serves to define the license type
for any other usages of licensee, as well as to human readers of the file.

For this reason, and to ensure it remains a valid legal instrument, it's important that there be no non-standard
modifications to the license file or collisions with other supported licence files. This workflow ensures that any
changes which would change the license type or which license file is used by the detection are caught automatically.
2021-07-16 01:53:46 -07:00
92cd60a753 Add CI workflow to lint YAML files
On every push and pull request that affects relevant files, run yamllint to check the YAML files of
the repository for issues.

The .yamllint.yml file is used to configure yamllint:
https://yamllint.readthedocs.io/en/stable/configuration.html
2021-07-15 09:38:58 -07:00
39bf4cdceb Add CI workflow to validate GitHub Actions workflows
On every push or pull request that affects the repository's GitHub Actions workflows, and periodically, validate them
against the JSON schema.
2021-07-15 09:38:58 -07:00
03a76407e5 Add CI workflow to validate Taskfiles
On every push or pull request that affects the repository's Taskfiles, and periodically, validate them
against the JSON schema.
2021-07-15 09:38:58 -07:00
94d4c58230 Add CI workflow to check for Prettier formatting compliance
On every push and pull request that affects relevant files, check whether the formatting of supported
files is compliant with the Prettier style.
2021-07-15 09:38:58 -07:00
93f71bd038 Add CI workflow to lint and check formatting of Go code
On every push and pull request that affects relevant files, check the Go module for:

- Common detectable errors in the code.
- Use of outdated APIs
- Code style violations
- Code formatting inconsistency
- Misconfiguration
2021-07-15 09:38:58 -07:00
71ea0c6d07 Add CI workflow to lint and check formatting of Python files
On every push and pull request that affects relevant files, run flake8 to check the Python files of
the repository for issues and black to check formatting.

The .flake8 file is used to configure flake8:
https://flake8.pycqa.org/en/latest/user/configuration.html
2021-07-15 09:38:58 -07:00
bd36fe6325 Add registry validator integration tests
On every push and pull request that affects relevant files, run the integration tests of the registry data file validator.
2021-07-15 09:38:58 -07:00
f7c07a67cf Validate library registry data file format
On every push or pull request that modifies a relevant file, validate the data structure of registry.txt.
2021-07-15 09:32:50 -07:00
900b25859f Add CI workflow to check general file formatting
On every push, pull request, and periodically, check whether the repository's files are formatted according to
.editorconfig.
2021-07-14 17:16:29 -07:00