-
-
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
remove deprecated settings #33872
base: main
Are you sure you want to change the base?
remove deprecated settings #33872
Conversation
ef4bb99
to
3cdf752
Compare
@wxiaoguang Please take a look at this approach |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last ask: are we ready and do we have enough courage to break many existing users' upgrade operation and force them to manually edit their config file? If yes, mark this PR as breaking and add a "breaking" section to tell users what would happen and what they should do.
Some "breaking" references:
also cc @go-gitea/maintainers |
change tests to depend on length instead of error existance
I'd say yes. All those options where deprecated 3 or more releases ago and therefore could technically been removed anytime and unfortunately there's no premade solution for managing settings at this level. |
// Specifically default PATH to LFS_CONTENT_PATH | ||
// DEPRECATED should not be removed because users maybe upgrade from lower version to the latest version | ||
// if these are removed, the warning will not be shown | ||
deprecatedSetting(rootCfg, "server", "LFS_CONTENT_PATH", "lfs", "PATH", "v1.19.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we still keep them at the original places? I think that will help code readers to find the history of the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First version added errors to every setting loader function which would allow to keep the history, but as it has been explained - settings might do changes based on configuration options so early failure is better.
See #33761 (comment) for explanation and basis for this approach.
I do agree that it's less than ideal though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we can put some comments in the original places as a reference?
I'll stay neutral on this topic as I can see both advantages and disadvantages to this idea. @wxiaoguang, how long would you keep them? |
These deprecations have been shown on the admin page for a long time, I'm fine with removing and calling out the alternatives in the release notes. |
Hmm yes, we had never introduced so many breaking changes in one release, TBH I don't know how end users would react to this. If they would feel frustrated for making so many changes in one release upgrade, they would give up and stay with the versions which have security vulnerabilities ...... So taking some progressive actions and waiting for more time seem reasonable. |
From my own pov - I did look through release notes (mainly for new features) and I haven't been maintaining I'm fine with waiting for longer or for better ideas but this is a bridge that will need to be crossed eventually with a good future proof plan. Keeping deprecated config values forever is not feasible or a good idea in general. I feel like 3 releases back is generally "good enough" - especially since it's technically major version change every time and there are cases where a flag/config is deprecated from 1.x -> 1.y and then removed in 2.0.0. More related to the settings issue in general than PR: I've also looked at existing systems (viper, koanf) but they won't provide what we need here (deprecation warnings and removal) so a custom solution would be required anyway. I'd like to help rewrite/refactor the settings system but for that we'd need to gather requirements - my own being TOML support and json schema for settings. |
introduce a very basic removed settings management system
Related to: #33761
This removes configuration options that were deprecated more than 3 releases ago - up to Gitea 1.21.
See below for list of impacted options.
Impact on administrators of an instance
If user has any of the removed configuration options in their
app.ini
file at startup Gitea will log all issues and terminate. This will continue until all issues with configuration options are resolved.As such the administrator of Gitea may experience downtime, constant restarting of the service or other startup issues depending on their configuration if they perform unattended upgrade to Gitea 1.24.
Otherwise there's no impact if there is no deprecated options in their configuration.
Keys or values preventing startup