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

values schema #811

Merged
merged 36 commits into from
Jan 21, 2025
Merged

values schema #811

merged 36 commits into from
Jan 21, 2025

Conversation

wkloucek
Copy link
Contributor

@wkloucek wkloucek commented Nov 22, 2024

Description

Maintain a schema file to find misconfigurations.
There were already some misconfigurations found in the deployment examples (see the diff).

Related Issue

Motivation and Context

How Has This Been Tested?

  • tested in CI against CI values and deployment examples
  • tested against well known deployments outside of this Chart repo
    • the "B" project, see issue backref on this ticket
    • the "E" project, I ran a command like this helm lint charts/ocis -f ~/Projects/gitlab.xxx/exxx/ocis-infra/common/ocis/values.yaml -f ~/Projects/gitlab.xxx/exxx/ocis-infra/prod/apps/ocis/values.yaml

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation generated (make docs) and committed
  • Documentation ticket raised:
  • Documentation PR created:

@wkloucek wkloucek marked this pull request as draft November 22, 2024 10:27
@wkloucek wkloucek added the QA label Nov 25, 2024
@wkloucek wkloucek requested a review from d7oc November 25, 2024 14:23
@wkloucek
Copy link
Contributor Author

wkloucek commented Nov 25, 2024

@d7oc could you skim those changes to check if you agree with the principle of this change?

Most interesting from my side:

  • the effect on the values.yaml changes in the future (one needs to maintain the schema annotations)
  • the schema helps devs to put configuration in the right place and avoid configuration that does nothing (includes config that was removed)
  • the deployment examples stay up to date because their configuration is now linted, too
  • the schema forces us to have sane defaults / configuration methods

If we can agree on the schema beeing a good thing, I'll gonna do some polishing on this PR, especially on the configuration documentation that received a small fallout.

@wkloucek wkloucek marked this pull request as ready for review December 6, 2024 08:14
@wkloucek
Copy link
Contributor Author

wkloucek commented Dec 6, 2024

@d7oc I'd like to get this into the chart soonish or agree on a timeframe when this change does fits our risk analysis / schedule / ...

This week I had another occurence where this schema feature would have saved a college and my like 2 hours each because we had fine looking configuration on a wrong indention level.

Copy link
Contributor

@d7oc d7oc left a comment

Choose a reason for hiding this comment

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

Submitting first feedback. Check until line 800 in values.yaml

charts/ocis/values.yaml Show resolved Hide resolved
charts/ocis/values.yaml Show resolved Hide resolved
charts/ocis/values.yaml Outdated Show resolved Hide resolved
charts/ocis/values.yaml Outdated Show resolved Hide resolved
charts/ocis/values.yaml Show resolved Hide resolved
charts/ocis/values.yaml Show resolved Hide resolved
charts/ocis/values.yaml Show resolved Hide resolved
charts/ocis/values.yaml Show resolved Hide resolved
charts/ocis/values.yaml Show resolved Hide resolved
charts/ocis/values.yaml Show resolved Hide resolved
@d7oc
Copy link
Contributor

d7oc commented Dec 6, 2024

I'm missing the command here to generate the schema from the values.yaml or is there some magic I've overlooked?

@wkloucek wkloucek requested a review from d7oc December 17, 2024 13:58
Copy link
Contributor

@d7oc d7oc left a comment

Choose a reason for hiding this comment

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

Finished review.

charts/ocis/values.yaml Show resolved Hide resolved
charts/ocis/values.yaml Show resolved Hide resolved
Comment on lines 874 to 877
# @schema
# type: [string, null]
# required: false
# @schema
Copy link
Contributor

Choose a reason for hiding this comment

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

We could use format: "uri" here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 993 to 996
# @schema
# type: [string, null]
# required: false
# @schema
Copy link
Contributor

Choose a reason for hiding this comment

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

We could use format: "uri" here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

charts/ocis/values.yaml Show resolved Hide resolved
Comment on lines 5096 to 5099
# @schema
# type: [string, null]
# required: false
# @schema
Copy link
Contributor

Choose a reason for hiding this comment

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

We could use format: "uri" here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

# -- Configure the {"styles": []} section in the Web config.json.
styles:
[]
# - href: /theme/foo.css
# @schema
# additionalProperties: true
# @schema
# -- Configure the {"styles": []} section in the Web config.json.
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to me that this description of the setting is wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment on lines 5185 to 5189
postLogoutRedirectURI:
# @schema
# type: [string, null]
# required: false
# @schema
Copy link
Contributor

Choose a reason for hiding this comment

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

We could add format: "uri" here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 5180 to 5183
# @schema
# type: [string, null]
# required: false
# @schema
Copy link
Contributor

Choose a reason for hiding this comment

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

We could add format: "uri" here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

charts/ocis/values.yaml Show resolved Hide resolved
@wkloucek wkloucek requested a review from d7oc January 20, 2025 08:04
charts/ocis/values.yaml Show resolved Hide resolved
@wkloucek wkloucek merged commit 5ee94f6 into owncloud:main Jan 21, 2025
1 check passed
@wkloucek wkloucek deleted the values-schema branch January 21, 2025 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add values schema
2 participants