Quantcast

[sonar-dev] Trying to add parameters for existing sonar-flex-pmd rules

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[sonar-dev] Trying to add parameters for existing sonar-flex-pmd rules

François-Olivier Gaillard
Hello

I'm trying to add a parameter to an existing rule given in the sonar-flex-plugin 1.0
The problem I encounter is that the parameter I want to add is of a string type.

If I add

<rule....>
    <priority>1</priority>
    <category>Maintainability</category>
    <properties>
        ...
        <property name="exceptions">
            <value>x,y</value>
        </property>
        ....
    </properties>
</rule>

to the rules.xml file (src\main\resources\org\sonar\plugins\flex\flexpmd\rules.xml)

Once i build the plugin and relanch my Sonar, I get an "exceptions" parameter field in the Sonar rule configuration interface, but this field acceps only integer values.

Is there a way to make it accept String values?

Sincerely 

François Gaillard
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[sonar-dev] Determining if a project has been deleted

Jean-Hervé Laveau

Hy all,

We would like to know in Sonar repository if a project has been deleted in the local workspace or in SCM.

We are automating all Sonar analysis in a continued integration platform.

Our SCM tool contains many projects which are analyzed separately as a sonar project. So each analyzed  project has its own Sonar pom.xml.

When a project is deleted, the related pom.xml (stored separately) tries to analyze a deleted one. The analyze fails and we know it by analyzing sonar logs.

But we would like to know if it’s possible to have a status in the repository reflecting that project has been deleted. Have we to implement a new plugin ?

 

Thank you in advance for your answers

 

Best regards

 

Jean-Hervé

 

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[sonar-dev] Automation features

Jean-Hervé Laveau

Hello,

In order to be able to automate Sonar analysis we would like to use REST API to :

- Assign groups of users to projects newly created through an analysis

- Rename projects

Is it possible ?

 

If not possible, we can do that through a stored procedure.

- We know how to assign groups to projects

- Does anybody know how to rename projects ?

 

Thank you for your answers

 

 

Best regards

 

Jean-Hervé

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Automation features

Simon Brandhof
Hi,

No need for complex workarounds :
 

- Assign groups of users to projects newly created through an analysis


Default permissions can be configured in Configuration -> Project roles
 

- Rename projects


Simply use the parameter -Dsonar.projectName
 
Regards

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [sonar-dev] Automation features

Jean-Hervé Laveau

Thank you Simon for your quick answer.

I’ll use –Dsonar.projectName

 

But I don’t want to do that through application UI because projects are changing very often, and I do not want an administrator action.

So have you  another solution ?

 

Regards

 

 

 

De : Simon Brandhof [mailto:[hidden email]]
Envoyé : mercredi 11 juillet 2012 17:53
À : [hidden email]
Cc : JHL Qualixo
Objet : Re: [sonar-dev] Automation features

 

Hi,

No need for complex workarounds :
 

- Assign groups of users to projects newly created through an analysis


Default permissions can be configured in Configuration -> Project roles
 

- Rename projects


Simply use the parameter -Dsonar.projectName
 
Regards

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Automation features

Simon Brandhof

 

But I don’t want to do that through application UI because projects are changing very often, and I do not want an administrator action.

So have you  another solution ?


What kinds of permissions do you want to set ? Can you give a concrete example ?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [sonar-dev] Automation features

Jean-Hervé Laveau

Hello Simon,

 

We have normalized permissions settings as follow: Projects are grouped in streams (we are working with RTC). Each stream S belongs to a team and we have made groups of users having admin (“S-administrators”), users (“S-users”) or code-viewers (“S-code-viewers”) roles on projects P1…Pn of this stream S. We have decided to NEVER assign Project Role to a user.

On a stream S, Projects P1…Pn are created during different development sprints. We generate poms (and in a near future comandline properties) automatically when a project Pn appears on local workspace, and launch first analysis. To be complete, we would like to assign corresponding rights automatically after analysis: “S-administrators” group à administrators role, “S-users” group à users role, “S-code-viewer” group à code-viewers role on project Pn.

The optimal solution would be to do that through

 

Best regards

 

Jean-Hervé

 

De : Simon Brandhof [mailto:[hidden email]]
Envoyé : mercredi 11 juillet 2012 18:46
À : JHL Qualixo
Cc : [hidden email]
Objet : Re: [sonar-dev] Automation features

 

 

But I don’t want to do that through application UI because projects are changing very often, and I do not want an administrator action.

So have you  another solution ?


