diff --git a/plugins/plugin-github/che-plugin-github-factory-resolver/src/main/java/org/eclipse/che/plugin/github/factory/resolver/GithubURLParser.java b/plugins/plugin-github/che-plugin-github-factory-resolver/src/main/java/org/eclipse/che/plugin/github/factory/resolver/GithubURLParser.java index 2975c0eaed..a416d82422 100644 --- a/plugins/plugin-github/che-plugin-github-factory-resolver/src/main/java/org/eclipse/che/plugin/github/factory/resolver/GithubURLParser.java +++ b/plugins/plugin-github/che-plugin-github-factory-resolver/src/main/java/org/eclipse/che/plugin/github/factory/resolver/GithubURLParser.java @@ -35,7 +35,7 @@ public class GithubURLParser { */ protected static final Pattern GITHUB_PATTERN = Pattern.compile( - "^(?:http)(?:s)?(?:\\:\\/\\/)github.com/(?[^/]++)/(?[^/]++)((?:/tree/(?[^/]++)(?:/(?.*))?)|(/pull/(?[^/]++)))?$"); + "^(?:http)(?:s)?(?:\\:\\/\\/)github.com/(?[^/]++)/(?[^/]++)((/)|(?:/tree/(?[^/]++)(?:/(?.*))?)|(/pull/(?[^/]++)))?$"); /** Regexp to find repository and branch name from PR link */ protected static final Pattern PR_DATA_PATTERN = diff --git a/plugins/plugin-github/che-plugin-github-factory-resolver/src/test/java/org/eclipse/che/plugin/github/factory/resolver/GithubURLParserTest.java b/plugins/plugin-github/che-plugin-github-factory-resolver/src/test/java/org/eclipse/che/plugin/github/factory/resolver/GithubURLParserTest.java index 7258a1436e..450262a481 100644 --- a/plugins/plugin-github/che-plugin-github-factory-resolver/src/test/java/org/eclipse/che/plugin/github/factory/resolver/GithubURLParserTest.java +++ b/plugins/plugin-github/che-plugin-github-factory-resolver/src/test/java/org/eclipse/che/plugin/github/factory/resolver/GithubURLParserTest.java @@ -72,6 +72,7 @@ public class GithubURLParserTest { public Object[][] urls() { return new Object[][] { {"https://github.com/eclipse/che"}, + {"https://github.com/eclipse/che/"}, {"https://github.com/eclipse/che/tree/4.2.x"}, {"https://github.com/eclipse/che/tree/master/"}, {"https://github.com/eclipse/che/tree/master/dashboard/"}, @@ -85,6 +86,7 @@ public class GithubURLParserTest { public Object[][] expectedParsing() { return new Object[][] { {"https://github.com/eclipse/che", "eclipse", "che", "master", null}, + {"https://github.com/eclipse/che/", "eclipse", "che", "master", null}, {"https://github.com/eclipse/che/tree/4.2.x", "eclipse", "che", "4.2.x", null}, { "https://github.com/eclipse/che/tree/master/dashboard/", diff --git a/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/URLFactoryBuilder.java b/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/URLFactoryBuilder.java index bf6e0e0b38..6e05c8660e 100644 --- a/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/URLFactoryBuilder.java +++ b/wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/urlfactory/URLFactoryBuilder.java @@ -106,7 +106,11 @@ public class URLFactoryBuilder { .withV(CURRENT_VERSION) .withWorkspace(DtoConverter.asDto(wsConfig))); } catch (DevfileException e) { - throw new BadRequestException(e.getMessage()); + throw new BadRequestException( + "Error occurred during creation a workspace from devfile located at `" + + devfileLocation + + "`. Cause: " + + e.getMessage()); } }