Support for get_params attributes in git resource put steps

This commit is contained in:
Kris De Volder
2017-01-21 18:45:36 -08:00
parent f9a464cb8c
commit 535c9574b2
2 changed files with 27 additions and 7 deletions

View File

@@ -132,10 +132,9 @@ public class PipelineYmlSchema implements YamlSchema {
addProp(getStep, "resource", t_string);
addProp(getStep, "version", t_version);
addProp(getStep, "passed", f.yseq(jobName));
YType t_get_params = f.contextAware("GetParams", (dc) ->
addProp(getStep, "params", f.contextAware("GetParams", (dc) ->
resourceTypes.getInParamsType(getResourceType("get", models, dc))
);
addProp(getStep, "params", t_get_params);
));
addProp(getStep, "trigger", t_boolean);
YBeanType putStep = f.ybean("PutStep");
@@ -144,8 +143,9 @@ public class PipelineYmlSchema implements YamlSchema {
addProp(putStep, "params", f.contextAware("PutParams", (dc) ->
resourceTypes.getOutParamsType(getResourceType("put", models, dc))
));
addProp(putStep, "get_params", t_get_params);
addProp(putStep, "get_params", f.contextAware("GetParams", (dc) ->
resourceTypes.getInParamsType(getResourceType("put", models, dc))
));
YBeanType taskStep = f.ybean("TaskStep");
addProp(taskStep, "task", t_ne_string);
addProp(taskStep, "file", t_string);

View File

@@ -815,7 +815,7 @@ public class PipelineYamlEditorTest {
);
}
@Test public void gitResourceGetParamsReconcile() throws Exception {
@Test public void gitResourceGetParamsHovers() throws Exception {
Editor editor = harness.newEditor(
"resources:\n" +
"- name: my-git\n" +
@@ -834,7 +834,7 @@ public class PipelineYamlEditorTest {
editor.assertHoverContains("disable_git_lfs", "will not fetch Git LFS files");
}
@Test public void gitResourceGetParamsHovers() throws Exception {
@Test public void gitResourceGetParamsReconcile() throws Exception {
Editor editor = harness.newEditor(
"resources:\n" +
"- name: my-git\n" +
@@ -966,6 +966,26 @@ public class PipelineYamlEditorTest {
editor.assertHoverContains("annotate", "path to a file containing the annotation message");
}
@Test public void gitResourcePut_get_params_Hovers() throws Exception {
Editor editor = harness.newEditor(
"resources:\n" +
"- name: my-git\n" +
" type: git\n" +
"jobs:\n" +
"- name: do-stuff\n" +
" plan:\n" +
" - put: my-git\n" +
" get_params:\n" +
" depth: 1\n" +
" submodules: none\n" +
" disable_git_lfs: true\n"
);
editor.assertHoverContains("depth", "using the `--depth` option");
editor.assertHoverContains("submodules", "If `none`, submodules will not be fetched");
editor.assertHoverContains("disable_git_lfs", "will not fetch Git LFS files");
}
@Test
public void contentAssistJobNames() throws Exception {
assertContextualCompletions(