[sonar-dev] How to get editable issue and its associated resource?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[sonar-dev] How to get editable issue and its associated resource?

kakawait
Hi,

I wanted to write a plugin in order to add attributes on Issue. So I first try to write an implementation of IssueHandler.

But I also need to deals with the resource of the issue and I didn't find anyway to retrieve Resource without using SonarIndex that is now deprecated since 5.0.

Thus I write a Decorator with Issuable perspective, that seems to be good at start but I seems to be not possible to edit Issue (in my case add attributes).

There is any solution to be able to retrieve editable Issue with the associated Resource?

Thanks,
Thibaud

--
Thibaud Leprêtre
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] How to get editable issue and its associated resource?

Julien HENRY
Hi Thibaud,

This part of the code is moving constantly as we plan to move all issue "post-processing" to server side.

As of today, the only way to edit an issue is indeed in a IssueHandler. But unfortunately resource is missing from IssueHandler context. What is the information you need to get from resource?

Using SonarIndex is fine probably until next LTS and at that time we should have a better vision of what are new extension point on server side to manipulate issues.

++

Julien


2015-01-28 17:51 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Hi,

I wanted to write a plugin in order to add attributes on Issue. So I first try to write an implementation of IssueHandler.

But I also need to deals with the resource of the issue and I didn't find anyway to retrieve Resource without using SonarIndex that is now deprecated since 5.0.

Thus I write a Decorator with Issuable perspective, that seems to be good at start but I seems to be not possible to edit Issue (in my case add attributes).

There is any solution to be able to retrieve editable Issue with the associated Resource?

Thanks,
Thibaud

--
Thibaud Leprêtre
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] How to get editable issue and its associated resource?

kakawait
I just needed path because I have to perform some SCM command (information that is not part of SCM measures) on the resource. Anyway I can recompose path using componentKey() with some tricky substring :).

But why I need to edit issue: in order to persist some state and I find Issue Attributes could be a right place. But may I do this in other way.

++
Thibaud

2015-01-30 11:51 GMT+01:00 Julien HENRY <[hidden email]>:
Hi Thibaud,

This part of the code is moving constantly as we plan to move all issue "post-processing" to server side.

As of today, the only way to edit an issue is indeed in a IssueHandler. But unfortunately resource is missing from IssueHandler context. What is the information you need to get from resource?

Using SonarIndex is fine probably until next LTS and at that time we should have a better vision of what are new extension point on server side to manipulate issues.

++

Julien


2015-01-28 17:51 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Hi,

I wanted to write a plugin in order to add attributes on Issue. So I first try to write an implementation of IssueHandler.

But I also need to deals with the resource of the issue and I didn't find anyway to retrieve Resource without using SonarIndex that is now deprecated since 5.0.

Thus I write a Decorator with Issuable perspective, that seems to be good at start but I seems to be not possible to edit Issue (in my case add attributes).

There is any solution to be able to retrieve editable Issue with the associated Resource?

Thanks,
Thibaud

--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] How to get editable issue and its associated resource?

Julien HENRY
Extracting SCM details is a FileSystem oriented task that should be done in a Sensor. Basically you sensor should do something like: foreach file, extract SCM details and store them in a Map<component key, scm details>

Then in your IssueHandler you simply have to read the map.

Anyway storing information in issue attributes is not a very common use so be ready to face some issues... SonarQube "batch" is about creating issues and storing measures. All other use may not be supported.

++

Julien

2015-01-30 16:35 GMT+01:00 Thibaud Lepretre <[hidden email]>:
I just needed path because I have to perform some SCM command (information that is not part of SCM measures) on the resource. Anyway I can recompose path using componentKey() with some tricky substring :).

But why I need to edit issue: in order to persist some state and I find Issue Attributes could be a right place. But may I do this in other way.

++
Thibaud

2015-01-30 11:51 GMT+01:00 Julien HENRY <[hidden email]>:
Hi Thibaud,

This part of the code is moving constantly as we plan to move all issue "post-processing" to server side.

As of today, the only way to edit an issue is indeed in a IssueHandler. But unfortunately resource is missing from IssueHandler context. What is the information you need to get from resource?

Using SonarIndex is fine probably until next LTS and at that time we should have a better vision of what are new extension point on server side to manipulate issues.

++

Julien


2015-01-28 17:51 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Hi,

