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

Stop build target start times from being overwritten on reentry

Summary:
See PHI615. Ref T13130. An install is reporting that "Lease Working Copy" build steps always report "Built instantly" after completion.

I'm not 100% sure that this is the fix, but I'm like 99% sure: "Lease Working Copy" build steps yield after they ask Drydock for a lease. They will later reenter `doWork()`, see that the lease is filled, and complete.

Right now, we reset the start time every time we enter `doWork()`. Instead, set it only if it hasn't been set yet.

Test Plan: This is low-risk and a bit tricky to reproduce locally, but I'll run some production builds and see what they look like.

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13130

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

+7 -1
+7 -1
src/applications/harbormaster/worker/HarbormasterTargetWorker.php
··· 46 46 $build = $target->getBuild(); 47 47 $viewer = $this->getViewer(); 48 48 49 - $target->setDateStarted(time()); 49 + // If this is the first time we're starting work on this target, mark the 50 + // current time as the start time. If the target yields or waits, we may 51 + // end up here again later, so we don't want to overwrite the start time if 52 + // we already have a value. 53 + if (!$target->getDateStarted()) { 54 + $target->setDateStarted(PhabricatorTime::getNow()); 55 + } 50 56 51 57 try { 52 58 if ($target->getBuildGeneration() !== $build->getBuildGeneration()) {