@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.

Prevent Harbormaster autobuilds from being stopped, paused or restarted

Summary: Fixes T8657. "Auto" builds are pushed into Harbormaster by an external system (currently, `arc`) so it does not make sense to stop or resume them: Harbormaster has no way to control the external system.

Test Plan:
- Tried to restart an autobuild, got an error.
- Restarted a normal build.
- Did "Restart All" on a buildable, got restarts on non-autoplans and no restarts on autoplans.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8657

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

+16
+16
src/applications/harbormaster/storage/build/HarbormasterBuild.php
··· 214 214 $this->getBuildStatus() === self::STATUS_BUILDING; 215 215 } 216 216 217 + public function isAutobuild() { 218 + return ($this->getPlanAutoKey() !== null); 219 + } 220 + 217 221 public function createLog( 218 222 HarbormasterBuildTarget $build_target, 219 223 $log_source, ··· 336 340 } 337 341 338 342 public function canRestartBuild() { 343 + if ($this->isAutobuild()) { 344 + return false; 345 + } 346 + 339 347 return !$this->isRestarting(); 340 348 } 341 349 342 350 public function canStopBuild() { 351 + if ($this->isAutobuild()) { 352 + return false; 353 + } 354 + 343 355 return !$this->isComplete() && 344 356 !$this->isStopped() && 345 357 !$this->isStopping(); 346 358 } 347 359 348 360 public function canResumeBuild() { 361 + if ($this->isAutobuild()) { 362 + return false; 363 + } 364 + 349 365 return $this->isStopped() && 350 366 !$this->isResuming(); 351 367 }