Hover infos for 'name' and 'path' attributes in inputs/outputs of a task.yml

This commit is contained in:
Kris De Volder
2017-01-27 09:06:10 -08:00
parent c8e5c6e3c5
commit 074dbdc0b7
8 changed files with 32 additions and 28 deletions

View File

@@ -168,10 +168,13 @@ public class PipelineYmlSchema implements YamlSchema {
YAtomicType t_platform = f.yenum("Platform", "windows", "linux", "darwin");
t_platform.parseWith(ValueParsers.NE_STRING); //no errors because in theory platform are just strings.
YType t_name_and_path = f.ybean("NameAndPath" ,
f.yprop("name", t_ne_string).isRequired(true),
f.yprop("path", t_ne_string)
);
YBeanType t_input = f.ybean("TaskInput");
addProp(t_input, "name", t_ne_string).isRequired(true);
addProp(t_input, "path", t_ne_string);
YBeanType t_output = f.ybean("TaskOutput");
addProp(t_output, "name", t_ne_string).isRequired(true);
addProp(t_output, "path", t_ne_string);
YBeanType t_command = f.ybean("Command");
addProp(t_command, "path", t_ne_string).isRequired(true);
@@ -183,8 +186,8 @@ public class PipelineYmlSchema implements YamlSchema {
addProp(task, "platform", t_platform).isRequired(true);
addProp(task, "image_resource", t_image_resource);
addProp(task, "image", t_ne_string);
addProp(task, "inputs", f.yseq(t_name_and_path)).isRequired(true);
addProp(task, "outputs", f.yseq(t_name_and_path));
addProp(task, "inputs", f.yseq(t_input)).isRequired(true);
addProp(task, "outputs", f.yseq(t_output));
addProp(task, "run", t_command).isRequired(true);
addProp(task, "params", t_string_params);

View File

@@ -1,13 +1,3 @@
*Required.* The expected set of inputs for the task.
This determines which artifacts will propagate into the task, as the [build plan](https://concourse.ci/build-plans.html) executes. If any specified inputs are not present, the task will end with an error, without running.
Each input has the following attributes:
name: string
Required. The logical name of the input.
path: string
Optional. The path where the input will be placed. If not specified, the input's name is used.

View File

@@ -2,18 +2,6 @@
Each output configures a directory to make available to later steps in the [build plan](https://concourse.ci/build-plans.html). The directory will be automatically created before the task runs, and the task should place any artifacts it wants to export in the directory.
Each output has the following attributes:
name: string
*Required.* The logical name of the output. The contents under `path` will be made available to the rest of the plan under this name.
path: string
*Optional.* The path to a directory where the output will be taken from. If not specified, the output's `name` is used.
Note that this value must not overlap with any other inputs or outputs. Each output results in a new empty directory that your task should place artifacts in; if the path overlaps it'll clobber whatever files used to be there.
For example, the following task and script would be used to propagate a built binary to later steps:
---

View File

@@ -0,0 +1 @@
*Required.* The logical name of the input.

View File

@@ -0,0 +1 @@
*Optional.* The path where the input will be placed. If not specified, the input's name is used.

View File

@@ -0,0 +1 @@
*Required.* The logical name of the output. The contents under `path` will be made available to the rest of the plan under this name.

View File

@@ -0,0 +1,4 @@
*Optional.* The path to a directory where the output will be taken from. If not specified, the output's `name` is used.
Note that this value must not overlap with any other inputs or outputs. Each output results in a new empty directory that your task should place artifacts in; if the path overlaps it'll clobber whatever files used to be there.

View File

@@ -1543,6 +1543,7 @@ public class ConcourseEditorTest {
editor.assertHoverContains("outputs", "The artifacts produced by the task");
editor.assertHoverContains("run", "Note that this is *not* provided as a script blob");
editor.assertHoverContains("params", "A key-value mapping of values that are exposed to the task via environment variables");
editor.assertHoverContains("repository", "The name of the repository");
editor.assertHoverContains("platform", "The platform the task should run on");
}
@@ -1626,6 +1627,21 @@ public class ConcourseEditorTest {
editor.assertProblems("user: admin|'path' is required");
}
@Test public void nameAndPathHoversInTaskInputsAndOutputs() throws Exception {
Editor editor = harness.newEditor(LanguageIds.CONCOURSE_TASK,
"inputs:\n" +
"- name: sts4\n" +
" path: botk\n" +
"outputs:\n" +
"- name: vsix-files\n" +
" path: zaza"
);
editor.assertHoverContains("name", 1, "The logical name of the input");
editor.assertHoverContains("name", 2, "The logical name of the output");
editor.assertHoverContains("path", 1, "The path where the input will be placed");
editor.assertHoverContains("path", 2, "The path to a directory where the output will be taken from");
}
//////////////////////////////////////////////////////////////////////////////
private void assertContextualCompletions(String conText, String textBefore, String... textAfter) throws Exception {