mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Remove the "deprecated calls in the last 30 days" setup warning
Summary: Ref T9980. I don't think this is actually useful, and plan to give users and administrators more powerful tools instead. Test Plan: Loaded setup warnings. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9980 Differential Revision: https://secure.phabricator.com/D14778
This commit is contained in:
parent
eb8835b15e
commit
00bd824781
2 changed files with 0 additions and 67 deletions
|
@ -228,7 +228,6 @@ phutil_register_library_map(array(
|
||||||
'ConduitCallTestCase' => 'applications/conduit/call/__tests__/ConduitCallTestCase.php',
|
'ConduitCallTestCase' => 'applications/conduit/call/__tests__/ConduitCallTestCase.php',
|
||||||
'ConduitConnectConduitAPIMethod' => 'applications/conduit/method/ConduitConnectConduitAPIMethod.php',
|
'ConduitConnectConduitAPIMethod' => 'applications/conduit/method/ConduitConnectConduitAPIMethod.php',
|
||||||
'ConduitConnectionGarbageCollector' => 'applications/conduit/garbagecollector/ConduitConnectionGarbageCollector.php',
|
'ConduitConnectionGarbageCollector' => 'applications/conduit/garbagecollector/ConduitConnectionGarbageCollector.php',
|
||||||
'ConduitDeprecatedCallSetupCheck' => 'applications/conduit/check/ConduitDeprecatedCallSetupCheck.php',
|
|
||||||
'ConduitEpochParameterType' => 'applications/conduit/parametertype/ConduitEpochParameterType.php',
|
'ConduitEpochParameterType' => 'applications/conduit/parametertype/ConduitEpochParameterType.php',
|
||||||
'ConduitException' => 'applications/conduit/protocol/exception/ConduitException.php',
|
'ConduitException' => 'applications/conduit/protocol/exception/ConduitException.php',
|
||||||
'ConduitGetCapabilitiesConduitAPIMethod' => 'applications/conduit/method/ConduitGetCapabilitiesConduitAPIMethod.php',
|
'ConduitGetCapabilitiesConduitAPIMethod' => 'applications/conduit/method/ConduitGetCapabilitiesConduitAPIMethod.php',
|
||||||
|
@ -4090,7 +4089,6 @@ phutil_register_library_map(array(
|
||||||
'ConduitCallTestCase' => 'PhabricatorTestCase',
|
'ConduitCallTestCase' => 'PhabricatorTestCase',
|
||||||
'ConduitConnectConduitAPIMethod' => 'ConduitAPIMethod',
|
'ConduitConnectConduitAPIMethod' => 'ConduitAPIMethod',
|
||||||
'ConduitConnectionGarbageCollector' => 'PhabricatorGarbageCollector',
|
'ConduitConnectionGarbageCollector' => 'PhabricatorGarbageCollector',
|
||||||
'ConduitDeprecatedCallSetupCheck' => 'PhabricatorSetupCheck',
|
|
||||||
'ConduitEpochParameterType' => 'ConduitListParameterType',
|
'ConduitEpochParameterType' => 'ConduitListParameterType',
|
||||||
'ConduitException' => 'Exception',
|
'ConduitException' => 'Exception',
|
||||||
'ConduitGetCapabilitiesConduitAPIMethod' => 'ConduitAPIMethod',
|
'ConduitGetCapabilitiesConduitAPIMethod' => 'ConduitAPIMethod',
|
||||||
|
|
|
@ -1,65 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class ConduitDeprecatedCallSetupCheck extends PhabricatorSetupCheck {
|
|
||||||
|
|
||||||
protected function executeChecks() {
|
|
||||||
$methods = id(new PhabricatorConduitMethodQuery())
|
|
||||||
->setViewer(PhabricatorUser::getOmnipotentUser())
|
|
||||||
->withIsDeprecated(true)
|
|
||||||
->execute();
|
|
||||||
if (!$methods) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$methods = mpull($methods, null, 'getAPIMethodName');
|
|
||||||
$method_names = mpull($methods, 'getAPIMethodName');
|
|
||||||
|
|
||||||
$table = new PhabricatorConduitMethodCallLog();
|
|
||||||
$conn_r = $table->establishConnection('r');
|
|
||||||
|
|
||||||
$calls = queryfx_all(
|
|
||||||
$conn_r,
|
|
||||||
'SELECT DISTINCT method FROM %T WHERE dateCreated > %d
|
|
||||||
AND method IN (%Ls)',
|
|
||||||
$table->getTableName(),
|
|
||||||
time() - (60 * 60 * 24 * 30),
|
|
||||||
$method_names);
|
|
||||||
$calls = ipull($calls, 'method', 'method');
|
|
||||||
|
|
||||||
foreach ($calls as $method_name) {
|
|
||||||
$method = $methods[$method_name];
|
|
||||||
|
|
||||||
$summary = pht(
|
|
||||||
'Deprecated Conduit method `%s` was called in the last 30 days. '.
|
|
||||||
'You should migrate away from use of this method: it will be '.
|
|
||||||
'removed in a future version of Phabricator.',
|
|
||||||
$method_name);
|
|
||||||
|
|
||||||
$uri = PhabricatorEnv::getURI('/conduit/log/?methods='.$method_name);
|
|
||||||
|
|
||||||
$description = $method->getMethodStatusDescription();
|
|
||||||
|
|
||||||
$message = pht(
|
|
||||||
'Deprecated Conduit method %s was called in the last 30 days. '.
|
|
||||||
'You should migrate away from use of this method: it will be '.
|
|
||||||
'removed in a future version of Phabricator.'.
|
|
||||||
"\n\n".
|
|
||||||
"%s: %s".
|
|
||||||
"\n\n".
|
|
||||||
'If you have already migrated all callers away from this method, '.
|
|
||||||
'you can safely ignore this setup issue.',
|
|
||||||
phutil_tag('tt', array(), $method_name),
|
|
||||||
phutil_tag('tt', array(), $method_name),
|
|
||||||
$description);
|
|
||||||
|
|
||||||
$this
|
|
||||||
->newIssue('conduit.deprecated.'.$method_name)
|
|
||||||
->setShortName(pht('Deprecated Conduit Method'))
|
|
||||||
->setName(pht('Deprecated Conduit Method "%s" In Use', $method_name))
|
|
||||||
->setSummary($summary)
|
|
||||||
->setMessage($message)
|
|
||||||
->addLink($uri, pht('View Method Call Logs'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in a new issue