-
Notifications
You must be signed in to change notification settings - Fork 356
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
Archived container records should not be displayed in the UI #1526
Comments
@himdel can you please take a look? |
I think this is the same problem as in #1553 .. so please read the discussion there.. I'm not sure if the current state of that PR will get merged (the special case is small enough, but I'm baffled as to why it's not needed elsewhere as well, and would really like to see the SQL live in models, not UI), but at least there's more examples... Also, maybe they should be visible somewhere, same as archived/retired VMs, shouldn't it? |
Archived container objects should not be visible in the UI, we keep them in the DB to be used in other areas (e.g. reports, chargeback) |
Some progres.. looks a lot like the other issue is just a missing association on the backend. EDIT: not sure about that though.. |
It seems like a similar issue. As mentioned in #1553 (comment) the |
We could send I recommend creating new function in controller which would be let's say What do you think about this @himdel? |
@karelhala Definitely all for consistency 👍 Maybe Agreed we can't be sending any SQL when calling EDIT: .. I think Martin had an idea about "report profiles" .. as in, you'd have a place which defines all the options for all the gtl reports, and simply call report data with the name of that profile, and it would probably be easier to move that to the API at some point.. but we can start with the |
cc @Ladas |
btw. a correct way is to use named_scope https://github.com/ManageIQ/manageiq-ui-classic/pull/1462/files let make sure we don't put SQL queries(not even partial where conditions) anywhere in the UI code |
@himdel @karelhala are there any updates here? |
@himdel yeah #1524 is indeed my PR :) it's actually not fixing this issue, it only deals with the new archiving of Container Node. |
Aaah, that makes sense, thanks :) .. I think we should just be passing that named scope with all the other params to the report_data request (something we can't do for where_clause, but should be perfectly safe for named scopes).. Will take a look.. |
There should be no SQL anywhere in the UI Why is this not part of the report definition? If this cannot be directly in the report then is should be a named scope at least. Although I'd rather have just one place to define the nested list/report. As a sidenote: we really need an API for this: ManageIQ/manageiq#14924 Please, avoid the use of Please don't add new exceptions. Try to make this particular case the same as are the other cases. |
@martinpovolny We already changed that to named scope, please see my comment above: #1526 (comment) |
detailed repro:
https://gist.github.com/cben/30cb93f5991d222a2315d503028cf501#file-rails-s-L48 has the actual query, does not filter by deleted_on. |
aha, the problem only happens with global view of all nodes; a specific provider's list of nodes (eg. http://localhost:3000/ems_container/1?display=container_nodes) does filter out archived nodes: And, as @zakiva says, this happens with all container entities that support archiving, not just nodes. |
Aaah.. so that PR fixed just nested lists, but not the main view.. Now I undestand, thanks @cben! :) |
P.S. anybody looking into how it works and where the query actually happens, see also #2163 about it doing 3N+1 queries. |
I no longer see archived nodes in the UI, can this be closed? |
👍 Confirmed works on gaprindashvili too (both provider's nodes and all nodes views). For the record the fast hacky way to test this is |
@himdel We use this to narrow the search before displaying the objects list (from
container_group_controller.rb
) :However, the displayed list contains all the records including the archived ones.
This may be related to the new way of fetching the data introduced in #592? I think it ignores the
options
passed fromshow_list
, is there a new way of narrowing the search?cc @simon3z @zeari @karelhala
The text was updated successfully, but these errors were encountered: