Jump to content

Project:Development environments

From mediawiki.org

This page coordinates the documentation of MediaWiki development environments on MediaWiki.org.

Cloning MediaWiki core

[edit]

Requires:

  • git
# full clone into a mediawiki directory
# ~2-5 minutes, ~870 MB
git clone https://gerrit.wikimedia.org/r/mediawiki/core.git mediawiki

# clone with SSH
git clone git clone ssh://gerrit.wikimedia.org:29418/mediawiki/core mediawiki

# configure SSH after cloning
git remote set-url origin ssh://YOUR_GERRIT_USERNAME@gerrit.wikimedia.org:29418/mediawiki/core

# shallow clone
# ~15 seconds, ~205 MB
# Faster but not suitable for development
git clone --depth 1 https://gerrit.wikimedia.org/r/mediawiki/core.git mediawiki

Setting up a development environment

[edit]

MediaWiki Docker

[edit]
Docs
DEVELOPERS.md
Setup time
~15 minutes[1]
Requires
#Cloning MediaWiki core
Docker Desktop (proprietary) or Docker Engine (Linux only)
Default stack
Apache
SQLite
jobrunner

mwcli

[edit]
Docs
CLI
Requires
#Cloning MediaWiki core
Docker Desktop (proprietary) or Docker Engine (Linux only)
gitlab:releng/cli
Default stack
Apache
Nginx proxy
DNS proxy server
MySQL

MediaWiki Vagrant

[edit]
Docs
MediaWiki-Vagrant
Setup time
~20 minutes[2]
Requires
#Cloning MediaWiki core
VirtualBox
Vagrant
NFS (Linux)
Cloning mediawiki/vagrant
Default stack
Apache
MySQL

Local installation (manual)

[edit]
Docs
Manual:Installing MediaWiki
Requires
#Cloning MediaWiki core
web server
PHP
database server

Local installation (quickstart)

[edit]
Docs
Local development quickstart
Setup time
~7 minutes
Requires
#Cloning MediaWiki core
PHP
Composer
Default stack
PHP built-in web server
SQLite

Installing a skin

[edit]

If you clone Vector after installing MediaWiki, you must add wfLoadSkin( 'Vector' ); to LocalSettings.php.

If you clone Vector before installing MediaWiki, the install script automatically updates LocalSettings.php.

Key pages

[edit]
  • Main off-wiki page for setting up a development environment
  • Only covers MediaWiki-Docker: "an extendable local development environment based on Docker Compose. This environment provides PHP, Apache, Xdebug and a SQLite database"
  • Links to How to become a MediaWiki hacker
  • Not translatable
  • Next steps after setup:
    • Shell into container
    • Run PHPUnit tests
    • Run Selenium tests
    • Run API integration tests
    • Install Vector skin
    • Install EventLogging extension
    • Run Xdebug
  • Main on-wiki page for setting up a development environment, via Developer hub
  • Covers how to "learn the basic skills needed to contribute to development"
  • Covers these options:
    • MediaWiki Docker: "setup a MediaWiki installation quickly and are not planning on installing many extensions."
    • mwcli: "sets up Docker with a few simple commands and provides basic orchestration functionality between MediaWiki, MySQL, ElasticSearch, Memcached, and other types of containers"
    • MediaWiki Vagrant: "saves you installation and configuration time compared to manually adding extensions in a Docker or local installation, but it runs a bit slower"
    • Local installation: "will take much more time to set up than Docker or Vagrant"
  • Links to (among others):
[edit]

Research

[edit]
  • "My biggest issue with our dev environments is the fragmentation"
  • Comments about dev environment documentation: negative:6; positive: 0
  • "Ease of use" was the number one priority for dev environments. The most common "other" priority was using a debugger. In contrast, portability was ranked low as a priority.
  • 57 people reported using a Docker-based environment, while 45 people reported using a "self-created environment".

References

[edit]
  1. MediaWiki-Docker
  2. Local testing