1SALSA(1) SALSA(1)
2
3
4
6 salsa - tool to manipulate salsa repositories and group members
7
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
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
58 Managing users and groups
59 join
60 Request access to a group.
61
62 salsa join js-team
63 salsa join --group js-team
64 salsa join --group-id 1234
65
66 add_user
67 Add a user to a group.
68
69 salsa --group js-group add_user guest foouser
70 salsa --group-id 1234 add_user guest foouser
71 salsa --group-id 1234 add_user maintainer 1245
72
73 First argument is the GitLab's access levels: guest, reporter,
74 developer, maintainer, owner.
75
76 del_user
77 Remove a user from a group
78
79 salsa --group js-team del_user foouser
80 salsa --group-id=1234 del_user foouser
81
82 list_groups
83 List sub groups of current one if group is set, groups of current
84 user else.
85
86 group
87 Show group members.
88
89 salsa --group js-team group
90 salsa --group-id 1234 group
91
92 search_group
93 Search for a group using given string. Shows group id and other
94 information.
95
96 salsa search_group perl-team
97 salsa search_group perl-team/modules
98 salsa search_group 2666
99
100 search_user
101 Search for a user using given string. Shows user id and other
102 information.
103
104 salsa search_user yadd
105
106 update_user
107 Update user role in a group.
108
109 salsa --group-id 1234 update_user guest foouser
110 salsa --group js-team update_user maintainer 1245
111
112 First argument is the GitLab's access levels: guest, reporter,
113 developer, maintainer, owner.
114
115 whoami
116 Gives information on the token owner
117
118 salsa whoami
119
120 Managing repositories
121 One of "--group", "--group-id", "--user" or "--user-id" is required to
122 manage repositories. If both are set, salsa warns and only
123 "--user"/"--user-id" is used. If none is given, salsa uses current user
124 id (token owner).
125
126 check_repo
127 Verify that repo(s) are well configured. It works exactly like
128 update_repo except that it does not modify anything but just lists
129 projects not well configured with found errors.
130
131 salsa --user yadd --tagpending --kgb --irc=devscripts check_repo test
132 salsa --group js-team check_repo --all
133 salsa --group js-team --rename-head check_repo test1 test2 test3
134
135 checkout or co
136 Clone repo in current dir. If directory already exists, update
137 local repo.
138
139 salsa --user yadd co devscripts
140 salsa --group js-team co node-mongodb
141 salsa co js-team/node-mongodb
142
143 You can clone more than one repository or all repositories of a
144 group or a user:
145
146 salsa --user yadd co devscripts autodep8
147 salsa co yadd/devscripts js-team/npm
148 salsa --group js-team co --all # All js-team repos
149 salsa co --all # All your repos
150
151 create_repo
152 Create public empty project. If "--group"/"--group-id" is set,
153 project is created in group directory, else in user directory.
154
155 salsa --user yadd create_repo test
156 salsa --group js-team --kgb --irc-channel=devscripts create_repo test
157
158 del_repo
159 Delete a repository.
160
161 fork
162 Forks a project in group/user repository and set "upstream" to
163 original project. Example:
164
165 $ salsa fork js-team/node-mongodb --verbose
166 ...
167 salsa.pl info: node-mongodb ready in node-mongodb/
168 $ cd node-mongodb
169 $ git remote --verbose show
170 origin git@salsa.debian.org:me/node-mongodb (fetch)
171 origin git@salsa.debian.org:me/node-mongodb (push)
172 upstream git@salsa.debian.org:js-team/node-mongodb (fetch)
173 upstream git@salsa.debian.org:js-team/node-mongodb (push)
174
175 For a group:
176
177 salsa fork --group js-team user/node-foo
178
179 forks
180 List forks of project(s).
181
182 salsa forks qa/qa debian/devscripts
183
184 Project can be set using full path or using --group/--group-id or
185 --user/--user-id, else it is searched in current user namespace.
186
187 push
188 Push relevant packaging refs to origin Git remote. To be run from
189 packaging working directory.
190
191 salsa push
192
193 It pushes the following refs to the configured remote for the
194 debian-branch or, falling back, to the "origin" remote:
195
196 "master" branch (or whatever is set to debian-branch in gbp.conf)
197 "upstream" branch (or whatever is set to upstream-branch in
198 gbp.conf)
199 "pristine-tar" branch
200 tags named "debian/*" (or whatever is set to debian-tag in
201 gbp.conf)
202 tags named "upstream/*" (or whatever is set to upstream-tag in
203 gbp.conf)
204 all tags, if the package's source format is "3.0 (native)"
205 ls or list_repos
206 Shows projects owned by user or group. If second argument exists,
207 search only matching projects
208
209 salsa --group js-team list_repos
210 salsa --user yadd list_repos foo*
211
212 merge_request, mr
213 Creates a merge request.
214
215 Suppose you created a fork using salsa fork, modify some things in
216 a new branch using one commit and want to propose it to original
217 project (branch "master"). You just have to launch this in source
218 directory:
219
220 salsa mr
221
222 Other example:
223
224 salsa mr --mr-dst-project debian/foo --mr-dst-branch debian/master
225
226 or simply
227
228 salsa mr debian/foo debian/master
229
230 Note that unless destination project has been set using command
231 line, salsa merge_request will search it in the following order:
232
233 using GitLab API: salsa will detect from where this project was
234 forked
235 using "upstream" origin
236 else salsa will use source project as destination project
237
238 To force salsa to use source project as destination project, you
239 can use "same":
240
241 salsa mr --mr-dst-project same
242 # or
243 salsa mr same
244
245 New merge request will be created using last commit title and
246 description.
247
248 See --mr-* options for more.
249
250 merge_requests, mrs
251 List opened merge requests for project(s)
252
253 salsa mrs qa/qa debian/devscripts
254
255 Project can be set using full path or using --group/--group-id or
256 --user/--user-id, else it is searched in current user namespace.
257
258 protect_branch
259 Protect/unprotect a branch.
260
261 Set protection
262 # project branch merge push
263 salsa --group js-team protect_branch node-mongodb master m d
264
265 "merge" and "push" can be one of:
266
267 o, owner: owner only
268 m, maintainer: o + maintainers allowed
269 d, developer: m + developers allowed
270 r, reporter: d + reporters allowed
271 g, guest: r + guest allowed
272 Unprotect
273 salsa --group js-team protect_branch node-mongodb master no
274
275 protected_branches
276 List protected branches
277
278 salsa --group js-team protected_branches node-mongodb
279
280 push_repo
281 Create a new project from a local Debian source directory
282 configured with git.
283
284 push_repo executes the following steps:
285
286 gets project name using debian/changelog file;
287 launches git remote add upstream ...;
288 launches create_repo;
289 pushes local repo.
290
291 Examples:
292
293 salsa --user yadd push_repo ./test
294 salsa --group js-team --kgb --irc-channel=devscripts push_repo .
295
296 rename_branch
297 Rename branch given in --source-branch with name given in
298 --dest-branch. You can use --no-fail and --all options here.
299
300 search, search_project, search_repo
301 Search for a project using given string. Shows name, owner id and
302 other information.
303
304 salsa search devscripts
305 salsa search debian/devscripts
306 salsa search 18475
307
308 update_repo
309 Configure repo(s) using parameters given to command line. A repo
310 name has to be given unless --all is set. Prefer to use
311 update_safe.
312
313 salsa --user yadd --tagpending --kgb --irc=devscripts update_repo test
314 salsa --group js-team update_repo --all
315 salsa --group js-team --rename-head update_repo test1 test2 test3
316 salsa update_repo js-team/node-mongodb --kgb --irc debian-js
317
318 By default when using --all, salsa will fail on first error. If you
319 want to continue, set --no-fail. In this case, salsa will display a
320 warning for each project that has fail but continue with next
321 project. Then to see full errors, set --verbose.
322
323 update_safe
324 Launch check_repo and ask before launching update_repo (unless
325 --yes).
326
327 salsa --user yadd --tagpending --kgb --irc=devscripts update_safe test
328 salsa --group js-team update_safe --all
329 salsa --group js-team --rename-head update_safe test1 test2 test3
330 salsa update_safe js-team/node-mongodb --kgb --irc debian-js
331
332 Other
333 purge_cache
334 Empty local cache.
335
337 General options
338 -C, --chdir
339 Change directory before launching command
340
341 salsa -C ~/debian co debian/libapache2-mod-fcgid
342
343 --cache-file
344 File to store cached values. Default to ~/.cache/salsa.json. An
345 empty value disables cache.
346
347 ".devscripts" value: SALSA_CACHE_FILE
348
349 --no-cache
350 Disable cache usage. Same as --cache-file ''
351
352 --conffile, --conf-file
353 Add or replace default configuration files ("/etc/devscripts.conf"
354 and "~/.devscripts"). This can only be used as the first option
355 given on the command-line.
356
357 replace:
358 salsa --conf-file test.conf <command>...
359 salsa --conf-file test.conf --conf-file test2.conf <command>...
360
361 add:
362 salsa --conf-file +test.conf <command>...
363 salsa --conf-file +test.conf --conf-file +test2.conf <command>...
364
365 If one --conf-file has no "+", default configuration files are
366 ignored.
367
368 --no-conf, --noconf
369 Don't read any configuration files. This can only be used as the
370 first option given on the command-line.
371
372 --debug
373 Enable debugging output
374
375 --group
376 Team to use. Use "salsa search_group name" to find it.
377
378 If you want to use a subgroup, you have to set its full path:
379
380 salsa --group perl-team/modules/packages check_repo lemonldap-ng
381
382 ".devscripts" value: SALSA_GROUP
383
384 Be careful when you use SALSA_GROUP in your ".devscripts" file.
385 Every salsa command will be executed in group space, for example if
386 you want to propose a little change in a project using salsa fork +
387 salsa mr, this "fork" will be done in group space unless you set a
388 --user/--user-id. Prefer to use an alias in your ".bashrc" file.
389 Example:
390
391 alias jsteam_admin="salsa --group js-team"
392
393 or
394
395 alias jsteam_admin="salsa --conf-file ~/.js.conf
396
397 or to use both .devscripts and .js.conf:
398
399 alias jsteam_admin="salsa --conf-file +~/.js.conf
400
401 then you can fix SALSA_GROUP in "~/.js.conf"
402
403 To enable bash completion for your alias, add this in your .bashrc
404 file:
405
406 _completion_loader salsa
407 complete -F _salsa_completion jsteam_admin
408
409 --group-id
410 Group id to use. Use "salsa search_group name" to find it.
411
412 ".devscripts" value: SALSA_GROUP_ID
413
414 Be careful when you use SALSA_GROUP_ID in your ".devscripts" file.
415 Every salsa command will be executed in group space, for example if
416 you want to propose a little change in a project using salsa fork +
417 salsa mr, this "fork" will be done in group space unless you set a
418 --user/--user-id. Prefer to use an alias in your ".bashrc" file.
419 Example:
420
421 alias jsteam_admin="salsa --group-id 2666"
422
423 or
424
425 alias jsteam_admin="salsa --conf-file ~/.js.conf
426
427 then you can fix SALSA_GROUP_ID in "~/.js.conf"
428
429 --help: displays this manpage
430 -i, --info
431 Prompt before sensible changes.
432
433 ".devscripts" value: SALSA_INFO (yes/no)
434
435 --path
436 Repo path. Default to group or user path.
437
438 ".devscripts" value: SALSA_REPO_PATH
439
440 --token
441 Token value (see above).
442
443 --token-file
444 File to find token (see above).
445
446 --user
447 Username to use. If neither --group, --group-id, --user or
448 --user-id is set, salsa uses current user id (corresponding to
449 salsa private token).
450
451 --user-id
452 User id to use. Use "salsa search_user name" to find one. If
453 neither --group, --group-id, --user or --user-id is set, salsa uses
454 current user id (corresponding to salsa private token).
455
456 ".devscripts" value: SALSA_USER_ID
457
458 --verbose
459 Enable verbose output.
460
461 --yes
462 Never ask for consent.
463
464 ".devscripts" value: SALSA_YES (yes/no)
465
466 Update/create repo options
467 --all
468 When set, all project of group/user are affected by command.
469
470 --skip: ignore project with --all. Example:
471 salsa update_repo --tagpending --all --skip qa --skip devscripts
472
473 ".devscripts" value: SALSA_SKIP. To set multiples values, use
474 spaces. Example
475
476 SALSA_SKIP=qa devscripts
477
478 --skip-file: ignore projects in this file (1 project per line)
479 salsa update_repo --tagpending --all --skip-file ~/.skip
480
481 ".devscripts" value: SALSA_SKIP_FILE
482
483 --ci-config-path
484 Configure configuration file path of GitLab CI. Default: empty.
485 Example:
486
487 salsa update_safe --ci-config-path debian/.gitlab-ci.yml debian/devscripts
488
489 ".devscripts" value: SALSA_CI_CONFIG_PATH
490
491 --desc --no-desc
492 Configure repo description using pattern given in desc-pattern
493
494 ".devscripts" value: SALSA_DESC (yes/no)
495
496 --desc-pattern
497 Repo description pattern. Default to "Debian package %p". "%p" is
498 replaced by repo name, while "%P" is replaced by repo name given in
499 command (may contains full path).
500
501 ".devscripts" value: SALSA_DESC_PATTERN
502
503 --email, --no-email, --disable-email
504 Enable, ignore or disable email-on-push.
505
506 ".devscripts" value: SALSA_EMAIL (yes/ignore/no, default: ignore)
507
508 --email-recipient
509 Email-on-push recipient. Can be multi valued:
510
511 $ salsa update_safe myrepo \
512 --email-recipient foo@foobar.org \
513 --email-recipient bar@foobar.org
514
515 If recipient value contains "%p", it is replaced by project name.
516
517 ".devscripts" value: SALSA_EMAIL_RECIPIENTS (use spaces to separate
518 multiples recipients)
519
520 --enable-issues, --no-enable-issues, --disable-issues,
521 --no-disable-issues
522 Enable, ignore or disable issues.
523
524 ".devscripts" values: SALSA_ENABLE_ISSUES (yes/ignore/no, default:
525 ignore)
526
527 --enable-mr, --no-enable-mr, --disable-mr, --no-disable-mr
528 Enable, ignore or disable merge requests.
529
530 ".devscripts" values: SALSA_ENABLE_MR (yes/ignore/no, default:
531 ignore)
532
533 --irc-channel
534 IRC channel for KGB or Irker. Can be used more than one time only
535 with --irker.
536
537 Important: channel must not include the first "#". If salsa finds a
538 channel starting with "#", it will consider that the channel starts
539 with 2 "#"!
540
541 ".devscript" value: SALSA_IRC_CHANNEL.
542
543 Multiple values must be space separated.
544
545 Since configuration files are read using sh, be careful when using
546 "#": you must enclose the channel with quotes, else sh will
547 consider it as a comment and will ignore this value.
548
549 --irker, --no-irker, --disable-irker
550 Enable, ignore or disable Irker service
551
552 ".devscripts" values: SALSA_IRKER (yes/ignore/no, default: ignore)
553
554 --irker-host
555 Irker host. Default: ruprecht.snow-crash.org
556
557 ".devscripts" value: SALSA_IRKER_HOST
558
559 --irker-port
560 Irker port. Default: empty (default value)
561
562 ".devscripts" value: SALSA_IRKER_PORT
563
564 --kgb, --no-kgb, --disable-kgb
565 Enable, ignore or disable KGB webhook.
566
567 ".devscripts" value: SALSA_KGB (yes/ignore/no, default: ignore)
568
569 --kgb-options
570 List of KGB enabled options (comma separated). Default:
571 issues_events, merge_requests_events, note_events, pipeline_events,
572 push_events, tag_push_events, wiki_page_events,
573 enable_ssl_verification
574
575 $ salsa update_safe debian/devscripts --kgb --irc-channel devscripts \
576 --kgb-options 'merge_requests_events,issues_events,enable_ssl_verification'
577
578 List of available options: confidential_comments_events,
579 confidential_issues_events, confidential_note_events,
580 enable_ssl_verification, issues_events, job_events,
581 merge_requests_events, note_events, pipeline_events,
582 tag_push_events, wiki_page_events
583
584 ".devscripts" value: SALSA_KGB_OPTIONS
585
586 --no-fail
587 Don't stop on error when using update_repo with --all.
588
589 ".devscripts" value: SALSA_NO_FAIL (yes/no)
590
591 --rename-head, --no-rename-head
592 Rename HEAD branch given by --source-branch into --dest-branch and
593 change "default branch" of project. Works only with update_repo.
594
595 ".devscripts" value: SALSA_RENAME_HEAD (yes/no)
596
597 --source-branch: default "master"
598 ".devscripts" value: SALSA_SOURCE_BRANCH
599
600 --dest-branch: default "debian/master"
601 ".devscripts" value: SALSA_DEST_BRANCH
602
603 --tagpending, --no-tagpending, --disable-tagpending
604 Enable, ignore or disable "tagpending" webhook.
605
606 ".devscripts" value: SALSA_TAGPENDING (yes/ignore/no, default:
607 ignore)
608
609 Merge requests options
610 --mr-title
611 Title for merge request. Default: last commit title.
612
613 --mr-desc
614 Description of new MR. Default:
615
616 empty if --mr-title is set
617 last commit description if any
618 --mr-dst-branch (or second command line argument)
619 Destination branch. Default to "master".
620
621 --mr-dst-project (or first command line argument)
622 Destination project. Default: project from which the current
623 project was forked; or, if not found, "upstream" value found using
624 git remote --verbose show; or using source project.
625
626 If --mr-dst-project is set to same, salsa will use source project
627 as destination.
628
629 --mr-src-branch
630 Source branch. Default: current branch.
631
632 --mr-src-project
633 Source project. Default: current project found using git remote
634 --verbose show.
635
636 --mr-allow-squash, --no-mr-allow-squash
637 Allow upstream project to squash your commits, this is the default.
638
639 ".devscripts" value: SALSA_MR_ALLOW_SQUASH (yes/no)
640
641 --mr-remove-source-branch, --no-mr-remove-source-branch
642 Remove source branch if merge request is accepted. Default: no.
643
644 ".devscripts" value: SALSA_MR_REMOVE_SOURCE_BRANCH (yes/no)
645
646 Options to manage other Gitlab instances
647 --api-url
648 GitLab API. Default: <https://salsa.debian.org/api/v4>.
649
650 ".devscripts" value: SALSA_API_URL
651
652 --git-server-url
653 Default to "git@salsa.debian.org:"
654
655 ".devscripts" value: SALSA_GIT_SERVER_URL
656
657 --irker-server-url
658 Default to "ircs://irc.oftc.net:6697/"
659
660 ".devscripts" value: SALSA_IRKER_SERVER_URL
661
662 --kgb-server-url
663 Default to <http://kgb.debian.net:9418/webhook/?channel=>
664
665 ".devscripts" value: SALSA_KGB_SERVER_URL
666
667 --tagpending-server-url
668 Default to <https://webhook.salsa.debian.org/tagpending/>
669
670 ".devscripts" value: SALSA_TAGPENDING_SERVER_URL
671
672 Configuration file example
673
674 Example to use salsa with <https://gitlab.ow2.org> (group "lemonldap-
675 ng"):
676
677 SALSA_TOKEN=`cat ~/.ow2-gitlab-token`
678 SALSA_API_URL=https://gitlab.ow2.org/api/v4
679 SALSA_GIT_SERVER_URL=git@gitlab.ow2.org:
680 SALSA_GROUP_ID=34
681
682 Then to use it, add something like this in your ".bashrc" file:
683
684 alias llng_admin='salsa --conffile ~/.salsa-ow2.conf'
685
687 dpt-salsa
688
690 Xavier Guimard <yadd@debian.org>
691
693 Copyright (C) 2018, Xavier Guimard <yadd@debian.org>
694
695 It contains code formerly found in dpt-salsa (pkg-perl-tools) copyright
696 2018, gregor herrmann <gregoa@debian.org>.
697
698 This library is free software; you can redistribute it and/or modify it
699 under the terms of the GNU General Public License as published by the
700 Free Software Foundation; either version 2, or (at your option) any
701 later version.
702
703 This program is distributed in the hope that it will be useful, but
704 WITHOUT ANY WARRANTY; without even the implied warranty of
705 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
706 General Public License for more details.
707
708 You should have received a copy of the GNU General Public License along
709 with this program. If not, see <http://www.gnu.org/licenses/>.
710
711
712
713Debian Utilities 2020-07-27 SALSA(1)