New issue 117: API repository creation does not work when all subgroups do not
yet exist
https://bitbucket.org/conservancy/kallithea/issue/117/api-repository-creation-does-not-work-when
Thomas De Schampheleire:
Kallithea has an API to create a repository, and the help text mentions that if
the repository name contains slashes, the corresponding groups would be created
automatically.
This does not seem to work. Creating a repo like::
kallithea-api --apikey **** --apihost ***** create_repo repo_name:foo/bar/repo
clone_uri:*********
gives the following log in celery: (not sure if it's celery related):
IntegrityError: (IntegrityError) insert or update on table "repositories"
violates foreign key constraint "repositories_group_id_fkey"
DETAIL: Key (group_id)=(2) is not present in table "groups".
'INSERT INTO repositories (repo_name, repo_state, clone_uri, repo_type,
user_id, private, statistics, downloads, description, created_on, updated_on,
landing_revision, enable_locking, locked, changeset_cache, fork_id, group_id)
VALUES (%(repo_name)s, %(repo_state)s, %(clone_uri)s, %(repo_type)s,
%(user_id)s, %(private)s, %(statistics)s, %(downloads)s, %(description)s,
%(created_on)s, %(updated_on)s, %(landing_revision)s, %(enable_locking)s,
%(locked)s, %(changeset_cache)s, %(fork_id)s, %(group_id)s) RETURNING
repositories.repo_id' {'repo_type': u'hg', 'statistics': False, 'locked': None,
'description': u'repo', 'changeset_cache': None, 'downloads': False, 'private':
False, 'clone_uri': u'*****', 'created_on': datetime.datetime(2015, 3, 27, 15,
43, 22, 640922), 'fork_id': None, 'enable_locking': False, 'updated_on':
datetime.datetime(2015, 3, 27, 15, 43, 22, 640966), 'user_id': 2,
'landing_revision': 'rev:tip', 'group_id': 2, 'repo_state':
'repo_state_pending', 'repo_name': u
'foo/bar/repo'}
Creating the subgroups manually allows the repo creation to work successfully.
_______________________________________________
kallithea-general mailing list
[email protected]
http://lists.sfconservancy.org/mailman/listinfo/kallithea-general