Page MenuHomePhabricator

Add script_path to meta_p.wiki database
Open, LowPublic

Description

Toolserver used to provide script_path as part of its toolserver.wiki meta database (T50626). I'd like the meta_p database to provide this as well.

Perhaps we can do it better by making it a full url (including protocol and domain) to discourage any string manipulation. For now it would default to {url}/w. (Note, no trailing slash - per MediaWiki convention).

Alternatively, we could go one step further and also discourage creation of other entry points by tools and instead encourage them to always query the API, by adding api_url instead (e.g. they shouldn't use script_path for other urls).

By only maintaining dbname, slice, api_url tools can boostrap everything they need. Fields lang and project would be good to keep for better discovery of related wikis without having to query 800 API endpoints. Everything else can be queried from the API endpoint (or, if not, should be added to the siteinfo API).

Even just auto-populating it with a meaningless {url}/w/api.php would make the separation of concerns closer to where it should be, so that at least it isn't duplicated in every single tool.

Event Timeline

Krinkle raised the priority of this task from to Needs Triage.
Krinkle updated the task description. (Show Details)
Krinkle added a project: Toolforge.
Krinkle subscribed.
scfc triaged this task as Low priority.Apr 6 2015, 7:28 AM
scfc subscribed.

Bytes are cheap; is it useful from a MediaWiki perspective to promote: "To reach the API, take $url and append $script_path and /api.php", or does it make more sense to say: "To reach the API, take $api_url, and for the REST API, take $restapi_url", etc.?

This comment was removed by Krinkle.
Krinkle renamed this task from Add script_path to meta_p.wiki database to Add api_url to meta_p.wiki database.Dec 22 2016, 11:51 PM
Krinkle updated the task description. (Show Details)

The place to add this would be https://phabricator.wikimedia.org/source/operations-puppet/browse/production/modules/role/files/labs/db/views/maintain-meta_p.py

The schema change would be needed there plus new logic to populate the column(s) added. The script would probably also need to be extended to allow forcing the schema update by dropping the existing table.

I agree that it should be script_path and not api_url

Krinkle renamed this task from Add api_url to meta_p.wiki database to Add script_path to meta_p.wiki database.Sep 21 2017, 8:27 PM
Krinkle updated the task description. (Show Details)