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

Schema validation #137

Merged
merged 5 commits into from
Apr 22, 2024
Merged

Schema validation #137

merged 5 commits into from
Apr 22, 2024

Conversation

LunaUrsa
Copy link
Contributor

This adds validations to the actual JSON structure on each pull request, ensuring that we always have a consistent data structure that matches the given schema.

@utaninja @zelixir25 With the new system I've set up, you are a "code owner" for the drugs.json and combos.json files. If any pull requests modify either of those files, one of you will need to approve them before we can merge. This PR does have a small change to drugs.json that I found thanks to this new validation process, and I can bypass the approvals, but let's get into the habit of doing things the right way.

Both of you can ignore changes outside of those files unless you want to learn the FUN and FASCINATING world of JSON file management!!!!

codeowners - Defines who will need to approve the pull request when each of those files are changed. We can add more people eventually.
validate.yml - A github action that will run on every pull request. It basically runs the combosToDrugs.ts script and as long as no changes need to be made (alphabetization, schema validations, updating drugs.json) it will allow the pull request. This helps a ton because otherwise i would need to download the pull request and run the script myself.
settings.json - Added your usernames to the spell check definitions
package.json and package-lock.json - Defines the modules we use to run the scripts, used in every nodejs project
combo_definitions-schema.json, combos-schema.json and drugs-schema.json - These files determine the structure of the corresponding JSON files. They define which properties are valid so that it's very hard to make mistakes when modifying the json

Let me know if there are any questions!

@LunaUrsa LunaUrsa added the meta Meta discussions & more label Apr 11, 2024
@utaninja utaninja merged commit 18a0335 into main Apr 22, 2024
1 check passed
@utaninja utaninja deleted the schema-validation branch April 22, 2024 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Meta discussions & more
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants