Page MenuHomePhabricator

generate_user_files.py is no longer able to create a small user-config.py
Closed, ResolvedPublic

Description

It is recommended to have a user-config.py but the main settings are done in the config2.py and user-config.py have to hold the account related settings only. But there was a regression in generate_user_files which disabled the choice to generate a small variant of config settings. Now it copies the whole config2.

Event Timeline

See also T85270 which leads to the removal of this question.

I think we should copy all settings, but we should probably not actually set them. In other words, one should get a file

## This is mainly intended to support setting the
## X-Wikimedia-Debug header, which is sometimes
## needed to debug issues with Wikimedia sites:
## https://wikitech.wikimedia.org/wiki/Debugging_in_production
##
## Note that these headers will be sent with all requests,
## not just MediaWiki API calls.
# extra_headers = {}

etc.

That's indeed a good idea and not just copying the sections.
Anyway I prefer to have a minimal config file (e.g. for experienced user or for test stuff) as we had earlier.

Change 312534 had a related patch set uploaded (by Xqt):
[bugfix] copy all settings to user-config.py but do not set them

https://gerrit.wikimedia.org/r/312534

I think we should copy all settings, but we should probably not actually set them. In other words, one should get a file

## This is mainly intended to support setting the
## X-Wikimedia-Debug header, which is sometimes
## needed to debug issues with Wikimedia sites:
## https://wikitech.wikimedia.org/wiki/Debugging_in_production
##
## Note that these headers will be sent with all requests,
## not just MediaWiki API calls.
# extra_headers = {}

etc.

I find it more convenient to have these settings uncommented. Syntax highlighting is better and changing the config params can be done only by changing the values, no uncommenting required.

I think if someone does not want to have all these settings in their config file probably prefers a minimal version of the user-config as @Xqt has suggested.

I find it more convenient to have these settings uncommented. Syntax highlighting is better and changing the config params can be done only by changing the values, no uncommenting required.

A disadvantage of copying all setting would be that you never could change the default behaviour when required which we did in past in a few cases. The meaning of the user-config setting is to change default settings only and keep the others unchanged and in the scope of the framework itself.

This comment was removed by Dalba.
Dvorapa renamed this task from generate_user_files.py is no longer able to create a small user-config-py to generate_user_files.py is no longer able to create a small user-config.py.Jul 11 2017, 1:48 PM

Change 309965 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Fix the extended user-config extraction regex

https://gerrit.wikimedia.org/r/309965

Aklapper removed Xqt as the assignee of this task.Jul 2 2021, 5:22 AM

Removing task assignee due to inactivity, as this open task has been assigned for more than two years (see emails sent to assignee on May26 and Jun17, and T270544). Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be very welcome!

(See https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator.)

Change 309965 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [IMPR] Let user the choice which section to be copied

https://gerrit.wikimedia.org/r/309965

Xqt changed the task status from Open to In Progress.Nov 19 2022, 1:00 PM

Change 309965 merged by jenkins-bot:

[pywikibot/core@master] [IMPR] Let user the choice which section to be copied

https://gerrit.wikimedia.org/r/309965