Skip to content

Commit

Permalink
Prepare bugtracker type in order to better support JIRA integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
vertigo17 committed Jul 1, 2024
1 parent 56bc531 commit 57596ef
Show file tree
Hide file tree
Showing 14 changed files with 198 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public String createSimplifiedTestcase(
.type(newTestcase.getType())
.system(newTestcase.getSystem())
.subsystem("")
.svnurl("")
.repoUrl("")
.bugTrackerNewUrl("")
.bugTrackerNewUrl("")
.usrCreated(login)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,12 @@ public AnswerItem<HashMap<String, HashMap<String, Integer>>> readTestCaseCounter
public Answer create(Application object) {
MessageEvent msg;
StringBuilder query = new StringBuilder();
query.append("INSERT INTO application (`application`, `description`, `sort`, `type`, `system`, `SubSystem`, `svnurl`, `poolSize`, `BugTrackerUrl`, `BugTrackerNewUrl`, `deploytype`");
query.append("INSERT INTO application (`application`, `description`, `sort`, `type`, `system`, `SubSystem`, `repourl`, `poolSize`, `BugTrackerConnector`, `BugTrackerParam1`, `BugTrackerParam2`, `BugTrackerParam3`, `BugTrackerUrl`, `BugTrackerNewUrl`, `deploytype`");
query.append(", `mavengroupid`, `usrcreated` ) ");
if (StringUtil.isEmpty(object.getDeploytype())) {
query.append("VALUES (?,?,?,?,?,?,?,?,?,?,null,?,?)");
query.append("VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,null,?,?)");
} else {
query.append("VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)");
query.append("VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
}

LOG.debug("SQL : {}", query);
Expand All @@ -340,8 +340,12 @@ public Answer create(Application object) {
preStat.setString(i++, object.getType());
preStat.setString(i++, object.getSystem());
preStat.setString(i++, object.getSubsystem());
preStat.setString(i++, object.getSvnurl());
preStat.setString(i++, object.getRepoUrl());
preStat.setInt(i++, object.getPoolSize());
preStat.setString(i++, object.getBugTrackerConnector());
preStat.setString(i++, object.getBugTrackerParam1());
preStat.setString(i++, object.getBugTrackerParam2());
preStat.setString(i++, object.getBugTrackerParam3());
preStat.setString(i++, object.getBugTrackerUrl());
preStat.setString(i++, object.getBugTrackerNewUrl());
if (!StringUtil.isEmpty(object.getDeploytype())) {
Expand Down Expand Up @@ -395,7 +399,7 @@ public Answer update(String application, Application object) {
if (StringUtil.isEmpty(object.getDeploytype())) {
object.setDeploytype(null);
}
final String query = "UPDATE application SET Application = ?, description = ?, sort = ?, `type` = ?, `system` = ?, SubSystem = ?, svnurl = ?, poolSize = ?, BugTrackerUrl = ?, BugTrackerNewUrl = ?, "
final String query = "UPDATE application SET Application = ?, description = ?, sort = ?, `type` = ?, `system` = ?, SubSystem = ?, repourl = ?, poolSize = ?, BugTrackerConnector = ?, BugTrackerParam1 = ?, BugTrackerParam2 = ?, BugTrackerParam3 = ?, BugTrackerUrl = ?, BugTrackerNewUrl = ?, "
+ "deploytype = ?, mavengroupid = ?, dateModif = NOW(), usrModif= ? WHERE Application = ?";

LOG.debug("SQL : {}", query);
Expand All @@ -410,8 +414,12 @@ public Answer update(String application, Application object) {
preStat.setString(i++, object.getType());
preStat.setString(i++, object.getSystem());
preStat.setString(i++, object.getSubsystem());
preStat.setString(i++, object.getSvnurl());
preStat.setString(i++, object.getRepoUrl());
preStat.setInt(i++, object.getPoolSize());
preStat.setString(i++, object.getBugTrackerConnector());
preStat.setString(i++, object.getBugTrackerParam1());
preStat.setString(i++, object.getBugTrackerParam2());
preStat.setString(i++, object.getBugTrackerParam3());
preStat.setString(i++, object.getBugTrackerUrl());
preStat.setString(i++, object.getBugTrackerNewUrl());
preStat.setString(i++, object.getDeploytype());
Expand Down Expand Up @@ -578,10 +586,14 @@ public Application loadFromResultSet(ResultSet rs) throws SQLException {
String type = ParameterParserUtil.parseStringParam(rs.getString("app.type"), "");
String system = ParameterParserUtil.parseStringParam(rs.getString("app.system"), "");
String subsystem = ParameterParserUtil.parseStringParam(rs.getString("app.subsystem"), "");
String svnUrl = ParameterParserUtil.parseStringParam(rs.getString("app.svnurl"), "");
String repoUrl = ParameterParserUtil.parseStringParam(rs.getString("app.repourl"), "");
int poolSize = ParameterParserUtil.parseIntegerParam(rs.getString("app.poolSize"), 0);
String deployType = ParameterParserUtil.parseStringParam(rs.getString("app.deploytype"), "");
String mavenGroupId = ParameterParserUtil.parseStringParam(rs.getString("app.mavengroupid"), "");
String bugTrackerConnector = ParameterParserUtil.parseStringParam(rs.getString("app.bugtrackerconnector"), "");
String bugTrackerParam1 = ParameterParserUtil.parseStringParam(rs.getString("app.bugtrackerparam1"), "");
String bugTrackerParam2 = ParameterParserUtil.parseStringParam(rs.getString("app.bugtrackerparam2"), "");
String bugTrackerParam3 = ParameterParserUtil.parseStringParam(rs.getString("app.bugtrackerparam3"), "");
String bugTrackerUrl = ParameterParserUtil.parseStringParam(rs.getString("app.bugtrackerurl"), "");
String bugTrackerNewUrl = ParameterParserUtil.parseStringParam(rs.getString("app.bugtrackernewurl"), "");
String usrModif = ParameterParserUtil.parseStringParam(rs.getString("app.UsrModif"), "");
Expand All @@ -595,7 +607,11 @@ public Application loadFromResultSet(ResultSet rs) throws SQLException {
.type(type)
.system(system)
.subsystem(subsystem)
.svnurl(svnUrl)
.repoUrl(repoUrl)
.bugTrackerConnector(bugTrackerConnector)
.bugTrackerParam1(bugTrackerParam1)
.bugTrackerParam2(bugTrackerParam2)
.bugTrackerParam3(bugTrackerParam3)
.bugTrackerUrl(bugTrackerUrl)
.bugTrackerNewUrl(bugTrackerNewUrl)
.poolSize(poolSize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ public class Application {
private String type;
private String system;
private String subsystem;
private String svnurl;
private String repoUrl;
private String bugTrackerConnector;
private String bugTrackerParam1;
private String bugTrackerParam2;
private String bugTrackerParam3;
private String bugTrackerUrl;
private String bugTrackerNewUrl;
private int poolSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public ArrayList<String> getSqlDocumentation() {
b.append(",('application','bugtrackerurl','','ru','URL-адрес системы регистрации ошибок','Это соответствует URL-адресу системы регистрации ошибок <code class=\\'doc-crbvvoca\\'>application</code>.<br><br><table cellspacing=0 cellpadding=3><th class=\\'ex\\' colspan=\\'2\\'>Следующие переменные могут быть использованы внутри URL-адреса </th><tr><td class=\\'ex\\'><code class=\\'doc-variable\\'>%BUGID%</code></td><td class=\\'ex\\'>ID of the Bug</td></tr></table>','_application_attributes')");
b.append(",('application','bugtrackerurl','','fr','URL du Bug Tracker','Correspond à l\\'URL du Bug Tracker de l\\'<code class=\\'doc-crbvvoca\\'>application</code>.<br><br><table cellspacing=0 cellpadding=3><th class=\\'ex\\' colspan=\\'2\\'>Les variables suivantes peuvent être utilisées dans l\\'URL</th><tr><td class=\\'ex\\'><code class=\\'doc-variable\\'>%BUGID%</code></td><td class=\\'ex\\'>ID du Bug</td></tr></table>','_application_attributes')");
b.append(",('application','bugtrackerurl','','fa','آدرس URL ردیاب خطا','این با آدرس URL سیستم ردیاب خطا <code class=\\'doc-crbvvoca\\'>برنامه کاربردی</code> مطابقت دارد.<br><br><table cellspacing=0 cellpadding=3><th class=\\'ex\\' colspan=\\'2\\'>متغیرهای زیر را می توان در آدرس URL استفاده نمود</th><tr><td class=\\'ex\\'><code class=\\'doc-variable\\'>%BUGID%</code></td><td class=\\'ex\\'>ID خطا</td></tr></table>','_application_attributes')");
b.append(",('application','bugTrackerConnector','','en','Bug Tracker Connector','This correspond to the connector of the Bug Tracker of the <code class=\\'doc-crbvvoca\\'>application</code>.','_application_attributes')");
b.append(",('application','bugTrackerConnector','','fr','Type du Bug Tracker','Correspond au type du Bug Tracker de l\\'<code class=\\'doc-crbvvoca\\'>application</code>.','_application_attributes')");
b.append(",('application','deploytype','','en','Deploy Type','This information groups the <code class=\\'doc-crbvvoca\\'>application</code> by typology of deployment process.<br>It can be used as a variable in the parameter <code class=\\'doc-parameter\\'>cerberus_jenkinsdeploy_url</code> that correspond to the URL that calls a continious integration system such as Jenkins.','_application_attributes')");
b.append(",('application','deploytype','','ru','Тип установки','Эта информация группирует <code class=\\'doc-crbvvoca\\'>application</code> по типу процесса развертывания.<br> Может быть использована как переменная в параметре <code class=\\'doc-parameter\\'>cerberus_jenkinsdeploy_url</code> которая соответствует URL адресу который вызывает систему непрерывной интеграции такую как Jenkins.','_application_attributes')");
b.append(",('application','deploytype','','fr','Type de deploiement','Cette information groupe les <code class=\\'doc-crbvvoca\\'>applications</code> par typologie de deploiement.<br>Peut être utilisé comme variable dans le parametre <code class=\\'doc-parameter\\'>cerberus_jenkinsdeploy_url</code> qui correspond à l\\'URL appelée vers un systeme d\\'intégration continue de type Jenkins.','_application_attributes')");
Expand All @@ -120,10 +122,10 @@ public ArrayList<String> getSqlDocumentation() {
b.append(",('application','poolSize','','ru','Размер буфера','Максимальное количество тестовых случаев которые могут быть выполнены в Cerberus','_environment')");
b.append(",('application','poolSize','','fr','Parallelisation','Nombre maximal, de tests pouvant être exécutés en parallèle par Cerberus','_environnement')");
b.append(",('application','poolSize','','fa','اندازه مخزن','حداکثر تعداد موارد آزمون که می تواند همزمان توسط سربروس اجرا شود','_environment')");
b.append(",('application','svnurl','','en','SVN URL','This correspond to the URL of the svn repository of the <code class=\\'doc-crbvvoca\\'>application</code>.','_application_attributes')");
b.append(",('application','svnurl','','ru','URL-адресс SVN','Это соответствует URL-адресу SVN репозитория <code class=\\'doc-crbvvoca\\'>приложения</code>.','_application_attributes')");
b.append(",('application','svnurl','','fr','URL du SVN','Correspond à l\\'URL du SVN de l\\'<code class=\\'doc-crbvvoca\\'>application</code>.','_application_attributes')");
b.append(",('application','svnurl','','fa','آدرس URL SVN','این مربوط است به آدرس URL مخزن SVN <code class=\\'doc-crbvvoca\\'>برنامه کاربردی</code>.','_application_attributes')");
b.append(",('application','repourl','','en','Repo URL','This correspond to the URL of the repository of the <code class=\\'doc-crbvvoca\\'>application</code>.','_application_attributes')");
b.append(",('application','repourl','','ru','URL-адресс SVN','Это соответствует URL-адресу SVN репозитория <code class=\\'doc-crbvvoca\\'>приложения</code>.','_application_attributes')");
b.append(",('application','repourl','','fr','URL du Repo','Correspond à l\\'URL du Repo de l\\'<code class=\\'doc-crbvvoca\\'>application</code>.','_application_attributes')");
b.append(",('application','repourl','','fa','آدرس URL SVN','این مربوط است به آدرس URL مخزن SVN <code class=\\'doc-crbvvoca\\'>برنامه کاربردی</code>.','_application_attributes')");
b.append(",('application','system','','en','System','A <code class=\\'doc-crbvvoca\\'>system</code> is a group of <code class=\\'doc-crbvvoca\\'>application</code> for which all changes sometimes require to be done all together.<br> Most of the time those <code class=\\'doc-crbvvoca\\'>applications</code> all connect to a single database and share the same data structure.','_application_attributes')");
b.append(",('application','system','','ru','Система','<code class=\\'doc-crbvvoca\\'>система</code> група <code class=\\'doc-crbvvoca\\'>application</code> для которой все изменения иногда необходимо сделать вместе.<br> В большинстве случаев все эти <code class=\\'doc-crbvvoca\\'>applications</code> подключаются к одной базе данных и используют одну и ту же структуру данных.','_application_attributes')");
b.append(",('application','system','','fr','Système','Un <code class=\\'doc-crbvvoca\\'>système</code> est un groupe d\\'<code class=\\'doc-crbvvoca\\'>applications</code> pour lesquels il y a de temps en temps necessité de faire les changements en même temps.<br> La plupart du temps ces <code class=\\'doc-crbvvoca\\'>applications</code> partagent une même base de donnée et donc une structure de donnée unique.','_application_attributes')");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
String description = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter("description"), "", charset);
// Parameter that we cannot secure as we need the html --> We DECODE them
int poolSize = ParameterParserUtil.parseIntegerParam(request.getParameter("poolSize"), 0);
String svnURL = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("svnurl"), "", charset);
String repoUrl = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("repourl"), "", charset);
String bugTrackerConnector = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("bugtrackerconnector"), "", charset);
String bugTrackerParam1 = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("bugtrackerparam1"), "", charset);
String bugTrackerParam2 = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("bugtrackerparam2"), "", charset);
String bugTrackerParam3 = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("bugtrackerparam3"), "", charset);
String bugTrackerURL = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("bugtrackerurl"), "", charset);
String newBugURL = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("bugtrackernewurl"), "", charset);
Integer sort = 10;
Expand Down Expand Up @@ -173,8 +177,12 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
.type(type)
.system(system)
.subsystem(subSystem)
.svnurl(svnURL)
.repoUrl(repoUrl)
.bugTrackerUrl(bugTrackerURL)
.bugTrackerConnector(bugTrackerConnector)
.bugTrackerParam1(bugTrackerParam1)
.bugTrackerParam2(bugTrackerParam2)
.bugTrackerParam3(bugTrackerParam3)
.bugTrackerNewUrl(newBugURL)
.poolSize(poolSize)
.deploytype(deployType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
String description = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter("description"), "", charset);
// Parameter that we cannot secure as we need the html --> We DECODE them
int poolSize = ParameterParserUtil.parseIntegerParam(request.getParameter("poolSize"), 0);
String svnURL = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("svnurl"), "", charset);
String repoURL = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("repourl"), "", charset);
String bugTrackerConnector = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("bugtrackerconnector"), "", charset);
String bugTrackerParam1 = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("bugtrackerparam1"), "", charset);
String bugTrackerParam2 = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("bugtrackerparam2"), "", charset);
String bugTrackerParam3 = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("bugtrackerparam3"), "", charset);
String bugTrackerURL = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("bugtrackerurl"), "", charset);
String newBugURL = ParameterParserUtil.parseStringParamAndDecode(request.getParameter("bugtrackernewurl"), "", charset);
Integer sort = 10;
Expand Down Expand Up @@ -187,9 +191,13 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
applicationData.setType(type);
applicationData.setMavengroupid(mavenGpID);
applicationData.setDeploytype(deployType);
applicationData.setSvnurl(svnURL);
applicationData.setRepoUrl(repoURL);
applicationData.setPoolSize(poolSize);
applicationData.setBugTrackerUrl(bugTrackerURL);
applicationData.setBugTrackerConnector(bugTrackerConnector);
applicationData.setBugTrackerParam1(bugTrackerParam1);
applicationData.setBugTrackerParam2(bugTrackerParam2);
applicationData.setBugTrackerParam3(bugTrackerParam3);
applicationData.setBugTrackerNewUrl(newBugURL);
applicationData.setDescription(description);
applicationData.setSort(sort);
Expand Down
13 changes: 13 additions & 0 deletions source/src/main/resources/database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6401,3 +6401,16 @@ CREATE TABLE `tagstatistic` (
UNIQUE KEY `tag_stat_unique` (`Tag`, `Country`, `Environment`))
ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- 1801
ALTER TABLE application
CHANGE svnurl RepoUrl varchar(150) NULL,
ADD BugTrackerConnector varchar(100) NULL AFTER RepoUrl,
ADD BugTrackerParam1 varchar(100) NULL AFTER BugTrackerConnector,
ADD BugTrackerParam2 varchar(100) NULL AFTER BugTrackerParam1,
ADD BugTrackerParam3 varchar(100) NULL AFTER BugTrackerParam2;

-- 1802
INSERT INTO `invariant` (`idname`, `value`, `sort`, `description`)
VALUES ('BUGTRACKERCONNECTOR', 'REDIRECT', 100, 'Redirection to Bug Tracker..')
,('INVARIANTPRIVATE', 'BUGTRACKERCONNECTOR', '910', 'Type of the Bug tracker.');

Binary file added source/src/main/webapp/images/bt-JIRA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/src/main/webapp/images/bt-REDIRECT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 57596ef

Please sign in to comment.