Page MenuHomePhabricator

Include QuickStatements in Wikibase release packages
Closed, ResolvedPublic13 Estimated Story Points


As a Wikibase Release manager I want to publish releases of QuickStatements so that Wikibase users can use it on their installations.

Acceptance Criteria:

  • Version(s) of Quickstatements that are compatible/required to be installed are indicated (write a build metadata file that can be used later)
  • Quickstatements should be released in a docker container complete with a webserver
  • Automated testing of integration between the relevant QuickStatements and the released version of Wikibase has happened during the releasing process

Testing should cover:

  • OAuth Item creation and checking it was inserted.

Event Timeline

toan renamed this task from Include QuickStatements in Release Pipeline to Include QuickStatements in Wikibase release packages.Jan 21 2021, 10:45 AM
toan updated the task description. (Show Details)
toan set the point value for this task to 13.
toan updated the task description. (Show Details)
toan added subscribers: Samantha_Alipio_WMDE, toan.
  • Quickstatements and it's dependencies should be included in a separate tarball

was removed and asked @Samantha_Alipio_WMDE it this should be included.

The results/worklog from the install process for QS should flow into the hands of the technical writer for inclusion here:

So the gerrithub chain goes

  1. Some initial additions to the build scripts
  1. Building quickstatements.docker.tar.gz
  1. Test that it works and a publish step

I'll do a writeup on the documentation tomorrow.

@danshick-wmde hopefully this should cover all the steps


  1. Clone repo or download the zip
  2. Update LocalSettings.php
wfLoadExtension( 'OAuth' );
$wgGroupPermissions['sysop']['mwoauthproposeconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthmanageconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthviewprivate'] = true;
$wgGroupPermissions['sysop']['mwoauthupdateownconsumer'] = true;
  1. add it to composer.local.json and run composer update aswell
  2. run update.php
  3. Check /wiki/Special:Version that it shows up


  1. Clone the repositories:

Repositories should be in the following directories.

  • Quickstatements: /www_root/quickstatements/
  • Magnustools: /www_root/magnustools/
  1. run composer install in quickstatements
  1. Place the following files in the corresponding folders

use these env variables and replace with envsubst or replace them manually

MW_SITE_NAME="site name"

config.json: /www_root/quickstatements/public_html/config.json

	"site" : "${MW_SITE_NAME}" ,
	"bot_config_file" : "/var/www/html/bot.ini" ,
	"logfile" : "/var/log/quickstatements/tool.log" ,
	"sites" : {
		"${MW_SITE_NAME}" : {
			"oauth" : {
				"language":"${MW_SITE_LANG}" ,
				"project":"${MW_SITE_NAME}" ,
				"ini_file":"/quickstatements/data/oauth.ini" ,
				"publicMwOAuthUrl":"${WB_PUBLIC_SCHEME_HOST_AND_PORT}/w/index.php?title=Special:OAuth" ,
				"mwOAuthUrl":"${WB_PUBLIC_SCHEME_HOST_AND_PORT}/w/index.php?title=Special:OAuth" ,
			} ,
			"server" : "${WB_PUBLIC_HOST_AND_PORT}" ,
			"api" : "${WIKIBASE_SCHEME_AND_HOST}/w/api.php" ,
			"pageBase" : "${WB_PUBLIC_SCHEME_HOST_AND_PORT}/wiki/" ,
			"toolBase" : "${QS_PUBLIC_SCHEME_HOST_AND_PORT}/" ,
			"types" : {
				"P" : { "type":"property" , "ns":"${WB_PROPERTY_NAMESPACE}" , "ns_prefix":"${WB_PROPERTY_PREFIX}" } ,
				"Q" : { "type":"item" , "ns":"${WB_ITEM_NAMESPACE}" , "ns_prefix":"${WB_ITEM_PREFIX}" }

oauth.ini: /quickstatements/data/oauth.ini

; HTTP User-Agent header
agent = 'Wikibase QuickStatements'
; assigned by Special:OAuthConsumerRegistration (request modelled after
consumerKey = '<OAUTH_CONSUMER_KEY>'
consumerSecret = '<OAUTH_CONSUMER_SECRET>'

Then create an OAuth consumer

# set these environment variables
MW_ADMIN_NAME=<Admin username> 

# execute this on mediawiki with OAuth
php /var/www/html/extensions/OAuth/maintenance/createOAuthConsumer.php \
    --approve \
    --callbackUrl $QS_PUBLIC_SCHEME_HOST_AND_PORT/api.php \
    --callbackIsPrefix true \
    --user $MW_ADMIN_NAME \
    --name QuickStatements \
    --description QuickStatements \
    --version 1.0.1 \
    --grants createeditmovepage \
    --grants editpage \
    --grants highvolume \

A successful response should return with "created": true flag set.


Replace the <OAUTH_CONSUMER_KEY> and <OAUTH_CONSUMER_SECRET> with the key and secret that was generated.

With this setup you should be able to visit the webserver and log in

Thanks for this. Information added to .

One question: are these LocalSettings additions specific to a Wikibase install, or should they go along with a standard OAuth install?:

$wgGroupPermissions['sysop']['mwoauthproposeconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthmanageconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthviewprivate'] = true;
$wgGroupPermissions['sysop']['mwoauthupdateownconsumer'] = true;