Re: salsa-import script
Greetings, Anton,
On Wed, Jan 03, 2018 at 10:22:43PM +0100, Anton Gladky wrote:
Hi Filippo,
there is the script for the debian-science team:
=====================
#!/bin/sh
set -eux
PROJECT="${1%.git}"
DESCRIPTION="$PROJECT packaging"
ALIOTH_URL="https://anonscm.debian.org/cgit"
ALIOTH_GROUP="debian-science/packages"
SALSA_URL="https://salsa.debian.org/api/v4"
SALSA_NAMESPACE="2136"
SALSA_TOKEN="YOURTOKEN"
curl -f "$SALSA_URL/projects?private_token=$SALSA_TOKEN" \
--data
"path=$PROJECT&namespace_id=$SALSA_NAMESPACE&description=$DESCRIPTION&import_url=$ALIOTH_URL/$ALIOTH_GROUP/$PROJECT&visibility=public"
=====================
I tried the script you provided, but it failed, running it from the packages
directory on alioth (debian-science):
lopippo@moszumanska:/git/debian-science/packages$ sh cb2bib-salsa-import.sh
+ PROJECT=cb2bib.git
+ DESCRIPTION=Packaging the cb2bib scientific bibliography managing software
+ ALIOTH_URL=https://anonscm.debian.org/cgit
+ ALIOTH_GROUP=debian-science/packages
+ SALSA_URL=https://salsa.debian.org/api/v4
+ SALSA_NAMESPACE=2136
+ SALSA_TOKEN=<secret>
+ curl -f https://salsa.debian.org/api/v4/projects?private_token=<secret> --data path=cb2bib.git&namespace_id=2136&description=Packaging the cb2bib scientific bibliography managing software&import_url=https://anonscm.debian.org/cgit/debian-science/packages/cb2bib.git&visibility=public
curl: (22) The requested URL returned error: 400
I tried to check that the alioth url was fine, and in effect it is ok.
I tried to check that the salsa url was fine by curl'ing this
curl -f https://salsa.debian.org/api/v4/projects?private_token=<secret>
I got a blow of text.
Then I tried adding some more to the tested url and at that point it failed.
lopippo@moszumanska:/git/debian-science/packages$ curl -f https://salsa.debian.org/api/v4/projects?private_token=sEmk1WykGK7xwDm7BuKb --data path=cb2bib.git&namespace_id=2136
[1] 6413
lopippo@moszumanska:/git/debian-science/packages$ curl: (22) The requested URL returned error: 400
So I decided to check that the SALSA_NAMESPACE=2136 was correct:
curl https://salsa.debian.org/api/v4/groups | jq . | grep 2136 -C5
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7668 100 7668 0 0 7668 0
0:00:01 --:--:-- 0:00:01 12591
Nothing happened.
With a correct team id:
(ins)rusconi@roma:~$ curl https://salsa.debian.org/api/v4/groups | jq . | grep 2008 -C5
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7668 100 7668 0 0 7668 0 0:00:01 --:--:-- 0:00:01 12570
"full_name": "Cloud Team",
"full_path": "cloud-team",
"parent_id": null
},
{
"id": 2008,
"name": "DebConf team",
"path": "debconf-team",
"description": "",
"visibility": "public",
"lfs_enabled": true,
So, apparently, salsa.d.o does not know of debian-science nor does it know of its
identifier (2136). What can we do to fix this ?
Thank you for your help,
Filippo
--
⢀⣴⠾⠻⢶⣦⠀ Filippo Rusconi, PhD
⣾⠁⢰⠒⠀⣿⡁ public crypto key B053 304E 17D6 D419 DD9B 4651 41AB 484D 7694 CF42 @ pgp.mit.edu
⢿⡄⠘⠷⠚⠋
⠈⠳⣄⠀⠀⠀⠀
Reply to: