Add support for 'inputs' in PutStep in concourse editor

See: https://github.com/spring-projects/sts4/issues/341

Signed-off-by: Kris De Volder <kdevolder@pivotal.io>
This commit is contained in:
Kris De Volder
2019-08-15 09:10:14 -07:00
parent 36a4f05d64
commit a856330738
3 changed files with 23 additions and 0 deletions

View File

@@ -325,6 +325,7 @@ public class PipelineYmlSchema implements YamlSchema {
YBeanType putStep = f.ybean("PutStep");
addProp(putStep, "put", t_put_get_name);
addProp(putStep, "resource", t_resource_name);
addProp(putStep, "inputs", t_strings);
addProp(putStep, "params", f.contextAware("PutParams", (dc) ->
resourceTypes.getOutParamsType(getResourceType("put", models, dc))
));

View File

@@ -0,0 +1 @@
*Optional*. If specified, only the listed artifacts will be provided to the container. If not specified, all artifacts will be provided.

View File

@@ -375,6 +375,7 @@ public class ConcourseEditorTest {
"- name: some-job\n" +
" plan:\n" +
" - put: something\n" +
" inputs: []\n" +
" resource: something\n" +
" params:\n" +
" some_param: some_value\n" +
@@ -382,6 +383,7 @@ public class ConcourseEditorTest {
" skip_download: true\n"
);
editor.assertHoverContains("inputs", "only the listed artifacts will be provided to the container");
editor.assertHoverContains("resource", "The resource to update");
editor.assertHoverContains("params", "A map of arbitrary configuration");
editor.assertHoverContains("get_params", "A map of arbitrary configuration to forward to the resource that will be utilized during the implicit `get` step");
@@ -1578,6 +1580,25 @@ public class ConcourseEditorTest {
editor.assertHoverContains("submodules", "If `none`, submodules will not be fetched");
editor.assertHoverContains("disable_git_lfs", "will not fetch Git LFS files");
}
@Test
public void putStepInputsReconcile() throws Exception {
//See: https://github.com/spring-projects/sts4/issues/341
Editor editor = harness.newEditor(
"resources:\n" +
"- name: my-git\n" +
" type: git\n" +
" source:\n" +
" uri: https://example.com/my-name/my-repo.git\n" +
" branch: master\n" +
"jobs:\n" +
"- name: do-stuff\n" +
" plan:\n" +
" - put: my-git\n" +
" inputs: not-a-list\n"
);
editor.assertProblems("not-a-list|Expecting a 'Sequence'");
}
@Test
public void contentAssistJobNames() throws Exception {