What kinds of permissions do you want to set ? Can you give a concrete example ?

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[sonar-dev] Automation features : Renaming projects

Jean-Hervé Laveau
In reply to this post by Jean-Hervé Laveau

Hy Simon,

I think I have misspoken:

When I say I want to rename projects, I do not talk about the label projectName, but about the sonar.projectKey by using the resource as reference in the query

It could give something like:

Curl -u admin:admin http://localhost:9000/api/resources -d PUT "resource=fr.flex.application:FTestError1,newresource=fr.flex.application32:FTestError999”

In order to modify groupID and artifactId of the corresponding resource.

The goal of that feature is to change projectkey according to scm renaming feature without losing historical data.

Thank you in advance for your answer

 

Best regards

 

Jean-Hervé

 

De : Simon Brandhof [[hidden email]]
Envoyé : mercredi 11 juillet 2012 17:53
À : [hidden email]
Cc : JHL Qualixo
Objet : Re: [sonar-dev] Automation features

 

Hi,

No need for complex workarounds :
 

- Assign groups of users to projects newly created through an analysis


Default permissions can be configured in Configuration -> Project roles
 

- Rename projects


Simply use the parameter -Dsonar.projectName
 
Regards

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Determining if a project has been deleted

Freddy Mallet
In reply to this post by Jean-Hervé Laveau
Hi Jean-Hervé, I see what you mean but I wouldn't implement such feature into Sonar as this relate to your application lifecyle. Another way to achieve this goal might be to monitor all projects whose last build/analyse date is too old with a Sonar filter.
Kind regards,
Freddy
-----
Sonar for Continuous Inspection



On Wed, Jul 11, 2012 at 3:34 PM, JHL Qualixo <[hidden email]> wrote:

Hy all,

We would like to know in Sonar repository if a project has been deleted in the local workspace or in SCM.

We are automating all Sonar analysis in a continued integration platform.

Our SCM tool contains many projects which are analyzed separately as a sonar project. So each analyzed  project has its own Sonar pom.xml.

When a project is deleted, the related pom.xml (stored separately) tries to analyze a deleted one. The analyze fails and we know it by analyzing sonar logs.

But we would like to know if it’s possible to have a status in the repository reflecting that project has been deleted. Have we to implement a new plugin ?

 

Thank you in advance for your answers

 

Best regards

 

Jean-Hervé

 

 


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Automation features : Renaming projects

Simon Brandhof
In reply to this post by Jean-Hervé Laveau
The good news is that next version 3.2 will allow to rename project keys from console. It will not be available as a web service in this version.



On 12 July 2012 12:34, JHL Qualixo <[hidden email]> wrote:

Hy Simon,

I think I have misspoken:

When I say I want to rename projects, I do not talk about the label projectName, but about the sonar.projectKey by using the resource as reference in the query

It could give something like:

Curl -u admin:admin http://localhost:9000/api/resources -d PUT "resource=fr.flex.application:FTestError1,newresource=fr.flex.application32:FTestError999”

In order to modify groupID and artifactId of the corresponding resource.

The goal of that feature is to change projectkey according to scm renaming feature without losing historical data.

Thank you in advance for your answer

 

Best regards

 

Jean-Hervé

 

De : Simon Brandhof [[hidden email]]
Envoyé : mercredi 11 juillet 2012 17:53
À : [hidden email]
Cc : JHL Qualixo
Objet : Re: [sonar-dev] Automation features

 

Hi,

No need for complex workarounds :
 

- Assign groups of users to projects newly created through an analysis


Default permissions can be configured in Configuration -> Project roles
 

- Rename projects


Simply use the parameter -Dsonar.projectName
 
Regards

 




--

Simon BRANDHOF | SonarSource
http://sonarsource.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [sonar-dev] Determining if a project has been deleted

Jean-Hervé Laveau
In reply to this post by Freddy Mallet

Hello Freddy,

 

I do understand your point of view.

But because all projects are not analyzed every day, your workaround will gives results maybe after many months.

So, we will put this notion into Sonar repository through a small plugin or manual measures.

 

Best regards

 

Jean-Hervé

 

 

 

 

De : Freddy Mallet [mailto:[hidden email]]
Envoyé : vendredi 13 juillet 2012 10:50
À : [hidden email]
Cc : JHL Qualixo
Objet : Re: [sonar-dev] Determining if a project has been deleted

 

Hi Jean-Hervé, I see what you mean but I wouldn't implement such feature into Sonar as this relate to your application lifecyle. Another way to achieve this goal might be to monitor all projects whose last build/analyse date is too old with a Sonar filter.

