Le mardi 13 février 2018 à 10:07:52+0100, Guido Günther a écrit : > On Tue, Feb 13, 2018 at 09:56:28AM +0100, Pierre-Elliott Bécue wrote: > > Le mardi 13 février 2018 à 09:45:43+0100, Guido Günther a écrit : > > > we can leave most of these out since they're not required: > > > > > > https://docs.gitlab.com/ce/api/projects.html#create-project > > > > Yes, but the defaults seem awkward to me for Debian git repositories, hence > > the suggestion to set them. > > I was hoping that not setting anything would use the salsa wide > defaults? If not we set them to the same values that you get by default.
Nah, have a look at the output json example I pasted. It's as you wish, but this default json seems really appropriate to me, at least for the public vs private status of the project. > > > > The only required intel is actually the project's name. > > > > > > Python has plenty json api packages to send such json, so it's a matter > > > > of > > > > implementation. > > > > > > We already use requests for http so this can be used to simplify things > > > furhter. There's also python3-gitlab. > > > > Should we try to rely on p3-gitlab or to stick with requests? > > Both is fine with me. The later would have the advantage that we could > use it later to set hooks like the hook_tagpending.sh in salsa-scripts. > If using p3-salsa we should make the use optional, that is fail if one > wants to create a repo on salsa without p3-gitlab installed (so it stays > simple for folks to port to other distros). I'll give a try with requests. > > > > I could take some time to code that, but I'd rather we agree on the > > > > "how" > > > > and the "what" before spending any time in such work. > > > > > > Would be great. Especially since we'd need some logic to figure out if > > > the remote end is using gitlab. For the moment we could just do: > > > > > > --remote-type=git+ssh (old behaviour) > > > --remote-type=gitlab (what you just describe) > > > --remote-type=auto > > > > > > The last option could just look into a fixed list within create_repo > > > > > > gitlab_hosts = ['salsa.debian.org'] > > > > > > to figure out what to do. > > > > Could you help me confirming what are the different steps supposed to be > > handled by create-remote-repo? > > > > I assume it's roughly these: > > > > 1. Find the url and determine the configurations, in particular, check if > > such a remote doesn't alreaty exist in the .git/config file. > > Yes, gbp-create-repo does this already. > > > 2. Create the actual remote repo > > 3. Update the local git config with this remote. > > 4. Push to this new remote. > > Yes, see create_repo. The only part that needs to be adjusted is around > build_remote_script. > > > > > Am I right? > > Yes, most of this is already here. As a bonus we could resolve insteadOf > references but that could be a different patch/bug. Alright, I'll give it a look and a try. Cheers, -- Pierre-Elliott Bécue GPG: 9AE0 4D98 6400 E3B6 7528 F493 0D44 2664 1949 74E2
signature.asc
Description: PGP signature