1SALSA(1)                                                              SALSA(1)
2
3
4

NAME

6       salsa - tool to manipulate salsa repositories and group members
7

SYNOPSIS

9         # salsa <command> <args>
10         salsa whoami
11         salsa search_project devscripts
12         salsa search_project qa/qa
13         salsa search_group js-team
14         salsa search_group perl-team/modules
15         salsa search_user yadd
16         salsa push_repo . --group js-team --kgb --irc devscripts --tagpending
17         salsa update_repo node-mongodb --group js-team --disable-kgb --desc \
18               --desc-pattern "Package %p"
19         salsa update_repo js-team/node-mongodb --kgb --irc debian-js
20         salsa update_safe --all --desc --desc-pattern "Debian package %p" \
21               --group js-team
22         salsa checkout node-mongodb --group js-team
23         salsa checkout js-team/node-mongodb
24         salsa add_user developer foobar --group-id 2665
25         salsa update_user maintainer foobar --group js-team
26         salsa del_user foobar --group js-team
27

DESCRIPTION

29       salsa is a designed to create and configure repositories on
30       <https://salsa.debian.org> and manage users of groups.
31
32       A Salsa token is required, except for search* commands, and must be set
33       in command line (see below), or in your configuration file
34       (~/.devscripts):
35
36         SALSA_TOKEN=abcdefghi
37
38       or
39
40         SALSA_TOKEN=`cat ~/.token`
41
42       or
43
44         SALSA_TOKEN_FILE=~/.dpt.conf
45
46       If you choose to link another file using SALSA_TOKEN_FILE, it must
47       contain a line with one of (no differences):
48
49         <anything>SALSA_PRIVATE_TOKEN=xxxx
50         <anything>SALSA_TOKEN=xxxx
51
52       This allows for example to use dpt(1) configuration file (~/.dpt.conf)
53       which contains:
54
55         DPT_SALSA_PRIVATE_TOKEN=abcdefghi
56

COMMANDS

