GH-849: Add build without version

This commit is contained in:
Nieraj Singh
2022-11-30 15:03:02 -08:00
parent 232795a45f
commit 749774276d
3 changed files with 37 additions and 3 deletions

View File

@@ -874,6 +874,8 @@ public class PipelineYmlSchema implements YamlSchema {
addProp(get, "bump", f.yenum("SemverBump", "major", "minor", "patch", "final"));
addProp(get, "pre", t_ne_string);
addProp(get, "pre_without_version", t_boolean);
addProp(get, "build_without_version", t_boolean);
AbstractType put = f.ybean("SemverPutParams");
for (YTypedProperty p : get.getProperties()) {

View File

@@ -0,0 +1 @@
*Optional.* Same as pre_without_version but for build labels.

View File

@@ -3714,8 +3714,8 @@ public class ConcourseEditorTest {
editor.assertProblems("version|Unused 'Resource'");
editor.assertHoverContains("openstack", "All openstack configuration");
}
@Test public void GH_849_build_without_version() throws Exception {
@Test public void GH_849_pre_without_version() throws Exception {
Editor editor = harness.newEditor(
"resources:\n" +
"- name: test\n" +
@@ -3741,7 +3741,38 @@ public class ConcourseEditorTest {
);
editor.assertHoverContains("pre_without_version", 1, "PreRelease will be bumped");
editor.assertHoverContains("pre_without_version", 2, "PreRelease will be bumped");
editor.assertHoverContains("pre_without_version", 2, "PreRelease will be bumped");
}
@Test public void GH_849_build_without_version() throws Exception {
Editor editor = harness.newEditor(
"resources:\n" +
"- name: test\n" +
" type: semver\n" +
" source:\n" +
" driver: git\n" +
" uri: some-git-url\n" +
" branch: main\n" +
" file: VERSION\n" +
"jobs:\n" +
"- name: test\n" +
" plan:\n" +
" - get: test\n" +
" params:\n" +
" build_without_version: not-a-bool\n" +
" - put: test\n" +
" params:\n" +
" build_without_version: not-b-bool\n"
);
editor.assertProblems(
"not-a-bool|boolean",
"not-b-bool|boolean"
);
editor.assertHoverContains("build_without_version", 1, "Same as pre_without_version but for build labels");
editor.assertHoverContains("build_without_version", 2, "Same as pre_without_version but for build labels");
}
@Test public void semverResourceGetParamsReconcileAndHovers() throws Exception {