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

Improve validation and automation for chain JSON files #6394

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Ramyromel
Copy link

@Ramyromel Ramyromel commented Dec 11, 2024

Add validation checks and update workflows for chain JSON files.

  • tools/schemaCheck.js:

    • Add checks to ensure shortName and name fields are unique across all chain JSON files.
    • Add checks to ensure icons referenced in chain JSON files exist in the _data/icons directory and follow the correct format.
  • .github/workflows/validate_json.yml:

    • Add a step to run the tools/schemaCheck.js script to validate the JSON schema of the chain files.
  • .github/workflows/stale.yml:

    • Configure the workflow to manage stale issues and PRs, ensuring unresolved issues are closed after a certain period of inactivity.
  • README.md:

    • Add a section to explain the automated validation process using GitHub Actions workflows.

For more details, open the Copilot Workspace session.

Add validation checks and update workflows for chain JSON files.

* **tools/schemaCheck.js**:
  - Add checks to ensure `shortName` and `name` fields are unique across all chain JSON files.
  - Add checks to ensure icons referenced in chain JSON files exist in the `_data/icons` directory and follow the correct format.

* **.github/workflows/validate_json.yml**:
  - Add a step to run the `tools/schemaCheck.js` script to validate the JSON schema of the chain files.

* **.github/workflows/stale.yml**:
  - Configure the workflow to manage stale issues and PRs, ensuring unresolved issues are closed after a certain period of inactivity.

* **README.md**:
  - Add a section to explain the automated validation process using GitHub Actions workflows.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/ethereum-lists/chains?shareId=XXXX-XXXX-XXXX-XXXX).
Copy link

You successfully submitted a PR! Due to the amount of PRs coming in: we will only look at PRs that the CI is happy with. We can also not hold your hand getting the CI green - just look how others that where merged did it and RTFM. So as long as there is any CI check that reports an error - no human will look at this. You might be able to ask for some support after supporting the project - e.g. by sending funds to lists.eth. When you fixed things after a requested change - then you also need to (re-)request a review.

Copy link
Member

@ligi ligi left a comment

Choose a reason for hiding this comment

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

The uniqueness of (short)names is already checked in the Kotlin side - we should not duplicate it (and also have different behavior as the names are normalized)

Comment on lines +128 to +132
To format the JSON files according to the style defined in `.prettierrc.json`, use the `prettier` tool. Run the following command to format all existing JSON files:

```
npx prettier --write _data/*/*.json
```
Copy link
Member

Choose a reason for hiding this comment

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

this is already stated in another part of the README - do not think it should be repeated. Let's keep things DRY

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.

2 participants