{"record":{"id":"e915badd2b33baf5","repo":"phacility/phabricator","slug":"name-one-or-more-buildables-to-publish-like-b123","errorCode":null,"errorMessage":"Name one or more buildables to publish, like \"B123\".","messagePattern":"Name one or more buildables to publish, like \"B123\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/harbormaster/management/HarbormasterManagementPublishWorkflow.php","lineNumber":28,"sourceCode":"      ->setSynopsis(\n        pht(\n          'Publish a buildable. This is primarily useful for developing '.\n          'and debugging applications which have buildable objects.'))\n      ->setArguments(\n        array(\n          array(\n            'name' =>  'buildable',\n            'wildcard' => true,\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $viewer = $this->getViewer();\n\n    $buildable_names = $args->getArg('buildable');\n    if (!$buildable_names) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Name one or more buildables to publish, like \"B123\".'));\n    }\n\n    $query = id(new PhabricatorObjectQuery())\n      ->setViewer($viewer)\n      ->withNames($buildable_names);\n\n    $query->execute();\n\n    $result_map = $query->getNamedResults();\n\n    foreach ($buildable_names as $name) {\n      if (!isset($result_map[$name])) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Argument \"%s\" does not name a buildable. Provide one or more '.\n            'valid buildable monograms or PHIDs.',","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/harbormaster/management/HarbormasterManagementPublishWorkflow.php#L10-L46","documentation":"Usage error from `bin harbormaster publish`: the command republishes (finalizes) buildables, and at least one buildable name (monogram like B123 or a PHID) must be given as wildcard arguments. An empty argument list fails here immediately.","triggerScenarios":"Running `harbormaster publish` with no arguments; a wrapper/cron line where the variable holding names expands to nothing because the preceding query returned no results.","commonSituations":"Automation that derives buildable names dynamically and runs the command unconditionally, even when the list is empty.","solutions":["Pass one or more buildable monograms/PHIDs: `./bin/phabricator harbormaster publish B123 B124`.","Guard automation: skip the call when the computed name list is empty."],"exampleFix":"# before\n./bin/phabricator harbormaster publish\n\n# after\n./bin/phabricator harbormaster publish B123","handlingStrategy":"validation","validationCode":"if (count($buildable_names) === 0) {\n  fwrite(STDERR, \"Name one or more buildables to publish, like B123.\\n\");\n  exit(64);\n}","typeGuard":null,"tryCatchPattern":"try {\n  runPublishWorkflow($args);\n} catch (PhutilArgumentUsageException $e) {\n  fwrite(STDERR, $e->getMessage().\"\\n\");\n  exit(64);\n}","preventionTips":["Guard cron entries: skip the publish invocation when the computed buildable list is empty.","Pass explicit monograms (B123) rather than dynamically guessed strings."],"tags":["harbormaster","cli","usage-error","publish"],"backgroundTag":"cli-argument-validation","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}