Hello,
For Google Data Studio integration with SQUAD, I need to retrieve the list of metrics for each project so I can let user select which project and metric he would like to view in the studio. Something like this here: https://github.com/Linaro/squad/blob/master/squad/frontend/views.py#L447 only for all available projects for this user.
Any suggestions on the correct approach here? I was thinking just adding a new API function in squad/api/views.py but I'd like an input on this approach and/or other ideas are welcome.
Thanks,
On Mon, 10 Dec 2018 at 11:42, Stevan Radakovic stevan.radakovic@linaro.org wrote:
Hello,
For Google Data Studio integration with SQUAD, I need to retrieve the list of metrics for each project so I can let user select which project and metric he would like to view in the studio. Something like this here: https://github.com/Linaro/squad/blob/master/squad/frontend/views.py#L447 only for all available projects for this user.
Any suggestions on the correct approach here? I was thinking just adding a new API function in squad/api/views.py but I'd like an input on this approach and/or other ideas are welcome.
I would go with /api/suitemetadata/?kind=metric&suite__project=<pk of the project you're working with>
Would that help?
milosz
On Mon, 10 Dec 2018 at 11:48, Milosz Wasilewski milosz.wasilewski@linaro.org wrote:
On Mon, 10 Dec 2018 at 11:42, Stevan Radakovic stevan.radakovic@linaro.org wrote:
Hello,
For Google Data Studio integration with SQUAD, I need to retrieve the list of metrics for each project so I can let user select which project and metric he would like to view in the studio. Something like this here: https://github.com/Linaro/squad/blob/master/squad/frontend/views.py#L447 only for all available projects for this user.
Any suggestions on the correct approach here? I was thinking just adding a new API function in squad/api/views.py but I'd like an input on this approach and/or other ideas are welcome.
I would go with /api/suitemetadata/?kind=metric&suite__project=<pk of the project you're working with>
ah, there seem to be a bug in the API filtering. SuiteMetadataFilter doesn't have a related Suite filter. But that's easy to fix.
milosz
Would that help?
milosz
Sounds good Milosz, I'll fix the filtering.
Cheers,
On 12/10/18 12:49 PM, Milosz Wasilewski wrote:
On Mon, 10 Dec 2018 at 11:48, Milosz Wasilewski milosz.wasilewski@linaro.org wrote:
On Mon, 10 Dec 2018 at 11:42, Stevan Radakovic stevan.radakovic@linaro.org wrote:
Hello,
For Google Data Studio integration with SQUAD, I need to retrieve the list of metrics for each project so I can let user select which project and metric he would like to view in the studio. Something like this here: https://github.com/Linaro/squad/blob/master/squad/frontend/views.py#L447 only for all available projects for this user.
Any suggestions on the correct approach here? I was thinking just adding a new API function in squad/api/views.py but I'd like an input on this approach and/or other ideas are welcome.
I would go with /api/suitemetadata/?kind=metric&suite__project=<pk of the project you're working with>
ah, there seem to be a bug in the API filtering. SuiteMetadataFilter doesn't have a related Suite filter. But that's easy to fix.
milosz
Would that help?
milosz
It turns out it's just /api/suitemetadata/?kind=metric&project=33 we do all the necessary processing in the viewset bc the 'suite' is charfield and not foreignkey in models.
Anyway, I'm getting a bit more results in this API call, you can compare available metrics in https://qa-reports.linaro.org/lkft/linux-mainline-oe-sanity/metrics/ and https://qa-reports.linaro.org/api/suitemetadata/?kind=metric&project=125
Any thoughts?
On 12/10/18 12:49 PM, Milosz Wasilewski wrote:
On Mon, 10 Dec 2018 at 11:48, Milosz Wasilewski milosz.wasilewski@linaro.org wrote:
On Mon, 10 Dec 2018 at 11:42, Stevan Radakovic stevan.radakovic@linaro.org wrote:
Hello,
For Google Data Studio integration with SQUAD, I need to retrieve the list of metrics for each project so I can let user select which project and metric he would like to view in the studio. Something like this here: https://github.com/Linaro/squad/blob/master/squad/frontend/views.py#L447 only for all available projects for this user.
Any suggestions on the correct approach here? I was thinking just adding a new API function in squad/api/views.py but I'd like an input on this approach and/or other ideas are welcome.
I would go with /api/suitemetadata/?kind=metric&suite__project=<pk of the project you're working with>
ah, there seem to be a bug in the API filtering. SuiteMetadataFilter doesn't have a related Suite filter. But that's easy to fix.
milosz
Would that help?
milosz
On Mon, 10 Dec 2018 at 12:36, Stevan Radakovic stevan.radakovic@linaro.org wrote:
It turns out it's just /api/suitemetadata/?kind=metric&project=33 we do all the necessary processing in the viewset bc the 'suite' is charfield and not foreignkey in models.
Anyway, I'm getting a bit more results in this API call, you can compare available metrics in https://qa-reports.linaro.org/lkft/linux-mainline-oe-sanity/metrics/ and https://qa-reports.linaro.org/api/suitemetadata/?kind=metric&project=125
Any thoughts?
Ah, right. 'project' is added in the get_queryset(). Maybe this code has a bug? Nothing stands out at first :(
milosz
On 12/10/18 12:49 PM, Milosz Wasilewski wrote:
On Mon, 10 Dec 2018 at 11:48, Milosz Wasilewski milosz.wasilewski@linaro.org wrote:
On Mon, 10 Dec 2018 at 11:42, Stevan Radakovic stevan.radakovic@linaro.org wrote:
Hello,
For Google Data Studio integration with SQUAD, I need to retrieve the list of metrics for each project so I can let user select which project and metric he would like to view in the studio. Something like this here: https://github.com/Linaro/squad/blob/master/squad/frontend/views.py#L447 only for all available projects for this user.
Any suggestions on the correct approach here? I was thinking just adding a new API function in squad/api/views.py but I'd like an input on this approach and/or other ideas are welcome.
I would go with /api/suitemetadata/?kind=metric&suite__project=<pk of the project you're working with>
ah, there seem to be a bug in the API filtering. SuiteMetadataFilter doesn't have a related Suite filter. But that's easy to fix.
milosz
Would that help?
milosz
-- Stevan Radaković | LAVA Engineer Linaro.org <www.linaro.org> │ Open source software for ARM SoCs
On Mon, 10 Dec 2018 at 12:53, Milosz Wasilewski milosz.wasilewski@linaro.org wrote:
On Mon, 10 Dec 2018 at 12:36, Stevan Radakovic stevan.radakovic@linaro.org wrote:
It turns out it's just /api/suitemetadata/?kind=metric&project=33 we do all the necessary processing in the viewset bc the 'suite' is charfield and not foreignkey in models.
Anyway, I'm getting a bit more results in this API call, you can compare available metrics in https://qa-reports.linaro.org/lkft/linux-mainline-oe-sanity/metrics/ and https://qa-reports.linaro.org/api/suitemetadata/?kind=metric&project=125
Any thoughts?
Ah, right. 'project' is added in the get_queryset(). Maybe this code has a bug? Nothing stands out at first :(
I think I know how it works. In the SuiteMetadata list you get all possible options for all envs. So with 4 envs and 4 metrics there would be 16 entries. We get 17 which is a bit worrying. Also when looking at the results it seems that some of them come from different project. I think it's related to name collisions in metrics. If you check project IDs 22 and 6 you will get the same list.
milosz
milosz
On 12/10/18 12:49 PM, Milosz Wasilewski wrote:
On Mon, 10 Dec 2018 at 11:48, Milosz Wasilewski milosz.wasilewski@linaro.org wrote:
On Mon, 10 Dec 2018 at 11:42, Stevan Radakovic stevan.radakovic@linaro.org wrote:
Hello,
For Google Data Studio integration with SQUAD, I need to retrieve the list of metrics for each project so I can let user select which project and metric he would like to view in the studio. Something like this here: https://github.com/Linaro/squad/blob/master/squad/frontend/views.py#L447 only for all available projects for this user.
Any suggestions on the correct approach here? I was thinking just adding a new API function in squad/api/views.py but I'd like an input on this approach and/or other ideas are welcome.
I would go with /api/suitemetadata/?kind=metric&suite__project=<pk of the project you're working with>
ah, there seem to be a bug in the API filtering. SuiteMetadataFilter doesn't have a related Suite filter. But that's easy to fix.
milosz
Would that help?
milosz
-- Stevan Radaković | LAVA Engineer Linaro.org <www.linaro.org> │ Open source software for ARM SoCs