Skip to content

Commit 44b9e15

Browse files
committed
shortcuts: git{lab,hub}.com is supported
1 parent d5c04fa commit 44b9e15

File tree

10 files changed

+32
-32
lines changed

10 files changed

+32
-32
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ are used when they would otherwise not be required.
109109
### Basic Application Flow
110110

111111
1. User fills in the form on the front page. This is represented by
112-
`workflow.WorkflowForm` and consists of just a URL to Github/Gitlab,
112+
`workflow.WorkflowForm` and consists of just a URL to github.com/gitlab.com,
113113
or a URL to a git repository as well as the branch and path of a
114114
workflow within the repository.
115115

src/main/java/org/commonwl/view/workflow/WorkflowController.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ public ModelAndView createWorkflow(@Valid WorkflowForm workflowForm, BindingResu
174174
}
175175

176176
/**
177-
* Display a page for a particular workflow from Github or Github format URL
178-
* @param domain The domain of the hosting site, Github or Gitlab
177+
* Display a page for a particular workflow from github.com or gitlab.com format URL
178+
* @param domain The domain of the hosting site, github.com or gitlab.com
179179
* @param owner The owner of the repository
180180
* @param repoName The name of the repository
181181
* @param branch The branch of repository
@@ -217,7 +217,7 @@ public ModelAndView getWorkflowGeneric(@Value("${applicationURL}") String applic
217217

218218
/**
219219
* Download the Research Object Bundle for a particular workflow
220-
* @param domain The domain of the hosting site, Github or Gitlab
220+
* @param domain The domain of the hosting site, github.com or gitlab.com
221221
* @param owner The owner of the repository
222222
* @param repoName The name of the repository
223223
* @param branch The branch of repository
@@ -260,7 +260,7 @@ public Resource getROBundleGeneric(@PathVariable("branch") String branch,
260260

261261
/**
262262
* Download a generated graph for a workflow in SVG format
263-
* @param domain The domain of the hosting site, Github or Gitlab
263+
* @param domain The domain of the hosting site, github.com or gitlab.com
264264
* @param owner The owner of the repository
265265
* @param repoName The name of the repository
266266
* @param branch The branch of repository
@@ -300,7 +300,7 @@ public Resource downloadGraphSvgGeneric(@PathVariable("branch") String branch,
300300

301301
/**
302302
* Download a generated graph for a workflow in PNG format
303-
* @param domain The domain of the hosting site, Github or Gitlab
303+
* @param domain The domain of the hosting site, github.com or gitlab.com
304304
* @param owner The owner of the repository
305305
* @param repoName The name of the repository
306306
* @param branch The branch of repository
@@ -340,7 +340,7 @@ public Resource downloadGraphPngGeneric(@PathVariable("branch") String branch,
340340

341341
/**
342342
* Download a generated graph for a workflow in XDOT format
343-
* @param domain The domain of the hosting site, Github or Gitlab
343+
* @param domain The domain of the hosting site, github.com or gitlab.com
344344
* @param owner The owner of the repository
345345
* @param repoName The name of the repository
346346
* @param branch The branch of repository
@@ -441,8 +441,8 @@ public static String extractPath(String path, int startSlashNum) {
441441
}
442442

443443
/**
444-
* Constructs a GitDetails object for Github/Gitlab details
445-
* @param domain The domain name (always .com)
444+
* Constructs a GitDetails object for github.com/gitlab.com details
445+
* @param domain The domain name ("github" or "gitlab", without .com)
446446
* @param owner The owner of the repository
447447
* @param repoName The name of the repository
448448
* @param branch The branch of the repository

src/main/java/org/commonwl/view/workflow/WorkflowFormValidator.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ public class WorkflowFormValidator {
3838

3939
private final Logger logger = LoggerFactory.getLogger(this.getClass());
4040

41-
// URL validation for cwl files on Github
41+
// URL validation for cwl files on github.com
4242
private static final String GITHUB_CWL_REGEX = "^https?:\\/\\/github\\.com\\/([A-Za-z0-9_.-]+)\\/([A-Za-z0-9_.-]+)\\/?(?:tree|blob)\\/([^/]+)(?:\\/(.+\\.cwl))$";
4343
private static final Pattern githubCwlPattern = Pattern.compile(GITHUB_CWL_REGEX);
4444

45-
// URL validation for directories on Github
45+
// URL validation for directories on github.com
4646
private static final String GITHUB_DIR_REGEX = "^https?:\\/\\/github\\.com\\/([A-Za-z0-9_.-]+)\\/([A-Za-z0-9_.-]+)\\/?(?:(?:tree|blob)\\/([^/]+)\\/?(.*)?)?$";
4747
private static final Pattern githubDirPattern = Pattern.compile(GITHUB_DIR_REGEX);
4848

49-
// URL validation for cwl files on Gitlab
49+
// URL validation for cwl files on gitlab.com
5050
private static final String GITLAB_CWL_REGEX = "^https?:\\/\\/gitlab\\.com\\/([A-Za-z0-9_.-]+)\\/([A-Za-z0-9_.-]+)\\/?(?:tree|blob)\\/([^/]+)(?:\\/(.+\\.cwl))$";
5151
private static final Pattern gitlabCwlPattern = Pattern.compile(GITLAB_CWL_REGEX);
5252

53-
// URL validation for directories on Gitlab
53+
// URL validation for directories on gitlab.com
5454
private static final String GITLAB_DIR_REGEX = "^https?:\\/\\/gitlab\\.com\\/([A-Za-z0-9_.-]+)\\/([A-Za-z0-9_.-]+)\\/?(?:(?:tree|blob)\\/([^/]+)\\/?(.*)?)?$";
5555
private static final Pattern gitlabDirPattern = Pattern.compile(GITLAB_DIR_REGEX);
5656

@@ -84,31 +84,31 @@ public GitDetails validateAndParse(WorkflowForm form, Errors e) {
8484
packedId = form.getPackedId();
8585
}
8686

87-
// Github URL
87+
// github.com URL
8888
Matcher m = githubCwlPattern.matcher(form.getUrl());
8989
if (m.find()) {
9090
repoUrl = "https://github.com/" + m.group(1) + "/" + m.group(2) + ".git";
9191
if (branch == null) branch = m.group(3);
9292
if (path == null) path = m.group(4);
9393
}
9494

95-
// Gitlab URL
95+
// gitlab.com URL
9696
m = gitlabCwlPattern.matcher(form.getUrl());
9797
if (m.find()) {
9898
repoUrl = "https://gitlab.com/" + m.group(1) + "/" + m.group(2) + ".git";
9999
if (branch == null) branch = m.group(3);
100100
if (path == null) path = m.group(4);
101101
}
102102

103-
// Github Dir URL
103+
// github.com Dir URL
104104
m = githubDirPattern.matcher(form.getUrl());
105105
if (m.find() && ! m.group(2).endsWith(".git")) {
106106
repoUrl = "https://github.com/" + m.group(1) + "/" + m.group(2) + ".git";
107107
if (branch == null) branch = m.group(3);
108108
if (path == null) path = m.group(4);
109109
}
110110

111-
// Gitlab Dir URL
111+
// gitlab.com Dir URL
112112
m = gitlabDirPattern.matcher(form.getUrl());
113113
if (m.find() && ! m.group(2).endsWith(".git")) {
114114
repoUrl = "https://gitlab.com/" + m.group(1) + "/" + m.group(2) + ".git";
@@ -158,4 +158,4 @@ private boolean isEmptyOrWhitespace(String str) {
158158
str.length() == 0 ||
159159
StringUtils.isWhitespace(str));
160160
}
161-
}
161+
}

src/main/java/org/commonwl/view/workflow/WorkflowJSONController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ public ResponseEntity<?> newWorkflowFromGitURLJson(@RequestParam(value="url") St
166166
}
167167

168168
/**
169-
* Get the JSON representation of a workflow from Github or Gitlab details
170-
* @param domain The domain of the hosting site, Github or Gitlab
169+
* Get the JSON representation of a workflow from github.com or gitlab.com details
170+
* @param domain The domain of the hosting site, github.com or gitlab.com
171171
* @param owner The owner of the Github repository
172172
* @param repoName The name of the repository
173173
* @param branch The branch of repository

src/main/java/org/commonwl/view/workflow/WorkflowService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ public Optional<String> findRawBaseForCommit(String commitId) {
567567
return Optional.of(potentialRaw.replace(path, ""));
568568
}
569569
}
570-
// Not found, or not at GitHub/GitLab
570+
// Not found, or not at github.com/gitlab.com
571571
return Optional.empty();
572572

573573
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
url.emptyOrWhitespace = Must be a URL to a workflow on Gitlab or Github, or a Git repository URL
1+
url.emptyOrWhitespace = Must be a URL to a workflow on gitlab.com or github.com, or a Git repository URL
22
branch.emptyOrWhitespace = You must provide a branch where the workflow exists
33
path.emptyOrWhitespace = You must provide a path to the workflow within the repository
44

@@ -7,4 +7,4 @@ git.notFound = The workflow could not be found within the repository
77
git.sshError = SSH URLs are not supported, please provide a HTTPS URL for the repository or submodules
88

99
url.parsingError = An unexpected error occurred when parsing the workflow
10-
url.noWorkflowsInDirectory = No workflow files were found in the given directory
10+
url.noWorkflowsInDirectory = No workflow files were found in the given directory

src/main/resources/static/js/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ require(['jquery'],
9494
}
9595
return success;
9696
} else if (!githubPattern.test(input) && !gitlabPattern.test(input)) {
97-
addWarning("url", "Must be a URL to a workflow or directory of workflows on Gitlab or Github, or a Git repository URL");
97+
addWarning("url", "Must be a URL to a workflow or directory of workflows on gitlab.com or github.com, or a Git repository URL");
9898
return false;
9999
}
100100
});
@@ -111,4 +111,4 @@ require(['jquery'],
111111
}
112112

113113
$("#url").trigger("change");
114-
});
114+
});

src/main/resources/templates/about.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ <h1>About</h1>
6868
<section id="privacy">
6969
<h1>Privacy policy</h1>
7070
<p>CWL Viewer publishes visualizations of workflows from publicly available
71-
<em>git</em> repositories hosted by third-parties like <a href="https://github.com/">GitHub</a>
72-
or <a href="https://about.gitlab.com/">GitLab</a>.
71+
<em>git</em> repositories hosted by third-parties like <a href="https://github.com/">github.com</a>
72+
or <a href="https://about.gitlab.com/">gitlab.com</a>.
7373
Anyone can submit a workflow, which will be added
7474
to our <a href="/workflows">public listing</a>.
7575
</p>

src/main/resources/templates/apidocs.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ <h4>Parameters</h4>
5959
<tr>
6060
<td>url</td>
6161
<td>String</td>
62-
<td>The URL of the repository. Either a Gitlab or Github URL, or any Git repository URL. If a Gitlab or Github repository URL is used, the following fields will take priority over those parsed from the URL if provided.</td>
62+
<td>The URL of the repository. Either a gitlab.com or github.com URL, or any Git repository URL. If a gitlab.com or github.com repository URL is used, the following fields will take priority over those parsed from the URL if provided.</td>
6363
</tr>
6464
<tr>
6565
<td>branch</td>
6666
<td>String</td>
67-
<td>The branch of the repository. Required if the URL is not from Gitlab or Github.</td>
67+
<td>The branch of the repository. Required if the URL is not from gitlab.com or github.com.</td>
6868
</tr>
6969
<tr>
7070
<td>path</td>
7171
<td>String</td>
72-
<td>The path within the repository to the workflow file. Required if the URL is not from Gitlab or Github.</td>
72+
<td>The path within the repository to the workflow file. Required if the URL is not from gitlab.com or github.com.</td>
7373
</tr>
7474
<tr>
7575
<td>packedId</td>

src/main/resources/templates/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h1>Common Workflow Language Viewer</h1>
4848
<hr/>
4949

5050
<h2>Workflow URL</h2>
51-
<p>Provide a Github, Gitlab or Git repository link to the workflow (or directory of workflows) here</p>
51+
<p>Provide a github.com, gitlab.com or Git repository link to the workflow (or directory of workflows) here</p>
5252
<div class="alert alert-grey">
5353
<strong>Don't know what to view?</strong> Try these from <i>common-workflow-language/workflows</i>:
5454
<a class="example" href="https://github.com/common-workflow-language/workflows/tree/master/workflows/compile/compile1.cwl">compile</a>,
@@ -67,7 +67,7 @@ <h2>Workflow URL</h2>
6767
</div>
6868
<div id="urlGroup" class="form-group">
6969
<label class="control-label" for="url">URL to workflow</label>
70-
<input type="text" class="form-control" placeholder="Github, Gitlab or Git repository URL" id="url" name="url" th:field="*{url}" th:value="${formURL}" />
70+
<input type="text" class="form-control" placeholder="github.com, gitlab.com or Git repository URL" id="url" name="url" th:field="*{url}" th:value="${formURL}" />
7171
<span class="help-block"></span>
7272
</div>
7373
<div id="extraInputs" class="row">

0 commit comments

Comments
 (0)