-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add UI controls for developer session #1691
Conversation
Martchus
commented
Jun 14, 2018
c78ed06
to
4d2564f
Compare
Codecov Report
@@ Coverage Diff @@
## master #1691 +/- ##
==========================================
+ Coverage 89.54% 89.87% +0.32%
==========================================
Files 137 137
Lines 9537 9616 +79
==========================================
+ Hits 8540 8642 +102
+ Misses 997 974 -23
Continue to review full report at Codecov.
|
28307f2
to
5e897ad
Compare
I adapted the existing tests for the new UI. @foursixnine When cherry-picking your commit, I made the host in the assertion variable instead of expecting localhost. So far, this PR will allow any admin to start the development session just by clicking on the panel header in the live view tab. As discussed, I'll try to make it 'more difficult' to create the development session. Maybe I'll actually add a 'Create developer session to apply selection' at the bottom of the form? When that is done, I'll continue with extending the tests. |
@Martchus,What does Create developer session to apply selection :P |
@foursixnine This button would be under the controls where you select what you actually want to do (e.g. pause at a specific module). So 'selection' refers to the form elements above the button. And it would lock those controls for other users by creating the developer session. |
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.
There will be some technical debt after this but looks good so far.
@@ -103,3 +103,32 @@ function alignBuildLabels() { | |||
var max = Math.max.apply(null, values); | |||
$('.build-label').css('min-width', max + 'px'); | |||
} | |||
|
|||
// returns an absolute "ws://" URL for the specified URL which might be relative | |||
function makeWsUrlAbsolute(url, servicePortDelta) { |
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.
Why not call it getabsolutewsurl? (It's just cosmetic I know ;))
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.
Because it doesn't just return a value which is already stored somewhere. It actually computes the value (though this is not very expensive).
assets/javascripts/running.js
Outdated
if (toPauseAtIndex < 0) { | ||
toPauseAtIndex = 0; | ||
} | ||
var moduleToPauseAtStillAhead = developerMode.moduleToPauseAt |
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 would enclose this inside ( )
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.
Ok, I'll change that to make it less ambiguous.
templates/test/module_select.html.ep
Outdated
@@ -0,0 +1,18 @@ | |||
<select class="custom-select" name="pause-at-module" id="developer-pause-at-module"> | |||
<option selected style="font-style: italic;">Don't pause at a module</option> |
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 would change it to 'Do not pause'
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.
Ok - so far there are no other ways to pause anyways.
# define global variable to store ws connections (tx) to JavaScript clients for each job | ||
my %java_script_transactions_by_job; | ||
# define global variable to store development session ws connections (tx) to JavaScript clients for each job | ||
my %devel_java_script_transactions_by_job; |
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 can be easily converted to a property of the controller via has: has blah => sub { {} };
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.
No, it can't. Properties via has
are non-static members. This has to be a static member variable. (To use sane C++ terms here.)
The reason is that Mojo will instantiate a separate controller object for each request it serves. At least in my tests it creates multiple controller objects. However, the transactions are shared by all requests to be able to broadcast.
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.
So if you want to refactor this, the property must be on the application. But for now I would say there are more important things to adjust.
Ah cool |
@coolo I've just mocked a possible workflow (imagine that the form will contain more elements later):
Ok for you? |
There seems to be a confusion here, because 'Developer mode' to me means the job is bound to a developer. Jobs not bound to a specific developer shouldn't even pause. If that developer has currently a session open or not is for sure interesting information because if not, another operator should at least have the option to cancel the job. As such a "Developer session" to me is having a tab open while you're the developer. You don't start the session as such - you become the developer and happen to have a tab open. |
393b7d8
to
e246fe8
Compare
templates/test/live.html.ep
Outdated
<div class="card-body"> | ||
<form action="#" method="get" id="developer-form" class="developer-mode-element" data-hidden-on="lockedByOtherDeveloper"> | ||
<p class="developer-mode-element" data-hidden-on="ownSession"> | ||
Select what you want to do and confirm using the button below. This will start a developer |
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.
@cyntss Can you give your blessing here on the UI/UX side of things? :). There are some screenshots attached, but you can always do your own run. /me wonders if mail would work better :P
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.
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, what would "unknown status" mean to the user? can we give some information under a (?) icon that once clicked opens a popover or modal with more information?
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.
it makes sense now that I see it in openQA.
templates/test/live.html.ep
Outdated
<div class="card-header-appendix" id="developer-session-info"> | ||
% if (my $developer_session = $job->developer_session) { | ||
% my $tab_count = $developer_session->ws_connection_count; | ||
opened by <%= $developer_session->user->name %> |
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.
owned by
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.
ok
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.
fixed
templates/test/live.html.ep
Outdated
</a> | ||
<a href="#" onclick="quitDeveloperSession(); return false;" | ||
class="btn btn-danger developer-mode-element" data-visible-on="ownSession"> | ||
<i class="far fa-stop-circle"></i> Cancel job |
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.
Clicking on Cancel Job, will simply cancel the developer session. Better rename it to cancel developer session, and cancel the job. unless @coolo has a different opinion. But for me a test that was paused and likely touched, is tainted.
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 still find the phrase 'developer session' pretty rather vague. To me a 'developer session' is the time between cigarettes - but we are looking for something more long term :)
templates/test/live.html.ep
Outdated
</a> | ||
<a href="<%= url_for('developer_ws_console')->query({proxy => 1}) %>" target="blank" | ||
class="btn btn-secondary developer-mode-element" data-visible-on="ownSession"> | ||
<i class="fas fa-terminal"></i> Open console |
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.
Hmmm I think it's safe to hide the console.
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.
Yes, I'll get rid of the console button. Or maybe I show it only when launching the Mojo app in development mode? Because when developing (the developer mode) it can still be useful to open that console.
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.
+1 with the development mode of the Mojo app
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.
implemented
@@ -0,0 +1,18 @@ | |||
<select class="custom-select" name="pause-at-module" id="developer-pause-at-module"> |
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.
As a follow up, we can set to disabled the options that are no longer available.
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.
Ok, would be quite easy I guess.
assets/javascripts/running.js
Outdated
if (developerMode.currentModule && !moduleToPauseAtStillAhead) { | ||
statusInfo += ', at ' + developerMode.currentModule; | ||
} | ||
$('#developer-status-info').text(statusInfo); |
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 would actually put the name of the module in bold when the test execution is set to be paused.
@cyntss Here's a more recent screenshot: Taken from http://e212.suse.de/tests/12263 where you can also play around. |
I think 'cancelled' or 'incomplete' is good enough for now - I was actually quite suprised when I controlled a circleci.com job through ssh that it ended passing even though I was debugging a failure :) And about the MAX_JOB_TIME: I would prefer to enlarge it, but that requires a call into the worker. |
@coolo that was exactly my point :P, autorestart sounds good. Let's add a ticket for the enlargement of the MAX_JOB_TIME. no pun intended. |
@cyntss the first part of your comment has the image twice :P. But i'll send you a mail in any case :) |
d06c35f
to
02b46f6
Compare
Ok, this contains now replacements suggested by @foursixnine and no more 'developer session'. I didn't change the case (eg. 'pause' => 'Pause') because this would be inconsistent with the other panels of the kind. If we want to capitalize everything, then we should it consistently (and not within this PR). |
Apparently popovers can not be in a form label because it otherwise instantly loses focus again.
1f0f5c0
to
2ed5ac4
Compare
I fixed some more bugs in the JavaScript. Likely not the last ones, but still I'd like to merge this until the PR grows too big. Let's see whether it still passes the checks. |
* Prevent overriding existing values with form defaults * Prevent updating form controls when the test hasn't been locked by anybody and the form is just shown initially * Don't submit any changes unless testStatus.running
2ed5ac4
to
1066d02
Compare
The tests pass now again. If there are no more objections, I'd like to merge this before continuing. The PR is big enough already. |
Well, time to do some user testing with colleagues I'd say |
Ok, so I'll deploy the latest version on e212 and try to find some victims :-) |
/me sneakingly trying it out on e212 in parallel.
|
I summarize the feedback we've got so far:
So nothing which prevents merging this from my point of view. I think @foursixnine can take care about 1. since he wrote that message. I will do 3. in some follow-up (likely with some more adjustments). 4. is out of the scope of this PR anyways. |
@okurz I over-read your comment. Q1: You start the test with the setting |
awesome! |
PR open: #1702 |
@okurz let's make it "VNC port 6012" instead
Yes, but that information is already available from the info about the assigned worker which also outputs the hostname
|
@okurz this is only display explicitly when the test is paused. What else
would you suggest here? (as the default information for the assigned
worker, is to show the worker instance, and you only get to see the VNC
port after placing the mouse on the element)
…On Mon, Jul 2, 2018 at 11:11 AM Oliver Kurz ***@***.***> wrote:
***@***.*** let's make it "VNC port 6012" instead
Yes, but that information is already available from the info about the
assigned worker which also outputs the hostname
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1691 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAN_eL2hOOj-Rxo5sG_SJXzkDM3QplwSks5uCePbgaJpZM4UoQ3f>
.
|