Kind regards,

Freddy

-----

Sonar for Continuous Inspection



On Wed, Jul 11, 2012 at 3:34 PM, JHL Qualixo <[hidden email]> wrote:

Hy all,

We would like to know in Sonar repository if a project has been deleted in the local workspace or in SCM.

We are automating all Sonar analysis in a continued integration platform.

Our SCM tool contains many projects which are analyzed separately as a sonar project. So each analyzed  project has its own Sonar pom.xml.

When a project is deleted, the related pom.xml (stored separately) tries to analyze a deleted one. The analyze fails and we know it by analyzing sonar logs.

But we would like to know if it’s possible to have a status in the repository reflecting that project has been deleted. Have we to implement a new plugin ?

 

Thank you in advance for your answers

 

Best regards

 

Jean-Hervé

 

 

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [sonar-dev] Automation features : Renaming projects

Jean-Hervé Laveau
In reply to this post by Simon Brandhof

Thank you Simon,

And when will it be integrated as a web services ?

 

Jean-Hervé

 

De : Simon Brandhof [mailto:[hidden email]]
Envoyé : vendredi 13 juillet 2012 11:14
À : JHL Qualixo
Cc : [hidden email]
Objet : Re: [sonar-dev] Automation features : Renaming projects

 

The good news is that next version 3.2 will allow to rename project keys from console. It will not be available as a web service in this version.


On 12 July 2012 12:34, JHL Qualixo <[hidden email]> wrote:

Hy Simon,

I think I have misspoken:

When I say I want to rename projects, I do not talk about the label projectName, but about the sonar.projectKey by using the resource as reference in the query

It could give something like:

Curl -u admin:admin http://localhost:9000/api/resources -d PUT "resource=fr.flex.application:FTestError1,newresource=fr.flex.application32:FTestError999”

In order to modify groupID and artifactId of the corresponding resource.

The goal of that feature is to change projectkey according to scm renaming feature without losing historical data.

Thank you in advance for your answer

 

Best regards

 

Jean-Hervé

 

De : Simon Brandhof [[hidden email]]
Envoyé : mercredi 11 juillet 2012 17:53
À : [hidden email]
Cc : JHL Qualixo
Objet : Re: [sonar-dev] Automation features

 

Hi,

No need for complex workarounds :
 

- Assign groups of users to projects newly created through an analysis


Default permissions can be configured in Configuration -> Project roles
 

- Rename projects


Simply use the parameter -Dsonar.projectName
 
Regards

 




--

 

Simon BRANDHOF | SonarSource
http://sonarsource.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Automation features : Renaming projects

Simon Brandhof
Nothing can be planned without JIRA issue. And this improvement is not registered in JIRA :D


On 13 July 2012 12:22, JHL Qualixo <[hidden email]> wrote:

Thank you Simon,

And when will it be integrated as a web services ?

 

Jean-Hervé

 

De : Simon Brandhof [mailto:[hidden email]]
Envoyé : vendredi 13 juillet 2012 11:14
À : JHL Qualixo
Cc : [hidden email]
Objet : Re: [sonar-dev] Automation features : Renaming projects

 

The good news is that next version 3.2 will allow to rename project keys from console. It will not be available as a web service in this version.


On 12 July 2012 12:34, JHL Qualixo <[hidden email]> wrote:

Hy Simon,

I think I have misspoken:

When I say I want to rename projects, I do not talk about the label projectName, but about the sonar.projectKey by using the resource as reference in the query

It could give something like:

Curl -u admin:admin http://localhost:9000/api/resources -d PUT "resource=fr.flex.application:FTestError1,newresource=fr.flex.application32:FTestError999”

In order to modify groupID and artifactId of the corresponding resource.

The goal of that feature is to change projectkey according to scm renaming feature without losing historical data.

Thank you in advance for your answer

 

Best regards

 

Jean-Hervé

 

De : Simon Brandhof [[hidden email]]
Envoyé : mercredi 11 juillet 2012 17:53
À : [hidden email]
Cc : JHL Qualixo
Objet : Re: [sonar-dev] Automation features

 

Hi,

No need for complex workarounds :
 

- Assign groups of users to projects newly created through an analysis


Default permissions can be configured in Configuration -> Project roles
 

- Rename projects


Simply use the parameter -Dsonar.projectName
 
Regards

 




--

 

Simon BRANDHOF | SonarSource
http://sonarsource.com




--

Simon BRANDHOF | SonarSource
http://sonarsource.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [sonar-dev] Automation features : Renaming projects

