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
fixes #8690 - converting repository to scoped search #5294
Conversation
Note, as part of this PR, i convert the content view 'add repositories' page to use a param instead of search. After playing around, search did not seem to work well for this use case. So here i present two variations to solving the issue:
jlsherrill@51165a3#diff-4a58e16252386909489b00a2f4451879R67
06f134c#diff-4a58e16252386909489b00a2f4451879R62 I am open to other solutions as well. Will squash and write a test to cover it after discussion. |
ab277d2
to
d26db07
Compare
On Thu, Jun 11, 2015 at 11:17 PM, Justin Sherrill notifications@github.com
What about available_for_content_view? Reads better to me.
What are your thoughts on the second approach being more automatic? For
|
The negation is a lot trickier than what you'd expect. Take this example from the repos controller:
To negate that via sql-logic, you'd say something like:
You'd expect that would return you the opposite of the first query, but in fact it does not simply because the join() here is an inner join and excludes all things that are not associated to a content view at all. Sure you could re-write this query to use an inner join and negate that, but what you are suggesting would require rewriting most all of our filter queries to use 'in clauses', which might be an option if it not for.... Available repos for a content view isn't simply the inverse of repos already associated to the content view. You have to consider org, only the repos in Library (default org view), etc... (notice here i set |
Yeah, i agree, if we go that route, i'd change it to 'available_for_content_view', i started using available_for for the 2nd route cause it sounded better and just didn't go back and change the initial param |
I see your point. Thoughts on trying to capture the parameter logic into a function similar to how the content concern works? Something like:
|
@ehelms updated and added a test |
Probably not a symptom of this change, but when listing docker repositories for a content view version I see not just the library version listed. Edit: In other words, I see both the library version and the one that I just created by publishing a version. |
Do you think we should change the repository list page to use normal search instead of filter with this update? |
@ehelms i do think we should add that, but it would be best to just re-write that page to use the details-nutupane template, rather than modifying the existing code and i'd rather do that in a separate PR |
I thought with past conversions we had updated the pages to take advantage of the conversion, if you feel strongly enough in this case that is should be a stand-alone update please file an issue. |
@ehelms generally they are already using nutupane or nutupane-details and no conversion has been needed. I started to do the conversion but with all the interaction and given the size of this PR already I didn't feel comfortable doing it as part of this PR. |
squashed |
@@ -35,56 +37,49 @@ class Api::V2::RepositoriesController < Api::V2::ApiController | |||
param :product_id, :number, :desc => N_("ID of a product to show repositories of") | |||
param :environment_id, :number, :desc => N_("ID of an environment to show repositories in") | |||
param :content_view_id, :number, :desc => N_("ID of a content view to show repositories in") | |||
param :available_to_content_view_id, :number, :desc => N_("ID of content view to show repositories not in") |
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.
Needs removing
I think some of the work here, the UI portion (https://github.com/Katello/katello/pull/5268/files), may have some coincidence with this update. You may want to review it, and perhaps consider getting it merged and then rebasing this PR as the autocomplete nature would be able to be added fairly easily? |
1d77c18
to
7ef96ce
Compare
@ehelms tested that PR ontop of mine, but i don't know that they need to applied in any order, they don't conflict and the auto complete works just fine with his patch as is (it works better after the masterOnly change i suggested) |
@jlsherrill thanks for giving it a try in conjunction with this, one last comment (#5294 (comment)) and I think I am good with this. |
ACK |
fixes #8690 - converting repository to scoped search
No description provided.