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

Implement JSON validation for all-contributors data #3619

Merged
merged 23 commits into from
Jun 7, 2024

Conversation

gandrewgabriel
Copy link
Contributor

Summary

Partially addresses #3549

The script checks for two kinds of problems in the all-contributors JSON: firstly, is the file parsable JSON (to catch problems caused by, for example, missing commas); and secondly, do the contents of the file match the schema required by all-contributors.

The schema I've added only checks the content of the "contributors" property. The other metadata in the JSON file is not validated against a schema, but errors in JSON syntax will be detected anywhere in the file.

I don't know enough about how the CI works, so I haven't made any changes there. When this validation script is ready for action, maybe someone else can add it to the CI pipeline.

What should a reviewer concentrate their feedback on?

  • Everything looks ok?
  • Scripts are suitable for CI use?

Acknowledging contributors

The following people should be added to the table of contributors in the README file: @gandrewgabriel

Copy link

welcome bot commented Apr 17, 2024

Thank You Banner
💖 Thanks for opening this pull request! 💖 The Turing Way community really appreciates your time and effort to contribute to the project. Please make sure you have read our Contributing Guidelines and filled in our pull request template to the best of your ability.
If you are submitting a new chapter, here are some things that will help get your pull request across the finish line! 🏁

  • Check you have removed all lorem ipsums from the chapter template (if you used it)
  • Check for any abbreviations or latin phrases (such as "e.g." or "i.e.") in your writing. See our style guide for more information on this topic.
  • Make sure you have added your new chapter to the Table of Contents

    We have Continuous Integration tests that check the writing style and will help you track down any slip-ups ♻ The Netlify bot will also comment with a preview of the book with your additions so you can see how it will look once it's merged! 🎉

    We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. If we don't acknowledge this pull request after 7 days, feel free to chat to us about it in our Slack workspace.

Copy link

netlify bot commented Apr 17, 2024

Deploy Preview for the-turing-way ready!

Name Link
🔨 Latest commit 8f32576
🔍 Latest deploy log https://app.netlify.com/sites/the-turing-way/deploys/66630c4c6edbc30008398d59
😎 Deploy Preview https://deploy-preview-3619--the-turing-way.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@JimMadge JimMadge requested a review from a team April 17, 2024 14:35
@aleesteele
Copy link
Member

Welcome @gandrewgabriel! Thanks for tagging the @the-turing-way/infrastructure-working-group, @JimMadge to get this reviewed and checked!

@JimMadge
Copy link
Member

Thanks @gandrewgabriel ! 🎉

I don't know enough about how the CI works, so I haven't made any changes there. When this validation script is ready for action, maybe someone else can add it to the CI pipeline.

Is that something you would like to learn? It might be possible for someone from the @the-turing-way/infrastructure-working-group to mentor or co-work with you on that.

@JimMadge JimMadge added the infrastructure For all issues related to book infrastructure label Apr 18, 2024
Copy link
Member

@sgibson91 sgibson91 left a comment

Choose a reason for hiding this comment

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

This looks good enough to me. I have a couple of nitpicks about hard-coded paths but that could be addressed in a follow-up PR, so I won't block on it.

I'd be happy to co-work with you to introduce these scripts into CI if you're interested?

tests/validate_contributors_json.py Outdated Show resolved Hide resolved
tests/validate_contributors_json.py Outdated Show resolved Hide resolved
@aleesteele
Copy link
Member

Hi @sgibson91, @gandrewgabriel, @JimMadge - just checking in with a friendly ping to remind you about this PR! No rush, but our Book Dash week might be a good time to push this forward 🚀

@JimMadge
Copy link
Member

Hi @sgibson91, @gandrewgabriel, @JimMadge - just checking in with a friendly ping to remind you about this PR! No rush, but our Book Dash week might be a good time to push this forward 🚀

Absolutely, this can be a target for me during Book Dash!

@JimMadge JimMadge self-requested a review June 3, 2024 08:31
@JimMadge
Copy link
Member

JimMadge commented Jun 3, 2024

I'm going to look at getting these changes made this week.

@JimMadge
Copy link
Member

JimMadge commented Jun 3, 2024

Just realised that the schema on jsonschema store doesn't validate the contributors objects and the schema added here does. I will try and merge the two here.

Would be good to contribute that extra validation upstream though.

@JimMadge
Copy link
Member

JimMadge commented Jun 3, 2024

🤞 seems to work locally.

@JimMadge JimMadge requested a review from sgibson91 June 3, 2024 15:14
@JimMadge JimMadge changed the title [WIP] Implement JSON validation for all-contributors data Implement JSON validation for all-contributors data Jun 4, 2024
@JimMadge JimMadge requested a review from a team June 4, 2024 10:14
@JimMadge
Copy link
Member

JimMadge commented Jun 5, 2024

Merged 😄 SchemaStore/schemastore#3836

This is no longer needed as those constraints have been merged upstream.
SchemaStore/schemastore#3836
@JimMadge JimMadge merged commit 1d6f55c into the-turing-way:main Jun 7, 2024
11 of 12 checks passed
Copy link

welcome bot commented Jun 7, 2024

Congratulations Banner
Congrats on merging your first pull request! 🎉 We here at The Turing Way are proud of you! 💖 Thank you so much for your contribution 🎁

@JimMadge
Copy link
Member

JimMadge commented Jun 7, 2024

@all-contributors please add @gandrewgabriel for infrastructure, code, test

Copy link
Contributor

@JimMadge

I've put up a pull request to add @gandrewgabriel! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-book-dash-june24 infrastructure For all issues related to book infrastructure
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants