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

JSON schema contribution guide #2248

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

Conversation

aarnq
Copy link
Contributor

@aarnq aarnq commented Aug 27, 2024

Warning

This is a public repository, ensure not to disclose:

  • personal data beyond what is necessary for interacting with this pull request, nor
  • business confidential information, such as customer names.

What kind of PR is this?

Required: Mark one of the following that is applicable:

  • kind/feature
  • kind/improvement
  • kind/deprecation
  • kind/documentation
  • kind/clean-up
  • kind/bug
  • kind/other

Optional: Mark one or more of the following that are applicable:

Important

Breaking changes should be marked kind/admin-change or kind/dev-change depending on type
Critical security fixes should be marked with kind/security

  • kind/admin-change
  • kind/dev-change
  • kind/security
  • kind/adr

What does this PR do / why do we need this PR?

This adds guidelines on how to write schema.

Closes https://github.com/elastisys/ck8s-issue-tracker/issues/282

Information to reviewers

Checklist

  • Proper commit message prefix on all commits
  • Change checks:
    • The change is transparent
    • The change is disruptive
    • The change requires no migration steps
    • The change requires migration steps
    • The change upgrades CRDs
    • The change updates the config and the schema
  • Metrics checks:
    • The metrics are still exposed and present in Grafana after the change
    • The metrics names didn't change (Grafana dashboards and Prometheus alerts are not affected)
    • The metrics names did change (Grafana dashboards and Prometheus alerts were fixed)
  • Logs checks:
    • The logs do not show any errors after the change
  • Pod Security Policy checks:
    • Any changed pod is covered by Pod Security Admission
    • Any changed pod is covered by Gatekeeper Pod Security Policies
    • The change does not cause any pods to be blocked by Pod Security Admission or Policies
  • Network Policy checks:
    • Any changed pod is covered by Network Policies
    • The change does not cause any dropped packets in the NetworkPolicy Dashboard
  • Audit checks:
    • The change does not cause any unnecessary Kubernetes audit events
    • The change requires changes to Kubernetes audit policy
  • Falco checks:
    • The change does not cause any alerts to be generated by Falco
  • Bug checks:
    • The bug fix is covered by regression tests

@aarnq aarnq added the kind/documentation Improvements or additions to documentation label Aug 27, 2024
@aarnq aarnq requested a review from Zash August 27, 2024 06:34
@aarnq aarnq self-assigned this Aug 27, 2024
config/schemas/README.md Outdated Show resolved Hide resolved
@aarnq aarnq changed the title wip: JSON schema contribution guide JSON schema contribution guide Oct 9, 2024
@aarnq aarnq force-pushed the aarnq/jsonschema-contribution-guide branch from eb2615f to 3c0d091 Compare October 9, 2024 07:23
@aarnq aarnq marked this pull request as ready for review October 9, 2024 07:23
Comment on lines +206 to +210
Compositions and conditions here refers to the use of `allOf`, `anyOf`, and `oneOf`, etc. to define schema compositions and conditions.

- Schemas with compositions and conditions must set defaults because otherwise they cannot be fully resolved.
- Schemas with compositions and conditions should set examples because otherwise they cannot be fully resolved.
- Should not use `if` `then` `else` as it has less support in tooling, and has a semantic that is generally different from other schema constructs.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think it might be good to include some examples in this section? I think conditionals can get kind of advanced, and there aren't that many examples to look at in our existing schemas.


### Metadata

These guidelines aims to help to create better quality reference documentation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
These guidelines aims to help to create better quality reference documentation.
These guidelines aim to help in creating better quality reference documentation.

Minor wording nit.


### Structural

These guidelines aims to help to create schemas that are easier to read and write.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
These guidelines aims to help to create schemas that are easier to read and write.
These guidelines aim to help in creating schemas that are easier to read and write.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants