Skip to content

Release status Analyser #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2f30eb7
dashboard-report+tagno
Nov 1, 2014
f5bdd0d
Initial commit
Nov 1, 2014
dbe7517
unneccessary info removed
Nov 1, 2014
48641ed
Create README.md
p00j4 Nov 1, 2014
bc37002
updated doc
May 12, 2015
663e9d0
adding image
May 12, 2015
a3f6d18
image
May 12, 2015
09efe2c
image reloaded
May 12, 2015
7fe0422
image reloaded
May 12, 2015
0d6b9fe
dashboard
May 12, 2015
d3168fa
dashboard
May 12, 2015
05a869f
plugin + README enhanced
Jun 9, 2015
71e2e6d
image path modified
Jun 9, 2015
59c5e6c
readme
Jun 9, 2015
074fd6c
dashboard-report+tagno
Nov 1, 2014
a1407c2
Initial commit
Nov 1, 2014
f8edc4a
unneccessary info removed
Nov 1, 2014
e52ffc0
Create README.md
p00j4 Nov 1, 2014
c1bb425
updated doc
May 12, 2015
79b116a
adding image
May 12, 2015
90ebfed
image
May 12, 2015
3127386
image reloaded
May 12, 2015
fd850e2
image reloaded
May 12, 2015
6afa610
dashboard
May 12, 2015
54c0f93
dashboard
May 12, 2015
9363c2d
plugin + README enhanced
Jun 9, 2015
b6dd913
image path modified
Jun 9, 2015
5e594d8
readme
Jun 9, 2015
436045d
Readme modified
Jun 10, 2015
cbba0c7
binary file updated
shahp00ja Jul 5, 2015
9dc2baf
Prepend context path to job page URLs.
Tblue Sep 20, 2014
60b1509
Style fix: Reformat POM.
Tblue Nov 22, 2014
7e823f3
Fix POM so that release:prepare works.
Tblue Nov 22, 2014
b8cc810
Add myself to maintainer list in POM.
Tblue Nov 22, 2014
44221e3
[maven-release-plugin] prepare for next development iteration
Tblue Nov 22, 2014
4a5a7d7
Trying to fix botchered release.
Tblue Nov 22, 2014
984c7d4
[maven-release-plugin] prepare release xfpanel-1.2.3
Tblue Nov 22, 2014
d0bb68d
[maven-release-plugin] prepare for next development iteration
Tblue Nov 22, 2014
86d136a
dashboard-report+tagno
Nov 1, 2014
cd0357b
resolved conflicts
shahp00ja Jun 16, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# RSA [Release Status Analyser]
==============

### Jenkins xfpanel plugin Reloaded
-----------


