3
final class ConduitDeprecatedCallSetupCheck extends PhabricatorSetupCheck {
5
protected function executeChecks() {
6
// NOTE: We still call deprecated methods, so don't enable this until at
7
// least 30 days after fixing T7111, T7112 and T7113.
10
$methods = id(new PhabricatorConduitMethodQuery())
11
->setViewer(PhabricatorUser::getOmnipotentUser())
12
->withIsDeprecated(true)
18
$methods = mpull($methods, null, 'getAPIMethodName');
19
$method_names = mpull($methods, 'getAPIMethodName');
21
$table = new PhabricatorConduitMethodCallLog();
22
$conn_r = $table->establishConnection('r');
26
'SELECT DISTINCT method FROM %T WHERE dateCreated > %d
28
$table->getTableName(),
29
time() - (60 * 60 * 24 * 30),
31
$calls = ipull($calls, 'method', 'method');
33
foreach ($calls as $method_name) {
34
$method = $methods[$method_name];
37
'Deprecated Conduit method `%s` was called in the last 30 days. '.
38
'You should migrate away from use of this method: it will be '.
39
'removed in a future version of Phabricator.',
42
$uri = PhabricatorEnv::getURI('/conduit/log/?methods='.$method_name);
44
$description = $method->getMethodStatusDescription();
47
'Deprecated Conduit method %s was called in the last 30 days. '.
48
'You should migrate away from use of this method: it will be '.
49
'removed in a future version of Phabricator.'.
53
'If you have already migrated all callers away from this method, '.
54
'you can safely ignore this setup issue.',
55
phutil_tag('tt', array(), $method_name),
56
phutil_tag('tt', array(), $method_name),
60
->newIssue('conduit.deprecated.'.$method_name)
61
->setShortName(pht('Deprecated Conduit Method'))
62
->setName(pht('Deprecated Conduit Method "%s" In Use', $method_name))
63
->setSummary($summary)
64
->setMessage($message)
65
->addLink($uri, pht('View Method Call Logs'));