58   Managing users and groups
59       add_user
60           Add a user to a group.
61
62             salsa --group js-group add_user guest foouser
63             salsa --group-id 1234 add_user guest foouser
64             salsa --group-id 1234 add_user maintainer 1245
65
66           First argument is the GitLab's access levels: guest, reporter,
67           developer, maintainer, owner.
68
69       del_user
70           Remove a user from a group
71
72             salsa --group js-team del_user foouser
73             salsa --group-id=1234 del_user foouser
74
75       list_groups
76           List sub groups of current one if group is set, groups of current
77           user else.
78
79       group
80           Show group members.
81
82             salsa --group js-team group
83             salsa --group-id 1234 group
84
85       search_group
86           Search for a group using given string. Shows group id and other
87           information.
88
89             salsa search_group perl-team
90             salsa search_group perl-team/modules
91             salsa search_group 2666
92
93       search_user
94           Search for a user using given string. Shows user id and other
95           information.
96
97             salsa search_user yadd
98
99       update_user
100           Update user role in a group.
101
102             salsa --group-id 1234 update_user guest foouser
103             salsa --group js-team update_user maintainer 1245
104
105           First argument is the GitLab's access levels: guest, reporter,
106           developer, maintainer, owner.
107
108       whoami
109           Gives information on the token owner
110
111             salsa whoami
112
113   Managing repositories
114       One of "--group", "--group-id", "--user" or "--user-id" is required to
115       manage repositories. If both are set, salsa warns and only
116       "--user"/"--user-id" is used. If none is given, salsa uses current user
117       id (token owner).
118
119       check_repo
120           Verify that repo(s) are well configured. It works exactly like
121           update_repo except that it does not modify anything but just lists
122           projects not well configured with found errors.
123
124             salsa --user yadd --tagpending --kgb --irc=devscripts check_repo test
125             salsa --group js-team check_repo --all
126             salsa --group js-team --rename-head check_repo test1 test2 test3
127
128       checkout or co
129           Clone repo in current dir. If directory already exists, update
130           local repo.
131
132             salsa --user yadd co devscripts
133             salsa --group js-team co node-mongodb
134             salsa co js-team/node-mongodb
135
136       create_repo
137           Create public empty project. If "--group"/"--group-id" is set,
138           project is created in group directory, else in user directory.
139
140             salsa --user yadd create_repo test
141             salsa --group js-team --kgb --irc-channel=devscripts create_repo test
142
143       del_repo
144           Delete a repository.
145
146       fork
147           Forks a project in group/user repository and set "upstream" to
148           original project. Example:
149
150             $ salsa fork js-team/node-mongodb --verbose
151             ...
152             salsa.pl info: node-mongodb ready in node-mongodb/
153             $ cd node-mongodb
154             $ git remote --verbose show
155             origin          git@salsa.debian.org:me/node-mongodb (fetch)
156             origin          git@salsa.debian.org:me/node-mongodb (push)
157             upstream        git@salsa.debian.org:js-team/node-mongodb (fetch)
158             upstream        git@salsa.debian.org:js-team/node-mongodb (push)
159
160           For a group:
161
162             salsa fork --group js-team user/node-foo
163
164       forks
165           List forks of project(s).
166
167             salsa forks qa/qa debian/devscripts
168
169           Project can be set using full path or using --group/--group-id or
170           --user/--user-id, else it is searched in current user namespace.
171
172       ls or list_repos
173           Shows projects owned by user or group. If second argument exists,
174           search only matching projects
175
176             salsa --group js-team list_repos
177             salsa --user yadd list_repos foo*
178
179       merge_request, mr
180           Creates a merge request.
181
182           Suppose you created a fork using salsa fork, modify some things in
183           a new branch using one commit and want to propose it to original
184           project (branch "master"). You just have to launch this in source
185           directory:
186
187             salsa mr
188
189           Other example:
190
191             salsa mr --mr-dst-project debian/foo --mr-dst-branch debian/master
192
193           or simply
194
195             salsa mr debian/foo debian/master
196
197           Note that unless destination project has been set using command
198           line, salsa merge_request will search it in the following order:
199
200           using GitLab API: salsa will detect from where this project was
201           forked
202           using "upstream" origin
203           else salsa will use source project as destination project
204
205           To force salsa to use source project as destination project, you
206           can use "same":
207
208             salsa mr --mr-dst-project same
209             # or
210             salsa mr same
211
212           New merge request will be created using last commit title and
213           description.
214
215           See --mr-* options for more.
216
217       merge_requests, mrs
218           List opened merge requests for project(s)
219
220             salsa mrs qa/qa debian/devscripts
221
222           Project can be set using full path or using --group/--group-id or
223           --user/--user-id, else it is searched in current user namespace.
224
225       protect_branch
226           Protect/unprotect a branch.
227
228           Set protection
229                 #                                    project      branch merge push
230                 salsa --group js-team protect_branch node-mongodb master m     d
231
232               "merge" and "push" can be one of:
233
234               o, owner: owner only
235               m, maintainer: o + maintainers allowed
236               d, developer: m + developers allowed
237               r, reporter: d + reporters allowed
238               g, guest: r + guest allowed
239           Unprotect
240                 salsa --group js-team protect_branch node-mongodb master no
241
242       protected_branches
243           List protected branches
244
245             salsa --group js-team protected_branches node-mongodb
246
247       push_repo
248           Create a new project from a local Debian source directory
249           configured with git.
250
251           push_repo executes the following steps:
252
253           gets project name using debian/changelog file;
254           launches git remote add upstream ...;
255           launches create_repo;
256           pushes local repo.
257
258           Examples:
259
260             salsa --user yadd push_repo ./test
261             salsa --group js-team --kgb --irc-channel=devscripts push_repo .
262
263       rename_branch
264           Rename branch given in --source-branch with name given in
265           --dest-branch.  You can use --no-fail and --all options here.
266
267       search, search_project, search_repo
268           Search for a project using given string. Shows name, owner id and
269           other information.
270
271             salsa search devscripts
272             salsa search debian/devscripts
273             salsa search 18475
274
275       update_repo
276           Configure repo(s) using parameters given to command line.  A repo
277           name has to be given unless --all is set. Prefer to use
278           update_safe.
279
280             salsa --user yadd --tagpending --kgb --irc=devscripts update_repo test
281             salsa --group js-team update_repo --all
282             salsa --group js-team --rename-head update_repo test1 test2 test3
283             salsa update_repo js-team/node-mongodb --kgb --irc debian-js
284
285           By default when using --all, salsa will fail on first error. If you
286           want to continue, set --no-fail. In this case, salsa will display a
287           warning for each project that has fail but continue with next
288           project. Then to see full errors, set --verbose.
289
290       update_safe
291           Launch check_repo and ask before launching update_repo (unless
292           --yes).
293
294             salsa --user yadd --tagpending --kgb --irc=devscripts update_safe test
295             salsa --group js-team update_safe --all
296             salsa --group js-team --rename-head update_safe test1 test2 test3
297             salsa update_safe js-team/node-mongodb --kgb --irc debian-js
298
299   Other
300       purge_cache
301           Empty local cache.
302

