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

create JSON schema for slice definitions files #178

Open
cjdcordeiro opened this issue Nov 28, 2024 · 0 comments
Open

create JSON schema for slice definitions files #178

cjdcordeiro opened this issue Nov 28, 2024 · 0 comments

Comments

@cjdcordeiro
Copy link
Collaborator

cjdcordeiro commented Nov 28, 2024

Problem

The issue is depicted in #176. In short, we want to be able to validate new slice definitions that are being proposed, even though Chisel itself may ignore fields that are not part of the schema.

Suggested approach

Instead of making Chisel print warnings for unknown fields, the preferred approach is to create a manageable JSON schema within this repo, that can be updated alongside the code and used as a reference from the SchemaStore.

Pros:

  • the repo itself will be the source of truth and hold the explicit schema that Chisel expects within a Slice Definitions File
    • with this JSON schema, our CI can do an early validation of new slice definitions without having to run Chisel
  • adding this schema to the SchemaStore will allow contributors to have off-the-shelf validation within their IDEs

Additional considerations

When validating a slice definition, we may need to consider

  1. the format version
  2. the chisel-release
  3. the chisel version

We need to carefully think about this because adding new fields doesn't equate to bumping the format.

Examples

Similar work has already been done for Rockcraft:

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

No branches or pull requests

1 participant