Commit graph

62 commits

Author SHA1 Message Date
Arlo Breault
ebdea35aeb Branch commit for REL1_43
Bug: T372318
Change-Id: I9a9aa83c455b16d57d08327489bd960e9b0a3ec2
2024-10-22 12:47:33 -04:00
jenkins-bot
5522c780a5 Merge "maintenance: Remove dev folder" 2024-01-01 20:24:44 +00:00
Umherirrender
3f9d716653 maintenance: Remove dev folder
Using php5.6, which is outdated for use with MediaWiki

Use quickstarts described at DEVELOPERS.md for supported versions

Change-Id: I1001d50ecd60d4bc8c836e2aa22ffb57c1b2b859
2023-12-31 10:33:14 +00:00
Kosta Harlan
3d4294af3b
composer serve: create and set log directory
Why:

- New users will appreciate having easy access to MediaWiki logs; in
  order to make that easier, we need to have a directory to write to and
  set an environment variable to use that directory

What:

- Set MW_LOG_DIR for the `serve` command
- Add a `logs` directory at the root of MW, and gitignore it
- Create the `logs` directory via DevelopmentSettings, if MW_LOG_DIR is
  defined but does not exist

I considered the `cache` directory for the log location as it
already exists, but it seemed preferable to not conflate cache and
logs.

Bug: T347347
Change-Id: Ic3ddb0203df07a0c93df9f431b25a2a5d9ecc407
2023-12-21 08:39:07 +01:00
MusikAnimal
46314491c1 gitignore: add /images/phonos-render for Extension:Phonos
Change-Id: Ice6a986f31c3708926eeb663a98b575935f2ae30
2022-12-12 13:13:56 -05:00
Daimona Eaytoy
4f2692a056 Kill tests/phan
As per comments on phabricator, the Suppressor was used when phan still
didn't have per-line suppression, which is no longer the case. The phan
script was also outdated and broken, so just remove everything.

Bug: T267859
Change-Id: Ic4a68dd30a4481656a5c44b2446cf851ea638c1c
2020-11-17 16:04:33 +01:00
Tim Starling
243875ddb9 Local config override file for Phan
Support a local (uncommitted) override file for Phan config. This is
mostly so that I can exclude various broken things, rather than making a
whole new clean source tree just for Phan.

Change-Id: Icc66d8ae2b0029aabf57a57479c54cef05c747b9
2020-11-04 10:28:22 +11:00
DannyS712
631578c685 Remove old references to AdminSettings, which was removed in 1.23
Change-Id: I90575b6af120bf73c3be71ca6bffafe09b9b2c83
2020-07-13 08:15:03 +00:00
Kosta Harlan
c27eda79a0 [docker] Use a .env file for setting the port and user
- allows for cleanly overriding host exposed port
- easier to override XDebug settings
- easier setup for Linux hosts

When wikimedia/fresh is updated with https://github.com/wikimedia/fresh/pull/18,
we can simplify the Selenium / API testing instructions too (removing the
`export` statements).

Bug: T246586
Bug: T246588
Change-Id: Ibd266411636ac144789617bb0999c33a83e9e652
2020-04-01 17:29:14 +02:00
Kosta Harlan
89083ea868 Add configuration for Docker based development environment
This patch introduces a simple docker-compose based development environment
with the idea to allow most development use cases for beginning and
experienced MediaWiki developers.

- PHP and Apache container with XDebug enabled
- Support for overriding services with docker-compose override file
- Documentation for usage and a documented place for sharing docker-compose
  overrides and LocalSettings.php configuration snippets for e.g. MySQL,
	DB replication, Redis, etc

Depends-On: I50079cca6a286d8aaea8fd0785be48c80e80271c
Bug: T238224
Change-Id: I3b76c1599b1ff32174af5603aadc9f7c7634c98b
2020-02-21 10:09:48 +00:00
Volker E
3fa38ae795 Drop the abandoned, replaced 'KSS' styleguide and references in MWUI
KSS is no longer in use anywhere. The only official style guide is
at https://design.wikimedia.org/style-guide.