I wanted to write a plugin in order to add attributes on Issue. So I first try to write an implementation of IssueHandler.

But I also need to deals with the resource of the issue and I didn't find anyway to retrieve Resource without using SonarIndex that is now deprecated since 5.0.

Thus I write a Decorator with Issuable perspective, that seems to be good at start but I seems to be not possible to edit Issue (in my case add attributes).

There is any solution to be able to retrieve editable Issue with the associated Resource?

Thanks,
Thibaud

--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] How to get editable issue and its associated resource?

kakawait
Yeah I will think about that. Thanks for information.

2015-01-30 16:53 GMT+01:00 Julien HENRY <[hidden email]>:
Extracting SCM details is a FileSystem oriented task that should be done in a Sensor. Basically you sensor should do something like: foreach file, extract SCM details and store them in a Map<component key, scm details>

Then in your IssueHandler you simply have to read the map.

Anyway storing information in issue attributes is not a very common use so be ready to face some issues... SonarQube "batch" is about creating issues and storing measures. All other use may not be supported.

++

Julien

2015-01-30 16:35 GMT+01:00 Thibaud Lepretre <[hidden email]>:
I just needed path because I have to perform some SCM command (information that is not part of SCM measures) on the resource. Anyway I can recompose path using componentKey() with some tricky substring :).

But why I need to edit issue: in order to persist some state and I find Issue Attributes could be a right place. But may I do this in other way.

++
Thibaud

2015-01-30 11:51 GMT+01:00 Julien HENRY <[hidden email]>:
Hi Thibaud,

This part of the code is moving constantly as we plan to move all issue "post-processing" to server side.

As of today, the only way to edit an issue is indeed in a IssueHandler. But unfortunately resource is missing from IssueHandler context. What is the information you need to get from resource?

Using SonarIndex is fine probably until next LTS and at that time we should have a better vision of what are new extension point on server side to manipulate issues.

++

Julien


2015-01-28 17:51 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Hi,

I wanted to write a plugin in order to add attributes on Issue. So I first try to write an implementation of IssueHandler.

But I also need to deals with the resource of the issue and I didn't find anyway to retrieve Resource without using SonarIndex that is now deprecated since 5.0.

Thus I write a Decorator with Issuable perspective, that seems to be good at start but I seems to be not possible to edit Issue (in my case add attributes).

There is any solution to be able to retrieve editable Issue with the associated Resource?

Thanks,
Thibaud

--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] How to get editable issue and its associated resource?

kakawait
Hum I just tested a simple IssueHandler that add attributes via context but I got the following error:

java.lang.UnsupportedOperationException: TODO

I'm using sonar 5.0, does it finally not possible to add attribute even using IssueHandler api?

2015-01-30 16:59 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Yeah I will think about that. Thanks for information.

2015-01-30 16:53 GMT+01:00 Julien HENRY <[hidden email]>:
Extracting SCM details is a FileSystem oriented task that should be done in a Sensor. Basically you sensor should do something like: foreach file, extract SCM details and store them in a Map<component key, scm details>

Then in your IssueHandler you simply have to read the map.

Anyway storing information in issue attributes is not a very common use so be ready to face some issues... SonarQube "batch" is about creating issues and storing measures. All other use may not be supported.

++

Julien

2015-01-30 16:35 GMT+01:00 Thibaud Lepretre <[hidden email]>:
I just needed path because I have to perform some SCM command (information that is not part of SCM measures) on the resource. Anyway I can recompose path using componentKey() with some tricky substring :).

But why I need to edit issue: in order to persist some state and I find Issue Attributes could be a right place. But may I do this in other way.

++
Thibaud

2015-01-30 11:51 GMT+01:00 Julien HENRY <[hidden email]>:
Hi Thibaud,

This part of the code is moving constantly as we plan to move all issue "post-processing" to server side.

As of today, the only way to edit an issue is indeed in a IssueHandler. But unfortunately resource is missing from IssueHandler context. What is the information you need to get from resource?

Using SonarIndex is fine probably until next LTS and at that time we should have a better vision of what are new extension point on server side to manipulate issues.

++

Julien


2015-01-28 17:51 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Hi,

I wanted to write a plugin in order to add attributes on Issue. So I first try to write an implementation of IssueHandler.

But I also need to deals with the resource of the issue and I didn't find anyway to retrieve Resource without using SonarIndex that is now deprecated since 5.0.

