Skip to content

Add schema-based rules for pluggable monitor dependencies data of package index #293

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
Nov 17, 2021
Merged

Add schema-based rules for pluggable monitor dependencies data of package index #293

merged 3 commits into from
Nov 17, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Nov 11, 2021

These are the JSON schema-based rules to check the packages[].platforms[].monitorDependencies[]-level data of Arduino Package Index projects.

Support for a new optional `packages[*].platforms[*].monitorDependencies` field in the Arduino package index format has
been added to Arduino CLI. Since the package index JSON schema does not allow additional properties in
`packages[*].platforms[*]`, package indexes using this new property would previously fail validation against the schema.
There was an inefficient approach to populating the project data for package index components, where the slices were
iterated over redundantly for each of the components they contained. At first perhaps a reasonable tradeoff for the sake
of consistency and readability, the redundancy has became more significant over time as new components are added. With
the pending addition of yet another for pluggable monitor support, it seems best to refactor now.
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Nov 11, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2021

Codecov Report

Merging #293 (8b48129) into main (cf9c369) will increase coverage by 0.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #293      +/-   ##
==========================================
+ Coverage   89.79%   89.95%   +0.15%     
==========================================
  Files          44       44              
  Lines        6626     6728     +102     
==========================================
+ Hits         5950     6052     +102     
  Misses        553      553              
  Partials      123      123              
Flag Coverage Δ
unit 89.95% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ternal/rule/ruleconfiguration/ruleconfiguration.go 100.00% <ø> (ø)
internal/rule/schema/schemadata/bindata.go 49.67% <ø> (ø)
internal/project/projectdata/packageindex.go 100.00% <100.00%> (ø)
internal/rule/rulefunction/packageindex.go 98.27% <100.00%> (+0.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf9c369...8b48129. Read the comment docs.

Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small typos need to be fixed but the rest looks great. 👍

These are the JSON schema-based rules to check the `packages[].platforms[].monitorDependencies[]`-level data of the
Arduino Package Index.
@per1234 per1234 requested a review from silvanocerza November 12, 2021 16:26
@per1234 per1234 merged commit e75b3de into arduino:main Nov 17, 2021
@per1234 per1234 deleted the monitordependencies branch November 17, 2021 15:44
@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