Change-Id: I688a78e9a71a082c499af55bd01e8fd615130486
2020-02-11 15:38:53 -08:00
Kosta Harlan
5f9c0c8481 Add includes/PlatformSettings.php to .gitignore
As suggested by Krinkle at T182020#3829950.

Follows-up 50212e6d0e.

Bug: T182020
Change-Id: I15d658539a0fd0c3555eaa5c85880edb3bf0fd03
2020-01-29 09:22:42 +00:00
Clara Andrew-Wani
322f2a5b2d Add api-testing's local configuration file to .gitignore
Change-Id: Ib7fb8e66ff47ecadbbbd28e26961e548180def7f
2020-01-13 09:56:38 -05:00
Max Semenik
dd7026585c Backwards-compatible PHPUnit 8 preparations
This commit splits changes from Ic14f5debc53e55d6714 to reduce it to
only strictly needed things. It can be merged immediately.

Bug: T192167
Change-Id: I8c541a66ea13421dbe7fa51d197d5455cc4786eb
2019-11-02 12:40:07 -07:00
Timo Tijhof
567b99db17 docs: Add "/docs/latex" to gitignore (generated by Doxygen)
Change-Id: Id788607925c14d2c409bfeef8cc88c98d1242d2d
2019-10-24 18:59:40 +01:00
Kosta Harlan
214750d8d2 Define unit and integration test suites
Following discussion in Ibb8175981092d7f41864e641cc3c118af70a5c76, this patch
proposes to further reduce the scope of what unit tests may access, by removing
the loading of DefaultSettings and GlobalFunctions.php. This also has the
implied effect of disabling the storage backend, as well as the global service
locator.

MediaWikiTestCase is renamed to MediaWikiIntegrationTestCase so it's scope and
purpose is more clear. Whether we still need to keep `@group Database`
annotation around is debatable, as it's unclear to me what the performance costs
are of implying database access for all tests which extend IntegrationTestCase.
As far as I can tell, `@group Database` is primarily used in CI to run faster
tests before slower ones, and with the new UnitTestCase the annotation seems
redundant.

To run all testsuites, use `composer phpunit`. Other composer scripts:

- `composer phpunit:unit` to run unit tests
- `composer phpunit:integration` to run integration tests
- `composer phpunit:coverage` to generate code coverage reports from unit
   tests (requires XDebug).

Note that you can pass arguments to composer scripts with `--`, e.g. `composer
phpunit:integration --exclude-group Dump`.

Other changes:

- Rename bootstrap.php to bootstrap.maintenance.php so it's clear it's part of
  the legacy PHPUnit-as-maintenance-class setup
- Create new bootstrap.php which loads the minimal configuration necessary for
  the tests, and do additional setup in the run() method of the unit/integration
	test case classes
- Move the unit-tests.xml file to phpunit.xml.dist in preparation for this being
  the default test configuration

For a follow-up patch:

- Find unit/integration tests for extensions/skins
- Migrate other test suites from suite.xml
- Support running all tests via vendor/bin/phpunit

Bug: T84948
Bug: T89432
Bug: T87781
Change-Id: Ie717b0ecf4fcfd089d46248f14853c80b7ef4a76
2019-06-28 12:18:18 -04:00
Timo Tijhof
3540897a6f resources: Add caching for faster runs and offline use
Also honour any XDG variables if set (such as Wikimedia CI does)
so that gate jobs can automatically persist the cache.

Bug: T203694
Change-Id: I156af1c5097b8a87be228345fc0a0b80bb3ae338
2019-03-24 20:57:46 +00:00
Ed Sanders
591cb30581 eslint: Enable caching
Makes re-running eslint faster on dev environments.

Change-Id: I3bd7932b49de35022898cdc8add1934633e6dacb
2019-02-19 19:57:08 +00:00
Timo Tijhof
73be70fca1 docs: Remove 'code-coverage' placeholder directory
In 8 years, this is the first time I see this directory exists
and that there is a Makefile that would write to it.

I don't know if anyone uses that, but PHPUnit auto-creates this
directory as needed. Hence, it need not exist ahead of time.

It seems most contributors generate code coverage by invoking
PHPUnit directory, which requires a path to be specified.

