Project

General

Custom queries

Profile

Actions

Bug #11652

closed

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

Added by Tom Morris over 7 years ago. Updated over 7 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 2 (0 open2 closed)

Task #11802: Implement groups#contents?recursive=trueResolvedTom Clegg05/10/2017

Actions
Task #11813: Review branch 11652-recursive-contents-wbResolvedRadhika Chippada06/06/2017

Actions

Related issues 2 (0 open2 closed)

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

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

Actions
Actions #1

Updated by Tom Morris over 7 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
Actions #2

Updated by Tom Morris over 7 years ago

  • Description updated (diff)
  • Story points set to 2.0
Actions #3

Updated by Tom Morris over 7 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
Actions #4

Updated by Radhika Chippada over 7 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
Actions #5

Updated by Tom Clegg over 7 years ago

11652-recursive-contents @ fd4bdb760eb47013b8b60b40859ba7f004ee8383

Actions #6

Updated by Radhika Chippada over 7 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
Actions #7

Updated by Radhika Chippada over 7 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

Actions #8

Updated by Tom Clegg over 7 years ago

11652-recursive-contents @ 29665e2d9a543bffb237d148c3484c03b03e30aa

Actions #9

Updated by Lucas Di Pentima over 7 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!

Actions #10

Updated by Radhika Chippada over 7 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%22%5D_%5B%22zzzzz-j7d0g-subprojsamenam2%22">"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.

Actions #11

Updated by Radhika Chippada over 7 years ago

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

Applied in changeset arvados|commit:f7b0474852fa8f270605c4cb5eeaf85c910c421e.

Actions

Also available in: Atom PDF