Temporary Disabled. :) please Go back ⚓ T356013 wrong url redirection for wikimediafoundation.org api www.fgks.org » Address: [go: up one dir, main page] Include Form Remove Scripts Accept Cookies Show Images Show Referer Rotate13 Base64 Strip Meta Strip Title Session Cookies Page MenuHomePhabricatorSearchConfigure Global SearchLog InCreate Task Maniphest T356013 wrong url redirection for wikimediafoundation.org apiOpen, Needs TriagePublicBUG REPORTActionsEdit TaskEdit Related Tasks...Create SubtaskEdit Parent TasksEdit SubtasksMerge Duplicates InClose As DuplicateEdit Related Objects...Edit CommitsEdit MocksSubscribeMute NotificationsProtect as security issueAward TokenFlag For LaterAssigned ToNoneAuthored ByXqtJan 28 2024, 12:17 PM2024-01-28 12:17:29 (UTC+0)TagsWikimedia Foundation Governance Wiki (foundation.wikimedia.org) (Requests)wikimediafoundation.org (Incoming)Patch-For-ReviewReferenced FilesNoneSubscribersAklapperVarnentXqtDescriptionhttps://wikimediafoundation.org/w/api.php is redirected to https://foundation.wikimedia.org/w/api.php. But when redirecting the url the "|" delimiters of the query are lost. Current behaviour Following https://wikimediafoundation.org/w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics will be forwardet to the url https://foundation.wikimedia.org/w/api.php?action=query&meta=siteinfo&siprop=generalnamespacesnamespacealiasesstatistics and the error message is: { "batchcomplete": "", "warnings": { "siteinfo": { "*": "Unrecognized value for parameter \"siprop\": generalnamespacesnamespacealiasesstatistics" } } } Expected behaviour: Redirection should be either https://foundation.wikimedia.org/w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics or even better wikimediafoundation should have its own api path like https://wikimediafoundation.org/w/api.php?DetailsSubjectRepoBranchLines +/-[tests] test that https://wikimediafoundation.org/$1 is not a wikipywikibot/coremaster+3 -0Update baseURL for Foundation Governance Wiki entry.integration/visualdiffmaster+1 -1 Modify family file for Foundation Governance Wiki to see if it addresses a related bug.pywikibot/coremaster+2 -1Customize query in gerritRelated ObjectsSearch...Task GraphMentionsStatusSubtypeAssignedTask OpenNoneT152961 Improve tests suite OpenNoneT129368 Usages of unittest.expectedFailure or unittest.skip should be solved (goal) OpenXqtT356009 page_tests.TestPageObject.testLinks sometimes fails due to missing namespace OpenBUG REPORTNoneT356013 wrong url redirection for wikimediafoundation.org apiMentioned In rIVDI72f040c81c3b: Update baseURL for Foundation Governance Wiki entry. Mentioned Here T331680: Update footer links to direct to proper locations on Foundation Governance Wiki Event TimelineXqt created this task.Jan 28 2024, 12:17 PM2024-01-28 12:17:29 (UTC+0)Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 28 2024, 12:17 PM2024-01-28 12:17:30 (UTC+0)Xqt added a parent task: T356009: page_tests.TestPageObject.testLinks sometimes fails due to missing namespace.Jan 28 2024, 12:18 PM2024-01-28 12:18:03 (UTC+0)Xqt changed the subtype of this task from "Task" to "Bug Report".Jan 29 2024, 5:22 AM2024-01-29 05:22:19 (UTC+0)Volans removed a project: Infrastructure-Foundations.Jan 29 2024, 8:59 AM2024-01-29 08:59:58 (UTC+0)Varnent moved this task from Backlog to Requests on the Wikimedia Foundation Governance Wiki (foundation.wikimedia.org) board.Jan 31 2024, 4:57 AM2024-01-31 04:57:02 (UTC+0)Varnent subscribed.Comment ActionsThe URL redirect for wikimediafoundation.org is already set with a redirect wildcard - so nothing more can be done on that front. It is not a MediaWiki based site - so adding an API setup would not resolve this issue (although the site does have its own API system). I think the solution is to fix the incorrect origin link - will look into that as a part of T331680.Varnent claimed this task.Jan 31 2024, 4:57 AM2024-01-31 04:57:23 (UTC+0)gerritbot added a comment.Jan 31 2024, 5:22 AM2024-01-31 05:22:23 (UTC+0)Comment ActionsChange 994394 had a related patch set uploaded (by Varnent; author: Varnent): [pywikibot/core@master] Modify family file for Foundation Governance Wiki to see if it addresses a related bug. https://gerrit.wikimedia.org/r/994394gerritbot added a project: Patch-For-Review.Jan 31 2024, 5:22 AM2024-01-31 05:22:24 (UTC+0)Varnent added a comment.Jan 31 2024, 5:23 AM2024-01-31 05:23:46 (UTC+0)Comment Actions@Xqt: Do you have any idea where it is getting that URL from? I am not having any luck tracking it down - but changing interwiki to same setup as MediaWiki and others perhaps will help?gerritbot added a comment.Jan 31 2024, 5:46 AM2024-01-31 05:46:00 (UTC+0)Comment ActionsChange 994398 had a related patch set uploaded (by Varnent; author: Varnent): [integration/visualdiff@master] Update baseURL for Foundation Governance Wiki entry. https://gerrit.wikimedia.org/r/994398Xqt added a comment.Jan 31 2024, 3:06 PM2024-01-31 15:06:53 (UTC+0)Comment Actions@Varnent: I'll try to figure out some points... ... wikimediafoundation.org ... not a MediaWiki based site This is good to know. I could add this point to site_detect tests. Do you have any idea where it is getting that URL from Reading the expanded text of the Main Page on en-wiki I found this problematic Link: foundationsite:our-work/wikimedia-projects/ import pywikibot site = pywikibot.Site('wikipedia:en') main = site.siteinfo['mainpage'] page = pywikibot.Page(site, main) text = page.expand_text() text = pywikibot.textlib.removeDisabledParts(text) links = [match['title'] for match in pywikibot.link_regex.finditer(text)] links is a list of link titles on Main Page. Try to create a pywikibot.Link with it: title = 'foundationsite:our-work/wikimedia-projects/' link = pywikibot.Link(title) Ask for the site: print(repr(link.site)) APISite("wikimediafoundation", "wikimediafoundation") Looks like a valid API site was found and it looks like a MediaWiki. The site was created by Autofamily constructor and needs an url. Where does is comes from? Link.parse_site found it. It uses interwikimap API. Please follow that link and you will find the following entry for foundationsite: { "prefix": "foundationsite", "local": "", "url": "https://wikimediafoundation.org/$1" },gerritbot added a comment.Jan 31 2024, 3:23 PM2024-01-31 15:23:34 (UTC+0)Comment ActionsChange 994748 had a related patch set uploaded (by Xqt; author: Xqt): [pywikibot/core@master] [tests] test that https://wikimediafoundation.org/$1 is not a WikiHTMLPageParser https://gerrit.wikimedia.org/r/994748gerritbot added a comment.Jan 31 2024, 4:15 PM2024-01-31 16:15:06 (UTC+0)Comment ActionsChange 994398 merged by jenkins-bot: [integration/visualdiff@master] Update baseURL for Foundation Governance Wiki entry. https://gerrit.wikimedia.org/r/994398Jdforrester-WMF mentioned this in rIVDI72f040c81c3b: Update baseURL for Foundation Governance Wiki entry..Jan 31 2024, 6:59 PM2024-01-31 18:59:10 (UTC+0)Varnent added a comment.Feb 1 2024, 12:43 AM2024-02-01 00:43:48 (UTC+0)Comment Actions@Xqt - I see. Given it is not a MediaWiki site - is there much we can do about that? Out of curiosity - how does it handle things like interwiki links to Phabricator or other non-MediaWiki sites?gerritbot added a comment.Feb 1 2024, 8:25 AM2024-02-01 08:25:19 (UTC+0)Comment ActionsChange 994748 merged by jenkins-bot: [pywikibot/core@master] [tests] test that https://wikimediafoundation.org/$1 is not a wiki https://gerrit.wikimedia.org/r/994748Xqt added a comment.Feb 1 2024, 5:24 PM2024-02-01 17:24:41 (UTC+0)Comment Actionshow does it handle things like interwiki links to Phabricator or other non-MediaWiki sites? There is a SiteDefinitionError because there is no API found for such sites. This is handled graceful somehow: import pywikibot link = pywikibot.Link('phab:T356013') link pywikibot.exceptions.SiteDefinitionError: Invalid AutoFamily('phabricator.wikimedia.org') But for foundationsite a valid api is found.Varnent removed Varnent as the assignee of this task.Mar 15 2024, 1:00 AM2024-03-15 01:00:01 (UTC+0)Comment Actions@Xqt - did https://gerrit.wikimedia.org/r/994748 resolve the issue?Log In to Comment
https://wikimediafoundation.org/w/api.php is redirected to https://foundation.wikimedia.org/w/api.php. But when redirecting the url the "|" delimiters of the query are lost.
Current behaviour Following https://wikimediafoundation.org/w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics
will be forwardet to the url https://foundation.wikimedia.org/w/api.php?action=query&meta=siteinfo&siprop=generalnamespacesnamespacealiasesstatistics and the error message is:
{ "batchcomplete": "", "warnings": { "siteinfo": { "*": "Unrecognized value for parameter \"siprop\": generalnamespacesnamespacealiasesstatistics" } } }
Expected behaviour: Redirection should be either https://foundation.wikimedia.org/w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics or even better wikimediafoundation should have its own api path like https://wikimediafoundation.org/w/api.php?
The URL redirect for wikimediafoundation.org is already set with a redirect wildcard - so nothing more can be done on that front. It is not a MediaWiki based site - so adding an API setup would not resolve this issue (although the site does have its own API system).
I think the solution is to fix the incorrect origin link - will look into that as a part of T331680.
Change 994394 had a related patch set uploaded (by Varnent; author: Varnent):
[pywikibot/core@master] Modify family file for Foundation Governance Wiki to see if it addresses a related bug.
https://gerrit.wikimedia.org/r/994394
@Xqt: Do you have any idea where it is getting that URL from? I am not having any luck tracking it down - but changing interwiki to same setup as MediaWiki and others perhaps will help?
Change 994398 had a related patch set uploaded (by Varnent; author: Varnent):
[integration/visualdiff@master] Update baseURL for Foundation Governance Wiki entry.
https://gerrit.wikimedia.org/r/994398
@Varnent: I'll try to figure out some points...
... wikimediafoundation.org ... not a MediaWiki based site
This is good to know. I could add this point to site_detect tests.
Do you have any idea where it is getting that URL from
Reading the expanded text of the Main Page on en-wiki I found this problematic Link: foundationsite:our-work/wikimedia-projects/
import pywikibot site = pywikibot.Site('wikipedia:en') main = site.siteinfo['mainpage'] page = pywikibot.Page(site, main) text = page.expand_text() text = pywikibot.textlib.removeDisabledParts(text) links = [match['title'] for match in pywikibot.link_regex.finditer(text)]
links is a list of link titles on Main Page. Try to create a pywikibot.Link with it: title = 'foundationsite:our-work/wikimedia-projects/' link = pywikibot.Link(title) Ask for the site:
print(repr(link.site)) APISite("wikimediafoundation", "wikimediafoundation")
Looks like a valid API site was found and it looks like a MediaWiki. The site was created by Autofamily constructor and needs an url. Where does is comes from? Link.parse_site found it. It uses interwikimap API. Please follow that link and you will find the following entry for foundationsite:
{ "prefix": "foundationsite", "local": "", "url": "https://wikimediafoundation.org/$1" },
Change 994748 had a related patch set uploaded (by Xqt; author: Xqt):
[pywikibot/core@master] [tests] test that https://wikimediafoundation.org/$1 is not a WikiHTMLPageParser
https://gerrit.wikimedia.org/r/994748
Change 994398 merged by jenkins-bot:
@Xqt - I see. Given it is not a MediaWiki site - is there much we can do about that? Out of curiosity - how does it handle things like interwiki links to Phabricator or other non-MediaWiki sites?
Change 994748 merged by jenkins-bot:
[pywikibot/core@master] [tests] test that https://wikimediafoundation.org/$1 is not a wiki
how does it handle things like interwiki links to Phabricator or other non-MediaWiki sites?
There is a SiteDefinitionError because there is no API found for such sites. This is handled graceful somehow:
import pywikibot link = pywikibot.Link('phab:T356013') link pywikibot.exceptions.SiteDefinitionError: Invalid AutoFamily('phabricator.wikimedia.org')
But for foundationsite a valid api is found.
@Xqt - did https://gerrit.wikimedia.org/r/994748 resolve the issue?