From aa24ca85137a12a95b7b13bcbffd7d58528c691a Mon Sep 17 00:00:00 2001 From: Dave Snyder Date: Mon, 30 Mar 2020 11:13:46 -0600 Subject: [PATCH 01/38] ignore IDE files --- .gitignore | 4 + OverOps.iml | 386 ---------------------------------------------------- bamboo.iml | 29 ---- 3 files changed, 4 insertions(+), 415 deletions(-) delete mode 100644 OverOps.iml delete mode 100644 bamboo.iml diff --git a/.gitignore b/.gitignore index 6a595d6..0529986 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,7 @@ hs_err_pid* target/* */target/* *.DS_Store + +*.iml +.project +.settings/ diff --git a/OverOps.iml b/OverOps.iml deleted file mode 100644 index 736e3f3..0000000 --- a/OverOps.iml +++ /dev/null @@ -1,386 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bamboo.iml b/bamboo.iml deleted file mode 100644 index ac80e31..0000000 --- a/bamboo.iml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From e9c9e95c07b4d5b37bf69a1d8425741eaf275330 Mon Sep 17 00:00:00 2001 From: Dave Snyder Date: Tue, 31 Mar 2020 17:43:31 -0600 Subject: [PATCH 02/38] add comments --- .gitignore | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0529986..451bd8d 100644 --- a/.gitignore +++ b/.gitignore @@ -21,11 +21,16 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* -.idea/* target/* */target/* -*.DS_Store +# MacOS +.DS_Store + +# IntelliJ *.iml +.idea/* + +# VS Code .project .settings/ From 9aea6d21f59758bdeaac9a3d411db2d5ced5798a Mon Sep 17 00:00:00 2001 From: Dave Snyder Date: Wed, 1 Apr 2020 10:04:08 -0600 Subject: [PATCH 03/38] debugging WIP --- src/main/java/com/overops/plugins/bamboo/TaskType.java | 3 +++ .../java/com/overops/plugins/bamboo/configuration/Const.java | 2 +- .../plugins/bamboo/service/impl/OverOpsServiceImpl.java | 2 +- src/main/resources/OverOps.properties | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/overops/plugins/bamboo/TaskType.java b/src/main/java/com/overops/plugins/bamboo/TaskType.java index e29d8c8..7d08424 100644 --- a/src/main/java/com/overops/plugins/bamboo/TaskType.java +++ b/src/main/java/com/overops/plugins/bamboo/TaskType.java @@ -38,6 +38,9 @@ public TaskResult execute(@NotNull TaskContext context) throws TaskException { final BuildLogger logger = context.getBuildLogger(); logger.addBuildLogEntry("Executing OverOps task..."); logger.addBuildLogEntry("OverOpsBamboo plugin v." + Utils.getVersion()); + logger.addBuildLogEntry("-------------"); + logger.addBuildLogEntry(context.getConfigurationMap().toString()); + logger.addBuildLogEntry("-------------"); QueryOverOps query = QueryOverOps.mapToObject(context.getConfigurationMap()); try { ReportBuilder.QualityReport report = overOpsService.perform(query, logger); diff --git a/src/main/java/com/overops/plugins/bamboo/configuration/Const.java b/src/main/java/com/overops/plugins/bamboo/configuration/Const.java index 66c85f6..c791ca3 100644 --- a/src/main/java/com/overops/plugins/bamboo/configuration/Const.java +++ b/src/main/java/com/overops/plugins/bamboo/configuration/Const.java @@ -10,7 +10,7 @@ public class Const { public static final String DEFAULT_URL = "https://api.overops.com"; public static final String URL = "url"; - public static final String ENV_ID = "evnId"; + public static final String ENV_ID = "envId"; public static final String TOKEN = "token"; public static final String APP_NAME = "applicationName"; public static final String DEP_NAME = "deploymentName"; diff --git a/src/main/java/com/overops/plugins/bamboo/service/impl/OverOpsServiceImpl.java b/src/main/java/com/overops/plugins/bamboo/service/impl/OverOpsServiceImpl.java index 3d537e7..c017cf3 100644 --- a/src/main/java/com/overops/plugins/bamboo/service/impl/OverOpsServiceImpl.java +++ b/src/main/java/com/overops/plugins/bamboo/service/impl/OverOpsServiceImpl.java @@ -36,7 +36,7 @@ public ReportBuilder.QualityReport perform(QueryOverOps queryOverOps, BuildLogge printStream = null; } - pauseForTheCause(printStream); + // pauseForTheCause(printStream); validateInputs(queryOverOps, printStream); diff --git a/src/main/resources/OverOps.properties b/src/main/resources/OverOps.properties index 6d3b97b..86f208e 100644 --- a/src/main/resources/OverOps.properties +++ b/src/main/resources/OverOps.properties @@ -7,7 +7,7 @@ overops.task.help.link=https://github.com/takipi/bamboo-overops-plugin overops.task.help.title=How to configure OverOps task ? overops.admin.url=OverOps URL -overops.admin.evn=OverOps Env ID +overops.admin.env=OverOps Env ID overops.admin.token=OverOps API Token user-key-settingspage.label=Settings page From 31354ae22c3be71891a447c6bb588626c698bf25 Mon Sep 17 00:00:00 2001 From: Dave Snyder Date: Mon, 6 Apr 2020 09:38:42 -0600 Subject: [PATCH 04/38] update api-client; plugin name, description --- pom.xml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c7cde9e..85a0ef6 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 5.7.2 6.3.6 1.2.3 - 2.23.0 + 2.32.0 @@ -17,8 +17,15 @@ bamboo 1.0.0 - OverOps Quality test - This plugin will check a build for errors in OverOps. + OverOps Quality Report + + This app provides a mechanism for applying OverOps severity assignment and regression analysis + to new builds to allow application owners, DevOps engineers, and SREs to determine the quality of + their code before promoting it into production. Run the OverOps Quality Report task after all + other testing is complete to generate a Quality Report that will determine the stability of the + build. From the Quality Report you can drill down into each specific error using the OverOps + Automated Root Cause analysis screen to solve the issue. + https://github.com/takipi/bamboo-overops-plugin atlassian-plugin From 6cd9185b14841e8fd4eb0aa39312310631bdc9fc Mon Sep 17 00:00:00 2001 From: Dave Snyder Date: Mon, 6 Apr 2020 09:39:40 -0600 Subject: [PATCH 05/38] remove dead code --- .../plugins/bamboo/SettingsProcessor.java | 45 ------------------- 1 file changed, 45 deletions(-) delete mode 100644 src/main/java/com/overops/plugins/bamboo/SettingsProcessor.java diff --git a/src/main/java/com/overops/plugins/bamboo/SettingsProcessor.java b/src/main/java/com/overops/plugins/bamboo/SettingsProcessor.java deleted file mode 100644 index db0cb71..0000000 --- a/src/main/java/com/overops/plugins/bamboo/SettingsProcessor.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.overops.plugins.bamboo; - -import com.atlassian.bamboo.chains.StageExecution; -import com.atlassian.bamboo.chains.plugins.PreJobAction; -import com.atlassian.bamboo.task.TaskDefinition; -import com.atlassian.bamboo.v2.build.BuildContext; -import com.atlassian.sal.api.pluginsettings.PluginSettings; -import com.atlassian.sal.api.pluginsettings.PluginSettingsFactory; -import com.overops.plugins.bamboo.configuration.Const; - -import java.util.List; -import java.util.Map; - -import org.jetbrains.annotations.NotNull; - -import static com.overops.plugins.bamboo.configuration.Const.API_ENV; -import static com.overops.plugins.bamboo.configuration.Const.API_TOKEN; -import static com.overops.plugins.bamboo.configuration.Const.API_URL; - -public class SettingsProcessor implements PreJobAction { - - PluginSettingsFactory pluginSettingsFactory; - - public SettingsProcessor(PluginSettingsFactory pluginSettingsFactory) { - this.pluginSettingsFactory = pluginSettingsFactory; - } - - @Override - public void execute(@NotNull final StageExecution stageExecution, @NotNull final BuildContext buildContext) { - PluginSettings pluginSettings = this.pluginSettingsFactory.createGlobalSettings(); - String url = (String) pluginSettings.get(API_URL); - String env = (String) pluginSettings.get(API_ENV); - String token = (String) pluginSettings.get(API_TOKEN); - buildContext.getBuildDefinition().getTaskDefinitions().get(0).getPluginKey(); - List tds = buildContext.getBuildDefinition().getTaskDefinitions(); - for (TaskDefinition d : tds) { - if (d.getPluginKey().equals(Const.PLUGIN_KEY)) { - Map conf = d.getConfiguration(); - conf.put(API_URL, url); - conf.put(API_ENV, env); - conf.put(API_TOKEN, token); - } - } - } -} From 228fea12097c7a386cfd9269d7969f9e46a0970e Mon Sep 17 00:00:00 2001 From: Dave Snyder Date: Mon, 6 Apr 2020 09:48:03 -0600 Subject: [PATCH 06/38] follow .properties file naming convention; clean up plugin config --- src/main/resources/atlassian-plugin.xml | 99 ++++++++++--------- .../plugins/bamboo/overops.properties} | 21 ++-- 2 files changed, 62 insertions(+), 58 deletions(-) rename src/main/resources/{OverOps.properties => com/overops/plugins/bamboo/overops.properties} (72%) diff --git a/src/main/resources/atlassian-plugin.xml b/src/main/resources/atlassian-plugin.xml index 9d37578..eb01c37 100644 --- a/src/main/resources/atlassian-plugin.xml +++ b/src/main/resources/atlassian-plugin.xml @@ -9,87 +9,88 @@ images/pluginOverOpsLogo.png - - + + - - + + - - + + - - /overops/admin - - - + - + - - + + + + OverOps administration servlet + + /overops/admin + - + - The OverOps Configuration Plugin + + OverOps administration settings section - - + - The User Key Settings page Plugin + + OverOps default settings page - - /plugins/servlet/overops/admin + + /plugins/servlet/overops/admin - - Checks if settings are still valid for the job - - - - Execute the OverOps Quality Gates as part of your build - + + + + OverOps Quality Report build task - - - + + + - + + - + /templates/viewOverOpsReport.ftl - - - Display the OverOps Report page + + + Link to OverOps Quality Report from job - - - Display the OverOps Report page + + + Link to OverOps Quality Report from stage