{"record":{"id":"86e13cfb224b272a","repo":"phacility/phabricator","slug":"the-specified-content-type-s-does-not-support","errorCode":null,"errorMessage":"The specified content type (\"%s\") does not support dry runs. Choose a testable content type. For this object, valid content types are: %s.","messagePattern":"The specified content type \\(\"(.+?)\"\\) does not support dry runs\\. Choose a testable content type\\. For this object, valid content types are: (.+?)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/herald/management/HeraldTestManagementWorkflow.php","lineNumber":90,"sourceCode":"    if (!strlen($content_type)) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify a content type to run rules for. For this object, valid '.\n          'content types are: %s.',\n          implode(', ', array_keys($can_select))));\n    }\n\n    if (!isset($can_select[$content_type])) {\n      if (!isset($display_adapters[$content_type])) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Specify a content type to run rules for. The specified content '.\n            'type (\"%s\") is not valid. For this object, valid content types '.\n            'are: %s.',\n            $content_type,\n            implode(', ', array_keys($can_select))));\n      } else {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'The specified content type (\"%s\") does not support dry runs. '.\n            'Choose a testable content type. For this object, valid content '.\n            'types are: %s.',\n            $content_type,\n            implode(', ', array_keys($can_select))));\n      }\n    }\n\n    $adapter = $can_select[$content_type]->newTestAdapter(\n      $viewer,\n      $object);\n\n    $content_source = $this->newContentSource();\n\n    $adapter\n      ->setContentSource($content_source)\n      ->setIsNewObject(false)","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/herald/management/HeraldTestManagementWorkflow.php#L72-L108","documentation":"The --type passed to 'bin/herald test' does resolve to a real Herald adapter for the object ($display_adapters), but that adapter does not support dry runs: canCreateTestAdapterForObject($object) returned false, so it is missing from $can_select. Herald can show rules of that type but cannot execute a test adapter for it, so the command refuses and points you at the testable types.","triggerScenarios":"Passing a display-only content type to 'bin/herald test', i.e. any adapter where isTestAdapterForObject() is true but canCreateTestAdapterForObject() is false for the selected object (an adapter that never implemented newTestAdapter()).","commonSituations":"Expecting every rule type visible in the web UI test console to be CLI-testable; custom adapters that render rules but have no test-adapter implementation; newly added adapters that only implement display.","solutions":["Choose a content type from the valid list in the error message; those are exactly the dry-run-capable adapters for the object.","If you only need to inspect rule evaluation for the non-testable type, use the web UI Herald test console instead.","If you maintain a custom adapter, implement canCreateTestAdapterForObject() and newTestAdapter() to make it testable."],"exampleFix":"// before\n./bin/herald test --object X123 --type <display-only-type>\n// after\n./bin/herald test --object X123 --type <one of the valid types listed in the error>","handlingStrategy":"validation","validationCode":"// Filter candidates down to dry-run-capable adapters before choosing --type:\n$testable = array();\nforeach (HeraldAdapter::getAllAdapters() as $key => $adapter) {\n  if ($adapter->isTestAdapterForObject($object)\n      && $adapter->isAvailableToUser($viewer)\n      && $adapter->canCreateTestAdapterForObject($object)) {\n    $testable[] = $key;\n  }\n}\n// pick $type from $testable only","typeGuard":"function isDryRunnableHeraldAdapter(HeraldAdapter $adapter, $object) {\n  return $adapter->canCreateTestAdapterForObject($object);\n}","tryCatchPattern":null,"preventionTips":["Do not assume an adapter visible in the web UI is CLI-testable; check canCreateTestAdapterForObject().","For custom adapters, implement newTestAdapter() if you need dry-run support in bin/herald test.","Keep a pinned list of testable adapter keys per object type in your tooling."],"tags":["herald","phabricator","cli","dry-run","adapter"],"backgroundTag":"unsupported-operation","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}