From a856330738edb5e8231f130908d1569d53727687 Mon Sep 17 00:00:00 2001 From: Kris De Volder Date: Thu, 15 Aug 2019 09:10:14 -0700 Subject: [PATCH] Add support for 'inputs' in PutStep in concourse editor See: https://github.com/spring-projects/sts4/issues/341 Signed-off-by: Kris De Volder --- .../vscode/concourse/PipelineYmlSchema.java | 1 + .../src/main/resources/desc/PutStep/inputs.md | 1 + .../vscode/concourse/ConcourseEditorTest.java | 21 +++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 headless-services/concourse-language-server/src/main/resources/desc/PutStep/inputs.md diff --git a/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java b/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java index e1647dd40..6c59de930 100644 --- a/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java +++ b/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java @@ -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)) )); diff --git a/headless-services/concourse-language-server/src/main/resources/desc/PutStep/inputs.md b/headless-services/concourse-language-server/src/main/resources/desc/PutStep/inputs.md new file mode 100644 index 000000000..f89914889 --- /dev/null +++ b/headless-services/concourse-language-server/src/main/resources/desc/PutStep/inputs.md @@ -0,0 +1 @@ +*Optional*. If specified, only the listed artifacts will be provided to the container. If not specified, all artifacts will be provided. diff --git a/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java b/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java index 272f02df6..cf0860b19 100644 --- a/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java +++ b/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java @@ -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 {