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

Automatic validaton of PRs #91

Open
nfriedly opened this issue Mar 3, 2017 · 6 comments
Open

Automatic validaton of PRs #91

nfriedly opened this issue Mar 3, 2017 · 6 comments

Comments

@nfriedly
Copy link
Contributor

nfriedly commented Mar 3, 2017

Pull Requests should automatically be tested to at least contain valid JSON, and could perhaps be validated against a JSON-Schema to ensure they conform to the expected format.

Initial discussion at #81 (comment)

CC @magicalyak @phillxnet @schakrava

@magicalyak
Copy link
Contributor

This is from a discussion on a Rock-On to streamline some of the usual suspects around JSON preferences. I'm in full support but need to figure out how to put this together.

@phillxnet
Copy link
Member

This JSON validation task may be one well suited to the new GitHub Apps system. Once that has properly rolled out I can take a look. Would be a great addition as we have had several non json additions as initial contributions to the Rock-ons repo.

Anyone up on the new GitHub Apps is more than welcome to chip in here on how we might implement this. Seems like a nice task to start out on using such a system.

@phillxnet
Copy link
Member

As per formatting I'm thinking 4 spaces, as per our Python, and no tabs obviously :). We have many existing Rock-ons that have a mix of 2 and 4 spaces and some that also have tabs mixed in. Is there a black equivalent but for json that anyone knows of?

@phillxnet
Copy link
Member

phillxnet commented Nov 24, 2021

@FroggyFlox Re:

This JSON validation task may be one well suited to the new GitHub Apps system.

It would seem we now have GitHub actions for this?

@FroggyFlox
Copy link
Member

@FroggyFlox Re:

It would seem we now have GitHub actions for this?

Do we?
Now that I'm more familiar with Github actions I think I saw a way to achieve this a little while back but never got to tackling it... It might be worth having another look, indeed. I think the "difficulty" would be to retrieve the json file(s) of the PR and then pass this to a json linter; note that there are documented ways to do that so it would "only" be a matter of retrieving these.

It's definitely something we should implement sooner rather than later, though, so I might as well bite the bullet and get to it.

@phillxnet
Copy link
Member

Minor update re @nfriedly original comment:

... validated against a JSON-Schema to ensure they conform to the expected format.

We do now have the in-need-of-attention fledgling repo that may be perfect for this purpose donated by @StephenBrown2:

https://github.com/rockstor/rockon-validator

"... a Rockon validator written in Go."

I.e. a GitHub action, using a Go ready container, pulls that repo and uses it for it's intended purpose.

This would most likely encourage folks to tend-to/extend what @StephenBrown2 started with the donation of that repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants