-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat(json-schema-check): add new action #240
Merged
kenji-miyake
merged 3 commits into
autowarefoundation:main
from
ambroise-arm:json-schema-check
Jun 26, 2023
+45
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# json-schema-check | ||
|
||
## Description | ||
|
||
This action checks if the ROS 2 parameter files (`config/*.param.yaml`) of packages comply with the format of their template JSON Schema file (`schema/*.schema.json`). | ||
|
||
## Usage | ||
|
||
```yaml | ||
jobs: | ||
json-schema-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run json-schema-check | ||
uses: autowarefoundation/autoware-github-actions/json-schema-check@v1 | ||
``` | ||
## Inputs | ||
None. | ||
## Outputs | ||
None. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: json-schema-check | ||
description: "" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install JSON Schema packages | ||
run: | | ||
pip3 install -U check-jsonschema | ||
shell: bash | ||
|
||
- name: Check configuration files | ||
run: | | ||
find -wholename '*/schema/*.schema.json' -execdir bash -c 'check-jsonschema --schemafile "$1" ../config/*.param.yaml' bash '{}' + | ||
shell: bash |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems these behaviors aren't implemented yet.
Is this pull request still under draft or do you plan to implement them in another pull request?
If it's the former, please mark this pull request as a draft.
If it's the latter, creating an issue would be good.
(Or am I misunderstanding something?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The design for the structure has been published here: https://github.com/orgs/autowarefoundation/discussions/3371
It has been implemented as an example for lidar_apollo_segmentation_tvm_nodes. A second one was added recently with autoware_auto_msgs_adapter. The rest is still to be done.
The idea is that in order for people to add those files, it is valuable to have the format checked in CI before they start to create patches. Otherwise we risk having incorrect files in the repositories and it will take time later to fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I misunderstood one thing. The correspondence between
param.yaml
andschema.json
was checked in the command.@ambroise-arm So do you want to merge this as it is?
I mean, it seems that this action succeeds if a package doesn't have any
schema.json
. Is that okay for you?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will update the spelling with ROS 2, otherwise yes.
Should I update .github/workflows/test-composite-actions.yaml and the main README to add this? Or anything else that I missed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not mandatory, but it's preferable if you can test this action.
Ah, yes. It would be nice.
No, looks good! Thank you for your work.
I'll make a new release after merging it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed them, so I'll merge this.