Jean-Hervé Laveau

No problem, done

https://jira.codehaus.org/browse/SONAR-3655

J

 

Jean-Hervé

 

De : Simon Brandhof [mailto:[hidden email]]
Envoyé : vendredi 13 juillet 2012 12:31
À : JHL Qualixo
Cc : [hidden email]
Objet : Re: [sonar-dev] Automation features : Renaming projects

 

Nothing can be planned without JIRA issue. And this improvement is not registered in JIRA :D

On 13 July 2012 12:22, JHL Qualixo <[hidden email]> wrote:

Thank you Simon,

And when will it be integrated as a web services ?

 

Jean-Hervé

 

De : Simon Brandhof [mailto:[hidden email]]
Envoyé : vendredi 13 juillet 2012 11:14
À : JHL Qualixo
Cc : [hidden email]
Objet : Re: [sonar-dev] Automation features : Renaming projects

 

The good news is that next version 3.2 will allow to rename project keys from console. It will not be available as a web service in this version.

On 12 July 2012 12:34, JHL Qualixo <[hidden email]> wrote:

Hy Simon,

I think I have misspoken:

When I say I want to rename projects, I do not talk about the label projectName, but about the sonar.projectKey by using the resource as reference in the query

It could give something like:

Curl -u admin:admin http://localhost:9000/api/resources -d PUT "resource=fr.flex.application:FTestError1,newresource=fr.flex.application32:FTestError999”

In order to modify groupID and artifactId of the corresponding resource.

The goal of that feature is to change projectkey according to scm renaming feature without losing historical data.

Thank you in advance for your answer

 

Best regards

 

Jean-Hervé

 

De : Simon Brandhof [[hidden email]]
Envoyé : mercredi 11 juillet 2012 17:53
À : [hidden email]
Cc : JHL Qualixo
Objet : Re: [sonar-dev] Automation features

 

Hi,

No need for complex workarounds :
 

- Assign groups of users to projects newly created through an analysis


Default permissions can be configured in Configuration -> Project roles
 

- Rename projects


Simply use the parameter -Dsonar.projectName
 
Regards

 




--

 

Simon BRANDHOF | SonarSource
http://sonarsource.com




--

 

Simon BRANDHOF | SonarSource
http://sonarsource.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [sonar-dev] Automation features : Setting projects roles to groups of users through REST API

Jean-Hervé Laveau
In reply to this post by Jean-Hervé Laveau

Hello Simon,

Ticket also done J

https://jira.codehaus.org/browse/SONAR-3656

 

Jean-Hervé

 

De : JHL Qualixo [mailto:[hidden email]]
Envoyé : jeudi 12 juillet 2012 11:12
À : 'Simon Brandhof'
Cc : [hidden email]; 'JHL Qualixo'
Objet : RE: [sonar-dev] Automation features

 

Hello Simon,

 

We have normalized permissions settings as follow: Projects are grouped in streams (we are working with RTC). Each stream S belongs to a team and we have made groups of users having admin (“S-administrators”), users (“S-users”) or code-viewers (“S-code-viewers”) roles on projects P1…Pn of this stream S. We have decided to NEVER assign Project Role to a user.

On a stream S, Projects P1…Pn are created during different development sprints. We generate poms (and in a near future comandline properties) automatically when a project Pn appears on local workspace, and launch first analysis. To be complete, we would like to assign corresponding rights automatically after analysis: “S-administrators” group à administrators role, “S-users” group à users role, “S-code-viewer” group à code-viewers role on project Pn.

The optimal solution would be to do that through

 

Best regards

 

Jean-Hervé

 

De : Simon Brandhof [[hidden email]]
Envoyé : mercredi 11 juillet 2012 18:46
À : JHL Qualixo
Cc : [hidden email]
Objet : Re: [sonar-dev] Automation features

 

 

But I don’t want to do that through application UI because projects are changing very often, and I do not want an administrator action.

So have you  another solution ?


What kinds of permissions do you want to set ? Can you give a concrete example ?

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Automation features

Simon Brandhof
In reply to this post by Jean-Hervé Laveau
Hi Jean-Hervé,

I better understand your need now. What do you think about definining default permissions by regular expressions of project keys ? See http://jira.codehaus.org/browse/SONAR-2957 for more details.

Regards
Simon

On 12 July 2012 11:12, JHL Qualixo <[hidden email]> wrote:

Hello Simon,

 

We have normalized permissions settings as follow: Projects are grouped in streams (we are working with RTC). Each stream S belongs to a team and we have made groups of users having admin (“S-administrators”), users (“S-users”) or code-viewers (“S-code-viewers”) roles on projects P1…Pn of this stream S. We have decided to NEVER assign Project Role to a user.

On a stream S, Projects P1…Pn are created during different development sprints. We generate poms (and in a near future comandline properties) automatically when a project Pn appears on local workspace, and launch first analysis. To be complete, we would like to assign corresponding rights automatically after analysis: “S-administrators” group à administrators role, “S-users” group à users role, “S-code-viewer” group à code-viewers role on project Pn.

The optimal solution would be to do that through

 

Best regards

 

Jean-Hervé

 

De : Simon Brandhof [mailto:[hidden email]]
Envoyé : mercredi 11 juillet 2012 18:46
À : JHL Qualixo
Cc : [hidden email]


Objet : Re: [sonar-dev] Automation features

 

 

But I don’t want to do that through application UI because projects are changing very often, and I do not want an administrator action.

So have you  another solution ?


What kinds of permissions do you want to set ? Can you give a concrete example ?

 




--

Simon BRANDHOF | SonarSource
http://sonarsource.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [sonar-dev] Automation features

Jean-Hervé Laveau

Hello Simon,

 

This feature would greatly simplify our authentication administration work. We create an artifact named Pn during analysis of project Pn of stream S.

So we could associate “S-code-viewers” to “S:*” artifacts.

I vote for that solution.

But it would be great if that feature was automated through REST API ;-))

 

 

Best regards

Jean-Hervé

 

De : Simon Brandhof [mailto:[hidden email]]
Envoyé : lundi 16 juillet 2012 10:34
À : JHL Qualixo
Cc : [hidden email]
Objet : Re: [sonar-dev] Automation features

 

Hi Jean-Hervé,

I better understand your need now. What do you think about definining default permissions by regular expressions of project keys ? See http://jira.codehaus.org/browse/SONAR-2957 for more details.

Regards
Simon

On 12 July 2012 11:12, JHL Qualixo <[hidden email]> wrote:

Hello Simon,

 

We have normalized permissions settings as follow: Projects are grouped in streams (we are working with RTC). Each stream S belongs to a team and we have made groups of users having admin (“S-administrators”), users (“S-users”) or code-viewers (“S-code-viewers”) roles on projects P1…Pn of this stream S. We have decided to NEVER assign Project Role to a user.

On a stream S, Projects P1…Pn are created during different development sprints. We generate poms (and in a near future comandline properties) automatically when a project Pn appears on local workspace, and launch first analysis. To be complete, we would like to assign corresponding rights automatically after analysis: “S-administrators” group à administrators role, “S-users” group à users role, “S-code-viewer” group à code-viewers role on project Pn.

The optimal solution would be to do that through

 

Best regards

 

Jean-Hervé

 

De : Simon Brandhof [mailto:[hidden email]]
Envoyé : mercredi 11 juillet 2012 18:46
À : JHL Qualixo
Cc : [hidden email]


Objet : Re: [sonar-dev] Automation features

 

 

But I don’t want to do that through application UI because projects are changing very often, and I do not want an administrator action.

So have you  another solution ?


What kinds of permissions do you want to set ? Can you give a concrete example ?

 




--

 

Simon BRANDHOF | SonarSource
http://sonarsource.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Trying to add parameters for existing sonar-flex-pmd rules

Evgeny Mandrikov
In reply to this post by François-Olivier Gaillard
Hi,

First of all - I'm not sure that I can understand your problem. What you want to achive? And why you modify sources of plugin instead of using Sonar UI? Moreover I wasn't able to find such file in latest version of plugin ;)


On Tue, Jul 10, 2012 at 8:52 PM, François-Olivier Gaillard <[hidden email]> wrote:
Hello

I'm trying to add a parameter to an existing rule given in the sonar-flex-plugin 1.0
The problem I encounter is that the parameter I want to add is of a string type.

If I add

<rule....>
    <priority>1</priority>
    <category>Maintainability</category>
    <properties>
        ...
        <property name="exceptions">
            <value>x,y</value>
        </property>
        ....
    </properties>
</rule>

to the rules.xml file (src\main\resources\org\sonar\plugins\flex\flexpmd\rules.xml)

Once i build the plugin and relanch my Sonar, I get an "exceptions" parameter field in the Sonar rule configuration interface, but this field acceps only integer values.

Is there a way to make it accept String values?

Sincerely 

François Gaillard



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_
Loading...