Thus I write a Decorator with Issuable perspective, that seems to be good at start but I seems to be not possible to edit Issue (in my case add attributes).

There is any solution to be able to retrieve editable Issue with the associated Resource?

Thanks,
Thibaud

--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]



--
Thibaud Leprêtre
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] How to get editable issue and its associated resource?

Simon Brandhof
Hi Thibaud,

Unfortunately you're right, this method is not implemented yet. I'm wondering why it was published in API. Sorry for this error.

Regards


Simon BRANDHOF | SonarSource
http://twitter.com/SimonBrandhof

On 30 January 2015 at 19:46, Thibaud Lepretre <[hidden email]> wrote:
Hum I just tested a simple IssueHandler that add attributes via context but I got the following error:

java.lang.UnsupportedOperationException: TODO

I'm using sonar 5.0, does it finally not possible to add attribute even using IssueHandler api?

2015-01-30 16:59 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Yeah I will think about that. Thanks for information.

2015-01-30 16:53 GMT+01:00 Julien HENRY <[hidden email]>:
Extracting SCM details is a FileSystem oriented task that should be done in a Sensor. Basically you sensor should do something like: foreach file, extract SCM details and store them in a Map<component key, scm details>

Then in your IssueHandler you simply have to read the map.

Anyway storing information in issue attributes is not a very common use so be ready to face some issues... SonarQube "batch" is about creating issues and storing measures. All other use may not be supported.

++

Julien

2015-01-30 16:35 GMT+01:00 Thibaud Lepretre <[hidden email]>:
I just needed path because I have to perform some SCM command (information that is not part of SCM measures) on the resource. Anyway I can recompose path using componentKey() with some tricky substring :).

But why I need to edit issue: in order to persist some state and I find Issue Attributes could be a right place. But may I do this in other way.

++
Thibaud

2015-01-30 11:51 GMT+01:00 Julien HENRY <[hidden email]>:
Hi Thibaud,

This part of the code is moving constantly as we plan to move all issue "post-processing" to server side.

As of today, the only way to edit an issue is indeed in a IssueHandler. But unfortunately resource is missing from IssueHandler context. What is the information you need to get from resource?

Using SonarIndex is fine probably until next LTS and at that time we should have a better vision of what are new extension point on server side to manipulate issues.

++

Julien


2015-01-28 17:51 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Hi,

I wanted to write a plugin in order to add attributes on Issue. So I first try to write an implementation of IssueHandler.

But I also need to deals with the resource of the issue and I didn't find anyway to retrieve Resource without using SonarIndex that is now deprecated since 5.0.

Thus I write a Decorator with Issuable perspective, that seems to be good at start but I seems to be not possible to edit Issue (in my case add attributes).

There is any solution to be able to retrieve editable Issue with the associated Resource?

Thanks,
Thibaud

--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]



--
Thibaud Leprêtre
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] How to get editable issue and its associated resource?

kakawait
Hi Simon,

Ok but do you plan to remove from the plugin API or provide an implementation?

Thanks,
Thibaud

2015-02-01 22:03 GMT+01:00 Simon Brandhof <[hidden email]>:
Hi Thibaud,

Unfortunately you're right, this method is not implemented yet. I'm wondering why it was published in API. Sorry for this error.

Regards


Simon BRANDHOF | SonarSource
http://twitter.com/SimonBrandhof

On 30 January 2015 at 19:46, Thibaud Lepretre <[hidden email]> wrote:
Hum I just tested a simple IssueHandler that add attributes via context but I got the following error:

java.lang.UnsupportedOperationException: TODO

I'm using sonar 5.0, does it finally not possible to add attribute even using IssueHandler api?

2015-01-30 16:59 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Yeah I will think about that. Thanks for information.

2015-01-30 16:53 GMT+01:00 Julien HENRY <[hidden email]>:
Extracting SCM details is a FileSystem oriented task that should be done in a Sensor. Basically you sensor should do something like: foreach file, extract SCM details and store them in a Map<component key, scm details>

Then in your IssueHandler you simply have to read the map.

Anyway storing information in issue attributes is not a very common use so be ready to face some issues... SonarQube "batch" is about creating issues and storing measures. All other use may not be supported.

++

Julien

