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

feat: ✨ input validation using schema #1166

Merged
merged 12 commits into from
Sep 16, 2024

Conversation

mloiseleur
Copy link
Contributor

@mloiseleur mloiseleur commented Aug 14, 2024

What does this PR do?

Introduce usage of https://github.com/losisin/helm-values-schema-json to generate a schema from values reading annotations from comments

Motivation

Fixes #1140

More

  • Yes, I updated the tests accordingly
  • Yes, I ran make test and all the tests passed

@mloiseleur mloiseleur linked an issue Aug 14, 2024 that may be closed by this pull request
@mloiseleur

This comment was marked as resolved.

@mloiseleur mloiseleur marked this pull request as ready for review August 27, 2024 12:10
Copy link
Contributor

@darkweaver87 darkweaver87 left a comment

Choose a reason for hiding this comment

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

LVGTM

@mloiseleur
Copy link
Contributor Author

@jnoordsij If you can take a look, it would be great 🙏

Copy link
Collaborator

@jnoordsij jnoordsij left a comment

Choose a reason for hiding this comment

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

Oooh I like this a lot, could be very useful to have for validation in IDEs to spot errors more easily. Great work!

Maybe we want to document this for contributors as well? Or even try to have some workflow setup to automatically update the generated schema file? Otherwise probably updating it somewhere in the release process similar to the changelog works fine as well, but still that should be noted somewhere.

@mloiseleur
Copy link
Contributor Author

Ah yes, I totally missed the update / workflow / contributor part. Thanks !

@mloiseleur mloiseleur removed the kind/proposal a proposal that needs to be discussed. label Aug 29, 2024
@mloiseleur
Copy link
Contributor Author

@jnoordsij @darkweaver87 I updated Guidelines and added a github action which fails when schema is not updated.

Anything to add / remove / improve before merge ?

@@ -22,6 +22,14 @@ jobs:
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Check if values schema is up-to-date
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should also add - [ ] Yes, I updated the values and updated schema with `make schema` to the PR template as a guide for people?

@traefiker traefiker merged commit cf703c7 into traefik:master Sep 16, 2024
1 check passed
@mloiseleur mloiseleur deleted the feat/schema branch September 16, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input validation using with schema
4 participants