Project

General

Profile

Actions

Bug #6652

closed

[API] Error "Owner uuid must refer to a user with a username" when creating a new repository.

Added by Radhika Chippada almost 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
API
Target version:
Story points:
0.5

Description

Ways to create a new repo:
  • Admin gear menu → Repositories → "Add a new repository" button -- fail
  • User menu → Manage Account → "Add new repository" button -- success
  • arv repository create --repository '{"name":"myusername/foobar"}' -- fail
I suspect this is a problem with validation order:

If these happened in the reverse order, :valid_owner would pass.


Subtasks 2 (0 open2 closed)

Task #6979: Do not offer "Add a new repository" and "Add a new SSH key" buttons when admin settings pages are accessed.ResolvedManoj Malipeddu08/13/2015Actions
Task #6990: Review 6652-test-system-menuResolved08/14/2015Actions
Actions #1

Updated by Tom Clegg almost 9 years ago

  • Subject changed from [Workbench] Fiddlesticks error "Owner uuid must refer to a user with a username" error accessing "Add a new repository" button in the settings menu. Works in "manage account" page. to [API] Error "Owner uuid must refer to a user with a username" when creating a new repository.
  • Description updated (diff)
Actions #2

Updated by Tom Clegg almost 9 years ago

  • Category set to API
  • Story points set to 0.5

This might be easy to fix by moving self.owner_uuid ||= current_user.uuid into a before_validation method.

(Obviously it needs a test case, too.)

Actions #3

Updated by Manoj Malipeddu almost 9 years ago

In 4999699d7614f214eb8718b85c5c30e9fb382c23:

Added tests for the system menu and the pages in the dropdown menu.

Actions #4

Updated by Manoj Malipeddu almost 9 years ago

In 61d432f332dd9314f8c4cd57c2393e80e8ecef59:

System menu test now skips repositories and test has been moved to application_layout_test.

Actions #5

Updated by Manoj Malipeddu almost 9 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:9b2bf1dddd21c991623e4b2b8b412e1f3fb05d34.

Actions #6

Updated by Brett Smith almost 9 years ago

  • Status changed from Resolved to New

Re-opening this because it doesn't sound like we made the desired API changes.

Actions #7

Updated by Brett Smith over 8 years ago

  • Target version changed from Bug Triage to 2015-09-02 sprint
Actions #8

Updated by Radhika Chippada over 8 years ago

I played with Tom's suggestion "moving self.owner_uuid ||= current_user.uuid into a before_validation method" and this does not solve the problem.

Once this is in place, the creation fails on name_format check. Thus, to solve this:
  • need to make the API update
  • update workbench to show the same popup as in user/repositories page. Alternatively, we can hide the New button admin#repositories page. I think this might actually be the right option, because what good is it to create all these repositories as <admin_user>/repo_name?
  • "arv repository create" should work provided name is provided as in Tom's example in the description.
Actions #9

Updated by Brett Smith over 8 years ago

  • Target version changed from 2015-09-02 sprint to Arvados Future Sprints
Actions #10

Updated by Brett Smith over 8 years ago

  • Target version changed from Arvados Future Sprints to 2015-09-02 sprint
Actions #11

Updated by Brett Smith over 8 years ago

  • Target version changed from 2015-09-02 sprint to Arvados Future Sprints
Actions #12

Updated by Tom Clegg over 8 years ago

  • Status changed from New to Resolved

This bug was fixed and merged with #6663. Now this succeeds:

$ arv repository create --repository '{"name":"myusername/foobar"}'
Workbench still has a non-functional "Add repository" button on the /repositories page (which is linked from the admin menu) but
  • it now gives a legitimate error that indicates a Workbench flaw instead of an API flaw: "Name must be the owner's username, then '/', then a letter followed by alphanumerics"
  • that button is useless anyway because users can create their own repositories on the user menu -> Repositories page. It should be removed.
Actions #13

Updated by Radhika Chippada over 8 years ago

  • Status changed from Resolved to In Progress
  • Assigned To set to Manoj Malipeddu
  • Target version changed from Arvados Future Sprints to 2015-08-19 sprint
Actions #14

Updated by Radhika Chippada over 8 years ago

Reopening to address the last comment added by Tom in note #12.

So, what needs to be done: When accessed from admin settings menu,

  • /repositories page should not offer the "Add a new repository" button
  • /authorized_keys page also does not need to offer the "Add a new authorized key" button.
Actions #15

Updated by Manoj Malipeddu over 8 years ago

In 84d14d659b8c31c266a3b08e688171f90fe46cad:

Add a new repository and add a new authorized key buttons no longer appear in the admin pages and tests have been updated.

Actions #16

Updated by Radhika Chippada over 8 years ago

Review comments:

  • Please add an else block for "if add_button_text" in the test
      if add_button_text
        assert_selector 'button', text: "Add a new #{add_button_text}" 
        find('button', text: "Add a new #{add_button_text}").click
      else
        assert_no_selector 'button', text: "Add a new" 
      end
  • Can you please use "assert_text" instead of "page.has_text?" in the last statement of the test

Thanks.

Actions #17

Updated by Manoj Malipeddu over 8 years ago

In 3bfb9c5cbf5dd56b84fd17f9e1dcdd6a219fe5fe:

Added else statement and changed assertion to use assert_text in "test system menu #{page_name} link".

Actions #18

Updated by Manoj Malipeddu over 8 years ago

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

Applied in changeset arvados|commit:c1ceb0f74d5547c56cf6cdde56044adba171efaf.

Actions

Also available in: Atom PDF