-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
How to handle deprecated/removed config options #33761
Comments
After some work with huma they have a pretty nice system for body validation which I think might be reusable in this context. It doesn't quick fail when on bad arguments, but collects them instead into
See: TheFox0x7@5286afe for quick initial proposal (currently it lacks version comparison). If we were to split removed settings into it's own file/func for clarity, it should be loaded before all the actual settings IMO providing early return. unless this should come after some other refactor of settings? @wxiaoguang mentioned a rewrite of parsing package might be needed if I remember correctly? |
I do not think it should stop starting when a "deprecated error" occurs. The deprecation could occur in many "load config" functions. See case 2: #33707 (comment) |
The way I understood it is that Fatal implies a critical error (here a config option is no longer used and was detected in the file) which in turn terminates server/aborts startup. |
Sorry I misread, I thought "returning err" implies "fatal". Because there is another case, the
So ideally, when a non-removed-option error occurs, it should "fatal" as soon as possible to avoid other side-effects. So to be honest, instead of "errors.Join", I think it's worth to use a separate error list to manage the "removed-option errors", and the "removed-option" check should be done before other "load" functions IMO. |
So something more like this then? Though maybe it would be worth solving technical debt first so it doesn't pile up. |
Yup, it overall looks good. |
Both a system failure and a critical issue can impact the admin user. To ensure awareness, we should implement a mandatory warning page that appears on every login, requiring the admin to acknowledge it before proceeding.
Originally posted by @lunny in #33707 (comment)
The text was updated successfully, but these errors were encountered: