Code Monkey home page Code Monkey logo

qualinsight-plugins-sonarqube-badges's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qualinsight-plugins-sonarqube-badges's Issues

Detect and use available font

"When FOP does not have a specific font at its disposal (because it's not installed in the operating system or set up in FOP's configuration), the font is replaced with "any". "any" is internally mapped to the Base-14 font "Times" (see above)."

As a result, as Verdana is missing on around 43% of linux installations, batik is unable to set the font family correctly.

Fix to implement:

  • detect available fonts
  • select font (preference order "Verdana, "Bitstream Vera Sans", "DejaVu Sans", Tahoma, Geneva, Arial, Sans-serif)

Refused fix:

  • embed font in plugin

See:

Enable generation of status images based on other metrics

Refactor code in order to allow to generate:

  • UT Coverage status
  • IT Coverage status
  • Overall coverage
  • Debt ratio
  • SQALE rank

Background color should be based on project's quality gate if enabled, gray otherwise.

Images must be cached in order to limit DoS attack risks.

quality gate badges cannot be displayed if "execute analysis" restrictions are set

Due to SONAR-7628, version 2.0.x of the SVG Badges plugin is currently not able to display quality gate badges if your SonarQube server is configured to restrict analysis execution rights. When analysis execution restrictions are set, quality badges are displayed as "not found" badges.

This limitation will be removed in SonarQube 5.6 (begining of June). Note that, if "anybody" can execute an analysis, then the quality gate badges are displayed correctly.

Create wiki page for the project

#The documentation starts to be difficult to be read to its density. Splitting the README.md file into Wiki pages should improve the readability of the documentation.

Wiki pages:

  • Introduction
  • Project Architecture (UML models, design decisions)
  • Installation
    • Compatibility Matrix
  • Usage
    • Quality Gate badges
    • Measures badges
    • Computer Engine Activity badges
  • Badges link generator (external link to pages or to www.qualinsight.com)
    • Quality Gate badges
    • Measures badges
    • Computer Engine Activity badges
  • Known limitations
  • Contributing
    • Guidelines
    • Past Contributors
  • Contact

The README.md file should only contain:

  • General presentation
  • Badges (Travis-CI build, SonarQube.com, javadoc)
  • Link to WIKI documentation

Cannot start SQ when installing SVG Badges plugin on Docker JRE 8 image

enviroment to reproduce

  • start the latest docker container
docker run -d  --name sonarqube-develop \
        -p 9000:9000 \
        -p 9092:9092 \
        sonarqube:5.6-alpine
  • visit localhost:9000/updatecenter/available
  • click install SVG Badges (v2.01)
  • click restart sonarqube
  • run docker logs sonarqube-develop

and you will see this

2016.06.26 05:25:30 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener  
java.lang.IllegalStateException: Unable to load component class com.qualinsight.plugins.sonarqube.badges.ws.BadgesWebService                                                         
        at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:69) ~[sonar-core-5.6.jar:na]                                 

the stack trace is

