-
Notifications
You must be signed in to change notification settings - Fork 42
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
Annotation line in graphs. #371
Conversation
fb12d3f
to
b853ef0
Compare
b853ef0
to
367c1f9
Compare
squad/frontend/urls.py
Outdated
@@ -36,4 +36,5 @@ | |||
url(r'^(%s)/(%s)/build/([^/]+)/testrun/([^/]+)/metadata$' % ((slug_pattern,) * 2), views.test_run_metadata, name='testrun_metadata'), | |||
url(r'^(%s)/(%s)/build/([^/]+)/testrun/([^/]+)/attachments/([^/]+)$' % ((slug_pattern,) * 2), views.attachment, name='attachment'), | |||
url(r'^testjob/(\d+)$', views.test_job, name='test_job'), | |||
url(r'^(%s)/(%s)/update-annotation/$' % ((slug_pattern,) * 2), views.update_annotation, name='update_annotation'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we consider annotations 'sensitive'? If not, maybe create REST endpoint and update using PUT requests?
367c1f9
to
3d11c99
Compare
oups, I think I merged in wrong order. Could you please rebase? |
3d11c99
to
8afc804
Compare
It seems to work. I have one doubt though. When I set annotation for the build on the chart I'm getting as many labels as there are environments. Is that expected? I think there should be only one annotation label no matter how many environments. |
8afc804
to
1d5f6ac
Compare
@@ -25,7 +25,6 @@ function ChartsController($scope, $http, $location, $compile) { | |||
minDate = data[name][0][0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting the following error:
TypeError: "data[name][0] is undefined"
1d5f6ac
to
8f5daa2
Compare
hi, I'm sorry but after #377 was merged there a few merge conflicts here. that is a pretty big PR so delaying much longer would make things even worse. |
(basically the template changes bow have to be done against the *.jinja2 counterparts of the templates you changed originally) |
8f5daa2
to
23782a5
Compare
@terceiro I've rebased the PR against the jinja2 update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UI looks good, thanks!
I felt adding annotations while looking at the chart is a bit cumbersome. I have to go back to the list of builds, look for the one I want by its number, then add the annotation there. ISTR that clicking on the circle (the points in the graph) used to lead you to the corresponding build page, maybe that got lost at some point?
Also, when you have two annotations that overlap, the ilne from one of them can go over the label for the other:
Is it possible to make all the vertical lines on one z-index, and the labels on another?
I have also some specific comments on the code.
squad/api/urls.py
Outdated
@@ -21,4 +21,5 @@ | |||
url(r'^data/(%s)/(%s)' % ((slug_pattern,) * 2), data.get), | |||
url(r'^resubmit/([0-9]+)', ci.resubmit_job), | |||
url(r'^forceresubmit/([0-9]+)', ci.force_resubmit_job), | |||
url(r'^update-annotation/(%s)/(%s)/(%s)$' % ((slug_pattern,) * 3), views.update_annotation, name='update_annotation'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also IMO it would probably be better to use the REST API here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specially seeing the implementation of this view below, since it has nothing special. it would be better to not have to maintain that code.
squad/core/queries.py
Outdated
) | ||
entry[environment] = [ | ||
[int(p['test_run__build__datetime'].timestamp()), p['result'], p['test_run__build__version']] for p in series | ||
[int(p['test_run__build__datetime'].timestamp()), p['result'], p['test_run__build__version'], "" if p['test_run__build__annotation__description'] is None else p['test_run__build__annotation__description']] for p in series |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use p['test_run__build__annotation__description'] or ""
which is simpler and shorter
squad/core/queries.py
Outdated
).annotate( | ||
pass_percentage=100 * Sum('tests_pass') / Sum(tests_total) | ||
).order_by('test_run__build__datetime') | ||
|
||
results[environment] = [ | ||
[int(s['test_run__build__datetime'].timestamp()), s['pass_percentage'], s['test_run__build__version']] | ||
[int(s['test_run__build__datetime'].timestamp()), s['pass_percentage'], s['test_run__build__version'], "" if s['test_run__build__annotation__description'] is None else s['test_run__build__annotation__description']] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
squad/frontend/views.py
Outdated
@@ -9,6 +9,7 @@ | |||
from django.contrib.auth.decorators import login_required | |||
from django.http import HttpResponse, Http404 | |||
from django.shortcuts import render, get_object_or_404, redirect | |||
from django.urls import reverse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems unused
We have the chart click event, it should work for opening build pages, otherwise there's a bug in master. The overlapping is a bug in the annotation plugin chartjs/chartjs-plugin-annotation#94 so we can maybe fix it upstream at some point. |
23782a5
to
7527184
Compare
just tested the click and it works on master |
(and it also works on your branch; not sure why it didn't work for me yesterday) |
I found what seems to be a error that is triggered whenever I hit "reload" having a few environments and one metrics selected:
this is Firefox 62, and it happens consistently on your branch, but not on master. |
7527184
to
66c6910
Compare
Add UI for adding/updating annotation in build pages. Add annotation lines in metrics with corresponding label. Fixes Linaro#179.
66c6910
to
8c1f21c
Compare
Fixed all reported issues with the latest push. |
Looks good from my perspective. |
Add UI for adding/updating annotation in build pages.
Add annotation lines in metrics with corresponding label.
Fixes #179.