OPTIONS

304   General options
305       -C, --chdir
306           Change directory before launching command
307
308             salsa -C ~/debian co debian/libapache2-mod-fcgid
309
310       --cache-file
311           File to store cached values. Default to ~/.cache/salsa.json. An
312           empty value disables cache.
313
314           ".devscripts" value: SALSA_CACHE_FILE
315
316       --no-cache
317           Disable cache usage. Same as --cache-file ''
318
319       --conffile, --conf-file
320           Add or replace default configuration files ("/etc/devscripts.conf"
321           and "~/.devscripts"). This can only be used as the first option
322           given on the command-line.
323
324           replace:
325                 salsa --conf-file test.conf <command>...
326                 salsa --conf-file test.conf --conf-file test2.conf  <command>...
327
328           add:
329                 salsa --conf-file +test.conf <command>...
330                 salsa --conf-file +test.conf --conf-file +test2.conf  <command>...
331
332               If one --conf-file has no "+", default configuration files are
333               ignored.
334
335       --no-conf, --noconf
336           Don't read any configuration files. This can only be used as the
337           first option given on the command-line.
338
339       --debug
340           Enable debugging output
341
342       --group
343           Team to use. Use "salsa search_group name" to find it.
344
345           ".devscripts" value: SALSA_GROUP
346
347           Be careful when you use SALSA_GROUP in your ".devscripts" file.
348           Every salsa command will be executed in group space, for example if
349           you want to propose a little change in a project using salsa fork +
350           salsa mr, this "fork" will be done in group space unless you set a
351           --user/--user-id.  Prefer to use an alias in your ".bashrc" file.
352           Example:
353
354             alias jsteam_admin="salsa --group js-team"
355
356           or
357
358             alias jsteam_admin="salsa --conf-file ~/.js.conf
359
360           then you can fix SALSA_GROUP in "~/.js.conf"
361
362       --group-id
363           Group id to use. Use "salsa search_group name" to find it.
364
365           ".devscripts" value: SALSA_GROUP_ID
366
367           Be careful when you use SALSA_GROUP_ID in your ".devscripts" file.
368           Every salsa command will be executed in group space, for example if
369           you want to propose a little change in a project using salsa fork +
370           salsa mr, this "fork" will be done in group space unless you set a
371           --user/--user-id.  Prefer to use an alias in your ".bashrc" file.
372           Example:
373
374             alias jsteam_admin="salsa --group-id 2666"
375
376           or
377
378             alias jsteam_admin="salsa --conf-file ~/.js.conf
379
380           then you can fix SALSA_GROUP_ID in "~/.js.conf"
381
382       --help: displays this manpage
383       -i, --info
384           Prompt before sensible changes.
385
386           ".devscripts" value: SALSA_INFO (yes/no)
387
388       --path
389           Repo path. Default to group or user path.
390
391           ".devscripts" value: SALSA_REPO_PATH
392
393       --token
394           Token value (see above).
395
396       --token-file
397           File to find token (see above).
398
399       --user
400           Username to use. If neither --group, --group-id, --user or
401           --user-id is set, salsa uses current user id (corresponding to
402           salsa private token).
403
404       --user-id
405           User id to use. Use "salsa search_user name" to find one. If
406           neither --group, --group-id, --user or --user-id is set, salsa uses
407           current user id (corresponding to salsa private token).
408
409           ".devscripts" value: SALSA_USER_ID
410
411       --verbose
412           Enable verbose output.
413
414       --yes
415           Never ask for consent.
416
417           ".devscripts" value: SALSA_YES (yes/no)
418
419   Update/create repo options
420       --all
421           When set, all project of group/user are affected by command.
422
423           --skip: ignore project with --all. Example:
424                 salsa update_repo --tagpending --all --skip qa --skip devscripts
425
426               ".devscripts" value: SALSA_SKIP. To set multiples values, use
427               spaces.  Example
428
429                 SALSA_SKIP=qa devscripts
430
431           --skip-file: ignore projects in this file (1 project per line)
432                 salsa update_repo --tagpending --all --skip-file ~/.skip
433
434               ".devscripts" value: SALSA_SKIP_FILE
435
436       --ci-config-path
437           Configure configuration file path of GitLab CI. Default: empty.
438           Example:
439
440             salsa update_safe --ci-config-path debian/.gitlab-ci.yml debian/devscripts
441
442           ".devscripts" value: SALSA_CI_CONFIG_PATH
443
444       --desc --no-desc
445           Configure repo description using pattern given in desc-pattern
446
447           ".devscripts" value: SALSA_DESC (yes/no)
448
449       --desc-pattern
450           Repo description pattern. Default to "Debian package %p". "%p" is
451           replaced by repo name, while "%P" is replaced by repo name given in
452           command (may contains full path).
453
454           ".devscripts" value: SALSA_DESC_PATTERN
455
456       --email, --no-email, --disable-email
457           Enable, ignore or disable email-on-push.
458
459           ".devscripts" value: SALSA_EMAIL (yes/ignore/no, default: ignore)
460
461       --email-recipient
462           Email-on-push recipient. Can be multi valued:
463
464             $ salsa update_safe myrepo \
465                   --email-recipient foo@foobar.org \
466                   --email-recipient bar@foobar.org
467
468           If recipient value contains "%p", it is replaced by project name.
469
470           ".devscripts" value: SALSA_EMAIL_RECIPIENTS (use spaces to separate
471           multiples recipients)
472
473       --enable-issues, --no-enable-issues, --disable-issues,
474       --no-disable-issues
475           Enable, ignore or disable issues.
476
477           ".devscripts" values: SALSA_ENABLE_ISSUES (yes/ignore/no, default:
478           ignore)
479
480       --enable-mr, --no-enable-mr, --disable-mr, --no-disable-mr
481           Enable, ignore or disable merge requests.
482
483           ".devscripts" values: SALSA_ENABLE_MR (yes/ignore/no, default:
484           ignore)
485
486       --irc-channel
487           IRC channel for KGB or Irker. Can be used more than one time only
488           with --irker.
489
490           Important: channel must not include the first "#". If salsa finds a
491           channel starting with "#", it will consider that the channel starts
492           with 2 "#"!
493
494           ".devscript" value: SALSA_IRC_CHANNEL.
495
496           Multiple values must be space separated.
497
498           Since configuration files are read using sh, be careful when using
499           "#": you must enclose the channel with quotes, else sh will
500           consider it as a comment and will ignore this value.
501
502       --irker, --no-irker, --disable-irker
503           Enable, ignore or disable Irker service
504
505           ".devscripts" values: SALSA_IRKER (yes/ignore/no, default: ignore)
506
507       --irker-host
508           Irker host. Default: ruprecht.snow-crash.org
509
510           ".devscripts" value: SALSA_IRKER_HOST
511
512       --irker-port
513           Irker port. Default: empty (default value)
514
515           ".devscripts" value: SALSA_IRKER_PORT
516
517       --kgb, --no-kgb, --disable-kgb
518           Enable, ignore or disable KGB webhook.
519
520           ".devscripts" value: SALSA_KGB (yes/ignore/no, default: ignore)
521
522       --no-fail
523           Don't stop on error when using update_repo with --all.
524
525           ".devscripts" value: SALSA_NO_FAIL (yes/no)
526
527       --rename-head, --no-rename-head
528           Rename HEAD branch given by --source-branch into --dest-branch and
529           change "default branch" of project. Works only with update_repo.
530
531           ".devscripts" value: SALSA_RENAME_HEAD (yes/no)
532
533           --source-branch: default "master"
534               ".devscripts" value: SALSA_SOURCE_BRANCH
535
536           --dest-branch: default "debian/master"
537               ".devscripts" value: SALSA_DEST_BRANCH
538
539       --tagpending, --no-tagpending, --disable-tagpending
540           Enable, ignore or disable "tagpending" webhook.
541
542           ".devscripts" value: SALSA_TAGPENDING (yes/ignore/no, default:
543           ignore)
544
545   Merge requests options
546       --mr-title
547           Title for merge request. Default: last commit title.
548
549       --mr-desc
550           Description of new MR. Default:
551
552           empty if --mr-title is set
553           last commit description if any
554       --mr-dst-branch (or second command line argument)
555           Destination branch. Default to "master".
556
557       --mr-dst-project (or first command line argument)
558           Destination project. Default: project from which the current
559           project was forked; or, if not found, "upstream" value found using
560           git remote --verbose show; or using source project.
561
562           If --mr-dst-project is set to same, salsa will use source project
563           as destination.
564
565       --mr-src-branch
566           Source branch. Default: current branch.
567
568       --mr-src-project
569           Source project. Default: current project found using git remote
570           --verbose show.
571
572       --mr-allow-squash, --no-mr-allow-squash
573           Allow upstream project to squash your commits, this is the default.
574
575           ".devscripts" value: SALSA_MR_ALLOW_SQUASH (yes/no)
576
577       --mr-remove-source-branch, --no-mr-remove-source-branch
578           Remove source branch if merge request is accepted. Default: no.
579
580           ".devscripts" value: SALSA_MR_REMOVE_SOURCE_BRANCH (yes/no)
581
582   Options to manage other Gitlab instances
583       --api-url
584           GitLab API. Default: <https://salsa.debian.org/api/v4>.
585
586           ".devscripts" value: SALSA_API_URL
587
588       --git-server-url
589           Default to "git@salsa.debian.org:"
590
591           ".devscripts" value: SALSA_GIT_SERVER_URL
592
593       --irker-server-url
594           Default to "ircs://irc.oftc.net:6697/"
595
596           ".devscripts" value: SALSA_IRKER_SERVER_URL
597
598       --kgb-server-url
599           Default to <http://kgb.debian.net:9418/webhook/?channel=>
600
601           ".devscripts" value: SALSA_KGB_SERVER_URL
602
603       --tagpending-server-url
604           Default to <https://webhook.salsa.debian.org/tagpending/>
605
606           ".devscripts" value: SALSA_TAGPENDING_SERVER_URL
607
608       Configuration file example
609
610       Example to use salsa with <https://gitlab.ow2.org> (group "lemonldap-
611       ng"):
612
613         SALSA_TOKEN=`cat ~/.ow2-gitlab-token`
614         SALSA_API_URL=https://gitlab.ow2.org/api/v4
615         SALSA_GIT_SERVER_URL=git@gitlab.ow2.org:
616         SALSA_GROUP_ID=34
617
618       Then to use it, add something like this in your ".bashrc" file:
619
620         alias llng_admin='salsa --conffile ~/.salsa-ow2.conf'
621

SEE ALSO

623       dpt-salsa
624

AUTHOR

626       Xavier Guimard <yadd@debian.org>
627
629       Copyright (C) 2018, Xavier Guimard <yadd@debian.org>
630
631       It contains code formely found in dpt-salsa (pkg-perl-tools) copyright
632       2018, gregor herrmann <gregoa@debian.org>.
633
634       This library is free software; you can redistribute it and/or modify it
635       under the terms of the GNU General Public License as published by the
636       Free Software Foundation; either version 2, or (at your option) any
637       later version.
638
639       This program is distributed in the hope that it will be useful, but
640       WITHOUT ANY WARRANTY; without even the implied warranty of
641       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
642       General Public License for more details.
643
644       You should have received a copy of the GNU General Public License along
645       with this program.  If not, see <http://www.gnu.org/licenses/>.
646
647
648
649Debian Utilities                  2019-02-18                          SALSA(1)
Impressum