No errors for fetch param in git resource

This commit is contained in:
Kris De Volder
2017-05-12 13:03:37 -07:00
parent 56e698706a
commit 6dba67c33b
2 changed files with 26 additions and 0 deletions

View File

@@ -417,6 +417,7 @@ public class PipelineYmlSchema implements YamlSchema {
addProp(get, "depth", t_pos_integer);
addProp(get, "submodules", f.yany("GitSubmodules").addHints("all", "none"));
addProp(get, "disable_git_lfs", t_boolean);
addProp(get, "fetch", t_strings); //Warning: t_strings is just a guess. This property is undocumented. The example I've seen seem to use list of git branch/tag names.
AbstractType put = f.ybean("GitPutParams");
addProp(put, "repository", t_ne_string).isPrimary(true);

View File

@@ -1133,6 +1133,9 @@ public class ConcourseEditorTest {
,
"disable_git_lfs: <*>"
,
"fetch:\n" +
" - <*>"
,
"submodules:\n"+
" <*>"
);
@@ -3739,6 +3742,28 @@ public class ConcourseEditorTest {
);
}
@Test public void gitResourceFetchParameter() throws Exception {
Editor editor = harness.newEditor(
"resources:\n" +
" - name: cf-networking-dev\n" +
" type: git\n" +
" source:\n" +
" uri: git@github.com:cloudfoundry-incubator/cf-networking-release.git\n" +
" branch: develop\n" +
" ignore_paths:\n" +
" - docs\n" +
" private_key: {{cf-networking-deploy-key}}\n" +
"jobs:\n" +
"- name: foo\n" +
" plan:\n" +
" - get: cf-networking-dev\n" +
" params:\n" +
" fetch: [master]\n" +
" submodules: none\n"
);
editor.assertProblems(/*NONE*/);
}
//////////////////////////////////////////////////////////////////////////////
private void assertContextualCompletions(String conText, String textBefore, String... textAfter) throws Exception {