@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove Releeph "Authors" rules

Summary:
Fixes T3659. Releeph has some awkward complexity around who ends up as a commit author. Instead, we should always try to use the original author.

Metadata (like the requestor's identity) should be accessed via Conduit or other channels instead.

Test Plan: Saved some projects, grepped for all related symbols.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T3659

Differential Revision: https://secure.phabricator.com/D8630

+7 -104
+7 -20
src/applications/releeph/conduit/work/ConduitAPI_releephwork_nextrequest_Method.php
··· 127 127 $diff_name = $handles[$diff_phid]->getName(); 128 128 } 129 129 130 - // Calculate the new-author information (if any) 131 - $new_author = null; 132 130 $new_author_phid = null; 133 - switch ($project->getDetail('commitWithAuthor')) { 134 - case ReleephProject::COMMIT_AUTHOR_NONE: 135 - break; 136 - 137 - case ReleephProject::COMMIT_AUTHOR_FROM_DIFF: 138 - if ($diff_rev) { 139 - $new_author_phid = $diff_rev->getAuthorPHID(); 140 - } else { 141 - $pr_commit = $releeph_request->loadPhabricatorRepositoryCommit(); 142 - if ($pr_commit) { 143 - $new_author_phid = $pr_commit->getAuthorPHID(); 144 - } 145 - } 146 - break; 147 - 148 - case ReleephProject::COMMIT_AUTHOR_REQUESTOR: 149 - $new_author_phid = $releeph_request->getRequestUserPHID(); 150 - break; 131 + if ($diff_rev) { 132 + $new_author_phid = $diff_rev->getAuthorPHID(); 133 + } else { 134 + $pr_commit = $releeph_request->loadPhabricatorRepositoryCommit(); 135 + if ($pr_commit) { 136 + $new_author_phid = $pr_commit->getAuthorPHID(); 137 + } 151 138 } 152 139 153 140 return array(
-80
src/applications/releeph/controller/project/ReleephProjectEditController.php
··· 22 22 } 23 23 $pick_failure_instructions = $request->getStr('pickFailureInstructions', 24 24 $this->getReleephProject()->getDetail('pick_failure_instructions')); 25 - $commit_author = $request->getStr('commitWithAuthor', 26 - $this->getReleephProject()->getDetail('commitWithAuthor')); 27 25 $test_paths = $request->getStr('testPaths'); 28 26 if ($test_paths !== null) { 29 27 $test_paths = array_filter(explode("\n", $test_paths)); ··· 72 70 ->setDetail('pushers', $pusher_phids) 73 71 ->setDetail('pick_failure_instructions', $pick_failure_instructions) 74 72 ->setDetail('branchTemplate', $branch_template) 75 - ->setDetail('commitWithAuthor', $commit_author) 76 73 ->setDetail('testPaths', $test_paths); 77 74 78 75 $fake_commit_handle = ··· 188 185 ->setDatasource('/typeahead/common/users/') 189 186 ->setValue($pusher_handles)); 190 187 191 - $commit_author_inset = $this->buildCommitAuthorInset($commit_author); 192 - 193 188 // Build the Template inset 194 189 $help_markup = PhabricatorMarkupEngine::renderOneObject( 195 190 id(new PhabricatorMarkupOneOff())->setContent($this->getBranchHelpText()), ··· 224 219 ->setUser($request->getUser()) 225 220 ->appendChild($basic_inset) 226 221 ->appendChild($pushers_inset) 227 - ->appendChild($commit_author_inset) 228 222 ->appendChild($template_inset); 229 223 230 224 $form ··· 241 235 return $this->buildStandardPageResponse( 242 236 array($error_view, $panel), 243 237 array('title' => pht('Edit Releeph Project'))); 244 - } 245 - 246 - private function buildCommitAuthorInset($current) { 247 - $vcs_type = $this->getReleephProject() 248 - ->loadPhabricatorRepository() 249 - ->getVersionControlSystem(); 250 - 251 - switch ($vcs_type) { 252 - case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 253 - case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: 254 - break; 255 - 256 - case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 257 - return; 258 - break; 259 - } 260 - 261 - $vcs_name = PhabricatorRepositoryType::getNameForRepositoryType($vcs_type); 262 - 263 - // pht? 264 - $help_markup = hsprintf(<<<EOTEXT 265 - When your project's release engineers run <tt>arc releeph</tt>, they will be 266 - listed as the <strong>committer</strong> of the code committed to release 267 - branches. 268 - 269 - %s allows you to specify a separate author when committing code. Some 270 - tools use the author of a commit (rather than the committer) when they need to 271 - notify someone about a build or test failure. 272 - 273 - Releeph can use one of the following to set the <strong>author</strong> of the 274 - commits it makes: 275 - EOTEXT 276 - , $vcs_name); 277 - 278 - $trunk = $this->getReleephProject()->getTrunkBranch(); 279 - 280 - $options = array( 281 - array( 282 - 'value' => ReleephProject::COMMIT_AUTHOR_FROM_DIFF, 283 - 'label' => pht('Original Author'), 284 - 'caption' => 285 - pht('The author of the original commit in: %s.', $trunk), 286 - ), 287 - array( 288 - 'value' => ReleephProject::COMMIT_AUTHOR_REQUESTOR, 289 - 'label' => pht('Requestor'), 290 - 'caption' => 291 - pht('The person who requested that this code go into the release.'), 292 - ), 293 - array( 294 - 'value' => ReleephProject::COMMIT_AUTHOR_NONE, 295 - 'label' => pht('None'), 296 - 'caption' => 297 - pht('Only record the default committer information.'), 298 - ), 299 - ); 300 - 301 - if (!$current) { 302 - $current = ReleephProject::COMMIT_AUTHOR_FROM_DIFF; 303 - } 304 - 305 - $control = id(new AphrontFormRadioButtonControl()) 306 - ->setLabel(pht('Author')) 307 - ->setName('commitWithAuthor') 308 - ->setValue($current); 309 - 310 - foreach ($options as $dict) { 311 - $control->addButton($dict['value'], $dict['label'], $dict['caption']); 312 - } 313 - 314 - return id(new AphrontFormInsetView()) 315 - ->setTitle(pht('Authors')) 316 - ->appendChild($help_markup) 317 - ->appendChild($control); 318 238 } 319 239 320 240 private function getBranchHelpText() {
-4
src/applications/releeph/storage/ReleephProject.php
··· 6 6 const DEFAULT_BRANCH_NAMESPACE = 'releeph-releases'; 7 7 const SYSTEM_AGENT_USERNAME_PREFIX = 'releeph-agent-'; 8 8 9 - const COMMIT_AUTHOR_NONE = 'commit-author-none'; 10 - const COMMIT_AUTHOR_FROM_DIFF = 'commit-author-is-from-diff'; 11 - const COMMIT_AUTHOR_REQUESTOR = 'commit-author-is-requestor'; 12 - 13 9 protected $name; 14 10 15 11 // Specifying the place to pick from is a requirement for svn, though not