diff --git a/concourse/s3-expiration-rules.sh b/concourse/s3-expiration-rules.sh new file mode 100755 index 000000000..b322feebb --- /dev/null +++ b/concourse/s3-expiration-rules.sh @@ -0,0 +1,11 @@ +#!/bin/bash +s3cmd expire s3://s3-test.spring.io \ + --expiry-prefix mvn-caches --expiry-days 7 \ + +# Note: it seems we can only apply one rule to a bucket. +# We would really want to expire other folders as well: +# --expiry-prefix sts3/commons/snapshots --expiry-days 7 \ +# --expiry-prefix sts4/vscode-extensions/snapshots --expiry-days 30 +# But since that doesn't work, I only added one rule for the biggest space waster. + + diff --git a/headless-services/manifest-yaml-language-server/src/main/java/org/springframework/ide/vscode/manifest/yaml/ManifestYmlSchema.java b/headless-services/manifest-yaml-language-server/src/main/java/org/springframework/ide/vscode/manifest/yaml/ManifestYmlSchema.java index 28f897508..bbe109ffb 100644 --- a/headless-services/manifest-yaml-language-server/src/main/java/org/springframework/ide/vscode/manifest/yaml/ManifestYmlSchema.java +++ b/headless-services/manifest-yaml-language-server/src/main/java/org/springframework/ide/vscode/manifest/yaml/ManifestYmlSchema.java @@ -123,19 +123,7 @@ public class ManifestYmlSchema implements YamlSchema { TOPLEVEL_TYPE.addProperty(f.yprop("applications", f.yseq(application))); TOPLEVEL_TYPE.addProperty("inherit", t_string, descriptionFor("inherit")); -// YAtomicType t_test_hanging = f.yatomic("Hanging"); -// t_test_hanging.addHintProvider(() -> { -// try { -// Thread.sleep(60_000); -// } catch (InterruptedException e) { -// LaunguageServerApp.LOG.info("test_hanging hint provider interrupted!"); -// throw e; -// } -// return YTypeFactory.hints(ImmutableList.of("very", "slow", "hints")); -// }); - YTypedPropertyImpl[] props = { -// f.yprop("test_hanging", t_test_hanging), f.yprop("buildpack", t_buildpack), f.yprop("command", t_string), f.yprop("disk_quota", t_memory), @@ -155,7 +143,8 @@ public class ManifestYmlSchema implements YamlSchema { f.yprop("services", t_services), f.yprop("stack", t_string), f.yprop("timeout", t_pos_integer), - f.yprop("health-check-type", t_health_check_type) + f.yprop("health-check-type", t_health_check_type), + f.yprop("health-check-http-endpoint", t_ne_string) }; for (YTypedPropertyImpl prop : props) { diff --git a/headless-services/manifest-yaml-language-server/src/main/resources/description-by-prop-name/health-check-http-endpoint.md b/headless-services/manifest-yaml-language-server/src/main/resources/description-by-prop-name/health-check-http-endpoint.md new file mode 100644 index 000000000..190e86b00 --- /dev/null +++ b/headless-services/manifest-yaml-language-server/src/main/resources/description-by-prop-name/health-check-http-endpoint.md @@ -0,0 +1,6 @@ +Use the `health-check-http-endpoint` attribute to customize the endpoint for the `http` health check type. If you do not provide a `health-check-http-endpoint` attribute, it uses endpoint `/`. + +--- + ... + health-check-type: http + health-check-http-endpoint: /health diff --git a/headless-services/manifest-yaml-language-server/src/test/java/org/springframework/ide/vscode/manifest/yaml/ManifestYamlEditorTest.java b/headless-services/manifest-yaml-language-server/src/test/java/org/springframework/ide/vscode/manifest/yaml/ManifestYamlEditorTest.java index e2c4c84ea..4034c6033 100644 --- a/headless-services/manifest-yaml-language-server/src/test/java/org/springframework/ide/vscode/manifest/yaml/ManifestYamlEditorTest.java +++ b/headless-services/manifest-yaml-language-server/src/test/java/org/springframework/ide/vscode/manifest/yaml/ManifestYamlEditorTest.java @@ -257,6 +257,8 @@ public class ManifestYamlEditorTest { "env:\n"+ " <*>", // --------------- + "health-check-http-endpoint: <*>", + // --------------- "health-check-type: <*>", // --------------- // "host: <*>", @@ -327,6 +329,9 @@ public class ManifestYamlEditorTest { " <*>", // --------------- "applications:\n" + + "- health-check-http-endpoint: <*>", + // --------------- + "applications:\n" + "- health-check-type: <*>", // --------------- "applications:\n" + @@ -415,6 +420,48 @@ public class ManifestYamlEditorTest { ); } + @Test + public void reconcileHealthCheckType() throws Exception { + Editor editor; + Diagnostic problem; + + editor = harness.newEditor( + "applications:\n" + + "- name: my-app\n" + + " health-check-type: http\n" + + " health-check-http-endpoint: /health" + ); + editor.assertProblems(/*NONE*/); + + editor = harness.newEditor( + "applications:\n" + + "- name: foo\n" + + " health-check-type: none" + ); + problem = editor.assertProblems("none|'none' is deprecated in favor of 'process'").get(0); + assertEquals(DiagnosticSeverity.Warning, problem.getSeverity()); + + editor = harness.newEditor( + "applications:\n" + + "- name: foo\n" + + " health-check-type: none" + ); + + editor = harness.newEditor( + "applications:\n" + + "- name: foo\n" + + " health-check-type: port" + ); + editor.assertProblems(/*NONE*/); + + editor = harness.newEditor( + "applications:\n" + + "- name: foo\n" + + " health-check-type: process" + ); + editor.assertProblems(/*NONE*/); + } + @Test public void hoverInfos() throws Exception { Editor editor = harness.newEditor( @@ -449,7 +496,8 @@ public class ManifestYamlEditorTest { " - instance_XYZ\n" + " stack: cflinuxfs2\n" + " timeout: 80\n" + - " health-check-type: none\n" + " health-check-type: none\n" + + " health-check-http-endpoint: /health\n" ); editor.assertIsHoverRegion("memory"); @@ -497,17 +545,7 @@ public class ManifestYamlEditorTest { editor.assertHoverContains("stack", "Use the `stack` attribute to specify which stack to deploy your application to."); editor.assertHoverContains("timeout", "The `timeout` attribute defines the number of seconds Cloud Foundry allocates for starting your application"); editor.assertHoverContains("health-check-type", "Use the `health-check-type` attribute to"); - } - - @Test - public void deprecatedHealthCheckTypeNone() throws Exception { - Editor editor = harness.newEditor( - "applications:\n" + - "- name: foo\n" + - " health-check-type: none" - ); - Diagnostic problem = editor.assertProblems("none|'none' is deprecated in favor of 'process'").get(0); - assertEquals(DiagnosticSeverity.Warning, problem.getSeverity()); + editor.assertHoverContains("health-check-http-endpoint", "customize the endpoint for the `http`"); } @Test @@ -590,6 +628,9 @@ public class ManifestYamlEditorTest { " <*>", // --------------- "applications:\n" + + "- health-check-http-endpoint: <*>", + // --------------- + "applications:\n" + "- health-check-type: <*>", // --------------- "applications:\n" + @@ -668,6 +709,10 @@ public class ManifestYamlEditorTest { "- name: test" , // --------------------- "applications:\n" + + "- health-check-http-endpoint: <*>\n" + + "- name: test" + , // --------------------- + "applications:\n" + "- health-check-type: <*>\n" + "- name: test" , // --------------------- @@ -1010,23 +1055,6 @@ public class ManifestYamlEditorTest { assertDoesNotContainCompletions("domains:\n" + " - <*>", "wrong.cfapps.io"); } - ////////////////////////////////////////////////////////////////////////////// - - private void assertCompletions(String textBefore, String... textAfter) throws Exception { - Editor editor = harness.newEditor(textBefore); - editor.assertCompletions(textAfter); - } - - private void assertDoesNotContainCompletions(String textBefore, String... notToBeFound) throws Exception { - Editor editor = harness.newEditor(textBefore); - editor.assertDoesNotContainCompletions(notToBeFound); - } - - private void assertContainsCompletions(String textBefore, String... textAfter) throws Exception { - Editor editor = harness.newEditor(textBefore); - editor.assertContainsCompletions(textAfter); - } - @Test public void reconcileRouteFormat() throws Exception { Editor editor = harness.newEditor( @@ -1120,4 +1148,21 @@ public class ManifestYamlEditorTest { editor.assertProblems(); } + ////////////////////////////////////////////////////////////////////////////// + + private void assertCompletions(String textBefore, String... textAfter) throws Exception { + Editor editor = harness.newEditor(textBefore); + editor.assertCompletions(textAfter); + } + + private void assertDoesNotContainCompletions(String textBefore, String... notToBeFound) throws Exception { + Editor editor = harness.newEditor(textBefore); + editor.assertDoesNotContainCompletions(notToBeFound); + } + + private void assertContainsCompletions(String textBefore, String... textAfter) throws Exception { + Editor editor = harness.newEditor(textBefore); + editor.assertContainsCompletions(textAfter); + } + }