diff --git a/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php --- a/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php @@ -52,8 +52,17 @@ $method = nonempty(idx($settings, 'method'), 'POST'); + $data = ''; + if ($settings['data'] !== '') { + $data = $this->mergeVariables( + 'vurisprintf', + $settings['data'], + $variables); + } + $future = id(new HTTPSFuture($uri)) ->setMethod($method) + ->setData($data) ->setTimeout(60); $credential_phid = $this->getSetting('credential'); @@ -96,6 +105,12 @@ 'credential.provides' => PassphraseCredentialTypePassword::PROVIDES_TYPE, ), + 'data' => array( + 'name' => 'Data', + 'description' => + pht('Data for request (for POST/PUT requests)'), + 'type' => 'text', + ), ); } diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuild.php b/src/applications/harbormaster/storage/build/HarbormasterBuild.php --- a/src/applications/harbormaster/storage/build/HarbormasterBuild.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuild.php @@ -184,8 +184,12 @@ public function retrieveVariablesFromBuild() { $results = array( 'buildable.diff' => null, + 'buildable.description' => null, + 'buildable.requester' => null, 'buildable.revision' => null, 'buildable.commit' => null, + 'buildable.author' => null, + 'buildable.summary' => null, 'repository.callsign' => null, 'repository.vcs' => null, 'repository.uri' => null, @@ -200,10 +204,17 @@ if ($object instanceof DifferentialDiff) { $results['buildable.diff'] = $object->getID(); $revision = $object->getRevision(); + $results['buildable.description'] = $revision->getTitle(); $results['buildable.revision'] = $revision->getID(); + $user = id(new PhabricatorUser()) + ->loadOneWhere('phid = %s', $revision->getAuthorPHID()); + $results['buildable.requester'] = $user->getUserName(); $repo = $revision->getRepository(); } else if ($object instanceof PhabricatorRepositoryCommit) { + $commit_data = $object->loadCommitData(); $results['buildable.commit'] = $object->getCommitIdentifier(); + $results['buildable.author'] = $commit_data->getAuthorName(); + $results['buildable.summary'] = $commit_data->getSummary(); $repo = $object->getRepository(); } @@ -223,9 +234,18 @@ return array( 'buildable.diff' => pht('The differential diff ID, if applicable.'), + 'buildable.description' => + pht('The differential diff Description, if applicable.'), 'buildable.revision' => pht('The differential revision ID, if applicable.'), - 'buildable.commit' => pht('The commit identifier, if applicable.'), + 'buildable.requester' => + pht('The differential author, if applicable'), + 'buildable.commit' => + pht('The commit identifier, if applicable.'), + 'buildable.author' => + pht('The commit author, if applicable.'), + 'buildable.summary' => + pht('The commit summary, if applicable.'), 'repository.callsign' => pht('The callsign of the repository in Phabricator.'), 'repository.vcs' => @@ -271,6 +291,7 @@ return !$this->isRestarting(); } + public function canStopBuild() { return !$this->isComplete() && !$this->isStopped() && diff --git a/src/applications/repository/storage/PhabricatorRepositoryCommitData.php b/src/applications/repository/storage/PhabricatorRepositoryCommitData.php --- a/src/applications/repository/storage/PhabricatorRepositoryCommitData.php +++ b/src/applications/repository/storage/PhabricatorRepositoryCommitData.php @@ -13,6 +13,10 @@ protected $commitMessage = ''; protected $commitDetails = array(); + public function getAuthorName() { + return $this->authorName; + } + public function getConfiguration() { return array( self::CONFIG_TIMESTAMPS => false,