Per https://mediawiki.org/wiki/Manual:PHP_unit_testing/Code_coverage,
this tends to be docs/coverage, not docs/code-coverage.

Change the Makefile to write there as well, as better example,
and also add it to gitignore.

Change-Id: I0a4cf716ea9b7fae89c282945b160b0dc7b2d02f
2019-01-25 18:35:46 -08:00
Amir Sarabadani
5805e8c537 Add *.iml to .gitignore
Made by IntelliJ IDEA

Change-Id: Ifd55b5cfeed187d68497346065eb976d169720c8
2018-11-14 21:25:23 +01:00
Zoranzoki21
b6be5ec043 .gitignore: Fix .vscode
.vscode is directory

Change-Id: I82d1da1b51b4bd32423ad0bb70d30df109fae1ae
2018-10-26 13:34:21 +00:00
Zoranzoki21
999fe6498d Add .vscode to .gitignore file
.vscode is place of configurations for Visual Studio Code.

Change-Id: Ie066b9773af757181f325c090af1af68d4954236
2018-10-21 15:08:48 +00:00
Timo Tijhof
ebec274f17 Remove support for StartProfiler.php
Bug: T201782
Bug: T189966
Change-Id: I6ef5af969b1d74a04d5d89370e6ac800c20be1ad
2018-08-26 02:09:44 +00:00
Timo Tijhof
e52b056322 selenium: Create local ./log directory if needed
Without this, the tests sometimes fail like this:

> Error: ENOENT: no such file or directory, open './log/should-be-creatable.png'
>   at screenshot() - saveScreenshot.js:52:17
>   at saveScreenshot("./log/should-be-creatable.png")

This seems to race with the junit plugin, which uses mkdirp to
create it if missing, but the screenshot handling is separate
from that. WebdriverIO's own screenshot handling also does this
so it makes sense for ours to do that, too.

I considered trying to re-use WebdriverIO's save mechanism,
directly but it's not publicly exposed and only used for the
crash scenario, so for now we'll have to keep our own.

Also:
* Add to gitignore.

* Update default to use __dirname instead of './' because the
  latter will somtimes be mediawiki/ and sometimes be selenium/
  depending on whether you run all tests or some tests.

* Remove trailing slash from default logPath, and instead add the
  slash in filePath.
  Reason:
  - The LOG_DIR used by Jenkins doesn't end in a slash either
    (currently not failing because we no longer use that job,
    and let quibble run the tests instead, which doesn't set
    the LOG_DIR).
  - The WDIO docs and example also use screenshotPath without
    trailing slash.
  - Without this, setting LOG_DIR=/tmp/something results in
    filenames like /tmp/somethingexample.png.

Bug: T193088
Change-Id: I6550f9315bae89f96a791f7ae8cc2fbec5ee8dd5
2018-05-09 14:30:55 +00:00
Brion Vibber
d910b1e282 Add TimedMediaHandler's images/transcoded to .gitignore
Avoids git looking in your transcoded audio/video files
for changes...

Change-Id: I5610354a1575bb97f4523d58d3e9713512416305
2018-02-21 21:17:04 +00:00
Kunal Mehta
10f187821e .gitignore: Exclude Extension:Score generated files
Change-Id: Ic9cd0051cc8bd241b933037466a2af76d0f6a287
2017-12-03 11:02:16 +00:00
Arlo Breault
1b775a6be7 Ignore npm-debug.log
Change-Id: Ia984f7baa2aa94e00b7be712d5dc4846d29ede85
2017-08-25 15:21:44 -04:00
Huji Lee
d14006dabd .gitignore: Ignore /composer.phar file
The file is needed if using composer via a phar file.

