Support for get_params attributes in git resource put steps
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user