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

Config validation via TypeBox schema. #449

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

Conversation

Gnuxie
Copy link
Member

@Gnuxie Gnuxie commented Jun 12, 2024

Part of #217.

This whole exercise was miserable and has failed, sadly (read commit messages).

https://matrix.to/#/%23draupnir%3Amatrix.org/%24FDjyJ_bxlqx6lW5Ce74RfpDQpYxT973fddywBtyNJQY?via=matrix.org&via=envs.net&via=ubuntu.com

Following up I think the best course of action is to first figure out how to report transform errors correctly (or stop using transforms).

And also migrate the config to a new format behind the scenes that can be validated more easily*.

What we mean by this is we create a new format, which we encourage everyone to use, but the old format can still be loaded just fine and is migrated to the new one transparently until they change to the new format. Which we will detect with a version number

This is the most boring and demotivating thing I have done in
awhile. Jesus christ, I hated this and it took me so long
just to convince myself to start copy and pasting things.

And I don't know why
This has failed miserably because for some reason transform errors
are reported differently to schema validation errors. They aren't
treated like a TypeBox `ValueError`.

`Config.util.extendDeep` also for some obscure reason introduces
`null`s when objects such as `sentry` are undefined,
so the schema had to be changed for that.
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.

1 participant