Bug #6652
closed
[API] Error "Owner uuid must refer to a user with a username" when creating a new repository.
Added by Radhika Chippada over 9 years ago.
Updated over 9 years ago.
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.
- 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)
- 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.)
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset arvados|commit:9b2bf1dddd21c991623e4b2b8b412e1f3fb05d34.
- Status changed from Resolved to New
Re-opening this because it doesn't sound like we made the desired API changes.
- Target version changed from Bug Triage to 2015-09-02 sprint
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.
- Target version changed from 2015-09-02 sprint to Arvados Future Sprints
- Target version changed from Arvados Future Sprints to 2015-09-02 sprint
- Target version changed from 2015-09-02 sprint to Arvados Future Sprints
- 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.
- 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
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.
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.
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Applied in changeset arvados|commit:c1ceb0f74d5547c56cf6cdde56044adba171efaf.
Also available in: Atom
PDF