Skip to content
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

Adds JSON Schema for Fixit configs. #188

Merged
merged 13 commits into from
May 27, 2021
Merged

Conversation

lisroach
Copy link
Contributor

Summary

In the long run adding a JSON Schema will give us the ability to configure which keys of inheritable configs should be overridden vs merged. See my full explanation on #183, happy to discuss the long term plan there as well.

Adding this today is a step towards inheritable configs, as well as it removes the need for the code doing type checking on the configs. We can configure it to be more specific if we want as well (like what keys are required vs optional, that sort of thing).

Test Plan

Added some unit tests.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 27, 2021
fixit/cli/add_new_rule.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Apr 27, 2021

Codecov Report

Merging #188 (0bff6fc) into master (b078404) will increase coverage by 0.09%.
The diff coverage is 93.93%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #188      +/-   ##
==========================================
+ Coverage   85.93%   86.03%   +0.09%     
==========================================
  Files          90       91       +1     
  Lines        3691     3702      +11     
==========================================
+ Hits         3172     3185      +13     
+ Misses        519      517       -2     
Impacted Files Coverage Δ
fixit/common/config.py 91.04% <85.71%> (+1.71%) ⬆️
fixit/common/tests/test_config.py 100.00% <100.00%> (ø)

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 b078404...0bff6fc. Read the comment docs.

Copy link
Contributor

@jimmylai jimmylai left a comment

Choose a reason for hiding this comment

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

It's great that the config validation is simpler now. The changes is not ready and has the following errors.

There is an error on loading the schema file in CI builds: https://github.com/Instagram/Fixit/pull/188/checks?check_run_id=2453268372
Type error: https://github.com/Instagram/Fixit/runs/2453268393

fixit/common/config.py Show resolved Hide resolved
fixit/common/config.py Outdated Show resolved Hide resolved
MANIFEST.in Outdated Show resolved Hide resolved
fixit/common/config.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jimmylai jimmylai left a comment

Choose a reason for hiding this comment

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

LGTM. Found one thing can be improved in the test case.

fixit/common/tests/test_config.py Outdated Show resolved Hide resolved
@lisroach
Copy link
Contributor Author

Type errors are unrelated to this diff, I will create a new PR to fix those.

@lisroach
Copy link
Contributor Author

Pyre PR: #196

@lisroach lisroach merged commit cb1d589 into Instagram:master May 27, 2021
@lisroach lisroach deleted the json_schema branch May 27, 2021 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants