Page MenuHomePhabricator

Return autoconfirmed information for site via API
Closed, ResolvedPublic

Description

Make Siteinfo API returns autoconfirmed information for the site.

Event Timeline

I created this task because this is useful for T189286.

Make Siteinfo API returns autoconfirmed information for the site.

This request would be satisfied by exposing the value of $wgAutopromote.

I don't know what conditions are needed to pass an API request, community consensus?

Depends on the request.

If it's in the "Needs details or plan" column of the MediaWiki-Action-API workboard, that usually means discussion of some sort is needed. That could be discussion to determine if the change is actually a good idea, or just discussion to figure out how to actually do it.

If it's in "Needs Code", that normally means someone should write the code and then try to get me to review it. Or hope I find it interesting/useful enough to write the code myself.

RazeSoldier triaged this task as Medium priority.

I pushed a patch.

For default installation, the API display:

{
    "batchcomplete": "",
    "query": {
        "autopromote": {
            "autoconfirmed": {
                "conditions": [
                    [
                        "&",
                        [
                            1,
                            0
                        ],
                        [
                            2,
                            0
                        ]
                    ]
                ]
            }
        }
    }
}

Is this data structure feasible?

RazeSoldier lowered the priority of this task from Medium to Low.Jun 15 2018, 3:00 PM
Vvjjkkii renamed this task from Return autoconfirmed information for site via API to 8wbaaaaaaa.Jul 1 2018, 1:06 AM
Vvjjkkii removed RazeSoldier as the assignee of this task.
Vvjjkkii raised the priority of this task from Low to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
RazeSoldier renamed this task from 8wbaaaaaaa to Return autoconfirmed information for site via API.Jul 1 2018, 8:42 AM
RazeSoldier claimed this task.
RazeSoldier lowered the priority of this task from High to Low.
RazeSoldier updated the task description. (Show Details)
RazeSoldier added a subscriber: Aklapper.

Change 444335 had a related patch set uploaded (by 星耀晨曦; owner: 星耀晨曦):
[mediawiki/core@master] Make logical operators recognized in $wgAutopromote public

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

Change 444335 had a related patch set uploaded (by 沈澄心; author: 星耀晨曦):

[mediawiki/core@master] Make logical operators recognized in $wgAutopromote public

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

Declining this task because:

  • T196059 was created because of T189286, however, T189286 has been resolved without it. We therefore can no longer find the relevance of this task.
  • The current implementation in XTools pulls InitialiseSettings.php.txt and parses it using regexes. An alternative might be to get this data in json format from https://noc.wikimedia.org/wiki.php.
  • The json appears to be generated directly within that php page, so (unless we're missing something) there's no way to directly pull just the json for the config values of interest - they'd have to be extracted from the html. But that might be preferred to the current regex parsing
  • It might also be possible to make those individual variable values available as raw json, by adding that functionality to the noc.wikimedia.org site (its code lives within the mediawiki-config repository). Unsure who is responsible for that particular bit of code - RelEng maybe? Doing this would justify a separate task and a conversation on-task with the maintaining team.
  • It might also be possible to directly add logging of autoconfirmation assignment to mediawiki itself, so that autoconfirmation appears in Special:Log. However, that would be a significant number of database writes, and would therefore need an impact analysis to determine if it were actually feasible, and if usage of the feature would be beneficial enough to justify the additional load.

Declining this task

@codebug: Feel free to set the status of this task to "Declined" via the Add Action...Change Status dropdown if nobody should ever work on this (and potentially update the connected patches in Gerrit accordingly). Thanks.

Reedy subscribed.

Re-opening.

Based on T189286#4039311, it has been fixed by scraping config files. This is not very reliable or anything else.

Exposing this through the API makes a lot more sense.

Change 444335 merged by jenkins-bot:

[mediawiki/core@master] Make logical operators recognized in $wgAutopromote public

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

Change 992515 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@master] ApiSiteInfo: Add siprop=autopromoteonce

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

Change 436772 merged by jenkins-bot:

[mediawiki/core@master] ApiSiteInfo: Add siprop=autopromote to return $wgAutopromote data

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

Change 992515 merged by jenkins-bot:

[mediawiki/core@master] ApiSiteInfo: Add siprop=autopromoteonce

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

Reedy claimed this task.