Skip to content

New spec structure #817

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

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ae2a377
chore(deps): bump Renato66/auto-label from 2.3.0 to 3.0.0 (#788)
dependabot[bot] Jul 8, 2024
2b5b44e
chore(deps): bump eslint-plugin-promise from 6.1.1 to 6.4.0 (#787)
dependabot[bot] Jul 8, 2024
81de1e4
Add new sopnsor (#793)
benjagm Jul 8, 2024
f7b499e
chore(deps): bump actions/github-script from 6 to 7 (#740)
dependabot[bot] Jul 11, 2024
e9d84d0
chore(deps): bump next-themes from 0.2.1 to 0.3.0 (#743)
dependabot[bot] Jul 11, 2024
605bbb3
Added two workflows for fetching contributor and project roadmap data…
aialok Jul 16, 2024
d30dd69
chore(deps): bump markdown-to-jsx from 7.3.2 to 7.4.7 (#799)
dependabot[bot] Jul 16, 2024
43e3654
chore(deps): bump @types/node from 20.10.1 to 20.14.10 (#798)
dependabot[bot] Jul 16, 2024
fa59c06
chore(deps): bump next from 14.1.1 to 14.2.5 (#794)
dependabot[bot] Jul 16, 2024
8f18c3a
chore(deps): bump react and @types/react (#744)
dependabot[bot] Jul 16, 2024
eda0dcf
remove trailing comma from getting-started-step-by-step.md (#800)
joostholslag Jul 16, 2024
a842501
Enchantment Dark Mode Toggle shows a popup (#735)
JeelRajodiya Jul 16, 2024
10bb5d4
Add JSON Toolkit as a C++ implementation (#761)
jviotti Jul 16, 2024
71a18df
Chore(github-actions) : add CI/CD workflows guidelines and improve na…
aialok Jul 16, 2024
8946f64
Spec draft fixes
kwennB Jul 17, 2024
37ca719
Merge branch 'json-schema-org:main' into new-spec-structure
kwennB Jul 17, 2024
4292510
Updating draft sections
kwennB Jul 18, 2024
90410bf
metadata syntax fixes
DhairyaMajmudar Jul 18, 2024
5dba363
Merge pull request #1 from DhairyaMajmudar/new-spec-structure
kwennB Jul 18, 2024
49c5145
modified spec docs
kwennB Jul 19, 2024
902d0ae
adding table component
DhairyaMajmudar Jul 22, 2024
0e87086
adding title
DhairyaMajmudar Jul 22, 2024
b207f98
Merge pull request #2 from DhairyaMajmudar/new-spec-structure
kwennB Jul 22, 2024
bfcea46
Spec draft fixes-2
kwennB Jul 22, 2024
52e562e
Merge branch 'new-spec-structure' of https://github.com/kwennB/websit…
kwennB Jul 22, 2024
af4ba88
Add new sponsors (#814)
benjagm Jul 22, 2024
bcd01d5
Spec draft fixes-3
kwennB Jul 22, 2024
e7730dc
doc-table
DhairyaMajmudar Jul 23, 2024
1d5f9df
fixing draft7
DhairyaMajmudar Jul 23, 2024
4df579f
draft7 fix
DhairyaMajmudar Jul 23, 2024
d94018b
converting in links
DhairyaMajmudar Jul 23, 2024
b144b8f
Merge pull request #3 from DhairyaMajmudar/new-spec-structure
kwennB Jul 23, 2024
6251444
Merge branch 'json-schema-org:main' into new-spec-structure
kwennB Jul 23, 2024
68ff0c7
adding multiple files
DhairyaMajmudar Jul 23, 2024
d75b860
Merge pull request #4 from DhairyaMajmudar/new-spec-structure
kwennB Jul 23, 2024
58cc4cf
Spec draft fixes-4
kwennB Jul 23, 2024
653129d
Merge branch 'new-spec-structure' of https://github.com/kwennB/websit…
kwennB Jul 23, 2024
0e08ca7
Spec draft fixes-5
kwennB Jul 23, 2024
15ff1ad
Spec draft fixes-6
kwennB Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## JSON Schema Website CI/CD Workflow Guidelines

### Overview

This document outlines the guidelines for contributing to and maintaining GitHub Actions workflows in the JSON Schema Website project. Adherence to these guidelines ensures consistency, efficiency, and ease of maintenance across our CI/CD processes.

### General Principles

- **Change Management**: Modifications to files in this directory are closely monitored. Changes will trigger unauthorized file changes workflow during pull request checks. Only make changes when explicitly advised by a project contributor or maintainer.
- **Documentation and Naming**: Use descriptive, self-explanatory names for workflows, jobs, and steps. Include clear comments within workflow files to explain complex configurations.

### YAML Workflow File Structure

Our YAML files are organized based on specific roles and event triggers. When creating or modifying workflows, ensure that:
- The file roles described below are strictly maintained.
- Job sequences within workflows are preserved using [GitHub Action job dependencies](https://docs.github.com/en/actions/using-workflows/using-jobs-in-a-workflow#defining-prerequisite-jobs).

### File Categorization

Organize workflow files based on their primary event trigger:

- **Issue Workflows**:
- [Issue Workflow](./issue.yml): Handles issue-related events such as opening, closing, or labeling issues.

- **Pull Request Workflows**:
- [CI Workflow](./ci.yml): Runs for all contributors on pull requests, performing code-quality checks, unauthorized file changes detection, and build processes.
- [PR Interaction Workflow](./pull-request-target.yml): Contains workflows specifically for first-time contributors, such as welcome messages.

### Exceptions to File Categorization

Separate files may be created for workflows that:

- Require unique `cron` schedules for periodic execution.
Examples:
- [Link Checker](./link-checker.yml): Periodically checks for broken links in the repository.
- [Mark stale issues and pull requests](./stale-issues-prs.yml): Automatically labels and closes stale issues and PRs.
- [Dependabot](../dependabot.yml): Keeps dependencies up-to-date.

- Need specific `paths` triggers, activating only when files in particular directories are modified.
Example:
- [New Implementation Commenter](./new-implementation.yml): Adds comments when new implementation files are added.

- Only work correctly if they have a dedicated file.
Examples:
- [Preview Deployment](./preview-deployment.yml): Deploys preview environments for pull requests.
- [Production Deployment](./production-deployment.yml): Handles production deployments.
- [CodeQL Code Scanning](./codeql.yml): Performs code security analysis.
- [Check PR Dependencies](./pr-dependencies.yml): Enforces dependencies between PRs based on opening comments.

### Workflow Maintenance

To ensure the efficiency and reliability of our workflows, follow these maintenance guidelines:

- **Regular Review**: Review and update workflows at least quarterly to incorporate new features or best practices.
- **Dependency Updates**: Keep workflow dependencies up-to-date by reviewing and applying Dependabot suggestions promptly.
- **Documentation**: Update workflow documentation immediately after any changes or modifications to keep it current.
- **Performance Monitoring**: Regularly check workflow run times and optimize where possible to reduce GitHub Actions usage.
- **Security Checks**: Ensure that workflows using secrets or accessing sensitive data are properly secured and follow least privilege principles.

These guidelines aim to maintain the integrity and efficiency of our CI/CD processes. Always consult with the team before making significant changes to any workflow.
12 changes: 6 additions & 6 deletions .github/workflows/pull-request.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: PR Workflow
name: CI
on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
linting_and_type-checking:
name: Linting, Formatting and Type checking
code-quality-checks:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -44,8 +44,8 @@ jobs:
- name: Type checking
run: yarn run typecheck

Check-Unauthorized-File-Changes:
name: Checks if no unauthorized files are changed
check-unauthorized-file-changes:
name: Check Unauthorized File Changes
if: ${{github.actor != 'dependabot[bot]'}}
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -94,8 +94,8 @@ jobs:

build:
name: Build check
needs: code-quality-checks
runs-on: ubuntu-latest
needs: linting_and_type-checking
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ on:
types: ['opened']

jobs:
Issue-Labeler:
name: Adding Label to issue
runs-on: ubuntu-latest
steps:
- uses: Renato66/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
ignore-comments: true
default-labels: '["Status: Triage"]'
issue-labeler:
name: Adding Label to Issue
runs-on: ubuntu-latest
steps:
- name: Auto Label Issue
uses: Renato66/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
ignore-comments: true
default-labels: '["Status: Triage"]'

Issue-Greeting:
name: Greeting Message to User
runs-on: ubuntu-latest
steps:
- name: Greeting Message to User
uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
Welcome to the [JSON Schema](https://json-schema.org/) Community. We are so excited you are here! Thanks a lot for reporting your first issue!! 🎉🎉 Please make sure to take a look to our [contributors guide](https://github.com/json-schema-org/website/blob/main/CONTRIBUTING.md) if you plan on opening a pull request.
For more details check out [README.md](https://github.com/json-schema-org/website?tab=readme-ov-file#-welcome-to-the-json-schema-website) file.

issue-greeting:
name: Greeting Message to User
runs-on: ubuntu-latest
steps:
- name: Send Greeting Message
uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
Welcome to the [JSON Schema](https://json-schema.org/) Community. We are so excited you are here! Thanks a lot for reporting your first issue!! 🎉🎉 Please make sure to take a look at our [contributors guide](https://github.com/json-schema-org/website/blob/main/CONTRIBUTING.md) if you plan on opening a pull request.
For more details, check out the [README.md](https://github.com/json-schema-org/website?tab=readme-ov-file#-welcome-to-the-json-schema-website) file.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
linkChecker:
name: Check and Report Broken Links
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/new-implementation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-target.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pull Request Target Workflow
name: PR Interaction Workflow

on:
pull_request_target:
Expand Down
File renamed without changes.
59 changes: 59 additions & 0 deletions .github/workflows/sync-contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name : Sync Contributors Data

on:
schedule: # Run sunday at midnight every week
- cron: '0 0 * * 0'
workflow_dispatch:

jobs:
sync-contributors-data:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Get Token
uses: actions/create-github-app-token@v1
id: get_workflow_token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

- name: Fetch Contributors data
uses: actions/github-script@v7
env:
ORGS: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
with:
github-token: ${{ steps.get_workflow_token.outputs.token }}
script: |
const fs = require('fs');

let data = await github.paginate(github.rest.repos.listContributors, {
owner: process.env.ORGS,
repo: process.env.REPO,
per_page: 100,
headers: {
"X-GitHub-Api-Version": "2022-11-28",
},
});

// Filter the data to get only the required fields
data = data.map(({ login, id, avatar_url, html_url }) =>
({ login, id, avatar_url, html_url }));

// Store the data in a file
fs.writeFileSync('community.json', JSON.stringify(data, null, 2));

- name: Commit changes
env:
GITHUB_APP_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
run: |
git config user.name "the-json-schema-bot[bot]"
git config user.email "the-json-schema-bot[bot]@users.noreply.github.com"
git add community.json
git diff --quiet && git diff --staged --quiet || (git commit -m "chore(community): update community.json" && git push "https://x-access-token:${GITHUB_APP_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:${GITHUB_REF#refs/heads/})




100 changes: 100 additions & 0 deletions .github/workflows/sync-project-roadmap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name : Sync Project Roadmap Data

on:
schedule: # Run sundat at 00:05 every week
- cron: '5 0 * * 0'
workflow_dispatch:

jobs:
sync-roadmap-data:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get Token
uses: actions/create-github-app-token@v1
id: get_workflow_token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

# fetch project data and store it in a file
- name: Fetch project data
env:
GH_TOKEN: ${{ steps.get_workflow_token.outputs.token }} # GitHub App token stored in secrets
PROJECT_ID: ${{vars.ROADMAP_PROJECT_ID}} # Project ID
run: |
gh api graphql -f query='
query($PROJECT_ID : ID!) {
node(id: $PROJECT_ID) {
... on ProjectV2 {
items(first: 20) {
nodes {
id
fieldValues(first: 8) {
nodes {
... on ProjectV2ItemFieldTextValue {
text
field {
... on ProjectV2FieldCommon {
name
}
}
}
... on ProjectV2ItemFieldDateValue {
date
field {
... on ProjectV2FieldCommon {
name
}
}
}
... on ProjectV2ItemFieldSingleSelectValue {
name
field {
... on ProjectV2FieldCommon {
name
}
}
}
}
}
content {
... on DraftIssue {
title
body
}
... on Issue {
title
assignees(first: 10) {
nodes {
login
}
}
}
... on PullRequest {
title
assignees(first: 10) {
nodes {
login
}
}
}
}
}
}
}
}
}' -f PROJECT_ID=$PROJECT_ID | jq '.data.node.items.nodes' > project_data.json

# commit updated project data
- name: Commit changes
env:
GITHUB_APP_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
run: |
git config user.name "the-json-schema-bot[bot]"
git config user.email "the-json-schema-bot[bot]@users.noreply.github.com"
git add project_data.json
git diff --quiet && git diff --staged --quiet || (git commit -m "chore(project_data): update project_data.json" && git push "https://x-access-token:${GITHUB_APP_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:${GITHUB_REF#refs/heads/})

Loading
Loading