commit | 87111bb7060b9501fd902a717c0988b748169e4a | [log] [tgz] |
---|---|---|
author | Manojkiran Eda <manojkiran.eda@gmail.com> | Sat Aug 14 11:26:16 2021 +0530 |
committer | Andrew Geissler <geissonator@yahoo.com> | Wed Oct 20 17:54:56 2021 +0000 |
tree | 415e35ada4d23d8b094905618a9c693625572124 | |
parent | 01534ec4d019507387b497a4fa2c35bbee32db83 [diff] |
JSON validation support in CI Most of the openbmc repositories depend on JSON configuration files, which are consumed by the respective daemons at runtime. It's a good value add to catch the JSON validation errors early in the repository CI itself. By default, the CI would be picking config/eslint-global-config as the default configuration to run the JSON validation. The default configuration can be overridden by the presence of the .eslintrc.json file from the repository for which the CI is running against. Repositories cannot completely opt-out of the JSON validation, but they choose to skip whatever files/folders they want using the .eslintignore configuration file or, they can also write the rules in .eslintrc.json config file to turn errors into warnings. This commit brings in eslint & eslint-plugin-json which does only the "json validation". Visit the below link(s) for more details & various error's/warnings that this plugin would report: https://www.npmjs.com/package/eslint-plugin-json https://github.com/azeemba/eslint-plugin-json I have tested all the repos under openbmc with the eslint-global-config and only two repos are breaking due to this change, they are already fixed(please check the topic: "json-validation" for more details) Testing Example : 1. Make a json bad by purposefully removing a comma Running the json validator on the repo using it's config > /home/manojeda/ci_test_area/pldm/configurations/fru_master.json 19:26 error Expected comma json/* ✖ 1 problem (1 error, 0 warnings) 2. if the json is good, the validation proceeds fruther without any issues. Change-Id: I2c2c14b18bb626b1a5ab5d818b92d5ba370e1639 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Build script for CI jobs in Jenkins.