diff --git a/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java b/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java index 8c32cacce1..9708c61210 100644 --- a/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java +++ b/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java @@ -873,6 +873,9 @@ private void initializeDefaultResourceTypes() { AbstractType get = f.ybean("SemverGetParams"); 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()) { diff --git a/headless-services/concourse-language-server/src/main/resources/desc/SemverGetParams/build_without_version.md b/headless-services/concourse-language-server/src/main/resources/desc/SemverGetParams/build_without_version.md new file mode 100644 index 0000000000..38489e3640 --- /dev/null +++ b/headless-services/concourse-language-server/src/main/resources/desc/SemverGetParams/build_without_version.md @@ -0,0 +1 @@ +*Optional.* Same as pre_without_version but for build labels. \ No newline at end of file diff --git a/headless-services/concourse-language-server/src/main/resources/desc/SemverGetParams/pre_without_version.md b/headless-services/concourse-language-server/src/main/resources/desc/SemverGetParams/pre_without_version.md new file mode 100644 index 0000000000..886c80a834 --- /dev/null +++ b/headless-services/concourse-language-server/src/main/resources/desc/SemverGetParams/pre_without_version.md @@ -0,0 +1,2 @@ +*Optional.* By default `false`, once it's set to `true` +then PreRelease will be bumped without a version number. \ No newline at end of file diff --git a/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java b/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java index 6e7bf2a84b..53b4869c5e 100644 --- a/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java +++ b/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java @@ -3714,7 +3714,67 @@ public void resourceAttributeHovers() throws Exception { editor.assertProblems("version|Unused 'Resource'"); editor.assertHoverContains("openstack", "All openstack configuration"); } + + @Test public void GH_849_pre_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" + + " pre_without_version: not-a-bool\n" + + " - put: test\n" + + " params:\n" + + " pre_without_version: not-b-bool\n" + ); + editor.assertProblems( + "not-a-bool|boolean", + "not-b-bool|boolean" + ); + + editor.assertHoverContains("pre_without_version", 1, "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 { Editor editor = harness.newEditor( "resources:\n" +