-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ini_file: try using inactive option before creating a new one #6575
ini_file: try using inactive option before creating a new one #6575
Conversation
…reating a new option entry Add changelog fragment
4dffa7d
to
ad00fd1
Compare
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.
I'm not really sure this is a bug, or more a new feature. The module doesn't document that it should activate inactive options whenever possible, but on the other hand its strange that it did so in some cases, but not in others.
On the other hand, whether using "inactive" options is a good idea is something that really depends a lot on the context. In some cases, this might destroy and invalidate documentation in the comments of an INI file, while in other cases (like yours) this is a good thing.
I guess this is another case where the various different syntaxes and ways INI files are used cause a lot of problems and confusion...
changelogs/fragments/ini_file-use-inactive-options-when-possible.yml
Outdated
Show resolved
Hide resolved
…le.yml Co-authored-by: Felix Fontein <felix@fontein.de>
The reason I'm considering it a bug is because it was the intended behavior couple of years ago which, after researching a bit, got broken by this commit where it's not clear to me that it was the intended change to the behavior. But yeah, I agree with you that the way INI config exists in the wild is not always predictable, and although my change is not necessarily a better approach, it feels to me that it's less prone to causing errors than the existing setup (due to the condition given in the example, which is a common condition to be found in the wild based on my experience). |
CC @ziegenberg who originally implemented that feature. |
|
Ah, partly disregard my last comment. I mixed up the default values... 🙈 With the mentioned commit, I introduced the new option With Those changes are in a code branch where But the tests probably need some more fixing. |
@ziegenberg I'm not sure I'm following if this was the intentional change for it to ignore commented key=value and create a new one, or if you agree that this is something that needs fixing 😅
EDIT: I've updated the tests |
Please note that a new release will happen on Monday. It would be great if the discussion could be resolved and this PR merged by then if everyone's happy with it. |
That sounds good to me, but would appreciate a blessing from @ziegenberg |
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.
I guess, it's ok now.
Thanks. If nobody objects, I'll merge tomorrow morning for community.general 7.1.0 and 6.6.2. |
Backport to stable-7: 💚 backport PR created✅ Backport PR branch: Backported as #6726 🤖 @patchback |
* ini_file: make inactive options as active if they exist, instead of creating a new option entry Add changelog fragment * Update changelogs/fragments/ini_file-use-inactive-options-when-possible.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix test * Update tests * Fix spelling --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit f710a10)
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #6728 🤖 @patchback |
* ini_file: make inactive options as active if they exist, instead of creating a new option entry Add changelog fragment * Update changelogs/fragments/ini_file-use-inactive-options-when-possible.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix test * Update tests * Fix spelling --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit f710a10)
@njutn95 thanks for your contribution! |
…ption before creating a new one (#6728) ini_file: try using inactive option before creating a new one (#6575) * ini_file: make inactive options as active if they exist, instead of creating a new option entry Add changelog fragment * Update changelogs/fragments/ini_file-use-inactive-options-when-possible.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix test * Update tests * Fix spelling --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit f710a10) Co-authored-by: njutn95 <njutn95@yahoo.com>
…ption before creating a new one (#6726) ini_file: try using inactive option before creating a new one (#6575) * ini_file: make inactive options as active if they exist, instead of creating a new option entry Add changelog fragment * Update changelogs/fragments/ini_file-use-inactive-options-when-possible.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix test * Update tests * Fix spelling --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit f710a10) Co-authored-by: njutn95 <njutn95@yahoo.com>
This is a big breaking change that should have been introduced with an opt in option. It is destroying valuable defaults and comments in lots of files. |
@rightaway did you read my comment #7297 (comment) ? |
SUMMARY
Not sure if this is a bug or not, but it definitely impacts specific scenarios.
Code change updates the behavior of attempting to utilize already existing options that are commented out (i.e. inactive) by making them active with the new value, before creating a new option which leads to having both inactive and active options.
It is considered a bug fix because of the default
php-fpm.conf
configuration which looks like this:where the
pool.d/*.conf
is introducing a new section called[www]
after the include.With the original code, the following task:
would produce the following output
leading to process_control_timeout being applied to
[www]
section instead of[general]
, whereas the updated code will produce the following:ISSUE TYPE
COMPONENT NAME
ini_file
ADDITIONAL INFORMATION