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

Added Workflow to verify ambassaor.json schema #758

Merged
merged 52 commits into from
Jun 25, 2024

Conversation

ramishj
Copy link
Contributor

@ramishj ramishj commented Jun 19, 2024

GitHub Issue: [#755 ]

Summary:
This pull request updates the GitHub Actions workflow to validate the ambassadors.json file on push and pull request events.

Do you think resolving this issue might require an Architectural Decision Record (ADR)? (significant or noteworthy)
No

ramishj added 30 commits June 19, 2024 13:42
Copy link
Member

@Relequestual Relequestual 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, thanks for your work on this.

I have one condition on approving and one suggestion for the future.

Condition: When merging this, please select the "squash and merge" option.

Suggestion: Test on your local machine before pushing. Pushing should not be your test. You do not need to push every commit you make =]
You can squash commits locally by using git interactive rebasing. Happy to share some additional resources if that would be helpful.

You can test GitHub actions locally using ACT.

"properties": {
"type": {
"type": "string",
"enum": ["article", "talk", "video", "other"]
Copy link
Member

Choose a reason for hiding this comment

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

We have pending PRs which have more types than this.
@benjagm did you want to expand this list (and/or the list in the document)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets add:

  • book
  • paper
  • initiative
  • project
  • working group

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

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

Awesome!! Very good job with this!!

I just left some comments with small suggestions.

@@ -0,0 +1,77 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we change the json schema version to use the current 2020-12?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried updating it but got this error while testing should i chnage the script and manually check for each entry in schema?
Uploading Screenshot 2024-06-21 at 8.31.38 PM.png…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@benjagm Sir , could please advice what should we do...

Copy link
Member

@JeelRajodiya JeelRajodiya Jun 23, 2024

Choose a reason for hiding this comment

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

@ramishj, The image you uploaded is not visible, could you try uploading again please?

The below is the screenshot
image

.github/workflows/Validate Ambassadors JSON.yml Outdated Show resolved Hide resolved
programs/ambassadors/ambassadors-schema.json Show resolved Hide resolved
}
}
},
"required": ["name", "img", "bio", "title", "github", "twitter", "linkedin", "company", "country", "contributions"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's make twitter and linkedin optional.

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

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

I left some comments and suggestions.

Amazing job with this!!

ramishj and others added 2 commits June 21, 2024 19:53
Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com>
Updated schema version,added description to each field,expanded list of Type of contributions and made Linked and Twitter not mandatory
@ramishj
Copy link
Contributor Author

ramishj commented Jun 21, 2024

I left some comments and suggestions.

Amazing job with this!!

I have made the required changes you suggested .
Thanks for the suggestions and would love to keep contribute .
Thanks ....

@ramishj
Copy link
Contributor Author

ramishj commented Jun 21, 2024

This looks good, thanks for your work on this.

I have one condition on approving and one suggestion for the future.

Condition: When merging this, please select the "squash and merge" option.

Suggestion: Test on your local machine before pushing. Pushing should not be your test. You do not need to push every commit you make =] You can squash commits locally by using git interactive rebasing. Happy to share some additional resources if that would be helpful.

You can test GitHub actions locally using ACT.

Thanks for you suggestion @Relequestual would keep in my mind in future while testing for workflows .

fixed indentation error
@ramishj ramishj requested a review from benjagm June 21, 2024 19:24
benjagm
benjagm previously approved these changes Jun 23, 2024
Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

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

Nice job! Thanks!

@benjagm benjagm dismissed their stale review June 23, 2024 08:06

Found something else

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

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

The workflow is failing after updating to the current draft 2020-12. I think the dependency to use is other:
https://ajv.js.org/json-schema.html#draft-2020-12

Logs:
https://github.com/json-schema-org/community/actions/runs/9631882401

- name: Validate ambassadors.json
run: |
node -e "
const Ajv = require('ajv');
Copy link
Collaborator

Choose a reason for hiding this comment

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

To run the validation against a 2020-12 schema the dependency to use is: ajv/dist/2020

Right now the action is failing:
https://github.com/json-schema-org/community/actions/runs/9631882401

@ramishj ramishj requested a review from benjagm June 24, 2024 14:46
Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

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

Great job @ramishj ! This is a cool feature very much needed.

@benjagm benjagm merged commit 709a9b9 into json-schema-org:main Jun 25, 2024
2 checks passed
@Relequestual Relequestual linked an issue Dec 12, 2024 that may be closed by this pull request
2 tasks
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 this pull request may close these issues.

Add JSON schema for ambassadors.json
4 participants