A one click solution for ALL [ QA engineer, DevOps, CTO ] based on [jenkins/xfpanel](https://github.com/jenkinsci/xfpanel-plugin)
A comprehensive dashboard for feedback of all tests triggered for a build with lot more benefits,
originally built for serving test feedback needs @ [goibibo.com](http://www.goibibo.com/)


![Alt text](/docs/QuickView-dashBoard.png "QuickView")

```
It Includes :
* Nice layout of test jobs feedback [ Any one can understand and infer the release status in a glance ]
* Release info which broke the test [ DevOps Engineer love it]
* quick links to visit detail report of each build [ Full fledged customised report which shows details about all tests, their data & reason for failure]
* quick link to visit screenshots of the failed tests [ Dev Engineer love it ]
* quick link to visit console for debugging the cause [ Test Engineer need it]
```

### Requirements
To add this plugin to your internal jenkins
- upload/deploy xfpanel.hpi in your jenkins <either take directly, or build your own from source>
- + add 2 keys in build parameters of your test jobs
* env
* tagtotest

![Alt text](/docs/jobdef.png)

### Credits
- Thanks to [Vikalp](https://github.com/vikalp) for the ideas & motivation.
- Thanks to [Raj Kumar](github.com/rajdgreat007/) for consistent ui/js support & patience.
- Thanks to [Tilman and all contributors](https://github.com/jenkinsci/xfpanel-plugin) for starting it up :-)





Binary file added docs/QuickView-dashBoard.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 docs/jobdef.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 docs/xfpanel.hpi
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@
import hudson.tasks.junit.TestResultAction;
import hudson.tasks.test.AbstractTestResultAction;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang.StringUtils;

import maps.hudson.plugin.xfpanel.XFPanelView;

Expand Down Expand Up @@ -65,7 +75,7 @@ public XFPanelEntry(XFPanelView view, Job<?, ?> job) {
* @return the job's name
*/
public String getName() {
String label = job.getDisplayName().toUpperCase();
String label = job.getDisplayName(); //upercase removed pooja
if (getShowDescription() == true && !job.getDescription().isEmpty()) {
label += ": " + job.getDescription();
}
Expand Down Expand Up @@ -172,8 +182,147 @@ public Boolean getBuilding() {
*/
public String getUrl() {
return this.job.getUrl() + "lastBuild";

}

/**
* @return the URL for the last build
* @throws IOException
*//* didnt work get build parameters
public String getBuildparam() {
return "1. lastBuild/parameters=" + this.job.getUrl() + "lastBuild"
+ "parameters" + "2. getACL()=" + this.job.getACL()
+ "3. getProperty('env')="+this.job.getProperty("env")
+ "4. getProperties.get('env')="+this.job.getProperties().get("env")
+ "5. getPermalinks().get('env')"+this.job.getPermalinks().get("env")
+ "6. getAbsoluteUrl="+this.job.getAbsoluteUrl()
+ "7. getBuildStatusUrl="+this.job.getBuildStatusUrl()
+ "8. getDescription="+this.job.getDescription()
+ "9. getAllProperties.get(1)="+this.job.getAllProperties().get(1)
+ "10. getLastBuild.no="+this.job.getLastBuild().getNumber();
}

public int getLastStableBuildNo() {
return this.job.getLastStableBuild().getNumber();
}

public String getEnvfrompermalinks() {
return this.job.getPermalinks().get("env").toString();

}*/


public String getEnv() throws IOException {
String pageUrl = this.job.getAbsoluteUrl()+"/lastBuild"+"/parameters/"; //getUrl() wont work because Pagesource doesnt work on partial url
if(StringUtils.isEmpty(pageUrl))
return "in getAbEnv, null/empty pageUrl";
String pageSource = getPageSource(pageUrl);
if(StringUtils.isEmpty(pageSource))
return "in getAbEnv, null/empty pageSource";
String regExEnv = "<td class=\"setting-name\">env<\\/td>[\\s\\S]*?value=\"([\\s\\S]*?)\"";
String env = getStringAfterPattern(pageSource, regExEnv, 1);

return env;

}



/*** Pooja -- start **/

public String getCurrentTag(){
String pageUrl = this.job.getAbsoluteUrl()+"/lastBuild"+"/parameters/"; //getUrl() wont work because Pagesource doesnt work on partial url
if(StringUtils.isEmpty(pageUrl))
return "in curent tag, null/empty pageUrl";
String pageSource;
String tag;
try {
pageSource = getPageSource(pageUrl);

if(StringUtils.isEmpty(pageSource))
return "in curent tag, null/empty pageSource";
String regExEnv = "<td class=\"setting-name\">tagtotest<\\/td>[\\s\\S]*?value=\"([\\s\\S]*?)\"";
tag = getStringAfterPattern(pageSource, regExEnv, 1);

return tag;
} catch (Exception e) {
// TODO Auto-generated catch block
tag= e.getMessage();
}
return tag;
}

public String getLastSucceedNo(){
return String.valueOf(this.job.getLastStableBuild().getNumber());

}

public String getLastSucceedTag() throws IOException {
int lastSuccessfulNo = this.job.getLastStableBuild().getNumber();
if(lastSuccessfulNo<=0)
return "no successful build";

String pageUrl = this.job.getAbsoluteUrl()+ "/"
+ this.job.getLastStableBuild().getNumber()
+ "/parameters/";
String pageSource = getPageSource(pageUrl);
String regExTag = "<td class=\"setting-name\">tagtotest<\\/td>[\\s\\S]*?value=\"([\\s\\S]*?)\"";
String tag = getStringAfterPattern(pageSource, regExTag, 1);

String regExEnv = "<td class=\"setting-name\">env<\\/td>[\\s\\S]*?value=\"([\\s\\S]*?)\"";
String env = getStringAfterPattern(pageSource, regExEnv, 1);
tag =StringUtils.isEmpty(tag)?"":"last working tag : "+tag+" on env : "+env;
return tag;
}

public String getStringAfterPattern(String sentence, String pattern,
int groupIndex) {
String str = "";
Pattern p = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(sentence);
while (m.find()) {
str = m.group(groupIndex);
//System.out.println("found-" + str); // for try
}
return str.trim();
}

private static String getPageSource(String urlStr) throws IOException {
String username = "";
String password = "";

URL url = new URL(urlStr);

URLConnection conn = url.openConnection();

String userpass = username + ":" + password;
String basicAuth = "Basic " + new String(new Base64().encode(userpass.getBytes()));
conn.setRequestProperty ("Authorization", basicAuth);


BufferedReader in = new BufferedReader(new InputStreamReader(
conn.getInputStream(), "UTF-8"));
String inputLine;
StringBuilder a = new StringBuilder();
while ((inputLine = in.readLine()) != null)
a.append(inputLine);
in.close();

return a.toString();
}
/**
* @return the URL for the workspace
*/
public String getWsurl() {
return this.job.getUrl() + "ws";

}

/*** Pooja -- end **/




/**
* @return a list will all the currently building runs for this job.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ protected enum Blame { NOTATALL, ONLYLASTFAILEDBUILD, ONLYFIRSTFAILEDBUILD, EVER
private String responsiblesTopic = "Responsible(s): ";
private String lastBuildTimePreFix = "last successful: ";

private String successfulBuildColor = "#7E7EFF";
private String successfulBuildColor = "#078A35";
private String unstableBuildColor = "#FFC130";
private String brokenBuildColor = "#FF0000";
private String otherBuildColor = "#CCCCCC";
private String otherBuildColor = "#B5B5B5";
private String buildFontColor = "#FFFFFF";

/**
Expand Down Expand Up @@ -218,7 +218,7 @@ private String validateColor( String current, String defaultColor){
return defaultColor;
}
public String getSuccessfulBuildColor(){
return validateColor( successfulBuildColor, "7E7EFF");
return validateColor( successfulBuildColor, "078A35");
}
public String getUnstableBuildColor(){
return validateColor( unstableBuildColor, "FFC130");
Expand All @@ -227,7 +227,7 @@ public String getBrokenBuildColor(){
return validateColor( brokenBuildColor, "FF0000");
}
public String getOtherBuildColor(){
return validateColor( otherBuildColor, "CCCCCC");
return validateColor( otherBuildColor, "B5B5B5");
}
public String getBuildFontColor(){
return validateColor( buildFontColor, "FFFFFF");
Expand Down Expand Up @@ -656,7 +656,7 @@ public String getOtherFG() {
}

public static final XFPanelColors DEFAULT =
new XFPanelColors("#7E7EFF", "#FFFFFF", "#FFC130", "#FFFFFF", "#FF0000", "#FFFFFF", "#CCCCCC", "#FFFFFF");
new XFPanelColors("#078A35", "#FFFFFF", "#FFC130", "#FFFFFF", "#FF0000", "#FFFFFF", "#A7A7A7", "#FFFFFF");
/* okBG , okFG , failedBG , failedFG , brokenBG , brokenFG , otherBG ,
* otherFG FFFFFF = white FF0000 = red 7E7EFF = blue FFC130 = yellow
* 215E21 = huntergreen #267526 = another green
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,25 @@
<j:set var="claimTopMargin" value="${from.guiFailFont*0.2}px" />

<!-- JOB div -->
<a href="${rootURL}/${job.url}" style="font-style:normal; font-weight:bold;">
<div align="center" style="margin: 4px; background-color:${job.backgroundColor}; -moz-border-radius:10px; width:${width}; height:${height}; float: ${float}" tooltip="${job.name}">
<div id="div-1" align="center" style="width:${width}; height:260%; float: ${float}; border-radius:15px;margin: 4px; background-color:${job.backgroundColor}; -moz-border-radius:10px;" tooltip="${job.name}">
<div class="tagsParent"> <!--pooja -->
<div class="tag"><span class="tagLabel">Tag tested : </span><span class="tagValue">${job.currentTag}</span></div>
<div class="tag"><span class="tagLabel">On env : </span><span class="tagValue">${job.env}</span></div>
<div class="tag"><span class="tagLabel">${job.lastSucceedTag}</span></div>
</div>



<a href="${rootURL}/${job.url}" style="font-style:normal; font-weight:bold; height:${height};">
<div>
<j:set var="failColor" value="#00FF00" />
<j:if test="${job.failCount > 0}">
<j:set var="failColor" value="#FF0000" />
<j:set var="failColor" value="darkred" />
</j:if>

<!-- Right side bar -->
<div align="center" style="width: 20%; height:100%; text-align=center; color: ${failColor};
<!-- Right side bar --> <!--juery ui -pooja <link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css"></link> <script src="//code.jquery.com/jquery-1.10.2.js"></script><script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script> -->

<div id="div-2" align="center" style="width: 20%; height:100%; text-align=center; color: ${failColor};
font-size: ${failFont}; font-weight:bold; overflow:hidden; white-space: nowrap; float:right;">

<j:if test="${job.broken == true}">
Expand Down Expand Up @@ -77,7 +87,7 @@
</div>

<!-- Left side bar -->
<div style="width: 80%; height:100%; white-space: nowrap; overflow:hidden; color: ${job.color};" >
<div id="div-3" style="margin:1%;width: 80%; height:100%; white-space: nowrap; overflow:hidden; color: ${job.color};" >

<!-- Topic bar -->
<div class="fadeHiddenText" style ="font-size: ${jobFont};">
Expand Down Expand Up @@ -105,4 +115,11 @@
</div>
</div>
</a>
<div id="div-4" style=""> <!--div style="margin:5px;background:#aaa;border-radius:40px;overflow:hidden;" -->
<a class="btn" href="${rootURL}/${job.wsurl}/GoIbiboGenFw/target/site/allure-maven-plugin/index.html" style="float:left;">Detailed Reports </a>
<a class="btn" href="${resURL}/${job.wsurl}" style="float:left;"> Screenshots </a>
<a class="btn" href="${rootURL}/${job.url}/console" style="float:left;">Console</a>

</div>
</div>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,64 @@
Fix view by generating a new config-file: current_view's_url/configure<br/>
</j:when>
<j:otherwise>
<div class="dashboard"
style="left: 0px; top: 34px; position: absolute; height: 100%; z-index: 9999; width: 100%; background-color: white; text-align: center;">

<style>
.btn {
-webkit-border-radius: 28;
-moz-border-radius: 28;
border-radius: 28px;
font-family: Arial;
color: #ffffff;
font-size: 20px;
padding: 5px 40px;
text-decoration: none !important;
font-size:12px;
}

.btn:hover {
background: #3cb0fd;
text-decoration: none;
}


.jobParent{
left: 0px;
top: 34px;
position: absolute;
z-index: 9999;
width: 100%;
text-align: center;
overflow: auto;
}

.job{

}

.tagsParent{
padding: 2px;
text-align: left;
background: #6CA6A6;
margin-top: 13px;
}

.tag{
padding: 5px;
}

.tagLabel{
color: #000;
font-size: 12px;
}

.tagValue{
font-size: 14px;
font-weight: bold;
color: #FCF6F6;
}
</style>
<style type="text/css" href="custom-style.css"></style>
<div class="dashboard jobParent">

<j:invoke var="jobs" on="${from}" method="sort">
<j:arg type="java.util.Collection" value="${items}" />
Expand Down
Binary file added xfpanel.hpi
Binary file not shown.