Commit graph

12 commits

Author SHA1 Message Date
daniel
4eebc3491a FileRepo: replace Title in method signatures
NOTE: FileRepo is extended (via LocalRepo) by a couple of extensions,
even though it is not stable to extend. Hwever, none of these extensions
overrides any of the methods changed here.
https://codesearch.wmcloud.org/extensions/?q=extends%20%5Cw%2BRepo%5Cb&i=nope&files=&excludeFiles=&repos=

Bug: T278459
Change-Id: I0c236bfa354b01b03f864dd343371e4ae323b56f
2021-04-16 11:01:48 +00:00
Timo Tijhof
16ac6980f8 objectcache: Implement 'onHostRoutingPrefix' option in WANObjectCache
Renamed several methods for clarity and updated various comments

Use explicit number_format() instead of casting floats to strings
when making purge values

Fix LocalRepoTest mocking of WANObjectCache::makeGlobalKey()

Bug: T264604
Change-Id: Ib03b97fcab8a34d38d3a8a12da6e28e12feef4ad
2021-04-09 00:27:13 +00:00
Umherirrender
7691dbeca9 Add missing @param and @return to documentation in tests
Change-Id: Ic663e81cca0bf007804a70772250914a85f1fef4
2021-01-22 19:57:25 +01:00
Thiemo Kreuz
b655f382db Remove broken/outdated @param/@throws tags from @dataProviders
My personal best practice is to not document @params when there
is a @dataProvider. I mean, these test…() functions are not
meant to be called from anywhere. They do not really need
documentation. @param tags don't do much but duplicate what the
@dataProvider does. This is error-prone, as demonstrated by the
examples in this patch.

This patch also removes @throws tags from tests. A test…() can
never throw an exception. Otherwise the test would fail.

Most of these are found by the not yet released I10559d8.

Change-Id: I3782bca43f875687cd2be972144a7ab6b298454e
2021-01-21 03:42:42 +00:00
Aaron Schulz
57b2e2d6ac filerepo: remove repo name from getSharedCacheKey()
The name is only used for local config and internal virtual URLs.
A key use case is having a LocalRepo named "local" on central repo
wiki and a ForeignDBViaLBRepo named "shared" on the client wikis,
the later being a reference to the former. The keys should be be
shared regardless of this naming difference.

Bug: T267668
Change-Id: Ic239bb980740ec5237edc878af4274885034a96f
2020-11-16 17:28:31 -08:00
Aaron Schulz
70c4255978 filerepo: clean up shared cache keys to avoid key metrics clutter
This avoids statsd metrics with names that begin with DB domains

Bug: T261534
Change-Id: I69fa4482c639bd49bdc2dec48a8dcdd74d455432
2020-10-21 13:29:15 -07:00
Aaron Schulz
dc388e6c16 Cleanup up excess commit() call in LocalRepoTest
Bug: T256394
Change-Id: I4bdfa6f0034e36c88c337319df2b2fbacded147b
2020-07-22 16:22:01 -07:00
Aaron Schulz
88e17d3f7c filerepo: make LocalRepo::getSharedCacheKey() use makeGlobalKey()
Also rename image_redirect key to file_redirect while at it.
This assures that stale keys are not still in use.

Bug: T253405
Change-Id: I31a9bb6672b33fbfa1b974955d78fdfd8d58f5da
2020-05-23 17:32:55 +00:00
Daimona Eaytoy
8545ce131a Kill the remaining usages of PHPUnit4And6Compat methods
Bug: T192167
Change-Id: I1ea19e9b53683b7d32ff9836990ee73ab3e11104
2019-10-06 10:12:54 +00:00
Daimona Eaytoy
ef5ab69629 Replace setExpectedException with two args
Find: ^(\t*)(\$this->)setExpectedException\(\s+(\\?[a-z\\]+::class),\s+('(?:[^'\\]|\\')+'|"(?:[^"\\]|\\")+")\s+\);

Replace: $1$2expectException( $3 );\n$1\$this->expectExceptionMessage( $4 );

+broke long lines manually.

Bug: T192167
Change-Id: I5557b4372625def55a53ac637c2f980f51f12933
2019-10-05 16:14:05 +00:00
Marko Obrovac
f65beabcfd LocalRepo: Remove leading 0 from 32-byte SHA1 keys
Bug: T230667
Change-Id: I3d9de7a92495e894b4b44b0a5b0646b6d720f7c2
2019-09-03 16:04:14 +02:00
Aryeh Gregor
9b90a1fde7 Add some LocalRepo integration tests
Coverage is still far from 100%, but better than nothing.

Change-Id: Ifb22491414653a5730a83434c4ea31a3540f7d26
2019-08-30 12:36:46 +03:00