{"record":{"id":"f72619ae7d72b3db","repo":"phacility/phabricator","slug":"unknown-repository-operation-target-type-s-in-f72619","errorCode":null,"errorMessage":"Unknown repository operation target type \"%s\" (in target \"%s\").","messagePattern":"Unknown repository operation target type \"(.+?)\" \\(in target \"(.+?)\"\\)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php","lineNumber":171,"sourceCode":"    return $lease;\n  }\n\n  private function buildRepositoryMap(DrydockRepositoryOperation $operation) {\n    $repository = $operation->getRepository();\n\n    $target = $operation->getRepositoryTarget();\n    list($type, $name) = explode(':', $target, 2);\n    switch ($type) {\n      case 'branch':\n        $spec = array(\n          'branch' => $name,\n        );\n        break;\n      case 'none':\n        $spec = array();\n        break;\n      default:\n        throw new Exception(\n          pht(\n            'Unknown repository operation target type \"%s\" (in target \"%s\").',\n            $type,\n            $target));\n    }\n\n    $spec['merges'] = $operation->getWorkingCopyMerges();\n\n    $map = array();\n    $map[$repository->getCloneName()] = array(\n      'phid' => $repository->getPHID(),\n      'default' => true,\n    ) + $spec;\n\n    return $map;\n  }\n}\n","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php#L153-L189","documentation":"buildRepositoryMap() parses the operation's repository target as 'type:name' (explode on ':') and only accepts 'branch' and 'none'. Any other type segment throws immediately. The target string drives what the working copy checks out, so an unsupported or misspelled type is rejected before any VCS work starts.","triggerScenarios":"Calling setRepositoryTarget() with 'tag:v1', 'bookmark:default', 'commit:abc123', or a bare name with no colon; upstream code expecting a target type this version does not support.","commonSituations":"Newer client or integration sending target types this Phabricator version lacks; typos in automation scripts that build the target string; operations on Mercurial bookmarks versus git branches.","solutions":["Use a supported target: 'branch:<name>' to check out a branch, or 'none' for no checkout.","Validate the target format before submitting the operation.","If you need another target type, extend this switch in a patched DrydockRepositoryOperationUpdateWorker and the working-copy blueprint."],"exampleFix":"// before\n$operation->setRepositoryTarget('tag:v1.2.3');\n\n// after\n$operation->setRepositoryTarget('branch:release-1.2');","handlingStrategy":"validation","validationCode":"$target = $operation->getRepositoryTarget();\nlist($type) = explode(':', $target, 2) + array(null);\nif (!in_array($type, array('branch', 'none'), true)) {\n  throw new Exception(\n    pht('Target type must be \"branch\" or \"none\", got \"%s\".', $type));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build target strings from a whitelist of supported types ('branch:<name>', 'none').","Validate the target at submission time, not inside the worker."],"tags":["drydock","php","repository-operations","validation","enum","target"],"backgroundTag":"unsupported-target-type","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}