Add support for `depth` attribute in GitSemverSource.
This commit is contained in:
Kris De Volder
2022-09-07 10:29:27 -07:00
parent 3b0a2656fe
commit 7ea2e155fb
3 changed files with 10 additions and 3 deletions

View File

@@ -603,7 +603,7 @@ public class PipelineYmlSchema implements YamlSchema {
source.require(Constraints.mutuallyExclusive("tag_filter", "tag_regex"));
AbstractType get = f.ybean("GitGetParams");
addProp(get, "depth", t_pos_integer);
addProp(get, "depth", t_strictly_pos_integer);
addProp(get, "fetch_tags", t_boolean);
addProp(get, "submodules", f.yany("GitSubmodules").addHints("all", "none"));
addProp(get, "submodule_recursive", t_boolean);
@@ -823,6 +823,7 @@ public class PipelineYmlSchema implements YamlSchema {
addProp(git_source, "username", t_ne_string);
addProp(git_source, "password", t_ne_string);
addProp(git_source, "git_user", t_ne_string);
addProp(git_source, "depth", t_strictly_pos_integer);
addProp(git_source, "commit_message", t_ne_string);
addProp(git_source, "skip_ssl_verification", t_boolean);

View File

@@ -0,0 +1 @@
*Optional.* If a positive integer is given, shallow clone the repository using the `--depth` option.

View File

@@ -1983,7 +1983,7 @@ public class ConcourseEditorTest {
" describe_ref_options: whatever\n"
);
editor.assertProblems(
"-1|must be at least 0",
"-1|must be at least 1",
"not-bool-a|'boolean'",
"not-bool-b|'boolean'",
"not-bool-c|'boolean'",
@@ -3448,6 +3448,8 @@ public class ConcourseEditorTest {
, // ==>
" commit_message: <*>"
,
" depth: <*>"
,
" git_user: <*>"
,
" initial_version: <*>"
@@ -3483,14 +3485,15 @@ public class ConcourseEditorTest {
" username: jsmith\n" +
" password: s3cre$t\n" +
" git_user: jsmith@mailhost.com\n" +
" depth: 0\n" +
" bogus: bad"
);
editor.assertProblems(
"version|Unused",
"skip-ssl|'boolean'",
"0|must be at least 1",
"bogus|Unknown property"
);
editor.assertHoverContains("initial_version", "version number to use when bootstrapping");
editor.assertHoverContains("driver", "The driver to use");
editor.assertHoverContains("uri", "The repository URL");
@@ -3502,6 +3505,7 @@ public class ConcourseEditorTest {
editor.assertHoverContains("git_user", "The git identity to use");
editor.assertHoverContains("commit_message", "overides the default commit message");
editor.assertHoverContains("skip_ssl_verification", "Skip SSL verification for git endpoint");
editor.assertHoverContains("depth", "shallow clone the repository using the `--depth` option");
}
@Test public void semverResourceSourcePrimaryContentAssist() throws Exception {
@@ -3622,6 +3626,7 @@ public class ConcourseEditorTest {
"<*>"
, // ==>
"commit_message: <*>",
"depth: <*>",
"git_user: <*>",
"initial_version: <*>",
"password: <*>",