Merge lp:~cjwatson/launchpad/export-git-repositories-new into lp:launchpad
Status: | Rejected |
---|---|
Rejected by: | Colin Watson |
Proposed branch: | lp:~cjwatson/launchpad/export-git-repositories-new |
Merge into: | lp:launchpad |
Diff against target: |
496 lines (+185/-80) 9 files modified
lib/lp/code/errors.py (+5/-1) lib/lp/code/interfaces/gitnamespace.py (+6/-2) lib/lp/code/interfaces/gitrepository.py (+15/-2) lib/lp/code/model/githosting.py (+2/-2) lib/lp/code/model/gitnamespace.py (+42/-2) lib/lp/code/model/gitrepository.py (+21/-6) lib/lp/code/model/tests/test_gitrepository.py (+66/-0) lib/lp/code/xmlrpc/git.py (+27/-64) lib/lp/code/xmlrpc/tests/test_git.py (+1/-1) |
To merge this branch: | bzr merge lp:~cjwatson/launchpad/export-git-repositories-new |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Launchpad code reviewers | Pending | ||
Review via email: mp+373267@code.launchpad.net |
Commit message
Export IGitRepositoryS
Description of the change
For example, this allows snapcraft to create a temporary repository, issue an access token to it, and push code to it, all without needing to configure an SSH key.
In order to make this possible, I had to do some preliminary refactoring to push on-disk repository creation down from the XML-RPC endpoint to the model.
Unmerged revisions
- 19055. By Colin Watson
-
Fix GitRepositorySe
t.new, and export it on the webservice. This was previously untested, and had been broken since r18222.
Now that namespace.
createRepositor y can create the repository on the hosting
service, we can safely export this to create a bare repository via the API.
For example, this allows snapcraft to create a temporary repository, issue
an access token to it, and push code to it, all without needing to configure
an SSH key. - 19054. By Colin Watson
-
Push Git hosting creation down from XML-RPC endpoint to model.
Having the creation of the actual repository on disk be done by the XML-RPC
endpoint makes it difficult to expose other methods of creating
repositories.I rearranged how target and owner defaults are set. We have to create the
repository on the hosting service as the last step to avoid problems with
rolling back transactions, so pushing this part down to the model also
requires pushing down target/owner default handling, and the callback
mechanism previously in place wasn't very suited to that.I had to adjust the permission check in
GitRepositorySet.setDefaultRep ository slightly, because pushing down
target/owner default handling is easier if the Unauthorized exception
message is more accurate. setDefaultRepositoryForOwner already raised
exceptions with accurate messages.
Superseded by https:/ /code.launchpad .net/~cjwatson/ launchpad/ +git/launchpad/ +merge/ 373763.