Bug #11652

[Workbench] Search should search subprojects as well as selected project

Added by Tom Morris about 2 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Radhika Chippada
Category:
-
Target version:
Start date:
05/10/2017
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
2.0

Description

Customer request:

Is it possible to change behaviour of the search in the following way: selection of project will lead to all result matching the search within the subprojects and Data Collections? Currently it shows only the results for the project itself but does not go deeper into the subproject structure.
Example: project A > project B > project A & B
Search in all projects for B results in: Project B and Project A & B
Search in Project A for B results only in: Project B (we would like to have also project A & B)

Implementation:
- switch search to be recursive in the global search modal
- results are shown as a flat list


Subtasks

Task #11802: Implement groups#contents?recursive=trueResolvedTom Clegg

Task #11813: Review branch 11652-recursive-contents-wbResolvedRadhika Chippada


Related issues

Related to Arvados - Bug #11822: [API] Add recursive and include_trash params missing from discovery docDuplicate

Related to Arvados - Bug #11821: [API Server] Update discovery document to include latest API updatesResolved06/07/2017

Associated revisions

Revision b745c25c
Added by Tom Clegg about 2 years ago

Merge branch '11652-recursive-contents'

refs #11652

Revision f7b04748
Added by Radhika Chippada about 2 years ago

closes #11652
Merge branch '11652-recursive-contents-wb'

History

#1 Updated by Tom Morris about 2 years ago

  • Subject changed from [Workbench] Search should search subprojects as well as selected project to [Workbench] Search should search subprojects as well as selected project - to be groomed
  • Target version changed from 2017-06-07 sprint to 2017-06-21 sprint

#2 Updated by Tom Morris about 2 years ago

  • Description updated (diff)
  • Story points set to 2.0

#3 Updated by Tom Morris about 2 years ago

  • Subject changed from [Workbench] Search should search subprojects as well as selected project - to be groomed to [Workbench] Search should search subprojects as well as selected project

#4 Updated by Radhika Chippada about 2 years ago

  • Status changed from New to In Progress
  • Assigned To set to Radhika Chippada
  • Target version changed from 2017-06-21 sprint to 2017-06-07 sprint

#5 Updated by Tom Clegg about 2 years ago

11652-recursive-contents @ fd4bdb760eb47013b8b60b40859ba7f004ee8383

#6 Updated by Radhika Chippada about 2 years ago

LGTM

Please consider adding the following three tests in groups_controller_test.rb

  test 'get contents recursive=true from home project' do
    authorize_with :active
    get :contents, {
          recursive: true,
          format: :json,
        }
    owners = json_response['items'].map do |item|
      item['owner_uuid']
    end
    assert_includes(owners, users(:active).uuid)
    assert_includes(owners, groups(:aproject).uuid)
    assert_includes(owners, groups(:asubproject).uuid)
  end

  test 'get contents recursive=false' do
    authorize_with :active
    get :contents, {
          id: groups(:aproject).uuid,
          recursive: false,
          format: :json,
        }
    owners = json_response['items'].map do |item|
      item['owner_uuid']
    end
    assert_includes(owners, groups(:aproject).uuid)
    assert_not_includes(owners, groups(:asubproject).uuid)
  end

  test 'get contents with no recursive flag' do
    authorize_with :active
    get :contents, {
          id: groups(:aproject).uuid,
          format: :json,
        }
    owners = json_response['items'].map do |item|
      item['owner_uuid']
    end
    assert_includes(owners, groups(:aproject).uuid)
    assert_not_includes(owners, groups(:asubproject).uuid)
  end

#7 Updated by Radhika Chippada about 2 years ago

Lucas: branch 11652-recursive-contents-wb is ready for review @ f1aed11fd3a5e204a2cf2e4fc5f099179e877eb6

This branch implements the workbench side of recursive project contents for search.

To review: please compare against the 11652-recursive-contents branch (which is being addressed by Tom to implement the API server support for recursive flag. I will merge this branch after Tom merges 11652-recursive-contents branch.)

git diff 11652-recursive-contents...11652-recursive-contents-wb

#8 Updated by Tom Clegg about 2 years ago

11652-recursive-contents @ 29665e2d9a543bffb237d148c3484c03b03e30aa

#9 Updated by Lucas Di Pentima about 2 years ago

A couple of small comments:

  • File apps/workbench/test/controllers/search_controller_test.rb
    • Line 51: Shouldn’t the message say something like “search results for non empty project should not be empty”?
  • File services/api/lib/can_be_an_owner.rb
    • Line 36: I think the map call is not needed, shouldn’t exec_query(‘…’).rows be enough in this case?

The rest LGTM. Thanks!

#10 Updated by Radhika Chippada about 2 years ago

search_controller_test.rb - Line 51: Shouldn’t the message say something like “search results for non empty project should not be empty”?

Thanks for catching that. Copy/paste lapse. Corrected

File services/api/lib/can_be_an_owner.rb - Line 36: I think the map call is not needed, shouldn’t exec_query(‘…’).rows be enough in this case?

With exec_query.rows, we get this for descendets: [["zzzzz-j7d0g-axqo7eu9pwvna1x"], ["zzzzz-j7d0g-subprojsamenam2"]] , where as with the other we get this ["zzzzz-j7d0g-axqo7eu9pwvna1x", "zzzzz-j7d0g-subprojsamenam2"]. It may work, but better to have the right format. (This is already merged by Tom)

Thanks.

#11 Updated by Radhika Chippada about 2 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

Applied in changeset arvados|commit:f7b0474852fa8f270605c4cb5eeaf85c910c421e.

Also available in: Atom PDF