Page MenuHomePhabricator

Add script_path to database
Open, LowPublic


Toolserver used to provide script_path as part of its 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 created this task.Mar 21 2015, 8:18 PM
Krinkle raised the priority of this task from to Needs Triage.
Krinkle updated the task description. (Show Details)
Krinkle added a project: Toolforge.
Krinkle added a subscriber: Krinkle.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 21 2015, 8:18 PM
Sitic added a subscriber: Sitic.Mar 27 2015, 1:43 AM
scfc triaged this task as Low priority.Apr 6 2015, 7:28 AM
scfc added a subscriber: scfc.

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.?

scfc moved this task from Triage to Backlog on the Toolforge board.Apr 6 2015, 7:29 AM
Restricted Application added a project: Cloud-Services. · View Herald TranscriptJun 23 2015, 9:04 PM
jayvdb added a subscriber: jayvdb.Jun 24 2015, 1:10 AM
This comment was removed by Krinkle.
Krinkle renamed this task from Add script_path to database to Add api_url to database.Dec 22 2016, 11:51 PM
Krinkle updated the task description. (Show Details)
bd808 added a subscriber: bd808.Sep 20 2017, 11:46 PM

The place to add this would be

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.

bd808 moved this task from Backlog to Datasets on the Data-Services board.

I agree that it should be script_path and not api_url

Krinkle renamed this task from Add api_url to database to Add script_path to database.Sep 21 2017, 8:27 PM
Krinkle updated the task description. (Show Details)
gpaumier removed a subscriber: gpaumier.Jul 18 2018, 5:57 PM