Skip to content

Commit

Permalink
Increase scm column size (#852)
Browse files Browse the repository at this point in the history
* Increase scm column size

* Add github config name length validation

Co-authored-by: im.b <[email protected]>
  • Loading branch information
donggyu04 and imbyungjun authored Dec 10, 2021
1 parent cb75231 commit 25ac2bb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
@ToString
@JsonDeserialize(using = GitHubConfig.GitHubConfigDeserializer.class)
public class GitHubConfig {
public static final int CONFIG_NAME_MAX_LENGTH = 40;

private String name;
private String owner;
private String repo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import static org.ngrinder.common.util.PathUtils.removePrependedSlash;
import static org.ngrinder.common.util.TypeConvertUtils.cast;
import static org.ngrinder.script.model.FileType.getFileTypeByName;
import static org.ngrinder.script.model.GitHubConfig.CONFIG_NAME_MAX_LENGTH;
import static org.tmatesoft.svn.core.SVNDepth.INFINITY;
import static org.tmatesoft.svn.core.SVNURL.parseURIEncoded;
import static org.tmatesoft.svn.core.wc.SVNClientManager.newInstance;
Expand Down Expand Up @@ -322,6 +323,14 @@ public GitHubConfig getGitHubConfig(User user, String name) throws FileNotFoundE
public boolean validate(FileEntry gitConfigYaml) {
for (GitHubConfig config : getAllGithubConfig(gitConfigYaml)) {
try {
String configName = config.getName();
if (configName.length() > CONFIG_NAME_MAX_LENGTH) {
throw new NGrinderRuntimeException(
"Invalid github configuration.(" + config.getName() + ")\n" +
"Configuration name must be shorter than " + CONFIG_NAME_MAX_LENGTH
);
}

GHRepository ghRepository = getGitHubClient(config).getRepository(config.getOwner() + "/" + config.getRepo());
String branch = config.getBranch();
if (isNotEmpty(branch)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">
<changeSet author="ngrinder.3.5.5-p3" id="33" dbms="h2, mysql">
<modifyDataType tableName="PERF_TEST" columnName="scm" newDataType="varchar(50)"/>
</changeSet>
</databaseChangeLog>

0 comments on commit 25ac2bb

Please sign in to comment.