mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 19:32:40 +01:00
1786093c6e
Summary: Ref T1049. Currently you can cancel a build, but now that we're tracking a lot more state we can stop, resume, and restart builds. When the user issues a command against a build, I'm writing it into an auxiliary queue (`HarbormasterBuildCommand`) and then reading them out in the worker. This is mostly to avoid race messes where we try to `save()` the object in multiple places: basically, the BuildEngine is the //only// thing that writes to Build objects, and it holds a lock while it does it. Test Plan: - Created a plan which runs "sleep 2" a bunch of times in a row. - Stopped, resumed, and restarted it. Reviewers: btrahan Reviewed By: btrahan CC: aran, chad Maniphest Tasks: T1049 Differential Revision: https://secure.phabricator.com/D7892
18 lines
751 B
SQL
18 lines
751 B
SQL
CREATE TABLE {$NAMESPACE}_harbormaster.harbormaster_buildcommand (
|
|
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
authorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
|
|
targetPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
|
|
command VARCHAR(128) NOT NULL COLLATE utf8_bin,
|
|
dateCreated INT UNSIGNED NOT NULL,
|
|
dateModified INT UNSIGNED NOT NULL,
|
|
KEY `key_target` (targetPHID)
|
|
) ENGINE=InnoDB, COLLATE utf8_general_ci;
|
|
|
|
ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_build
|
|
DROP cancelRequested;
|
|
|
|
ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildtarget
|
|
ADD targetStatus VARCHAR(64) NOT NULL COLLATE utf8_bin;
|
|
|
|
UPDATE {$NAMESPACE}_harbormaster.harbormaster_buildtarget
|
|
SET targetStatus = 'target/pending' WHERE targetStatus = '';
|