java.lang.IllegalStateException: Unable to load component class com.qualinsight.plugins.sonarqube.badges.ws.BadgesWebService
Caused by: java.lang.IllegalStateException: Unable to load component class com.qualinsight.plugins.sonarqube.badges.ws.gate.QualityGateBadgeAction
Caused by: java.lang.IllegalStateException: Unable to load component class com.qualinsight.plugins.sonarqube.badges.ws.gate.QualityGateBadgeRequestHandler
Caused by: java.lang.IllegalStateException: Unable to load component class com.qualinsight.plugins.sonarqube.badges.ws.gate.QualityGateBadgeGenerator
Caused by: java.lang.IllegalStateException: Unable to load component class com.qualinsight.plugins.sonarqube.badges.ws.SVGImageGenerator
Caused by: java.lang.IllegalStateException: Unable to load component class com.qualinsight.plugins.sonarqube.badges.font.FontProviderLocator
Caused by: java.lang.NullPointerException: null
        at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264) ~[na:1.8.0_92-internal

add blinking effect

if the "blinking" WS parameter is set and if the quality gate is in ERROR, or if the measure to be displayed participates in the quality gate's ERROR status, then the value part of the badge should be blinking.

Quality gate server error

Hi,

I have installed SVG Badges 1.2.1 on SonarQube 5.1.2 :

2016.07.13 11:25:07 INFO  web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin SVG Badges / 1.2.1
2016.07.13 11:25:12 INFO  web[c.q.p.s.b.i.QualityGateStatusRetriever] QualityGateStatusRetriever is now ready.
2016.07.13 11:25:13 INFO  web[c.q.p.s.b.i.SVGImageGenerator] SVGImageGenerator is now ready.

When navigating to http://host:9000/api/badges/gate?key=blahblah the badge displays server error, but nothing in the log. Same result with a valid project key.

Any idea ?

Thanks,
Gabriel.

rename plugin to qualinsight-plugins-sonarqube-badges

Suggestion made by Fabrice Bellingard.

Changes to be made :

  • github repository
  • pom.xml (artifactId)
  • documentation
  • Comments inside SVG images
  • SonarQube update center (check impact when changing short name)
  • Google discussion group

Plugin can't work when SonarQube's "Force user authentication" option is set

To easily reproduce:

  • Install SQ and the Badge plugin
  • Analyse project Foo
  • Open the URL of the badge in a browser => you see the status of the SQ
  • Set "Force user authentication" to true in "Administration > Security"
  • Open the URL of the badge in a browser => you always see "server error"

The logs are clear:

2016.03.04 09:55:31 DEBUG web[c.q.p.s.s.i.QualityGateStatusRetriever] An error occurred while retrieving quality gate status for key 'org.sonarsource.sonarqube:sonarqube': {}
org.apache.http.client.ClientProtocolException: Unexpected response status: 401
    at com.qualinsight.plugins.sonarqube.status.internal.QualityGateStatusRetriever$1.handleResponse(QualityGateStatusRetriever.java:79) ~[qualinsight-sonarqube-status-1.1.1.jar:na]
    at com.qualinsight.plugins.sonarqube.status.internal.QualityGateStatusRetriever$1.handleResponse(QualityGateStatusRetriever.java:69) ~[qualinsight-sonarqube-status-1.1.1.jar:na]

This is because the WS of the plugin calls the server itself w/o passing credentials.

This limitation can be fixed when https://jira.sonarsource.com/browse/SONAR-6948 is implemented.

SVG Badges settings is not visible under SonarQube's administration page

Hi,
I have installed SVG Badges plugin 1.2.1 version on SonarQube 5.3 server. It installed successfully. On "Update Center" and "System Info" page it shows that SVG Badges 1.2.1 is installed. But SVG Badges settings are not displayed on SonarQube's administration page. There is no error shown on sonar.log also. So i am not sure if the plugin is installed properly or SVG Badges 1.2.1 is not compatible with SonarQube 5.3 version.

Can you please fix this issue or provide more details.
Thanks,
Kishore

Plugin generates "server error" badges (version 1.2.1)

I'm running SonarQube 5.4 and have installed SVG badges. However in the General Settings SVG badges does not show up. I also have problem to access the badges (always get a server error) hence I'm wondering if both are related. Sonar log says:

2016.04.29 23:09:17 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin SVG Badges / 1.2.1
...
2016.04.29 23:09:20 INFO  web[c.q.p.s.b.i.QualityGateStatusRetriever] QualityGateStatusRetriever is now ready.
2016.04.29 23:09:20 INFO  web[c.q.p.s.b.i.SVGImageGenerator] SVGImageGenerator is now ready.
2016.04.29 23:09:20 WARN  web[o.s.a.s.w.WebService$Action] Since is not set on action api/badges/gate
2016.04.29 23:09:20 WARN  web[o.s.a.s.w.WebService$Action] The response example is not set on action api/badges/gate

Below some screenshots. Any clue what's going on?
sonar-svg
sonar-settings

Bug: plugin might fail the server startup with IndexOutOfBoundsException

We got this error while trying to install the latest 2.0.0 version of the plugin on Nemo. Root cause is:

Caused by: java.lang.IndexOutOfBoundsException: start index (-1) must not be negative
at com.google.common.base.Preconditions.checkPositionIndexes(Preconditions.java:389) ~[guava-17.0.jar:na]
at com.google.common.collect.ImmutableList.subList(ImmutableList.java:381) ~[guava-17.0.jar:na]
at com.google.common.collect.ImmutableList.subList(ImmutableList.java:61) ~[guava-17.0.jar:na]
at com.qualinsight.plugins.sonarqube.badges.font.FontManager.detectFontFamily(FontManager.java:109) ~[na:na]
at com.qualinsight.plugins.sonarqube.badges.font.FontManager.(FontManager.java:60) ~[na:na]

You can find the full log here: http://pastebin.com/8nUvbdAE

Code coverage is not visible

Hi,

My code coverage is not visible.
I have enable measures badges. I include a badge with metric=coverage like this api/badges/measure?key=<projectKey>&metric=coverage but the displayed image show me coverage N/A. In Sonar my coverage is ok.

Badges with api/badges/gate are ok.

Could you help me ?

Benoît.

Badge name "quality" is a bit too generic

Badge name "quality" is a bit too generic from my point of view. Could it be renamed into "code quality" or "sonarqube" or "sonarqube code quality"? Could it make sense to make it configurable?

No configuration panel

Hi,

I have installed SVG Badges 1.2.1 on Sonarqube 4.5.6 but I don't get the configuration panel.
It still looks like this:
noconfiguration

The plugin is working but I would like to enable the measures badges. Is there a fix or perhaps a workaround?

Thanks,
Phil

Which version is required for the 'measure' API?

Hi,

I installed the SVG Badges plugin in version 2.0.1 and retrieving a quality gate badge works perfectly fine like this:

https://<myserver>/sonar/api/badges/measure?key=<mykey>

However, simply changing the API call to retrieve a metric badge does not work (nothing is returned, no image, no text...):

https://<myserver>/sonar/api/badges/measure?key=<mykey>&metric=coverage

I thought measure badges are already supported with version 2.0.0, is that wrong?

Regards,
Dominik

make logs less verbose

If sonar.core.serverBaseURL property is not set, only check once and log a warning once during SQ startup.

move badge generation code to an external library

Create a SVG badges generic library that could be used by any java project wanting to generate badges.

SVG Badges for Sonarqube would then make use of this library and would focus on SQ badges webservices development and data gathering.

The name of the library to be created is qualinsight-libs-badges.

Generate SVG link pointing to project's page

In order to simplify plugin usage on client side, add a SVG link that refers to project page to generated SVG image.

This feature must be optional (on/off from within SQ's administration) as it implies that current cache won't be usable as is.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.