2015-01-30 16:35 GMT+01:00 Thibaud Lepretre <[hidden email]>:
I just needed path because I have to perform some SCM command (information that is not part of SCM measures) on the resource. Anyway I can recompose path using componentKey() with some tricky substring :).

But why I need to edit issue: in order to persist some state and I find Issue Attributes could be a right place. But may I do this in other way.

++
Thibaud

2015-01-30 11:51 GMT+01:00 Julien HENRY <[hidden email]>:
Hi Thibaud,

This part of the code is moving constantly as we plan to move all issue "post-processing" to server side.

As of today, the only way to edit an issue is indeed in a IssueHandler. But unfortunately resource is missing from IssueHandler context. What is the information you need to get from resource?

Using SonarIndex is fine probably until next LTS and at that time we should have a better vision of what are new extension point on server side to manipulate issues.

++

Julien


2015-01-28 17:51 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Hi,

I wanted to write a plugin in order to add attributes on Issue. So I first try to write an implementation of IssueHandler.

But I also need to deals with the resource of the issue and I didn't find anyway to retrieve Resource without using SonarIndex that is now deprecated since 5.0.

Thus I write a Decorator with Issuable perspective, that seems to be good at start but I seems to be not possible to edit Issue (in my case add attributes).

There is any solution to be able to retrieve editable Issue with the associated Resource?

Thanks,
Thibaud

--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]



--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] How to get editable issue and its associated resource?

kakawait
Ok my bad jira ticket answer my question :)

++

2015-02-01 22:17 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Hi Simon,

Ok but do you plan to remove from the plugin API or provide an implementation?

Thanks,
Thibaud

2015-02-01 22:03 GMT+01:00 Simon Brandhof <[hidden email]>:
Hi Thibaud,

Unfortunately you're right, this method is not implemented yet. I'm wondering why it was published in API. Sorry for this error.

Regards


Simon BRANDHOF | SonarSource
http://twitter.com/SimonBrandhof

On 30 January 2015 at 19:46, Thibaud Lepretre <[hidden email]> wrote:
Hum I just tested a simple IssueHandler that add attributes via context but I got the following error:

java.lang.UnsupportedOperationException: TODO

I'm using sonar 5.0, does it finally not possible to add attribute even using IssueHandler api?

2015-01-30 16:59 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Yeah I will think about that. Thanks for information.

2015-01-30 16:53 GMT+01:00 Julien HENRY <[hidden email]>:
Extracting SCM details is a FileSystem oriented task that should be done in a Sensor. Basically you sensor should do something like: foreach file, extract SCM details and store them in a Map<component key, scm details>

Then in your IssueHandler you simply have to read the map.

Anyway storing information in issue attributes is not a very common use so be ready to face some issues... SonarQube "batch" is about creating issues and storing measures. All other use may not be supported.

++

Julien

2015-01-30 16:35 GMT+01:00 Thibaud Lepretre <[hidden email]>:
I just needed path because I have to perform some SCM command (information that is not part of SCM measures) on the resource. Anyway I can recompose path using componentKey() with some tricky substring :).

But why I need to edit issue: in order to persist some state and I find Issue Attributes could be a right place. But may I do this in other way.

++
Thibaud

2015-01-30 11:51 GMT+01:00 Julien HENRY <[hidden email]>:
Hi Thibaud,

This part of the code is moving constantly as we plan to move all issue "post-processing" to server side.

As of today, the only way to edit an issue is indeed in a IssueHandler. But unfortunately resource is missing from IssueHandler context. What is the information you need to get from resource?

Using SonarIndex is fine probably until next LTS and at that time we should have a better vision of what are new extension point on server side to manipulate issues.

++

Julien


2015-01-28 17:51 GMT+01:00 Thibaud Lepretre <[hidden email]>:
Hi,

I wanted to write a plugin in order to add attributes on Issue. So I first try to write an implementation of IssueHandler.

But I also need to deals with the resource of the issue and I didn't find anyway to retrieve Resource without using SonarIndex that is now deprecated since 5.0.

Thus I write a Decorator with Issuable perspective, that seems to be good at start but I seems to be not possible to edit Issue (in my case add attributes).

There is any solution to be able to retrieve editable Issue with the associated Resource?

Thanks,
Thibaud

--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]



--
Thibaud Leprêtre
[hidden email]




--
Thibaud Leprêtre
[hidden email]



--
Thibaud Leprêtre
[hidden email]