Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14020045
D10089.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D10089.diff
View Options
diff --git a/src/applications/harbormaster/controller/HarbormasterPlanViewController.php b/src/applications/harbormaster/controller/HarbormasterPlanViewController.php
--- a/src/applications/harbormaster/controller/HarbormasterPlanViewController.php
+++ b/src/applications/harbormaster/controller/HarbormasterPlanViewController.php
@@ -180,6 +180,7 @@
$plan,
$step,
null);
+ $available_artifacts = ipull($available_artifacts, 'type');
list($depends_ui, $has_conflicts) = $this->buildDependsOnList(
$depends,
diff --git a/src/applications/harbormaster/engine/HarbormasterBuildGraph.php b/src/applications/harbormaster/engine/HarbormasterBuildGraph.php
--- a/src/applications/harbormaster/engine/HarbormasterBuildGraph.php
+++ b/src/applications/harbormaster/engine/HarbormasterBuildGraph.php
@@ -46,7 +46,8 @@
protected function loadEdges(array $nodes) {
$map = array();
foreach ($nodes as $node) {
- $deps = $this->stepMap[$node]->getDetail('dependsOn', array());
+ $step = $this->stepMap[$node];
+ $deps = $step->getStepImplementation()->getDependencies($step);
$map[$node] = array();
foreach ($deps as $dep) {
diff --git a/src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php
--- a/src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php
+++ b/src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php
@@ -99,7 +99,28 @@
}
public function getDependencies(HarbormasterBuildStep $build_step) {
- return $build_step->getDetail('dependsOn', array());
+ $dependencies = $build_step->getDetail('dependsOn', array());
+
+ $inputs = $build_step->getStepImplementation()->getArtifactInputs();
+ $inputs = ipull($inputs, null, 'key');
+
+ $artifacts = $this->getAvailableArtifacts(
+ $build_step->getBuildPlan(),
+ $build_step,
+ null);
+
+ foreach ($artifacts as $key => $type) {
+ if (!array_key_exists($key, $inputs)) {
+ unset($artifacts[$key]);
+ }
+ }
+
+ $artifact_steps = ipull($artifacts, 'step');
+ $artifact_steps = mpull($artifact_steps, 'getPHID');
+
+ $dependencies = array_merge($dependencies, $artifact_steps);
+
+ return $dependencies;
}
/**
@@ -115,6 +136,8 @@
->withBuildPlanPHIDs(array($build_plan->getPHID()))
->execute();
+ $artifacts = array();
+
$artifact_arrays = array();
foreach ($steps as $step) {
if ($current_build_step !== null &&
@@ -124,19 +147,16 @@
}
$implementation = $step->getStepImplementation();
- $artifact_arrays[] = $implementation->getArtifactOutputs();
- }
-
- $artifacts = array();
- foreach ($artifact_arrays as $array) {
+ $array = $implementation->getArtifactOutputs();
$array = ipull($array, 'type', 'key');
foreach ($array as $name => $type) {
if ($type !== $artifact_type && $artifact_type !== null) {
continue;
}
- $artifacts[$name] = $type;
+ $artifacts[$name] = array('type' => $type, 'step' => $step);
}
}
+
return $artifacts;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 6, 11:54 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6716296
Default Alt Text
D10089.diff (3 KB)
Attached To
Mode
D10089: Make artifacts imply dependencies on build steps
Attached
Detach File
Event Timeline
Log In to Comment