• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

examples/H23-Sep-2019-4034

scarab/H23-Sep-2019-1,4901,236

tests/H23-Sep-2019-9879

LICENSEH A D23-Sep-20191.3 KiB2320

MANIFEST.inH A D23-Sep-2019211 1312

README.mdH A D23-Sep-20195.4 KiB12680

conftest.pyH A D23-Sep-201916 20

setup.cfgH A D23-Sep-201926 32

setup.pyH A D23-Sep-20191.8 KiB6955

tox.iniH A D23-Sep-201964 75

README.md

1# Overview
2scarab is a CLI tool to automate some of the Bugzilla-related workflows in the FreeBSD project.
3
4# Installation
5```
6# Install python3 and pip
7sudo pkg install python3 py36-pip
8
9# Install latest release of scarab
10pip-3.6 install --user scarab
11# .. or current WIP
12git clone https://github.com/gonzoua/scarab.git
13cd scarab
14pip-3.6 install --user -e .
15
16# Add ~/.local/bin to PATH
17# for bash:
18export PATH=$PATH:~/.local/bin
19# for tcsh/csh:
20setenv PATH $PATH\:$HOME/.local/bin
21
22# test setup
23scarab products
24```
25
26# Settings
27scarab config file has a generic section-based INI format. A section starts with [sectionname]  and consists of key/value pairs separated by "=". Value is the part of the line after "=" with leading and trailing spaces removed.  If there are spaces in the middle of the string, they're treated as a part of the value.
28
29## [default] section
30
31### url
32
33Base URL  for Bugzilla setup. By default, it's FreeBSD's Bugzilla instance https://bugs.freebsd.org/bugzilla/
34
35### api_key
36
37API key for the operations. Normally commands that do not modify Bugzilla's state like `fetch`, `fetchall`, `file` do not require it, unless you're trying to access PRs with restricted access. To generate new API key login to your Bugzilla instance, click on "Preferences" link then select "API keys" tab, check "Generate a new API key ..." checkbox, provide an optional description and click "Submit Changes"
38
39## [template:NNN] sections
40
41Templates are sets of fields that you can use when submitting new PRs instead of specifying them individually as command-line arguments. Valid keys for this kind of section are: `product`, `component`, `version`, `platform`, `severity`. Possible values depend on the actual Bugzilla instance configuration. Some of them can be inspected using `products` command. The part of the section name after the colon is used as an argument to `-t` switch of the `submit` command as a shorthand for multiple switches. For more examples of template usage see [scarabrc](examples/scarabrc).
42
43# Commands
44## addaflag
45addaflag [-h] attachment_id name [requestee]
46
47Add new flag named name to attachment attachment_id. If flag can be requested from specific user they can be specified by an optional requestee argument.
48
49## addflag
50addflag [-h] bug_id name [requestee]
51
52Add new flag named name to bug bug_id. If flag can be requested from specific user they can be specified by an optional requestee argument.
53
54## aflags
55aflags [-h] attachment_id
56
57Display flags for bug bug_id.
58
59## attach
60attach [-h] [-s SUMMARY] [-c COMMENT | -F COMMENT_FILE] [-t CONTENT_TYPE] attachment pr
61
62Attach file specified by the path `attachment` to the bug with id `pr`. If no summary provided the file name is used as a summary. If neither `-c` nor `-F` is specified tool will invoke editor so a user can enter the comment text. File content type is detecting automatically using libmagic and can be overridden by `-t` command-line switch.
63
64## fetch
65fetch [-h] [-o OUTPUT] attachment_id
66
67Download attachment with the id `attachment_id` to the file specified by `-o` command-line switch or to the file in the current directory with the same name as an attachment.
68
69## fetchall
70fetchall [-h] bug_id
71
72Download all non-obsolete attachments of the bug with id `bug_id` to the current directory.
73
74## files
75files [-h] [-a] [-s] bug_id
76
77Show list of the files attached to the bug with id `bug_id`. Unless `-a` is specified only non-obsolete attachments are displayed. When `-s` is used, the summary of the attachment is displayed instead of the file name.
78
79## info
80info [-h] bug_id
81
82Display information for bug bug_id including bug description
83
84## flags
85flags [-h] bug_id
86
87Display flags for bug bug_id.
88
89## products
90products [-h]
91
92Display list of products, their components and versions
93
94## rmaflags
95rmaflags [-h] attachment_id name [name ...]
96
97Remove one or more flags from attachment attachment_id. Name can be either flag name or numeric flag id, if there are more than one flag with the same name.
98
99## rmflags
100rmflags [-h] bug_id name [name ...]
101
102Remove one or more flags from bug bug_id. Name can be either flag name or numeric flag id, if there are more than one flag with the same name.
103
104## setaflag
105setaflag [-h] attachment_id name {+,-}
106
107Change attachment's flag value to either + or -. name can be either flag name or number flag id.
108
109## setflag
110setflag [-h] bug_id name {+,-}
111
112Change bug's flag value to either + or -. name can be either flag name or number flag id.
113
114## submit
115submit [-h] [-t TEMPLATES] [-p PRODUCT] [-m COMPONENT] [-v VERSION] [-c COMMENT | -F COMMENT_FILE] -s SUMMARY [-C CC] [-P PLATFORM] [-S SEVERITY]
116
117Submit new bug with the summary specified by `-s` command-line switch. Mandatory fields `product`, `component`, `version` should be specified either by command-line switches or as values in templates sections. If multiple templates are specified in one invocation, they are merged with fields each following template overriding values present in the previous ones. Values for the fields provided as a command-line switch override the values in the templates.
118
119## update
120update [-h] [-s STATUS] [-r RESOLUTION] [-a ASSIGNED_TO] [-C ADD_CC] [-X REMOVE_CC] [-c COMMENT | -F COMMENT_FILE] bug_id
121
122Update fields in existing PR. If neither `-c` nor `-F` specified no comment is posted with the change. `-C` and `-X` can be specified multiple times to add/remove more than one user.
123
124# Development
125To run the scarab command using checked out version of the repo use `python3 -m scarab.cli ...` command
126