Page MenuHomePhabricator

[RfC] Drop support for script_wui.py
Closed, ResolvedPublic

Description

script_wui.py is not maintained anymore for years and there are a lot of problems (to reimplement it):

  • unsufficient documentation, I've no idea for what this script is good for and what should it do
  • running on linux platforms only if any
  • outdated libraries like crontab or lua / lunatic-python / lunatic-python-universal
  • it uses botirc which is not very usable, see T212632
  • irc lib is failing due to T212627
  • external dependency_links wheren't processed since pip 1.4 due to a missing --process-dependency-links option
  • external dependemcy_links are droppend since pip 19.0

I propose to drop this script and move it to archive folder for historical reason (or delete it completely)

Event Timeline

Xqt created this task.May 7 2019, 7:53 PM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMay 7 2019, 7:53 PM
Dvorapa added a comment.EditedMay 7 2019, 8:04 PM

I have got lua 5.2 and 5.3 on my PC by default. I could manage to install only Lupa (not Ffilupa, not lunatic-python-universal) and after working around a ircbot issue, it gives me the following error:

$ python pwb.py script_wui
* Initialization of bot
** Redirecting Lua print in order to catch it
Traceback (most recent call last):
  File "pwb.py", line 250, in <module>
    if not main():
  File "pwb.py", line 243, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 95, in run_python_file
    main_mod.__dict__)
  File "./scripts/script_wui.py", line 361, in <module>
    main()
  File "./scripts/script_wui.py", line 352, in main
    bot = ScriptWUIBot(site, chan, site.user() + '_WUI', 'irc.wikimedia.org')
  File "./scripts/script_wui.py", line 139, in __init__
    lua.execute('print = python.globals().pywikibot.output')
  File "lupa/_lupa.pyx", line 280, in lupa._lupa.LuaRuntime.execute
  File "lupa/_lupa.pyx", line 1297, in lupa._lupa.run_lua
  File "lupa/_lupa.pyx", line 1306, in lupa._lupa.call_lua
  File "lupa/_lupa.pyx", line 1332, in lupa._lupa.execute_lua_call
  File "lupa/_lupa.pyx", line 1268, in lupa._lupa.raise_lua_error
lupa._lupa.LuaError: [string "<python>"]:1: attempt to call a nil value (field 'globals')
stack traceback:
	[string "<python>"]:1: in main chunk
CRITICAL: Exiting due to uncaught exception <class 'lupa._lupa.LuaError'>
Xqt added a comment.May 7 2019, 8:15 PM

Reading the summary:

Bot which runs python framework scripts as (sub-)bot.

I think this is a kind of user interface via irc while running one or several scripts with it. I guess this can be done with PAWS instead of reinvent the wheel to get this script running.

Yes, exactly, let's archive/deprecate it

Change 508717 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] Drop support for script_wui.py

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

Dvorapa added a comment.EditedMay 8 2019, 10:20 AM

Okay. I managed to run it:

The way it works:

  1. Install lua, crontab and irc
  2. Create /script wui-shell.css, /script wui-crontab.css and /Simulation subpages for your bot
  3. Edit /script wui-shell.css with the code you want to run by bot and script_wui will run it immediately and then once in a while

Possible issues:

  • Every save of shell code in .css page generates MediaWiki built-in abuse filter, which asks you if you really want to save invalid css code (as it is not a css code at all). You must click Publish again
  • It should work somehow with lua, but I could not manage to find out how
  • It definitely needs better documentation. In fact it needs any documentation
Xqt added a comment.May 8 2019, 11:16 AM
  • Every save of shell code in .css page generates MediaWiki built-in abuse filter, which asks you if you really want to save invalid css code (as it is not a css code at all). You must click Publish again

Do you need Interface admin rights to change it?

Again to PAWS: I think PAWS is a better approach for it because you don't need configuration on any css page; you can just start all scripts you want to.

Ok, cronjobs may be problematic (see T124972) and the timeout is too low keep it running. As windows user I have to find out alternatives anyway. Some scripts does not need a schedular because they are just sleeping a bit like checkimages.py or welcome.py.

Anyway what do you think about that script. You made the most work exploring its behavior and dependencies and there are only few steps to document it (most is made above). If you tend to keep I'll be fine with it.

Do you need Interface admin rights to change it?

Not for your account/bot

Again to PAWS: I think PAWS is a better approach for it because you don't need configuration on any css page; you can just start all scripts you want to.

Sure, it is.

Anyway what do you think about that script. You made the most work exploring its behavior and dependencies and there are only few steps to document it (most is made above). If you tend to keep I'll be fine with it.

Let's drop it to archive, I like your patch. Then I will create a patch to make it run again and create at least basic documentations to it.

Change 508717 merged by jenkins-bot:
[pywikibot/core@master] Drop support for script_wui.py

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

Xqt closed this task as Resolved.May 13 2019, 11:10 AM
Xqt claimed this task.