-
Notifications
You must be signed in to change notification settings - Fork 2k
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
UI: Proper task group breadcrumb on the allocation pages #4801
Conversation
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.
Thanks for looking at this @johncowen, can you provide steps to reproduce? |
It's actually really difficult to figure out the steps. It's always when I click on a breadcrumb, I think I've seen it happen on both the second to last and the third to last (I just got it to break now and that one was clicking on the third to last) I just tried to reproduce again, and at first I couldn't get it to break. So I figured it might be something to do with the fact that I'd run it using Mirage first and then switched to use the demo site (maybe something do with the localStorage values or something). I tried doing the same, and this time I got this error: ... again its really difficult to give exact steps as it seems to be sporadic. I refreshed and clicked around a bit more, and then got it to break exactly the same as the screengrab from last week. I then cleared cleared my localStorage completely and clicked around a little more and I managed to get it to happen again, unfortunately it doesn't look like it happens following specific steps. All of the above was experienced using whilst proxying to the demo site with Just before finishing up on this comment I just tried a few more times and I think I got it to break consistently with:
It might happen in other places also. John |
So I looked into the reload error and learned something new about Nomad. Apparently job IDs don't have to match job Names. This is rare, since it requires submitting a job via the api using JSON, but it's possible and in place in the Nomad demo cluster (https://demo.nomadproject.io/v1/job/SparkPi?namespace=analytics).
As for the querySelector of null from mountElements error, that smells like a race condition (component isDestroying) bug, which is also separate from this PR. Thank you for finding these bugs though! |
5c1e94c
to
4e36c52
Compare
Ah ha, one of those curve balls! 😄 Cool, does that last commit (4e36c52) include the fix then? If so I can give it another once over. On the 'querySelector of null from mountElements error', ping me when you get that one up and I can look at that then. |
Yep! All changes are pushed up. I'll comment where the bug was fixed. |
...jobCrumbs(model.get('job')), | ||
{ | ||
label: model.get('taskGroupName'), | ||
args: [ | ||
'jobs.job.task-group', | ||
model.get('job'), | ||
model.get('job.plainId'), |
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 was job.name
, which meant the job route was attempting to fetch a job with the wrong ID in the event that name and plainId aren't equal (which is rare but possible).
Hey, I'm still getting errors on here, I'm not sure if they are all related or entirely different things. So apologies up front if this is a bit non-specific. First thing that happened, that I couldn't reproduce, was that on clicking on the third to last breadcrumb, the loader animation came up and just hung, I left it for about a minute and it just stayed there. Unfortunately I hadn't opened up console so I have no error/network info for that to see if anything showed up, sorry. After that I kept trying to see if I could reproduce ^, but then hit another thing that I do have better information for: Overall I did notice that the 'in page sub menu' (the bit with the [Overview] button in) does this weird 'show you 0 or 1 button, then show you 4 buttons, then show you 1 button again' when you click on the third to last breadcrumb. Not a showstopper, but a bit strange, is that something you can avoid? Ah lastly, the way I'm reproducing this now is slightly different to how I explained in my last review as the specific Allocations/Tasks are no longer in the demo cluster. Now what I'm doing is:
The bug only seems to happen sometimes. Ping me once you've looked at it and I'll give it another go. Thanks, |
|
Hey, I'm still getting different errors around the breadcrumbs, although I'm not sure if its breadcrumbs or something else, here's another: This could be a similar loading error to what I got on Friday, I've just noticed whilst writing this that this time that the page did eventually load once I got a 524 error. Here's what the console looks like now: This does improve the situation from the original error, which I think was happening all the time, and I get the impression it would be better to address these other things separately, so I'm gonna go with your preference here and approve this - at the end of the day it does improve on the original bug. I have had a look over the code, and I'm going to dive back into it a bit now and I might have a few non-blocking questions from that. Thanks for bearing with it. John |
Ok first things first these are completely non-blocking and just a result of a bit of a bigger dive into some of the files changed here, not even necessarily things that are part of this change: You seem to be doing things here that I would have thought you'd be putting in an Ember Data Adapter: nomad/ui/app/services/system.js Lines 21 to 24 in 4e36c52
From working with Ember Data it seems to go to great lengths to abstract away the inner workings of an API, so much so that you don't interact with things using URLs, but instead using javascript functions. I'm not a great fan of the way it does this, but I do think it's the right thing to do. Is there a plan to move this into an Adapter in the future? And what is the reason behind not putting it within an Adapter? Another thing I noticed in this file is all the No rush for these at all, just queries. Thanks, John |
For the As for |
Cool, I was wondering if you could put the url's at least in an Adapter and then use I think what I'm coming to here which is more the TLDR; is, what about just using an adapter here, but not the serializer/store? |
I get the urge to put it in an adapter, since dealing with string concatenation in components and such is not ideal, but I think making an adapter for these use cases is the worser of two evils. Mostly because of the way Ember Data treats adapters. I don't see adapters as free-standing primitives. They are always paired with serializers and models. And this is mostly because adapters aren't called directly. There are exemptions, like I could see potentially having some other abstraction for these URLs, but the time being I don't mind having the URLs directly in the service and elsewhere. It's a pretty small blast radius considering how isolated the usages are. |
Good enough reason for me 👍 I suppose half of this system service is kind of a 'repository' for regions (and possibly namespaces also?), but not a 'repository' backed by ember data which is a-ok (a repository would hide that fact). You have some view related bits in here also. Don't mean to sound whatever here considering that other convo, but what do you think of the idea of splitting this up so you have data retrieving stuff in a repository-like service and the view related stuff in a view helper? (obviously very 'me' this, but give it a think - I don't mind either way) |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
The breadcrumb was missing the namespace query param which led to errors being thrown when using the breadcrumb on a non-default namespace.
Only impacts enterprise, since namespaces are an enterprise feature.