No longer displays pages from a title. In some cases it will display a list of index pages.
For example, http://en.wiktionary.org/w/index.php?title=Special:AllPages&from=Hillsbo... a list of index pages from Hilma, instead of pages titles from Hilma.
http://en.wiktionary.org/wiki/Special:AllPages/Hiffe displays no pages at all, and clicking on "Go" switches to Prefix index.
Not useful. Can we put back the working version please?
The format changed to avoid excessively long output. I've looked at the form and those links on wiktionary and don't see anything incorrect or not "working".
-Aaron Schulz
Date: Wed, 20 Aug 2008 08:06:29 +0300 From: rlullmann@gmail.com To: wikitech-l@lists.wikimedia.org Subject: [Wikitech-l] Special:All pages broken at about 03:00 UTC this morning
No longer displays pages from a title. In some cases it will display a list of index pages.
For example, http://en.wiktionary.org/w/index.php?title=Special:AllPages&from=Hillsbo... a list of index pages from Hilma, instead of pages titles from Hilma.
http://en.wiktionary.org/wiki/Special:AllPages/Hiffe displays no pages at all, and clicking on "Go" switches to Prefix index.
Not useful. Can we put back the working version please? _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_________________________________________________________________ Get ideas on sharing photos from people like you. Find new ways to share. http://www.windowslive.com/explore/photogallery/posts?ocid=TXT_TAGLM_WL_Phot...
Like this:
http://en.wiktionary.org/wiki/Special:AllPages/Hill
used to display 480 titles starting at "Hill". Now it does what PrefixIndex does. If I wanted that, I'd use Prefixindex. How do we get access to the original function? (And I don't understand the bit about "excessively long output" at all, it always displayed 480 titles (except at the end of the wiki).
It is now broken, and should be put back. (In particular, the python wikipedia framework has been broken.)
Two things in particular are now broken: the ability to display a section of the title index from an arbitrary starting point, and the the ability to display titles starting with at a prefix that doesn't exist in the database. (Also the undesirable switch from Allpages to Prefixindex.)
How do we do those now?
Robert
(also a meta question: how do we find out about these things before waking up to find them broken?)
On Wed, Aug 20, 2008 at 8:30 AM, Aaron Schulz jschulz_4587@msn.com wrote:
The format changed to avoid excessively long output. I've looked at the form and those links on wiktionary and don't see anything incorrect or not "working".
-Aaron Schulz
Date: Wed, 20 Aug 2008 08:06:29 +0300 From: rlullmann@gmail.com To: wikitech-l@lists.wikimedia.org Subject: [Wikitech-l] Special:All pages broken at about 03:00 UTC this
morning
No longer displays pages from a title. In some cases it will display a
list
of index pages.
For example,
http://en.wiktionary.org/w/index.php?title=Special:AllPages&from=Hillsbo...http://en.wiktionary.org/w/index.php?title=Special:AllPages&from=Hillsborough%21&namespace=0displays
a list of index pages from Hilma, instead of pages titles from Hilma.
http://en.wiktionary.org/wiki/Special:AllPages/Hiffe displays no pages
at
all, and clicking on "Go" switches to Prefix index.
Not useful. Can we put back the working version please? _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Get ideas on sharing photos from people like you. Find new ways to share.
http://www.windowslive.com/explore/photogallery/posts?ocid=TXT_TAGLM_WL_Phot... _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Wed, Aug 20, 2008 at 3:58 PM, Robert Ullmann rlullmann@gmail.com wrote:
It is now broken, and should be put back. (In particular, the python wikipedia framework has been broken.)
The User Interface is designed for users. The python Wikipedia framework, therefore, should use the API, and then it won't have these problems.
Quite so. However, it doesn't. And a *very* large amount of stuff is built on it. Would be good to fix it. Before changing the UI it relies on.
Question: How would the people maintaining it have known that it was going to be broken this morning?
Is easy to fix, took me < 3 minutes to fix my copy of wikipedia.py (mostly deleting code ;-).
But everyone else using the allpages generator will be stuck, and almost all will have no clue what is wrong or how to fix it.
On Wed, Aug 20, 2008 at 10:17 AM, Andrew Garrett andrew@epstone.net wrote:
On Wed, Aug 20, 2008 at 3:58 PM, Robert Ullmann rlullmann@gmail.com wrote:
It is now broken, and should be put back. (In particular, the python wikipedia framework has been broken.)
The User Interface is designed for users. The python Wikipedia framework, therefore, should use the API, and then it won't have these problems.
-- Andrew Garrett
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Anyone developing automated software which interfaces with MediaWiki should be subscribed to this list. And for any such person, this thread should be enough of a red-flag for them. The API has existed for awhile, and the UI should not be depended on for any automated things.
~Daniel Friesen(Dantman, Nadir-Seen-Fire) of: -The Nadir-Point Group (http://nadir-point.com) --It's Wiki-Tools subgroup (http://wiki-tools.com) --The ElectronicMe project (http://electronic-me.org) --Games-G.P.S. (http://ggps.org) -And Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) --Animepedia (http://anime.wikia.com) --Narutopedia (http://naruto.wikia.com)
Robert Ullmann wrote:
Quite so. However, it doesn't. And a *very* large amount of stuff is built on it. Would be good to fix it. Before changing the UI it relies on.
Question: How would the people maintaining it have known that it was going to be broken this morning?
Is easy to fix, took me < 3 minutes to fix my copy of wikipedia.py (mostly deleting code ;-).
But everyone else using the allpages generator will be stuck, and almost all will have no clue what is wrong or how to fix it.
On Wed, Aug 20, 2008 at 10:17 AM, Andrew Garrett andrew@epstone.net wrote:
On Wed, Aug 20, 2008 at 3:58 PM, Robert Ullmann rlullmann@gmail.com wrote:
It is now broken, and should be put back. (In particular, the python wikipedia framework has been broken.)
The User Interface is designed for users. The python Wikipedia framework, therefore, should use the API, and then it won't have these problems.
-- Andrew Garrett
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Robert Ullmann wrote:
Quite so. However, it doesn't. And a *very* large amount of stuff is built on it. Would be good to fix it. Before changing the UI it relies on.
Question: How would the people maintaining it have known that it was going to be broken this morning?
They have known for the past SEVERAL YEARS that UI COMPONENTS FREQUENTLY CHANGE and they should use MACHINE-READABLE APIS, as they have been told repeatedly OVER THE YEARS.
- -- brion
Brion Vibber wrote:
Robert Ullmann wrote:
Quite so. However, it doesn't. And a *very* large amount of stuff is built on it. Would be good to fix it. Before changing the UI it relies on.
Question: How would the people maintaining it have known that it was going to be broken this morning?
They have known for the past SEVERAL YEARS that UI COMPONENTS FREQUENTLY CHANGE and they should use MACHINE-READABLE APIS, as they have been told repeatedly OVER THE YEARS.
...so where's the edit API?
(Yeah, I know. But my real point is, you'll have a hard time convincing people that the API is actually a finished product ready for prime time as long as its feature set, as enabled on Wikimedia sites, has a huge gaping hole like that.)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Ilmari Karonen wrote:
Brion Vibber wrote:
Robert Ullmann wrote:
Quite so. However, it doesn't. And a *very* large amount of stuff is built on it. Would be good to fix it. Before changing the UI it relies on.
Question: How would the people maintaining it have known that it was going to be broken this morning?
They have known for the past SEVERAL YEARS that UI COMPONENTS FREQUENTLY CHANGE and they should use MACHINE-READABLE APIS, as they have been told repeatedly OVER THE YEARS.
...so where's the edit API?
Why is an edit API needed for reading a list of page names? Oh wait, it isn't! :)
The edit API is enabled on test.wikipedia.org for testing. If someday I hear from the API developers that it's ready to go, we'll see about turning it on elsewhere.
- -- brion
"Brion Vibber" brion@wikimedia.org wrote in message news:48AC45CE.8060308@wikimedia.org...
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Ilmari Karonen wrote:
Brion Vibber wrote:
Robert Ullmann wrote:
Quite so. However, it doesn't. And a *very* large amount of stuff is built on it. Would be good to fix it. Before changing the UI it relies on.
Question: How would the people maintaining it have known that it was going to be broken this morning?
They have known for the past SEVERAL YEARS that UI COMPONENTS FREQUENTLY CHANGE and they should use MACHINE-READABLE APIS, as they have been told repeatedly OVER THE YEARS.
...so where's the edit API?
Why is an edit API needed for reading a list of page names? Oh wait, it isn't! :)
That, of course, is not the point at all. The point is, why invest large amounts of time and effort in developing a bot framework to use an API that isn't yet complete?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Russell Blau wrote:
Why is an edit API needed for reading a list of page names? Oh wait, it isn't! :)
That, of course, is not the point at all. The point is, why invest large amounts of time and effort in developing a bot framework to use an API that isn't yet complete?
The API will never be complete -- it will always be under development.
MediaWiki will never be complete -- it will always be under development.
Wikipedia will never be complete -- it will always be under development.
Yet, I don't think we're going to back off and not use any of them until they're done?
Screen-scraping constantly-changing UI is like repeatedly banging yourself in the head with a bowling ball. It's painful and doesn't accomplish much, but it feels SO GOOD when you stop!
It's not as though nobody uses the API -- it's used by lots of bot frameworks and custom JS gadgets on the site, and has been FOR YEARS. It's time for pywikipediabot to wake up and stop hitting itself in the head...
- -- brion
Russell Blau wrote:
"Brion Vibber" brion@wikimedia.org wrote in message news:48AC45CE.8060308@wikimedia.org...
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Ilmari Karonen wrote:
Brion Vibber wrote:
Robert Ullmann wrote:
Quite so. However, it doesn't. And a *very* large amount of stuff is built on it. Would be good to fix it. Before changing the UI it relies on.
Question: How would the people maintaining it have known that it was going to be broken this morning?
They have known for the past SEVERAL YEARS that UI COMPONENTS FREQUENTLY CHANGE and they should use MACHINE-READABLE APIS, as they have been told repeatedly OVER THE YEARS.
...so where's the edit API?
Why is an edit API needed for reading a list of page names? Oh wait, it isn't! :)
That, of course, is not the point at all. The point is, why invest large amounts of time and effort in developing a bot framework to use an API that isn't yet complete?
I've been using the read API for at least a year, in a custom framework of my own design. It's easier to use than screen-scraping, uses less bandwidth for both the host and, client, it's stable, and it's faster. There's every reason in the world to use it, including that you don't have to worry about the UI changing by surprise at 3AM.
SQL
SQL writes:
There's every reason in the world to use it, including that you don't have to worry about the UI changing by surprise at 3AM.
SQL
Yes, you just have to worry that query.php is replaced with api.php, which may be then replaced with something else. And also, I went through the mediawiki-api archives and found about 9 breaking changes for API. Pretty stable, isn't it? :) --vvv
On Wed, Aug 20, 2008 at 1:58 PM, Victor Vasiliev vasilvv@gmail.com wrote:
Yes, you just have to worry that query.php is replaced with api.php, which may be then replaced with something else. And also, I went through the mediawiki-api archives and found about 9 breaking changes for API. Pretty stable, isn't it? :)
I don't understand why there are ever breaking changes in the API. THE API SHOULD NEVER EVER EVER CHANGE. IT SHOULD BE A STABLE INTERFACE. There needs to be a policy, set in stone, not negotiable, that behavior for a given API query should NEVER change in an incompatible fashion. If something is inconsistent it should be deprecated and a new function instituted to replace it. The old deprecated way could then be marked for a few years (say, three years, or at least one year) before finally being removed. Authors of bot frameworks should be encouraged to write code checking for <deprecated> or whatever and having their framework raise a warning of some kind to inform them that they should update it.
This really seems like a no-brainer to me. But, I'm not an API developer, so . . .
Aryeh Gregor schreef:
On Wed, Aug 20, 2008 at 1:58 PM, Victor Vasiliev vasilvv@gmail.com wrote:
Yes, you just have to worry that query.php is replaced with api.php, which may be then replaced with something else. And also, I went through the mediawiki-api archives and found about 9 breaking changes for API. Pretty stable, isn't it? :)
I don't understand why there are ever breaking changes in the API. THE API SHOULD NEVER EVER EVER CHANGE. IT SHOULD BE A STABLE INTERFACE. There needs to be a policy, set in stone, not negotiable, that behavior for a given API query should NEVER change in an incompatible fashion. If something is inconsistent it should be deprecated and a new function instituted to replace it. The old deprecated way could then be marked for a few years (say, three years, or at least one year) before finally being removed. Authors of bot frameworks should be encouraged to write code checking for <deprecated> or whatever and having their framework raise a warning of some kind to inform them that they should update it.
This really seems like a no-brainer to me. But, I'm not an API developer, so . . .
Those 9 breaking changes sound far worse than they are. Most breaking changes are allowed as such because they *technically* change the API's behavior, but in a way that's unlikely to bother people who use decent frameworks. Anyway, here they are:
[1] was done on the request of an end user and to achieve consistency across modules. As I pointed out to that user, I doubted that anyone actually *used* the old behavior, or would even notice when it was changed. [2] was done to prevent blowing up databases with LIMITless queries. The limit/continue interface has existed for other modules for ages, and supporting it for additional modules on the client side should be trivial. [3] broke something 24 hours after introducing it and made it actually do something useful [4] was announced by Yuri 10 months before hybrid support (i.e. support for both the old and the new parameter) was finally abandoned [5] and [6] handle erroneous parameters more gracefully, which was a much-requested improvement but technically broke BC, because erroneous requests would return a warning rather than an error [7] was, again, a few days old feature that was moved to a separate module. Anyone quick enough to support such a young feature can change one word in the module call equally quickly [8] was another change to a new module that prevented invalid XML from getting output [9] was partially undone in [8] (the userinfo part); the other part was more database-blowup avoidance
Breaking changes got a bad name earlier because one of them made it kind of impossible to support both the old and the new behavior at the same time. This had already been fixed, but the incompatible behavior was sadly present in 1.12.0rc1 (fixed in the final 1.12.0 release, though), and now that I know of the issue, I'll think about supporting both old and new behavior at the same time in future breaking changes. Ironically, [5] made that kind of support possible in certain situations.
Roan Kattouw (Catrope)
[1] http://lists.wikimedia.org/pipermail/mediawiki-api/2008-August/000660.html [2] http://lists.wikimedia.org/pipermail/mediawiki-api/2008-July/000588.html [3] http://lists.wikimedia.org/pipermail/mediawiki-api/2008-June/000576.html [4] http://lists.wikimedia.org/pipermail/mediawiki-api/2008-May/000528.html [5] http://lists.wikimedia.org/pipermail/mediawiki-api/2008-May/000541.html [6] http://lists.wikimedia.org/pipermail/mediawiki-api/2008-May/000543.html [7] http://lists.wikimedia.org/pipermail/mediawiki-api/2008-January/000319.html [8] http://lists.wikimedia.org/pipermail/mediawiki-api/2008-January/000311.html [9] http://lists.wikimedia.org/pipermail/mediawiki-api/2008-January/000310.html
On Wed, Aug 20, 2008 at 7:58 PM, Victor Vasiliev vasilvv@gmail.com wrote: [...]
And also, I went through the mediawiki-api archives and found about 9 breaking changes for API. Pretty stable, isn't it? :) --vvv
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
But far less recently. The API has been in development phase for the last two years or so with many modules added over time which were not all as consistent as we would want it to be. But I think now that we are entering a more stable phase where large portions that need to be covered are covered and not much change can be expected.
As for the edit api I'm not really sure whether it is ready. It has been some time that I last looked at it. If I remember correctly there are still some problems left with hooks that I'd rather see fixed. I did fix some myself some time ago but I don't recall whether I fixed all of them.
Bryan
Russell Blau schreef:
That, of course, is not the point at all. The point is, why invest large amounts of time and effort in developing a bot framework to use an API that isn't yet complete?
Because it can replace *most* (not all, yet) stuff screenscraping is currently still used for, and it'll be easier to migrate edit functions to the API once they're available.
About enabling the edit API on Wikipedia: I think it's ready to go. The only real problem it currently has is that action=edit doesn't handle aborts by hooks too well; the edit will be aborted, but the client will only get a vague "A hook aborted the action" (or something along those lines) error. A hook that allows for aborting the edit with a meaningful error message has been added (APIEditBeforeSave), but AFAIK it's currently only used by ConfirmEdit (and only because I migrated it myself). Similarly, extensions influencing other actions may rely on UI hooks that the API bypasses altogether.
We probably want testers' input here too. Also, we'll probably want to investigate which of the extensions enabled on Wikipedia use 'wrong' hooks and fix them.
Roan Kattouw (Catrope)
On Wed, Aug 20, 2008 at 2:20 PM, Roan Kattouw roan.kattouw@home.nl wrote:
About enabling the edit API on Wikipedia: I think it's ready to go. The only real problem it currently has is that action=edit doesn't handle aborts by hooks too well; the edit will be aborted, but the client will only get a vague "A hook aborted the action" (or something along those lines) error. A hook that allows for aborting the edit with a meaningful error message has been added (APIEditBeforeSave), but AFAIK it's currently only used by ConfirmEdit (and only because I migrated it myself). Similarly, extensions influencing other actions may rely on UI hooks that the API bypasses altogether.
Um, why are you adding an API-specific hook for this? Shouldn't it be a backend hook? I'm not sure why there should be *any* API hooks, actually, since the API should just be presenting backend information in a standard format. Extensions should never want to change the format that's returned, as far as I can imagine, since it's supposed to be uniform across all wikis. They should only want to change the actual info, which should be done on the backend level.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Aryeh Gregor wrote:
On Wed, Aug 20, 2008 at 2:20 PM, Roan Kattouw roan.kattouw@home.nl wrote:
About enabling the edit API on Wikipedia: I think it's ready to go. The only real problem it currently has is that action=edit doesn't handle aborts by hooks too well; the edit will be aborted, but the client will only get a vague "A hook aborted the action" (or something along those lines) error. A hook that allows for aborting the edit with a meaningful error message has been added (APIEditBeforeSave), but AFAIK it's currently only used by ConfirmEdit (and only because I migrated it myself). Similarly, extensions influencing other actions may rely on UI hooks that the API bypasses altogether.
Um, why are you adding an API-specific hook for this? Shouldn't it be a backend hook? I'm not sure why there should be *any* API hooks, actually, since the API should just be presenting backend information in a standard format. Extensions should never want to change the format that's returned, as far as I can imagine, since it's supposed to be uniform across all wikis. They should only want to change the actual info, which should be done on the backend level.
The way it _should_ be working is something like this:
1) There's a backend ("controller") class for performing edits. This has hook points for things like aborting or altering edits (spam checks, captcha, etc)
2) There's a frontend ("view") class for handling the HTML edit form. This has hook points for customizing the form output, checking custom input, and presenting UI for error conditions ("you hit spam!" or "you need to submit this extra form")
3) There's another frontend ("view") class for handling the API's edit interface. This _might_ also have hook points for handling special input/output and custom error formatting, though _ideally_ such stuff should be able to use existing I/O channels specified in the API (spam hit just raises an error conditions; captcha hits have an existing channel for saying "show this and respond to it").
Currently the EditPage class mixes a fair chunk of backend and UI, as do the edit filter hooks for spam blacklisting, CAPTCHAs, etc, so it's a bit icky. There's been some refactoring in the course of creating the edit API (as there was much refactoring to Special:Userlogin when the API's login modules were being created), but it remains incomplete.
(At least the raw page data storage model isn't mixed into EditPage! :)
- -- brion
Brion Vibber schreef:
Um, why are you adding an API-specific hook for this? Shouldn't it be a backend hook? I'm not sure why there should be *any* API hooks, actually, since the API should just be presenting backend information in a standard format. Extensions should never want to change the format that's returned, as far as I can imagine, since it's supposed to be uniform across all wikis. They should only want to change the actual info, which should be done on the backend level.
The way it _should_ be working is something like this:
- There's a backend ("controller") class for performing edits. This has
hook points for things like aborting or altering edits (spam checks, captcha, etc)
- There's a frontend ("view") class for handling the HTML edit form.
This has hook points for customizing the form output, checking custom input, and presenting UI for error conditions ("you hit spam!" or "you need to submit this extra form")
- There's another frontend ("view") class for handling the API's edit
interface. This _might_ also have hook points for handling special input/output and custom error formatting, though _ideally_ such stuff should be able to use existing I/O channels specified in the API (spam hit just raises an error conditions; captcha hits have an existing channel for saying "show this and respond to it").
Currently the EditPage class mixes a fair chunk of backend and UI, as do the edit filter hooks for spam blacklisting, CAPTCHAs, etc, so it's a bit icky. There's been some refactoring in the course of creating the edit API (as there was much refactoring to Special:Userlogin when the API's login modules were being created), but it remains incomplete.
(At least the raw page data storage model isn't mixed into EditPage! :)
Yup, EditPage is a nightmare. I have a half-written Edit class lying around that's supposed to contain the backend part of EditPage. It's far from complete, however, and currently on hold. I'd be happy to send anyone interested in continuing that rewrite before I do (which could take some time) my unfinished work.
About the hooks: most hooks should be in the backend, yes. However, extensions like ConfirmEdit need to return certain information (CAPTCHA URLs) to the user. There's a UI hook to do that in the UI, and there's an API hook to return that information to API users. Now CE is kind of unique that way, and the API does honor most hooks in EditPage.php, it just doesn't provide a way to pass a meaningful error message back to the user. The problem here is that since EditPage doesn't properly separete UI and backend, neither do its hooks. For instance, the hook that checks whether an edit is spam is supposed to come up with an HTML (!) error message, which it has to insert into the EditPage object somewhere. Of course that's deeply evil from the API's perspective. There's a similar issue with the upload code (actually, it's even worse) which necessitates a big rewrite before an action=upload module can even be written. Luckily (for me), Bryan committed to that task (thanks again).
The recurring theme here is that phase4 (if we ever go there) requires a rethinking of EditPage.php (and SpecialPreferences.php, BTW).
Roan Kattouw (Catrope)
On Wed, Aug 20, 2008 at 3:08 PM, Roan Kattouw roan.kattouw@home.nl wrote:
About the hooks: most hooks should be in the backend, yes. However, extensions like ConfirmEdit need to return certain information (CAPTCHA URLs) to the user. There's a UI hook to do that in the UI, and there's an API hook to return that information to API users.
What you *should* have is a backend hook that allows cancellation of an edit, with some way of passing back an error condition that can be displayed by both the human UI and the API.
The recurring theme here is that phase4 (if we ever go there) requires a rethinking of EditPage.php (and SpecialPreferences.php, BTW).
Sounds like an interesting project . . .
Aryeh Gregor schreef:
On Wed, Aug 20, 2008 at 3:08 PM, Roan Kattouw roan.kattouw@home.nl wrote:
About the hooks: most hooks should be in the backend, yes. However, extensions like ConfirmEdit need to return certain information (CAPTCHA URLs) to the user. There's a UI hook to do that in the UI, and there's an API hook to return that information to API users.
What you *should* have is a backend hook that allows cancellation of an edit, with some way of passing back an error condition that can be displayed by both the human UI and the API.
Come to think of it, letting the hook pass a message key and letting the extension add that message key to ApiBase::$messageMap as well seems like a good idea. Still, we'd be breaking dozens of extensions that way. I'd like some input from chief developers (you, Brion, etc.) before I do that.
Roan Kattouw (Catrope)
On Wed, Aug 20, 2008 at 4:21 PM, Roan Kattouw roan.kattouw@home.nl wrote:
Come to think of it, letting the hook pass a message key and letting the extension add that message key to ApiBase::$messageMap as well seems like a good idea. Still, we'd be breaking dozens of extensions that way.
Of course, you introduce a new hook and deprecate the old one (while still supporting it for now).
I'd like some input from chief developers (you, Brion, etc.) before I do that.
Well, I don't think I qualify as much of a "chief developer". Especially not to be listed before Brion. :P
Aryeh Gregor schreef:
Well, I don't think I qualify as much of a "chief developer". Especially not to be listed before Brion. :P
What I kind of meant is that you provide useful comments on pretty much everything you see.
Roan Kattouw (Catrope)
On Wed, Aug 20, 2008 at 4:41 PM, Roan Kattouw roan.kattouw@home.nl wrote:
Aryeh Gregor schreef:
Well, I don't think I qualify as much of a "chief developer". Especially not to be listed before Brion. :P
What I kind of meant is that you provide useful comments on pretty much everything you see.
Chief pundit, then. ;)
On Wed, Aug 20, 2008 at 11:58:39AM -0700, Brion Vibber wrote:
The way it _should_ be working is something like this:
- There's a backend ("controller") class for performing edits. This has
hook points for things like aborting or altering edits (spam checks, captcha, etc)
- There's a frontend ("view") class for handling the HTML edit form.
This has hook points for customizing the form output, checking custom input, and presenting UI for error conditions ("you hit spam!" or "you need to submit this extra form")
- There's another frontend ("view") class for handling the API's edit
interface. This _might_ also have hook points for handling special input/output and custom error formatting, though _ideally_ such stuff should be able to use existing I/O channels specified in the API (spam hit just raises an error conditions; captcha hits have an existing channel for saying "show this and respond to it").
Currently the EditPage class mixes a fair chunk of backend and UI, as do the edit filter hooks for spam blacklisting, CAPTCHAs, etc, so it's a bit icky. There's been some refactoring in the course of creating the edit API (as there was much refactoring to Special:Userlogin when the API's login modules were being created), but it remains incomplete.
So the obvious followup question is: is there a plan to migrate the front end to *use the API* to talk to the backend (which is the preferred approach to such things anyway)?
Cheers, -- jra
On Wed, Aug 20, 2008 at 3:24 PM, Jay R. Ashworth jra@baylink.com wrote:
So the obvious followup question is: is there a plan to migrate the front end to *use the API* to talk to the backend (which is the preferred approach to such things anyway)?
One practical issue with this at present is that nobody who does much of anything with core does much of anything with the API. I've barely looked at it at all.
As a more philosophical thing, there's no reason for the human UI to call the API. We should have a back-end, and then two interfaces to that: one designed for external robots, and one designed for HTML-viewing humans. Both of the interfaces should use the internal PHP interface to speak to the back-end. The API operates in a format that's suitable for robots to use, not suitable for internal code to use.
Aryeh Gregor schreef:
On Wed, Aug 20, 2008 at 3:24 PM, Jay R. Ashworth jra@baylink.com wrote:
So the obvious followup question is: is there a plan to migrate the front end to *use the API* to talk to the backend (which is the preferred approach to such things anyway)?
One practical issue with this at present is that nobody who does much of anything with core does much of anything with the API. I've barely looked at it at all.
True. Actually, there's a pattern of isolation here. While pretty much all developers are familiar with the 'core' classes (Title, Article, Revision, etc.), very few are familiar with isolated ones such as the parser, the API, the image handling code, the Database abstraction layer (except for select() and similar functions)
As a more philosophical thing, there's no reason for the human UI to call the API. We should have a back-end, and then two interfaces to that: one designed for external robots, and one designed for HTML-viewing humans. Both of the interfaces should use the internal PHP interface to speak to the back-end. The API operates in a format that's suitable for robots to use, not suitable for internal code to use.
Simetrical is right here: the UI and the API call the same functions, and display the results in different ways. That's exactly why there's no sense in migrating the front end to the API (and that's just forgetting about the HTTP overhead involved).
Roan Kattouw (Catrope)
Jay said:
So the obvious followup question is: is there a plan to migrate the front end to *use the API* to talk to the backend (which is the preferred approach to such things anyway)?
There are times when utilizing the API programatically could make extension development much easier. The last time I looked at the API certain things were hard coded (such as bot limits - yuck) which made it tough/impossible to use in certain extension scenarios. I believe these have been corrected though, so it's probably a good resource for certain classes of extensions.
Someone familiar with the core could always construct a proper $dbr->select() querys, but it would be easier (read: less code) in some cases to let the API classes handle it.
-- Jim R. Wilson (jimbojw)
On Wed, Aug 20, 2008 at 3:20 PM, Roan Kattouw roan.kattouw@home.nl wrote:
Aryeh Gregor schreef:
On Wed, Aug 20, 2008 at 3:24 PM, Jay R. Ashworth jra@baylink.com wrote:
So the obvious followup question is: is there a plan to migrate the front end to *use the API* to talk to the backend (which is the preferred approach to such things anyway)?
One practical issue with this at present is that nobody who does much of anything with core does much of anything with the API. I've barely looked at it at all.
True. Actually, there's a pattern of isolation here. While pretty much all developers are familiar with the 'core' classes (Title, Article, Revision, etc.), very few are familiar with isolated ones such as the parser, the API, the image handling code, the Database abstraction layer (except for select() and similar functions)
As a more philosophical thing, there's no reason for the human UI to call the API. We should have a back-end, and then two interfaces to that: one designed for external robots, and one designed for HTML-viewing humans. Both of the interfaces should use the internal PHP interface to speak to the back-end. The API operates in a format that's suitable for robots to use, not suitable for internal code to use.
Simetrical is right here: the UI and the API call the same functions, and display the results in different ways. That's exactly why there's no sense in migrating the front end to the API (and that's just forgetting about the HTTP overhead involved).
Roan Kattouw (Catrope)
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Thu, Aug 21, 2008 at 2:52 PM, Jim R. Wilson wilson.jim.r@gmail.com wrote:
Jay said:
So the obvious followup question is: is there a plan to migrate the front end to *use the API* to talk to the backend (which is the preferred approach to such things anyway)?
There are times when utilizing the API programatically could make extension development much easier. The last time I looked at the API certain things were hard coded (such as bot limits - yuck) which made it tough/impossible to use in certain extension scenarios. I believe these have been corrected though, so it's probably a good resource for certain classes of extensions.
Someone familiar with the core could always construct a proper $dbr->select() querys, but it would be easier (read: less code) in some cases to let the API classes handle it.
-- Jim R. Wilson (jimbojw)
On Wed, Aug 20, 2008 at 3:20 PM, Roan Kattouw roan.kattouw@home.nl wrote:
Aryeh Gregor schreef:
On Wed, Aug 20, 2008 at 3:24 PM, Jay R. Ashworth jra@baylink.com wrote:
So the obvious followup question is: is there a plan to migrate the front end to *use the API* to talk to the backend (which is the preferred approach to such things anyway)?
One practical issue with this at present is that nobody who does much of anything with core does much of anything with the API. I've barely looked at it at all.
True. Actually, there's a pattern of isolation here. While pretty much all developers are familiar with the 'core' classes (Title, Article, Revision, etc.), very few are familiar with isolated ones such as the parser, the API, the image handling code, the Database abstraction layer (except for select() and similar functions)
As a more philosophical thing, there's no reason for the human UI to call the API. We should have a back-end, and then two interfaces to that: one designed for external robots, and one designed for HTML-viewing humans. Both of the interfaces should use the internal PHP interface to speak to the back-end. The API operates in a format that's suitable for robots to use, not suitable for internal code to use.
Simetrical is right here: the UI and the API call the same functions, and display the results in different ways. That's exactly why there's no sense in migrating the front end to the API (and that's just forgetting about the HTTP overhead involved).
Roan Kattouw (Catrope)
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
PrefixSearch does it (around line 130).
-Chad
Jim R. Wilson schreef:
Jay said:
So the obvious followup question is: is there a plan to migrate the front end to *use the API* to talk to the backend (which is the preferred approach to such things anyway)?
There are times when utilizing the API programatically could make extension development much easier. The last time I looked at the API certain things were hard coded (such as bot limits - yuck) which made it tough/impossible to use in certain extension scenarios. I believe these have been corrected though, so it's probably a good resource for certain classes of extensions.
Someone familiar with the core could always construct a proper $dbr->select() querys, but it would be easier (read: less code) in some cases to let the API classes handle it.
Calling the API from within MW (or extensions) can be done using the FauxRequest class. This also makes the API ignore the maximum limit, so you can set limit parameters to whatever you like (not to infinity, however). This feature is documented at [1].
Roan Kattouw (Catrope)
On Thu, Aug 21, 2008 at 2:52 PM, Jim R. Wilson wilson.jim.r@gmail.com wrote:
There are times when utilizing the API programatically could make extension development much easier. The last time I looked at the API certain things were hard coded (such as bot limits - yuck) which made it tough/impossible to use in certain extension scenarios. I believe these have been corrected though, so it's probably a good resource for certain classes of extensions.
Someone familiar with the core could always construct a proper $dbr->select() querys, but it would be easier (read: less code) in some cases to let the API classes handle it.
That's functionality that the backend should provide, not the API. At least IMO. The API is primarily a bot interface, not a PHP interface. Trying to use it as a PHP interface as well will require a lot of contortions, since there are fundamental differences between the desirable traits of each type of interface:
* The level of access that bots and scripts can have. Bots get carefully limited access, while extensions have unlimited read/write access. This means that if the API is primarily targeted at bots, it will have limited write access, and *very* limited support for administrative functions that extensions may very well want to invoke. For instance, the userrights module was removed on principle, last I checked, as something that we didn't need the security risks of given that bots are unlikely to ever need to change user rights. * The format of access. Bots use HTTP requests, while extensions use direct function calls. HTTP requests are text-only, and consist of one of a very small number of filenames plus an arbitrary associative array mapping string parameters to string values. Function calls support a rich variety of data types, and consist of any of a potentially very large number of individual functions plus a small, fixed ordered list of parameters. Trying to shoehorn one access format into another will require contortions like FauxRequest. * The cost of access. HTTP requests have very high overhead -- set up network connection, pass request through a long chain of servers and processes, send result back -- usually on the order of a hundred milliseconds or more. Function calls have very low overhead, without even a context switch: likely well under a microsecond. Moreover, HTTP requests are stateless, while a function-call-based interface can maintain extremely rich state. These push the format and nature of a bot API in a very different direction from that of an extension API. A bot API will tend to encourage a small number of elaborate requests, because the state must be built on every request. A good extension API, on the other hand, allows many small function calls, reusing state (such as already-initialized objects) as often as possible, with each function doing one thing. Again, these cannot be cleanly reconciled.
Although I'm not an extension author, and you are, I don't *think* you want to use the API, now or ever. I think what you want is a clean separation between backend and frontend. You should then be able to call the backend functions directly, and they'll provide you with clean functionality like "perform an edit by this User object to this section number of this Article object with this text, with(out) usual permission checks, returning an easily-parsed array of errors and warnings if any occur".
On Thu, Aug 21, 2008 at 05:10:34PM -0400, Aryeh Gregor wrote:
- The cost of access. HTTP requests have very high overhead -- set up
network connection, pass request through a long chain of servers and processes, send result back -- usually on the order of a hundred milliseconds or more.
As soon as I read this, i realize that indeed, you guys are talking about "an implementation of an interface to the API", not the actual thing itself.
An API, by definition, is a declared set of call and response interfaces to a block of core code, with defined parameter domains and ranges.
It's not the interfaces you use to *get* to that, be it HTML, REST, or whosoever...
Cheers, -- jra
On Thu, Aug 21, 2008 at 6:03 PM, Jay R. Ashworth jra@baylink.com wrote:
As soon as I read this, i realize that indeed, you guys are talking about "an implementation of an interface to the API", not the actual thing itself.
An API, by definition, is a declared set of call and response interfaces to a block of core code, with defined parameter domains and ranges.
It's not the interfaces you use to *get* to that, be it HTML, REST, or whosoever...
When we say "API" we mean "bot API", i.e., "a web-based API provided for third parties to read data from (and possibly write data to) the wiki in a programmatic fashion, either anonymously or via a user account". This is in context to the human UI, which is meant to provide the same functions but to humans, not computer programs. This is how the term is often used in web contexts these days.
We do *not* mean a programming API, i.e., a set of classes, methods, and functions that MediaWiki itself and its extensions can call. That's what we often call the "backend". api.php uses the backend, as do the usual index.php and other human access methods.
The issue is that historically, the only access to the backend was through the human UI, or via extensions (but those can always hack things up by running queries directly and so on). Therefore there was a lot of careless mixing of UI and backend code. The existence of the bot API is forcing some of this mixing to be fixed, which incidentally improves things for extensions too. So the API is incidentally related to separation of interface logic from business logic -- but the API itself is supposed to only contain interface logic, for remote bot access.
Aryeh Gregor wrote:
On Thu, Aug 21, 2008 at 2:52 PM, Jim R. Wilson wilson.jim.r@gmail.com wrote:
There are times when utilizing the API programatically could make extension development much easier. The last time I looked at the API
Although I'm not an extension author, and you are, I don't *think* you want to use the API, now or ever. I think what you want is a clean
As an extension author, I can say that in one of my extensions I have used the API to great satisfaction of everyone :)
Nikola Smolenski schreef:
Aryeh Gregor wrote:
On Thu, Aug 21, 2008 at 2:52 PM, Jim R. Wilson wilson.jim.r@gmail.com wrote:
There are times when utilizing the API programatically could make extension development much easier. The last time I looked at the API
Although I'm not an extension author, and you are, I don't *think* you want to use the API, now or ever. I think what you want is a clean
As an extension author, I can say that in one of my extensions I have used the API to great satisfaction of everyone :)
Using the API internally is useful in some cases, yes. If you're gonna run a complex query the API happens to support, you're usually better off using the API, to prevent code duplication. But while there are bound to be places in the code where the API is used internally (which doesn't have the HTTP overhead I mentioned earlier, my mistake) in the core, in extensions and even in the API itself, there's no reason for the core to systematically use the API for everything.
Roan Kattouw (Catrope)
On Wed, Aug 20, 2008 at 10:20:44PM +0200, Roan Kattouw wrote:
Simetrical is right here: the UI and the API call the same functions, and display the results in different ways. That's exactly why there's no sense in migrating the front end to the API (and that's just forgetting about the HTTP overhead involved).
Um, we mean different things by "API", clearly.
What I think *you* mean by it is "a thin wrapper over the *actual* API".
Am I wrong?
Cheers, -- jra
Jay R. Ashworth schreef:
On Wed, Aug 20, 2008 at 10:20:44PM +0200, Roan Kattouw wrote:
Simetrical is right here: the UI and the API call the same functions, and display the results in different ways. That's exactly why there's no sense in migrating the front end to the API (and that's just forgetting about the HTTP overhead involved).
Um, we mean different things by "API", clearly.
What I think *you* mean by it is "a thin wrapper over the *actual* API".
Am I wrong?
In MediaWiki speak, the API is api.php . You're probably referring to the backend functions which *are* used by the UI.
Just to clarify again: the API and the UI call *the same functions*, but present the results differently. That's why there's *nothing to gain whatsoever* in letting the UI call the API.
Roan Kattouw (Catrope)
On Fri, Aug 22, 2008 at 12:01:53AM +0200, Roan Kattouw wrote:
Jay R. Ashworth schreef:
On Wed, Aug 20, 2008 at 10:20:44PM +0200, Roan Kattouw wrote:
Simetrical is right here: the UI and the API call the same functions, and display the results in different ways. That's exactly why there's no sense in migrating the front end to the API (and that's just forgetting about the HTTP overhead involved).
Um, we mean different things by "API", clearly.
What I think *you* mean by it is "a thin wrapper over the *actual* API".
Am I wrong?
In MediaWiki speak, the API is api.php . You're probably referring to the backend functions which *are* used by the UI.
Just to clarify again: the API and the UI call *the same functions*, but present the results differently. That's why there's *nothing to gain whatsoever* in letting the UI call the API.
If api.php exposes every and only the interfaces already used by the core code, and the current UI can't cheat and do things api.php does not expose to the core's state, then yes, my desire and concerns are satisfied.
Cheers, -- jra
On Fri, Aug 22, 2008 at 12:01 AM, Roan Kattouw roan.kattouw@home.nl wrote:
Just to clarify again: the API and the UI call *the same functions*, but present the results differently. That's why there's *nothing to gain whatsoever* in letting the UI call the API.
In theory...
When we say "API" we mean "bot API", i.e., "a web-based API provided for third parties to read data from (and possibly write data to) the wiki in a programmatic fashion, either anonymously or via a user account".
Ok, so under that strict definition, the answer to the original question of whether the internal core code would ever use it is obviously "no". If you define "the API" as including the externalized HTTP mechanism by which the functionality is accessed, then of course it makes no sense for core code to use it per all the reasons previously mentioned. Case closed, points granted. :)
On the other hand, if you consider the supporting PHP classes through which api.php makes its calls as part of "the API" then I still contend that there are probably cases where it would be easier or simpler (or both) to just use it than say construct all the database queries onesself.
Personally, I'm not enough of a purist to argue for or against making "all" core code utilize some standard set of classes to encapsulate a data model, except to say that there are good reasons why MW doesn't employ an ORM, and those reasons are probably applicable to the argument against a one-size-fits-all API backend.
-- Jim
On Thu, Aug 21, 2008 at 5:22 PM, Bryan Tong Minh bryan.tongminh@gmail.com wrote:
On Fri, Aug 22, 2008 at 12:01 AM, Roan Kattouw roan.kattouw@home.nl wrote:
Just to clarify again: the API and the UI call *the same functions*, but present the results differently. That's why there's *nothing to gain whatsoever* in letting the UI call the API.
In theory...
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Fri, Aug 22, 2008 at 2:02 AM, Jim R. Wilson wilson.jim.r@gmail.com wrote:
On the other hand, if you consider the supporting PHP classes through which api.php makes its calls as part of "the API" then I still contend that there are probably cases where it would be easier or simpler (or both) to just use it than say construct all the database queries onesself.
Those are what I'm calling the "backend", which is supposed to be called separately by both the human UI and the bot API. As well as any extensions.
On Fri, Aug 22, 2008 at 2:51 AM, Nikola Smolenski smolensk@eunet.yu wrote:
As an extension author, I can say that in one of my extensions I have used the API to great satisfaction of everyone :)
Which one?
On Fri, Aug 22, 2008 at 4:40 AM, Roan Kattouw roan.kattouw@home.nl wrote:
Using the API internally is useful in some cases, yes. If you're gonna run a complex query the API happens to support, you're usually better off using the API, to prevent code duplication.
So why does the API have any logic to do anything except translate the HTTP query into backend functions and display the results? If you have a lot of internal logic anywhere, that other callers would like to use, I suspect that would be best moved into the actual classes somehow. It's the same as with the human UI: you shouldn't (ideally) be mixing business logic with logic for a specific output type.
Aryeh Gregor wrote:
On Fri, Aug 22, 2008 at 2:51 AM, Nikola Smolenski smolensk@eunet.yu wrote:
As an extension author, I can say that in one of my extensions I have used the API to great satisfaction of everyone :)
Which one?
Aryeh Gregor schreef:
On Fri, Aug 22, 2008 at 4:40 AM, Roan Kattouw roan.kattouw@home.nl wrote:
Using the API internally is useful in some cases, yes. If you're gonna run a complex query the API happens to support, you're usually better off using the API, to prevent code duplication.
So why does the API have any logic to do anything except translate the HTTP query into backend functions and display the results? If you have a lot of internal logic anywhere, that other callers would like to use, I suspect that would be best moved into the actual classes somehow. It's the same as with the human UI: you shouldn't (ideally) be mixing business logic with logic for a specific output type.
That's probably laziness caused by the fact that the API implementation predates the code that uses FauxRequest.
Roan Kattouw (Catrope)
;) And then there are a few of us who get intimate with a fair percent of the complex and isolated interfaces, enough to scare themselves. T_T Some time ago, I came to realize that I had actually started to grasp an understanding of how the Parser worked. The preprocessor as well. Nearly all my new ParserFunctions use SFH_OBJ_ARGS and some even do scary things with the frames. When someone asks what function to use in a hook or a tag to do something with the parser, I actually understand what part of the parser will best do that for them (Without needing to trudge around the functions and make a bad guess), and even worse... T_T I'm actually rewriting a portion of the parser myself... And I'm starting to make use of parseresque code in my own work.
As for the other, anyone remember my rewrite of the Database class's titleName method. And my suggestion for a doQuery arg (though that was changed into a backend function that works with strings).
Actually, I'm building my own Database library. Heh, now that's the scary portion. I even implemented Brion's idea for a RawSql class ( Trust me ;) it works quite nicely, it even inspired the RawMarkup class inside of my markup abstraction library (similar to the Xml class))
~Daniel Friesen(Dantman, Nadir-Seen-Fire) of: -The Nadir-Point Group (http://nadir-point.com) --It's Wiki-Tools subgroup (http://wiki-tools.com) --The ElectronicMe project (http://electronic-me.org) --Games-G.P.S. (http://ggps.org) -And Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) --Animepedia (http://anime.wikia.com) --Narutopedia (http://naruto.wikia.com)
Roan Kattouw wrote:
Aryeh Gregor schreef:
On Wed, Aug 20, 2008 at 3:24 PM, Jay R. Ashworth jra@baylink.com wrote:
So the obvious followup question is: is there a plan to migrate the front end to *use the API* to talk to the backend (which is the preferred approach to such things anyway)?
One practical issue with this at present is that nobody who does much of anything with core does much of anything with the API. I've barely looked at it at all.
True. Actually, there's a pattern of isolation here. While pretty much all developers are familiar with the 'core' classes (Title, Article, Revision, etc.), very few are familiar with isolated ones such as the parser, the API, the image handling code, the Database abstraction layer (except for select() and similar functions)
As a more philosophical thing, there's no reason for the human UI to call the API. We should have a back-end, and then two interfaces to that: one designed for external robots, and one designed for HTML-viewing humans. Both of the interfaces should use the internal PHP interface to speak to the back-end. The API operates in a format that's suitable for robots to use, not suitable for internal code to use.
Simetrical is right here: the UI and the API call the same functions, and display the results in different ways. That's exactly why there's no sense in migrating the front end to the API (and that's just forgetting about the HTTP overhead involved).
Roan Kattouw (Catrope)
Daniel Friesen schreef:
;) And then there are a few of us who get intimate with a fair percent of the complex and isolated interfaces, enough to scare themselves. T_T Some time ago, I came to realize that I had actually started to grasp an understanding of how the Parser worked. The preprocessor as well. Nearly all my new ParserFunctions use SFH_OBJ_ARGS and some even do scary things with the frames. When someone asks what function to use in a hook or a tag to do something with the parser, I actually understand what part of the parser will best do that for them (Without needing to trudge around the functions and make a bad guess), and even worse... T_T I'm actually rewriting a portion of the parser myself... And I'm starting to make use of parseresque code in my own work.
As for the other, anyone remember my rewrite of the Database class's titleName method. And my suggestion for a doQuery arg (though that was changed into a backend function that works with strings).
Actually, I'm building my own Database library. Heh, now that's the scary portion. I even implemented Brion's idea for a RawSql class ( Trust me ;) it works quite nicely, it even inspired the RawMarkup class inside of my markup abstraction library (similar to the Xml class))
You're welcome to help out us API devs, if that's your next step ;)
Roan Kattouw (Catrope)
Heh, perhaps... ^_^ Though I'm more likely to do some DB+API evil and attempt to eliminate all the hardcoded SQL inside of the API.
Though, to say the truth I don't know how well I'd fit in the API. I honestly have a strong dislike of supporting real old things. While I do try to keep backwards compatibility in the rest of MediaWiki, there are many cases where where we break things for the extensions that interact with the software. When it comes to my extensions that's a whole strong case. I only support alpha and the latest stable (well, 1.13 came out, so I might support 1.12 for a few more months). Actually I have a few real complex extensions which only support recent versions of 1.14a, but of course those are special cases using real extreme parts of the parser which I've actually had to add to the parser myself. But really, one of my old morales was "Upgrades are for features and fixes... If you want features, then upgrade. There is no reason to support a new feature in an old version of the software. If someone wants the feature, then they can upgrade. It is the same software, it merely has a different version number and more features."
^_^ Actually, on an unrelated note... I wish I'd stop seeing these /extensions/.../install.php files. Does anyone not remember that we have a hook inside of update.php which allows extensions to add new SQL updates into the update system? ;)
~Daniel Friesen(Dantman, Nadir-Seen-Fire) of: -The Nadir-Point Group (http://nadir-point.com) --It's Wiki-Tools subgroup (http://wiki-tools.com) --The ElectronicMe project (http://electronic-me.org) --Games-G.P.S. (http://ggps.org) -And Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) --Animepedia (http://anime.wikia.com) --Narutopedia (http://naruto.wikia.com)
Roan Kattouw wrote:
Daniel Friesen schreef:
;) And then there are a few of us who get intimate with a fair percent of the complex and isolated interfaces, enough to scare themselves. T_T Some time ago, I came to realize that I had actually started to grasp an understanding of how the Parser worked. The preprocessor as well. Nearly all my new ParserFunctions use SFH_OBJ_ARGS and some even do scary things with the frames. When someone asks what function to use in a hook or a tag to do something with the parser, I actually understand what part of the parser will best do that for them (Without needing to trudge around the functions and make a bad guess), and even worse... T_T I'm actually rewriting a portion of the parser myself... And I'm starting to make use of parseresque code in my own work.
As for the other, anyone remember my rewrite of the Database class's titleName method. And my suggestion for a doQuery arg (though that was changed into a backend function that works with strings).
Actually, I'm building my own Database library. Heh, now that's the scary portion. I even implemented Brion's idea for a RawSql class ( Trust me ;) it works quite nicely, it even inspired the RawMarkup class inside of my markup abstraction library (similar to the Xml class))
You're welcome to help out us API devs, if that's your next step ;)
Roan Kattouw (Catrope)
Daniel Friesen schreef:
Heh, perhaps... ^_^ Though I'm more likely to do some DB+API evil and attempt to eliminate all the hardcoded SQL inside of the API.
Save your time, it's been eliminated already AFAIK.
Though, to say the truth I don't know how well I'd fit in the API. I honestly have a strong dislike of supporting real old things. While I do try to keep backwards compatibility in the rest of MediaWiki, there are many cases where where we break things for the extensions that interact with the software.
Hearing that, the idea of having you as API lead developer does sound scary (no offense).
Roan Kattouw (Catrope)
On Wed, Aug 20, 2008 at 04:01:14PM -0400, Aryeh Gregor wrote:
On Wed, Aug 20, 2008 at 3:24 PM, Jay R. Ashworth jra@baylink.com wrote:
So the obvious followup question is: is there a plan to migrate the front end to *use the API* to talk to the backend (which is the preferred approach to such things anyway)?
As a more philosophical thing, there's no reason for the human UI to call the API.
Sure there is. Jon Bentley is wrong?
We should have a back-end, and then two interfaces to
that: one designed for external robots, and one designed for HTML-viewing humans. Both of the interfaces should use the internal PHP interface to speak to the back-end. The API operates in a format that's suitable for robots to use, not suitable for internal code to use.
I think we're bandying semantics. There should be one interface to the core, which provides all the functionality necessary, and one of the clients to that interface should be the tradtional front end.
It's a design pattern that is well tested and proven... and means you never have to hear "why can't I access that function from the front end" again.
It also makes for a cleaner separation of powers from the UI to the core.
Cheers, -- jra
I'm actually working on refactoring the EditPage class. My goals are a bit different, but they still do require some more organization in EditPage.
I'm trying to make EditPage expendable. Currently the EditPage has so much different stuff mixed in different areas of the class that it's impossible to override a small area of it inside of a subclass. ie: A different type of edit page, such as SF's formedit.
~Daniel Friesen(Dantman, Nadir-Seen-Fire) of: -The Nadir-Point Group (http://nadir-point.com) --It's Wiki-Tools subgroup (http://wiki-tools.com) --The ElectronicMe project (http://electronic-me.org) --Games-G.P.S. (http://ggps.org) -And Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) --Animepedia (http://anime.wikia.com) --Narutopedia (http://naruto.wikia.com)
Brion Vibber wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Aryeh Gregor wrote:
On Wed, Aug 20, 2008 at 2:20 PM, Roan Kattouw roan.kattouw@home.nl wrote:
About enabling the edit API on Wikipedia: I think it's ready to go. The only real problem it currently has is that action=edit doesn't handle aborts by hooks too well; the edit will be aborted, but the client will only get a vague "A hook aborted the action" (or something along those lines) error. A hook that allows for aborting the edit with a meaningful error message has been added (APIEditBeforeSave), but AFAIK it's currently only used by ConfirmEdit (and only because I migrated it myself). Similarly, extensions influencing other actions may rely on UI hooks that the API bypasses altogether.
Um, why are you adding an API-specific hook for this? Shouldn't it be a backend hook? I'm not sure why there should be *any* API hooks, actually, since the API should just be presenting backend information in a standard format. Extensions should never want to change the format that's returned, as far as I can imagine, since it's supposed to be uniform across all wikis. They should only want to change the actual info, which should be done on the backend level.
The way it _should_ be working is something like this:
- There's a backend ("controller") class for performing edits. This has
hook points for things like aborting or altering edits (spam checks, captcha, etc)
- There's a frontend ("view") class for handling the HTML edit form.
This has hook points for customizing the form output, checking custom input, and presenting UI for error conditions ("you hit spam!" or "you need to submit this extra form")
- There's another frontend ("view") class for handling the API's edit
interface. This _might_ also have hook points for handling special input/output and custom error formatting, though _ideally_ such stuff should be able to use existing I/O channels specified in the API (spam hit just raises an error conditions; captcha hits have an existing channel for saying "show this and respond to it").
Currently the EditPage class mixes a fair chunk of backend and UI, as do the edit filter hooks for spam blacklisting, CAPTCHAs, etc, so it's a bit icky. There's been some refactoring in the course of creating the edit API (as there was much refactoring to Special:Userlogin when the API's login modules were being created), but it remains incomplete.
(At least the raw page data storage model isn't mixed into EditPage! :)
- -- brion
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkisaV8ACgkQwRnhpk1wk47AswCgxnUPZhA5+Kxg0tuGdxJ0Z19q SIEAoKNhI5/SCjIE8tqDPmPTGprwmcW8 =nPgB -----END PGP SIGNATURE-----
Daniel Friesen schreef:
I'm actually working on refactoring the EditPage class. My goals are a bit different, but they still do require some more organization in EditPage.
I'm trying to make EditPage expendable. Currently the EditPage has so much different stuff mixed in different areas of the class that it's impossible to override a small area of it inside of a subclass. ie: A different type of edit page, such as SF's formedit.
If that results in a clean separation of UI and backend code, it would probably solve my problem.
Roan Kattouw (Catrope)
It might do a bit of a better job of it. I'm actually thinking of putting the preview parsing stuff (just the parserOutput) into the initialization rather than arbitrarily calling a function which mixes UI and other stuff.
Though, I may be doing a bit more work in the UI area than a simple UI backend split. I'm actually splitting up the different areas of the UI so that parts can actually be overrided rather than needing to override and duplicate an entire large function in a way which may cause issues when some of that code is changed in future revisions.
~Daniel Friesen(Dantman, Nadir-Seen-Fire) of: -The Nadir-Point Group (http://nadir-point.com) --It's Wiki-Tools subgroup (http://wiki-tools.com) --The ElectronicMe project (http://electronic-me.org) --Games-G.P.S. (http://ggps.org) -And Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) --Animepedia (http://anime.wikia.com) --Narutopedia (http://naruto.wikia.com)
Roan Kattouw wrote:
Daniel Friesen schreef:
I'm actually working on refactoring the EditPage class. My goals are a bit different, but they still do require some more organization in EditPage.
I'm trying to make EditPage expendable. Currently the EditPage has so much different stuff mixed in different areas of the class that it's impossible to override a small area of it inside of a subclass. ie: A different type of edit page, such as SF's formedit.
If that results in a clean separation of UI and backend code, it would probably solve my problem.
Roan Kattouw (Catrope)
On Wed, Aug 20, 2008 at 1:58 AM, Robert Ullmann rlullmann@gmail.com wrote:
Like this:
http://en.wiktionary.org/wiki/Special:AllPages/Hill
used to display 480 titles starting at "Hill". Now it does what PrefixIndex does. If I wanted that, I'd use Prefixindex. How do we get access to the original function? (And I don't understand the bit about "excessively long output" at all, it always displayed 480 titles (except at the end of the wiki).
As far as I can tell, formerly the URL you gave did nothing at all. r39427 http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=39427 appears to have allowed subpage syntax to be used for AllPages; if I undo that commit then AllPages/Foo returns the same page as plain old AllPages. Your suggested behavior appears more sensible in any event, though.
I'm not really sympathetic to bot authors who screen-scrape special pages instead of using the API, though.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Aryeh Gregor wrote:
On Wed, Aug 20, 2008 at 1:58 AM, Robert Ullmann rlullmann@gmail.com wrote:
Like this:
http://en.wiktionary.org/wiki/Special:AllPages/Hill
used to display 480 titles starting at "Hill". Now it does what PrefixIndex does. If I wanted that, I'd use Prefixindex. How do we get access to the original function? (And I don't understand the bit about "excessively long output" at all, it always displayed 480 titles (except at the end of the wiki).
As far as I can tell, formerly the URL you gave did nothing at all.
You're incorrect.
- -- brion
On Wed, Aug 20, 2008 at 12:03 PM, Brion Vibber brion@wikimedia.org wrote:
Aryeh Gregor wrote:
As far as I can tell, formerly the URL you gave did nothing at all.
You're incorrect.
Yeah, looks like I only reverted one revision to test when it was a whole series.
Aryeh Gregor wrote:
On Wed, Aug 20, 2008 at 1:58 AM, Robert Ullmann rlullmann@gmail.com wrote:
As far as I can tell, formerly the URL you gave did nothing at all.
This is wrong. It used to list all pages, starting at Hill. There were links to the previous and next page of the large listing of all pages.
r39427 http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=39427 appears to have allowed subpage syntax to be used for AllPages;
Yes, so it seems if you compare to the immediately previous version. But that is the 3rd commit (by aaron) that day. If you go back to the older version (revision 36481, June 19), there is a similar statement isset($par), which calls showChunk() rather than showPrefixChunk().
The old implementation might have drawbacks, but the new version is too different in function.
On Wed, Aug 20, 2008 at 3:19 PM, Lars Aronsson lars@aronsson.se wrote:
This is wrong. It used to list all pages, starting at Hill. There were links to the previous and next page of the large listing of all pages.
. . .
Yes, so it seems if you compare to the immediately previous version. But that is the 3rd commit (by aaron) that day. If you go back to the older version (revision 36481, June 19), there is a similar statement isset($par), which calls showChunk() rather than showPrefixChunk().
The old implementation might have drawbacks, but the new version is too different in function.
Yes, this was all clarified in later messages. I was wrong, it was a functional change. The change was presumably not intended, and Brion reverted it.
Aaron Schulz wrote:
The format changed to avoid excessively long output. I've looked at the form and those links on wiktionary and don't see anything incorrect or not "working".
Changing Allpages to Prefindex doesn't accomplish this. Much shorter lists than before are now returned for unusual prefixes, such as "Kinematic". But I can still request a Prefindex for "A" and get 350 (?) links listed. Apparently there is both a change in behaviour (from Allpages to Prefindex) and a limit (to 350 links), and the desired result is achieved by the limit, not by the changed behaviour.
A better solution would be to provide a limit of 200 or 350 links in the output, but keeping the old behaviour of Allpages.
Especially, the ability to step *back* as well as forward in that list can be very useful, when you're looking for alternative spellings of a non-existing page name. After searching for Kinematics, I need to step backwards to find Kinematic diagram.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Lars Aronsson wrote:
Especially, the ability to step *back* as well as forward in that list can be very useful, when you're looking for alternative spellings of a non-existing page name. After searching for Kinematics, I need to step backwards to find Kinematic diagram.
Indeed, we've had regressions in the paging links (they used to be there, in both directions) as well as the starting point behavior.
Reverted in r39708.
- -- brion
wikitech-l@lists.wikimedia.org