Change-Id: I910bc8929d0cf26d9d110eeb1051c4d41c25aa3c
2017-08-16 22:21:39 +00:00
Arlo Breault
e1f820099f Remove composer.json from .gitignore
Change-Id: Ie9e5bab9f9c20c9512dbdda2019643fa35feac2c
2017-08-02 15:50:20 -04:00
Reedy
7076755463 Add .rej files to .gitignore
Change-Id: Ie4f470f5f0528308871b78c7c823851b0a45e8eb
2017-04-06 23:23:03 +01:00
Erik Bernhardson
f5b4bd19b2 Add configuration for running etsy/phan against core
Adds the necessary configuration and stubs for phan static analysis to
run against mediawiki core. A variety of fixes have been applied to core
recently such with this current configuration we are completely passing,
except for one issue with a bug in Phan (https://github.com/etsy/phan/issues/286)

In it's current configuration Phan will detect fatal errors trying to
access non existant classes, undefined method calls, and other errors.
The analysis can be expanded as we cleanup more of the codebase.  This
is in preparation for working on getting the CI to run phan as part of
the review process. I have found phan to be usefull in CirrusSearch
(although with stricter config) for catching bugs and I think it could
help in core as well.

We arn't too far from being able to disable `null_casts_as_any_type`,
there are only a few classes that need adjusting. Lots more work needs
to be done to reduce `minimum_severity` from 10 to 5 (normal) or
0 (low).

Change-Id: Iafd55b1380f37d7b0d195eed081f8042166690e8
2016-12-07 20:04:01 -08:00
Timo Tijhof
1d3c908d4f gitignore: Add /images/cache
This is the default directory for FileCache (as enabled with $wgUseFileCache).
Used by HTMLFileCache (article views) and ResourceFileCache (load.php).

Change-Id: I8c3ccb734268b0902b693c2c19125f7f858898f1
2015-05-12 02:45:17 +01:00
Bartosz Dziewoński
d750f132ff Add *.orig to .gitignore
People and tools sometimes accidentally commit these, let's make it
more difficult to do.

Follow-up to abb4271a. NO ONE SAW THIS EMBARASSING MISTAKE.

Change-Id: If5f427586814c304b30e5783a59f33814bfeaa54
2015-01-11 21:14:03 +01:00
Bartosz Dziewoński
abb4271ad1 Add .*.orig to .gitignore
People and tools sometimes accidentally commit these, let's make it
more difficult to do.

Change-Id: I05574d46186642940054aaecec055723c7ade8ac
2015-01-11 18:53:02 +00:00
Bryan Davis
578f2cc8b0 Introduce Composer merge plugin
Require Composer merge plugin to allow easier local Composer dependency
management without composer.json edit conflicts. The configuration
provided will merge Composer configuration directives found in
a `composer.local.json` config file into those specified by MediaWiki's
composer.json file at Composer runtime.

Bug: T67188
Change-Id: I66a19d0154191e536aab37a5e183e4505bf3e9be
2015-01-08 16:18:54 -07:00
addshore
33ea33f7b6 Allow use of phpunit.phar with MediaWiki's phpunit.php test entry point
MediaWiki tends to assume installation of phpunit via PEAR.
Distribution of phpunit via PEAR will eventually be discontinued,
in favor of distribution via PHAR or composer. PEAR installation
of phpunit 4.0 essentially distributes a phar.

https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.0.0

This patch allows phpunit.php to work with a phpunit.phar file,
as long as it's in the include path.  --with-phpunitdir can be used
to add a directory to the include path.

With composer install, no options are needed and it works.

Bug: 58881
Change-Id: Ibac9b36bbb9614d990c697a091947a64c8987d1d
2014-08-02 21:41:38 +00:00
Juliusz Gonera
070ef42720 Fix KSS mediawiki.ui style guide (docs)
Broken after a change in directory structure...

Change-Id: Ibe208302c30483ee9476a176efe8dd88b21d30a5
2014-04-11 14:25:22 -07:00
jrobson
a0474a4f30 Add ability to generate KSS files for mediawiki.ui
Run make kss to generate a style guide for mediawiki.ui

Change-Id: Ib2db52a855f7eb924a59eebfff88e23600af78d6
2013-12-20 12:25:27 -08:00
Marius Hoch
fe140a5200 Ignore root level .htaccess and .htpasswd files
One might want to have those in there in a development
environment.

Change-Id: Ie5f4bbc15cb738c9801490e800255470ceb42d79
2013-11-29 00:31:18 +01:00
Juliusz Gonera
eb9cc2b9ce Port mediawiki.ui SASS to LESS
This was the only SASS in core.

Remove gradient hacks for IE<10 (proprietary filter property) in
vertical-gradient mixin. Buttons look fine without gradients too,
and filter can often signfificantly degrade performance:
http://gomilkyway.com/web/why-site-is-so-slow-on-ie-even-to-scroll-poor-ie-performance/
http://coding.smashingmagazine.com/2010/04/28/css3-solutions-for-internet-explorer/
http://msdn.microsoft.com/en-us/library/ms532847%28VS.85%29.aspx
(look for "performance")

Remove text-shadow for button's text which had no effect on appearance.

Remove obsolete or non-existent vendor-prefixed properties:
* display: -moz-inline-stack (not needed for Firefox 3+)
* -webkit-border-radius, -moz-border-radius (supported for sometime
  without a prefix, graceful degradation for old browsers)
* -ms-border-radius, -o-border-radius (never existed)

Remove *vertical-align: auto from IE6/IE7 inline hack. Can't find any
evidence that it's necessary.

Bug: 54485
Change-Id: I81d8d0c9f6705aef8bdb8a28e1154f2de4301235
2013-11-13 21:35:11 -05:00
Mark Holmquist
3c5f2fa67b Add .sass-cache to .gitignore
The Makefile removes this automatically, but compass watch won't do that
for you. Much better to just .gitignore it so we don't have to worry
about it.

See resources/mediawiki.ui/sourcefiles to see what I mean, and see
https://www.mediawiki.org/wiki/Agora/Engineering#Working_with_the_Compass_code
for documentation about the current approach.

Change-Id: Icf7dbc9e19f0615c5fcc88924a17ae695df0ff05
2013-07-26 11:04:15 -07:00
Chad Horohoe
8c7c4e7475 Clean up sublime ignores
Change-Id: Ia7e22c2219040c7137a0f4ddc1dbb8ec1861a2d3
2013-05-13 19:08:29 -04:00
MarkAHershberger
6f1bede668 Some more editor files to ignore.
Change-Id: I9b5d03443d6b0f536ad887b25bbf86716a212742
2013-04-15 22:15:03 -04:00
Timo Tijhof
a0c55f2a17 Gitignore: Clean up and ensure /includes/cache is not ignored.
In Git (at least in version 1.8.x) entries without leading slash
can be matches in any subdirectory.

Add a / in front of all those that should only be in the root.

Change-Id: I61e2be30ac24c5b369a1d36869fbd027f197bebf
2013-03-05 00:53:16 +01:00
jenkins-bot
be6a0c5904 Merge "Initial JSDuck implementation" 2013-02-23 02:35:09 +00:00
Timo Tijhof
dfb8390a42 Initial JSDuck implementation
* Adding configuration files for jsduck.
* Fixing our previously undocumented code documentation to comply
  with jsduck specifications
  .. for the following modules:
  - mediawiki
  - mediawiki.Title
  - mediawiki.util
  - mediawiki.notification
  - mediawiki.api (and plugins thereof)
  - jquery.localize

I've choose these to show as many different examples for
different types of modules and methods that we encounter
in our code base.

Hopefully with this as a start it will be easy for other people
to extend the documentation for most (if not, all) other modules
we have in MediaWiki core.

Change-Id: Ieb8c5d2d2cb4672f1d6abc3f865c6fb1470d8feb
2013-02-23 03:02:45 +01:00
Antoine Musso
2e416d5256 .gitignore Composer related files
The Composer dependencie manager installs components under /vendor by
default so simply ignore that path. We do not care of tracking the
composer.* files, they will always be local just like LocalSettings.php.

Extensions are properly installed under /extensions/.

Change-Id: I7c50ee11edf2f7b1d71533fc32a75831a384a630
2013-01-29 16:35:22 +01:00
Antoine Musso
f456ac2350 ignore /.deploy used by git-deploy
git-deploy writes a status file at the root of the working copy. We want
to always ignore it.

Change-Id: I4dbbce669ba4d194c3ce5568733bd27db51fd40e
2013-01-10 15:15:43 +00:00
Timo Tijhof
8d306686cf Lint: Go-go-gadget jshint! Passing entire JS code base (again).
There were still some files not passing jshint, and for files
that did, we managed to screw 'em up again.

Added more explicit settings in .jshintrc to avoid relying on a
kind of default somewhere. There are too many default-factors:
closest(.jshintrc), ~/.jshintrc, IDE/editor, node-jshint..

Added node_modules/ and extensions/ to .jshintignore.
Previously "$ jshint ." would recurse over all kinds of
unrelated code. Extensions should have their own jshint
dotfiles. When linting from Jenkins this won't be a problem as
those will be ran per repo (so when linting core it will skip extensions and when in an extension dir, the core dotfiles
don't apply as they'll be out of scope).

Some of our modules are really messy and should be refactored
to be less spaghetti-ish and have more descriptive variable
names and more manageable function-level complexity.
But for this commit, I'm keeping it as much as-is as possible,
because its hard/large enough to review as it is.

A few errors are cited below to give an impression of the kind
of warnings I addressed (for cases where the diff isn't
so obvious):

* jquery.hidpi.js: line 110, col 15, Empty block.
* mediawiki.jqueryMsg.js: line 34, col 17, Too many var statements.
* mediawiki.jqueryMsg.js: line 145, col 33, Strings must use singlequote.
* mediawiki.action.edit.js: line 74, col 73, 'selectText' is defined but never used.
* startup.js: line 19, col 22, 'isCompatible' is defined but never used.
* jquery.byteLength.test.js: line 26, col 9, Identifier 'U_00A2' is not in camel case.
* jquery.localize.test.js: line 63, col 29, 'attrs' is defined but never used.
* mediawiki.cldr.test.js: line 72, col 27, 'mw' is not defined.
* mediawiki.jscompat.test.js: line 6, col 17, Strings must use singlequote.
* mediawiki.api.parse.test.js: line 9, col 17, Strings must use singlequote.
* mediawiki.api.parse.test.js: line 7, col 15, 'mw' is not defined.
* mediawiki.api.parse.test.js: line 14, col 24, '$' is not defined.
* mediawiki.api.test.js: line 43, col 28, 'data' is defined but never used.

Other fixes:
* Add closures fix implied global errors ($, mw and more),
  and prevents local variables from becoming globals.
* Avoid jQ magic map arg etc. (per code conventions).
* Fix incorrect usage of jQuery methods (prop instead of attr,
  prop false instead of removeProp, ..).
* Unquote keys in object literals for consistency, and
  enforce single quotes (no magic quotes in javascript, as much
  as we might think "\n" and '/n' are really exactly the same).
  Chose single quotes over double quotes since that's what most
  code already had and what conventions seemed to prefer
  (both the old generic ones and the new per-lang ones since
  2011/2012).
* Enforce camelCase variable names with jshint per code
  conventions.
* $foo.on('x', fn).trigger('x') -> $foo.on('x', fn); fn()
  (No event simulation overhead, unless intended of course)
* Incorrect indentation (ignore whitespace in the diff!).
* Avoid proprietary selectors like ':first' when .eq(0)
  afterwards is just as possible (significantly faster in
  jQuery due to mostly avoiding the Sizzle engine and going
  native in modern browsers).
* When at it, convert deprecated jQuery methods to new ones.
  Mostly just .delegate(sel, type, fn) -> .on(type, sel, fn).
* Addressed whitespace here and there.

Interesting:
* mediawiki.js: local function "compare" wasn't used anymore
  (hasn't been in a while!) removed per jshint warning.

* mediawiki.special.recentchanges.js: Was a mess, only a few
  lines of code, rewritten.

Pfew, let's hope it's the last one before we lint from Jenkins!

Change-Id: I23ad60a1d804c542d9b91454aaa20ce7be4ff289
2012-11-10 12:23:43 +01:00
Chad Horohoe
796f701fde Also ignore sublime project files
Change-Id: I3f7ea6a6ce123aff7f422b3e6f59f38f21c4ff00
2012-11-01 17:37:48 -04:00