-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Changes ui-side behavior in response to websocket job status updates on several lists #5968
Changes ui-side behavior in response to websocket job status updates on several lists #5968
Conversation
Build succeeded.
|
Shouldn't we be fixing this on the sending side? |
@wenottingham unlike "give me event data about Job XYZ", the "tell me about job status changes" websocket group isn't currently scoped in any way - it's literally just "tell me the IDs of jobs that encounter a status transition". So if we wanted to change this (especially if we wanted to make it include additional data about the job in question), we'd probably have to have some sort of per-user channel, or do RBAC checks for every status change for every subscriber. However, even if we changed this, we'd still probably have to do a One of the things we're experimenting with here is the idea that doing a list view and limiting it to |
No, we got rid of that. In this flow, you POST to JT jobs list or global jobs list to create a job. Then you POST to the start endpoint. This was removed, there is no way to do this anymore. It might still be the case that some tracebacks will put a job into the "new" state, as a vestigial thing. That means the server had an error, and is not a concern for us here. |
If you're filtering by Anyway, I say it's a safe assumption that "pending" status messages are received in order of creation and that successful/fail/error status messages are received in order of finished time, and discrepancies would be so minuscule that there is no value in worrying about it. +1 from me after reading your synopsis. |
implementation and described behavior lgtm 👍 It's worth pointing out:
I think this means we don't add new rows to lists with search filters applied? My gut tells me that removing live updates for these is a reasonable trade-off but I'm only guessing. @wenottingham @ryanpetrello @AlanCoding / anyone else with a bit more insight to customer usage at scale, does this seem like an acceptable trade-off? |
Is the implication that right now if you have some filter applied to the list, new rows will appear that don't match the filter? |
@wenottingham no, that shouldn't happen. We can apply those same filters when making the GET requests for the new rows. If they don't match the filters, we won't get them back. The |
So the options are a) not show them b) do a 'full' list request in that case only? |
@wenottingham yea, that's my understanding. Those would be the two options. |
Build succeeded.
|
Build succeeded.
|
Build succeeded.
|
Build failed.
|
Build failed.
|
Build failed.
|
f3f9486
to
115eff7
Compare
Build failed.
|
…e need to stick with a single spelling of the word
… to update the relevant row in the templates list.
…vant job row. Also adds logic to attempt to re-order the list when the sort order is -finished since we have enough information client-side to do that.
…own the line by buildTooltips().
…t and populated in the object. For anyone reading this later, know that AdHocCommands still have unified_job_template and unified_job_template_id fields, they are just nonetypes because they don't get used by the AdHocCommand objects. Which means you have to actually get the object, not just check that it's there, to use it the way I am in this change.
…long with successful/failed/canceled
01cfcd9
to
07752f4
Compare
Build succeeded.
|
…d then breaking the DateTime function
769c25b
to
457dc95
Compare
Build succeeded.
|
@unlikelyzero @mabashian @rebeccahhh 👋 Still LGTM - Where do we stand with this one? Is this thing ready to merge or does it need more review / testing? |
Final stages of testing. Merge meeting is tomorrow |
Build succeeded (gate pipeline).
|
SUMMARY
Part of #5883
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
It might be easiest for me to outline the expected behavior with these changes in order to illustrate what's changed and pose questions.
UI gets a socket message with a
status
other thanpending
.unified_job_id
provided in the socket message. If it finds a matching row, we update the status of the row to match the status in the message. (This same pattern will extend out to other fields (started/finished/etc) when provided by the api).UI gets a socket message with at
status
ofpending
.new
? If so, the code as it currently stands would potentially insert an extra job for this row (we don't check for this job in our existing list rows).-finished
or similar-started
order_by
filter applied to the list. If they're sorting by something else we have no idea where this potential new row fits into the list.id__in
.id__in
filter that matched a future job id. This probably isn't a realistic scenario though./api/v2/unified_jobs?id__in=9000&count_disabled=1
. Over the next 5 seconds, we hold on to all the id's of new jobs that come in and bundle them up into a single request to be executed 5 seconds after the initial request (id=9000). That second request would look like/api/v2/unified_jobs?id=9001,9002,9003
&count_disabled=1. The cycle continues until there are no more new jobs in the past 5 seconds.A special note about the launch modal: while it's open we will still update rows underneath the modal (because this no longer requires making GET requests and re-rendering the entire row). We don't add any new rows to the list while this modal is open though. This is because the modal itself (it's element) lives within the row. If this row were to get bumped out of the list the modal would disappear. As such, we hold on to new job id's and fire off the corresponding request only after the launch modal is closed. This behavior is consistent with the way we handle messages while the launch modal is open currently.
Question(s)
Probably for @wenottingham but I'm curious what others think as well.
-finished
(the default sort value) is not exactly "right". In reality, we're adding rows to the top of the list in the order which we receive the socket messages telling us that a new job has been created. This is probably OK until the job actually finishes. Once the jobs finish, they may be out of order based on the-finished
order_by
filter. Is that OK?Alternatively we could try to do something like: