diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 781894274e..09fd497be2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,7 +32,7 @@ jobs: docker cp push_data:/app/version.json build_info/version.json docker rm push_data - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: Build Info path: build_info diff --git a/.github/workflows/perl-slim.yml b/.github/workflows/perl-slim.yml index 3a81039079..9121b0d11a 100644 --- a/.github/workflows/perl-slim.yml +++ b/.github/workflows/perl-slim.yml @@ -28,7 +28,7 @@ jobs: docker run -v $(pwd):/app/result bmo-cpanfile cp cpanfile cpanfile.snapshot /app/result cp cpanfile cpanfile.snapshot build_info - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: Build Info path: build_info diff --git a/.readthedocs.yaml b/.readthedocs.yaml deleted file mode 100644 index d1ecf739e3..0000000000 --- a/.readthedocs.yaml +++ /dev/null @@ -1,13 +0,0 @@ -version: 2 - -build: - os: ubuntu-24.04 - tools: - python: "3.12" - -sphinx: - configuration: docs/en/rst/conf.py - -python: - install: - - requirements: docs/en/rst/requirements.txt diff --git a/.vscode/settings.json b/.vscode/settings.json index 531a874a7a..3dcc4324b9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,6 +17,5 @@ }, "search.exclude": { "**/local": true - }, - "esbonio.sphinx.confDir": "${workspaceFolder}/docs/en/rst/conf.py" + } } diff --git a/Bugzilla.pm b/Bugzilla.pm index 0687efb9cb..fa5732dd4e 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -13,7 +13,7 @@ use warnings; use Bugzilla::Logging; -our $VERSION = '20260805.1'; +our $VERSION = '20260825.1'; use Bugzilla::Auth; use Bugzilla::Auth::Persist::Cookie; diff --git a/Bugzilla/App/Controller/Docs.pm b/Bugzilla/App/Controller/Docs.pm new file mode 100644 index 0000000000..c1eea4a246 --- /dev/null +++ b/Bugzilla/App/Controller/Docs.pm @@ -0,0 +1,186 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +package Bugzilla::App::Controller::Docs; + +use 5.10.1; +use Mojo::Base 'Mojolicious::Controller'; + +use Bugzilla::Constants; +use Cwd qw(realpath); +use Encode qw(decode); +use File::Basename qw(basename); +use Mojo::DOM; +use Mojo::File (); + +# The Markdown documentation lives in docs/en/md and its images in +# docs/en/images, so the /docs/en URL space mirrors docs/en on disk. That +# way the relative links inside the converted files (../using/index.md, +# ../../images/foo.png) resolve in the browser without any rewriting. +sub _docs_root { realpath(bz_locations()->{libpath} . '/docs/en') } + +use constant IMAGE_TYPES => { + gif => 'image/gif', + jpeg => 'image/jpeg', + jpg => 'image/jpeg', + png => 'image/png', + svg => 'image/svg+xml', +}; + +use constant ALERT_TITLES => { + caution => 'Caution', + important => 'Important', + note => 'Note', + tip => 'Tip', + warning => 'Warning', +}; + +sub setup_routes { + my ($class, $r) = @_; + $r->get('/docs')->to('Docs#index')->name('docs_index'); + $r->get('/docs/en')->to('Docs#index'); + $r->get('/docs/en/*docs_path')->to('Docs#show')->name('docs_show'); +} + +sub index { ## no critic (ProhibitBuiltinHomonyms) + my ($self) = @_; + return $self->redirect_to($self->url_for('docs_show', docs_path => 'md/index.md')); +} + +sub show { + my ($self) = @_; + Bugzilla->usage_mode(USAGE_MODE_MOJO); + $self->bugzilla->login || return undef; + + my $path = $self->stash('docs_path') // ''; + $path =~ s{/+$}{}; + return $self->index if $path eq ''; + + # Be careful not to allow directory traversal. + if ($path =~ /\.\./ || $path !~ m{^[\w\-./]+$}) { + return $self->_not_found($path); + } + + my $root = _docs_root(); + my $file = realpath("$root/$path"); + unless (defined $file && CORE::index($file, "$root/") == 0 && (-f $file || -d $file)) { + # The docs were once built to Sphinx HTML and served externally + # (docs_urlbase), so old links and bookmarks use .html paths; send + # those to the Markdown page with the same name. + if ($path =~ m{^md/.+\.html$}) { + (my $md_path = $path) =~ s/\.html$/.md/; + my $md_file = realpath("$root/$md_path"); + if (defined $md_file && CORE::index($md_file, "$root/") == 0 && -f $md_file) { + return $self->redirect_to( + $self->url_for('docs_show', docs_path => $md_path)); + } + } + return $self->_not_found($path); + } + + # Directory URLs (e.g. /docs/en/md, /docs/en/md/using) go to the + # section's index page. + if (-d $file) { + return $self->_not_found($path) unless -f "$file/index.md"; + return $self->redirect_to( + $self->url_for('docs_show', docs_path => "$path/index.md")); + } + + if ($path =~ m{^md/.+\.md$}) { + return $self->_render_markdown($file, $path); + } + + if ($path =~ m{^images/.+\.(\w+)$} && IMAGE_TYPES->{lc $1}) { + $self->res->headers->content_type(IMAGE_TYPES->{lc $1}); + return $self->reply->file($file); + } + + return $self->_not_found($path); +} + +sub _not_found { + my ($self, $path) = @_; + return $self->user_error('docs_page_not_found', {path => $path}, + {status => 404, skip_exception_page => 1}); +} + +sub _render_markdown { + my ($self, $file, $path) = @_; + + require Bugzilla::Markdown::GFM; + require Bugzilla::Markdown::GFM::Parser; + + my $markdown = Mojo::File->new($file)->slurp; + + # The documentation is trusted content shipped in the repository, so raw + # HTML (the API reference tables, the anchors kept for deep links) + # is allowed through; tagfilter still neutralizes script-capable tags. + my $parser = Bugzilla::Markdown::GFM::Parser->new({ + unsafe => 1, + validate_utf8 => 1, + extensions => [qw( autolink tagfilter table strikethrough )], + }); + + my $dom = Mojo::DOM->new(decode('UTF-8', $parser->render_html($markdown))); + _add_heading_ids($dom); + _convert_alerts($dom); + + my $h1 = $dom->at('h1'); + my $title = $h1 ? $h1->all_text : basename($file, '.md'); + + $self->stash( + doc_html => $dom->to_string, + doc_title => $title, + doc_path => $path, + ); + return $self->render(template => 'pages/doc_viewer', handler => 'bugzilla', + format => 'html'); +} + +# cmark-gfm does not add ids to headings; GitHub does that in a separate +# pass. The docs link to GitHub-style heading slugs (lowercase; keep +# alphanumerics, "_" and "-"; spaces become "-"; everything else is +# dropped; duplicates get -1, -2, ...), so reproduce that algorithm or +# in-page anchors would dangle. +sub _add_heading_ids { + my ($dom) = @_; + my %seen; + $dom->find('h1, h2, h3, h4, h5, h6')->each(sub { + my ($h) = @_; + return if defined $h->attr('id'); + my $slug = lc $h->all_text; + $slug =~ s/^\s+|\s+$//g; + $slug =~ s/[^\w\- \t]//g; + $slug =~ s/[ \t]/-/g; + my $count = $seen{$slug}++; + $slug .= "-$count" if $count; + $h->attr(id => $slug); + }); +} + +# GitHub renders "> [!NOTE]" blockquotes as styled callouts; cmark-gfm +# leaves the marker as literal text, so turn those blockquotes into styled +# alert boxes here. +sub _convert_alerts { + my ($dom) = @_; + $dom->find('blockquote')->each(sub { + my ($bq) = @_; + my $p = $bq->at('p') or return; + my $first = $p->child_nodes->first; + return unless $first && $first->type eq 'text'; + my $text = $first->content; + return unless $text =~ s/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*//; + my $kind = lc $1; + $first->content($text); + $p->remove unless $p->all_text =~ /\S/ || $p->children->size; + $bq->attr(class => "docs-alert docs-alert-$kind"); + $bq->prepend_content( + qq{

${\ ALERT_TITLES->{$kind}}

}); + }); +} + +1; diff --git a/Bugzilla/App/Controller/MFA/Duo.pm b/Bugzilla/App/Controller/MFA/Duo.pm index 8dad382a77..997d8228ce 100644 --- a/Bugzilla/App/Controller/MFA/Duo.pm +++ b/Bugzilla/App/Controller/MFA/Duo.pm @@ -63,8 +63,10 @@ sub callback { # Retrieve the event data from the mfa token my $provider = Bugzilla::MFA->new_from($user, 'Duo'); - my $event - = $provider->verify_token($mfa_cookie, {no_redirect => 1, no_delete => 1}); + # provider_callback skips the duo_verified gate: we are the request that is + # about to establish it. + my $event = $provider->verify_token($mfa_cookie, + {no_redirect => 1, no_delete => 1, provider_callback => 1}); if (!$event) { return $self->code_error('duo_client_error', {reason => ERR_INVALID_MFA_COOKIE}); diff --git a/Bugzilla/App/Plugin/Error.pm b/Bugzilla/App/Plugin/Error.pm index f119a4dce1..e4df975e26 100644 --- a/Bugzilla/App/Plugin/Error.pm +++ b/Bugzilla/App/Plugin/Error.pm @@ -90,7 +90,7 @@ sub _render_error { error => 1, code => $code, message => $message, - documentation => 'https://bmo.readthedocs.io/en/latest/api/', + documentation => Bugzilla->localconfig->urlbase . 'docs/en/md/api/index.md', }; $c->render(json => $error, status => $status_code); diff --git a/Bugzilla/Config/General.pm b/Bugzilla/Config/General.pm index 187e447a44..6f74c5b970 100644 --- a/Bugzilla/Config/General.pm +++ b/Bugzilla/Config/General.pm @@ -31,13 +31,6 @@ use constant get_param_list => ( checker => \&check_email }, - { - name => 'docs_urlbase', - type => 't', - default => 'docs/%lang%/html/', - checker => \&check_url - }, - { name => 'utf8', type => 's', diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index 503626e4d7..5147beaa07 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -847,6 +847,9 @@ sub update_table_definitions { # Bug 1806896 - xavier.lhour@gmail.com _migrate_flag_state_activity(); + # Bug 2060356 - dkl@mozilla.com + _remove_duo_recovery_codes(); + ################################################################ # New --TABLE-- changes should go *** A B O V E *** this point # ################################################################ @@ -4538,6 +4541,19 @@ sub _migrate_flag_state_activity { $dbh->bz_drop_table('flag_state_activity'); } +sub _remove_duo_recovery_codes { + my $dbh = Bugzilla->dbh; + + # Duo users were able to generate recovery codes but never had a form in + # which to enter one, so these rows are unusable secrets. Recovery for Duo + # is handled by Duo Security itself. + $dbh->do( + "DELETE FROM profile_mfa + WHERE name LIKE 'recovery.%' + AND user_id IN (SELECT userid FROM profiles WHERE mfa = 'Duo')" + ); +} + 1; __END__ diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index bb3b5fab39..7259e3f772 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -185,8 +185,6 @@ sub FILESYSTEM { 'cvs-update.log' => {perms => WS_SERVE}, 'scripts/sendunsentbugmail.pl' => {perms => WS_EXECUTE}, 'docs/bugzilla.ent' => {perms => OWNER_WRITE}, - 'docs/makedocs.pl' => {perms => OWNER_EXECUTE}, - 'docs/style.css' => {perms => WS_SERVE}, 'docs/*/rel_notes.txt' => {perms => WS_SERVE}, 'docs/*/README.docs' => {perms => OWNER_WRITE}, "$datadir/params.old" => {perms => CGI_WRITE}, @@ -240,9 +238,6 @@ sub FILESYSTEM { js => {files => WS_SERVE, dirs => DIR_WS_SERVE}, static => {files => WS_SERVE, dirs => DIR_WS_SERVE}, $skinsdir => {files => WS_SERVE, dirs => DIR_WS_SERVE}, - 'docs/*/html' => {files => WS_SERVE, dirs => DIR_WS_SERVE}, - 'docs/*/pdf' => {files => WS_SERVE, dirs => DIR_WS_SERVE}, - 'docs/*/txt' => {files => WS_SERVE, dirs => DIR_WS_SERVE}, 'docs/*/images' => {files => WS_SERVE, dirs => DIR_WS_SERVE}, "$extensionsdir/*/web" => {files => WS_SERVE, dirs => DIR_WS_SERVE}, $confdir => {files => WS_SERVE, dirs => DIR_WS_SERVE,}, @@ -255,7 +250,6 @@ sub FILESYSTEM { # Directories only for the owner, not for the webserver. t => {files => OWNER_WRITE, dirs => DIR_OWNER_WRITE}, xt => {files => OWNER_WRITE, dirs => DIR_OWNER_WRITE}, - 'docs/lib' => {files => OWNER_WRITE, dirs => DIR_OWNER_WRITE}, 'docs/*/xml' => {files => OWNER_WRITE, dirs => DIR_OWNER_WRITE}, 'contrib' => {files => OWNER_EXECUTE, dirs => DIR_OWNER_WRITE,}, 'scripts' => {files => OWNER_EXECUTE, dirs => DIR_OWNER_WRITE,}, diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index defb5f448e..3cca4dbf79 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -83,7 +83,6 @@ use constant FEATURE_FILES => ( moving => ['importxml.pl'], auth_ldap => ['Bugzilla/Auth/Verify/LDAP.pm'], auth_radius => ['Bugzilla/Auth/Verify/RADIUS.pm'], - documentation => ['docs/makedocs.pl'], inbound_email => ['email_in.pl'], jobqueue => [ 'Bugzilla/Job/*', 'Bugzilla/JobQueue.pm', diff --git a/Bugzilla/Keyword.pm b/Bugzilla/Keyword.pm index 35dc2f594d..fc54374cc3 100644 --- a/Bugzilla/Keyword.pm +++ b/Bugzilla/Keyword.pm @@ -43,6 +43,14 @@ use constant UPDATE_COLUMNS => qw( is_active ); +# Keyword families that classify security vulnerabilities. Bug counts for these +# keywords are hidden from users who cannot see security bugs (bug 2056990). +# +# Note that C must be listed separately from C: the alternation +# is anchored on the trailing hyphen, so C only matches C and +# never C. +use constant SECURITY_KEYWORD_REGEX => qr/^(?:sec|csec|csectype|wsec|opsec)-/; + ############################### #### Accessors ###### ############################### @@ -59,6 +67,11 @@ sub bug_count { return $self->{'bug_count'}; } +sub is_security_keyword { + my ($self) = @_; + return $self->name =~ SECURITY_KEYWORD_REGEX ? 1 : 0; +} + ############################### #### Mutators ##### ############################### @@ -72,14 +85,34 @@ sub set_is_active { $_[0]->set('is_active', $_[1]); } ############################### sub get_all_with_bug_count { - my $class = shift; - my $dbh = Bugzilla->dbh; + my $class = shift; + my $dbh = Bugzilla->dbh; + my $user = Bugzilla->user; + + # Only count bugs that are visible to the current user based on group + # membership, so the counts don't leak the number of security-restricted + # bugs (e.g. the sec-* and csectype-* keyword families) to users who can't + # otherwise see them. A bug is hidden if it belongs to any group the user + # is not a member of; we detect that with a LEFT JOIN and only count the + # keyword rows that have no such group (bug_group_map.bug_id IS NULL). + # + # The reporter/assignee/qa/cc visibility exceptions (see + # Bugzilla::User->visible_bugs) are intentionally not applied here: ignoring + # them can only make a count lower than the user's true visibility, never + # higher, so no restricted data can leak. Using a conditional COUNT (rather + # than a WHERE clause) keeps keywords whose bugs are all restricted in the + # result set with a count of 0, instead of dropping them entirely. my $keywords = $dbh->selectall_arrayref( 'SELECT ' . join(', ', $class->_get_db_columns) . ', - COUNT(keywords.bug_id) AS bug_count + COUNT(CASE WHEN bug_group_map.bug_id IS NULL + THEN keywords.bug_id END) AS bug_count FROM keyworddefs LEFT JOIN keywords - ON keyworddefs.id = keywords.keywordid ' + ON keyworddefs.id = keywords.keywordid + LEFT JOIN bug_group_map + ON keywords.bug_id = bug_group_map.bug_id + AND bug_group_map.group_id NOT IN (' + . $user->groups_as_string . ') ' . $dbh->sql_group_by( 'keyworddefs.id', 'keyworddefs.name, keyworddefs.description' @@ -176,6 +209,17 @@ implements. Returns: A reference to an array of Keyword objects, or an empty arrayref if there are no keywords. +=item C + + Description: Indicates if the keyword belongs to one of the security + vulnerability keyword families (C, C, + C, C and C). Callers use this to + decide whether the keyword's bug count may be shown to the + current user. See C. + Params: none + Returns: a boolean value that is true if the keyword is a security + keyword. + =item C Description: Indicates if the keyword may be used on a bug diff --git a/Bugzilla/MFA.pm b/Bugzilla/MFA.pm index 9f08c1b484..177c3ceb13 100644 --- a/Bugzilla/MFA.pm +++ b/Bugzilla/MFA.pm @@ -54,6 +54,11 @@ sub prompt { } # throws errors if code is invalid sub check { } +# throws errors if the event does not carry proof of a successful verification. +# only meaningful for providers which verify out-of-band (ie. can_verify_inline +# is false), where the proof is recorded on the event by a separate request. +sub verify_event { } + # if true verification can happen inline (during enrollment/pref changes) # if false then the mfa provider requires an intermediate verification page sub can_verify_inline {0} @@ -86,6 +91,12 @@ sub verify_token { # return event data my $event = get_token_extra_data($token); + # Verification performed out-of-band (Duo) records its result on the event + # rather than throwing from check(). The provider's own callback runs this + # before that result exists and passes provider_callback to opt out; every + # other caller must be gated here. + $self->verify_event($event) if $event && !$options->{provider_callback}; + unless ($options->{no_delete}) { delete_token($token); diff --git a/Bugzilla/MFA/Duo.pm b/Bugzilla/MFA/Duo.pm index ffd2b905b4..4af0418a47 100644 --- a/Bugzilla/MFA/Duo.pm +++ b/Bugzilla/MFA/Duo.pm @@ -20,6 +20,25 @@ sub can_verify_inline { return 0; } +# Duo verification happens in a separate request handled by +# Bugzilla::App::Controller::MFA::Duo, which sets duo_verified on the event +# once the authorization code has been exchanged. Without it the mfa token +# only proves the prompt was issued, not that the user passed Duo. +sub verify_event { + my ($self, $event) = @_; + return if $event->{duo_verified}; + ThrowUserError('duo_user_error', {reason => 'Invalid Duo Security MFA Code'}); +} + +# Duo users have no way to enter a recovery code -- there is no Duo +# verification form, prompt() redirects straight to Duo. Recovery is handled +# by Duo itself (bypass codes, self-service device management). +sub generate_recovery_codes { + my ($self) = @_; + ThrowUserError('duo_user_error', + {reason => 'Recovery codes are not available when using Duo Security.'}); +} + sub enroll { my ($self, $params) = @_; diff --git a/Bugzilla/Markdown/GFM.pm b/Bugzilla/Markdown/GFM.pm index 61f1200053..9bee4d7eb6 100644 --- a/Bugzilla/Markdown/GFM.pm +++ b/Bugzilla/Markdown/GFM.pm @@ -30,6 +30,8 @@ my %OPTIONS = ( footnotes => (1 << 13), strikethrough_double_tilde => (1 << 14), table_prefer_style_attributes => (1 << 15), + full_info_string => (1 << 16), + unsafe => (1 << 17), ); my $FFI = FFI::Platypus->new( diff --git a/Bugzilla/Memcached.pm b/Bugzilla/Memcached.pm index eccebdca54..4928a02494 100644 --- a/Bugzilla/Memcached.pm +++ b/Bugzilla/Memcached.pm @@ -300,6 +300,13 @@ sub should_rate_limit { $memcached->add($key, 0, $rate_seconds + 1); my $tokens = $memcached->get_multi(@keys); my $cas = $memcached->gets($key); + + # gets() returns undef when memcached is unreachable (or the key expired + # between the add and the gets). Don't let $cas->[1]++ autovivify an + # arrayref holding an undef cas id, which would then be passed to cas(). + # Fail open: no working memcached means no rate limiting. + return 0 unless ref $cas eq 'ARRAY' && defined $cas->[0]; + $tokens->{$key} = $cas->[1]++; return 1 if sum(values %$tokens) >= $rate_max; return 0 if $memcached->cas($key, @$cas, $rate_seconds + 1); diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 9590d1884e..5247e51f06 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -1458,6 +1458,20 @@ sub _standard_joins { extra => ['security_cc.who = ' . $user->id], }; push @joins, $security_cc_join; + + # Triage owners can see all bugs in their component, but only if they are + # also a member of the mozilla-employee-confidential group. + if ($user->is_employee_confidential) { + my $security_triage_join = { + table => 'components', + as => 'security_triage', + from => 'bugs.component_id', + to => 'id', + join => 'LEFT', + extra => ['security_triage.triage_owner_id = ' . $user->id], + }; + push @joins, $security_triage_join; + } } return @joins; @@ -1538,6 +1552,12 @@ sub _standard_where { if (Bugzilla->params->{'useqacontact'}) { push @involved, ("bugs.qa_contact = $userid"); } + + # This must stay in sync with the security_triage join in _standard_joins, + # which is only present for confidential-group members. + if ($self->_user->is_employee_confidential) { + push @involved, ('security_triage.triage_owner_id IS NOT NULL'); + } $term .= ' OR (' . join(') OR (', @involved) . ')'; } diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index adf35a64b3..54518020cb 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -970,12 +970,13 @@ sub create { # Allow templates to get the absolute path of the URLBase value 'basepath' => sub { return Bugzilla->localconfig->basepath; }, - # Allow templates to access docs URL with users' preferred language + # Base URL of the in-app documentation viewer + # (Bugzilla::App::Controller::Docs). Kept as "docs_urlbase" so the + # many templates that build documentation links keep working; the + # viewer redirects legacy Sphinx-style .html paths to the Markdown + # pages. 'docs_urlbase' => sub { - my $language = Bugzilla->current_language; - my $docs_urlbase = Bugzilla->params->{'docs_urlbase'}; - $docs_urlbase =~ s/\%lang\%/$language/; - return $docs_urlbase; + return Bugzilla->localconfig->basepath . 'docs/en/md/'; }, # Check whether the URL is safe. diff --git a/Bugzilla/Template/Plugin/Hook.pm b/Bugzilla/Template/Plugin/Hook.pm index e814324bab..b07b8c7324 100644 --- a/Bugzilla/Template/Plugin/Hook.pm +++ b/Bugzilla/Template/Plugin/Hook.pm @@ -148,4 +148,4 @@ Output from processing template extension. L -L +L diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index fb57db004a..5387c88d55 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -1548,12 +1548,14 @@ sub visible_bugs { # same result for bug_group_map.bug_id (so DISTINCT filters # out duplicate rows). "SELECT DISTINCT bugs.bug_id, reporter, assigned_to, qa_contact, - reporter_accessible, cclist_accessible, cc.who, - bug_group_map.bug_id + components.triage_owner_id, reporter_accessible, + cclist_accessible, cc.who, bug_group_map.bug_id FROM bugs LEFT JOIN cc ON cc.bug_id = bugs.bug_id AND cc.who = $user_id + LEFT JOIN components + ON bugs.component_id = components.id LEFT JOIN bug_group_map ON bugs.bug_id = bug_group_map.bug_id AND bug_group_map.group_id NOT IN (" @@ -1567,13 +1569,20 @@ sub visible_bugs { $sth->execute(@check_ids); my $use_qa_contact = Bugzilla->params->{'useqacontact'}; + + # Triage owners can see all bugs in their component, but only if they are + # also a member of the mozilla-employee-confidential group. + my $use_triage_owner = $self->is_employee_confidential; while (my $row = $sth->fetchrow_arrayref) { - my ($bug_id, $reporter, $owner, $qacontact, $reporter_access, $cclist_access, - $isoncclist, $missinggroup) - = @$row; + my ( + $bug_id, $reporter, $owner, + $qacontact, $triage_owner, $reporter_access, + $cclist_access, $isoncclist, $missinggroup + ) = @$row; $visible_cache->{$bug_id} ||= ((($reporter == $user_id) && $reporter_access) - || ($use_qa_contact && $qacontact && ($qacontact == $user_id)) + || ($use_qa_contact && $qacontact && ($qacontact == $user_id)) + || ($use_triage_owner && $triage_owner && ($triage_owner == $user_id)) || ($owner == $user_id) || ($isoncclist && $cclist_access) || !$missinggroup) ? 1 : 0; @@ -2580,6 +2589,16 @@ sub is_insider { return $self->{'is_insider'}; } +sub is_employee_confidential { + my $self = shift; + + if (!defined $self->{'is_employee_confidential'}) { + $self->{'is_employee_confidential'} + = $self->in_group('mozilla-employee-confidential') ? 1 : 0; + } + return $self->{'is_employee_confidential'}; +} + sub is_global_watcher { my $self = shift; @@ -3482,6 +3501,10 @@ for flag mail. Returns true if the user can access private comments and attachments, i.e. if the 'insidergroup' parameter is set and the user belongs to this group. +=item C + +Returns true if the user belongs to the 'mozilla-employee-confidential' group. + =item C Returns true if the user is a global watcher, diff --git a/Bugzilla/WebService/Server/REST.pm b/Bugzilla/WebService/Server/REST.pm index b9ae7b9a3e..ec4faa4436 100644 --- a/Bugzilla/WebService/Server/REST.pm +++ b/Bugzilla/WebService/Server/REST.pm @@ -130,7 +130,8 @@ sub response { $result = $json_data->{error}; $result->{error} = $self->type('boolean', 1); - $result->{documentation} = Bugzilla->params->{docs_urlbase} . "api/"; + $result->{documentation} + = Bugzilla->localconfig->urlbase . 'docs/en/md/api/index.md'; delete $result->{'name'}; # Remove JSONRPCError } elsif (exists $json_data->{result}) { diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3a100e74eb..4f9b06c9ea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,7 @@ efforts from contributors on the same issue. Head over to [Codetribute](https://codetribute.mozilla.org/projects/bugzilla) to find good tasks to start with. -See [`README.rst`](README.rst) for more information +See [`README.md`](README.md) for more information on how to start working on Bugzilla. ## Pull Request Checklist diff --git a/Makefile.PL b/Makefile.PL index b556efcc1a..1f76648da4 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -186,13 +186,6 @@ my %optional_features = ( description => 'RADIUS Authentication', prereqs => {runtime => {requires => {'Authen::Radius' => 0}}} }, - documentation => { - description => 'Documentation', - prereqs => { - runtime => - {requires => {'File::Which' => 0, 'File::Copy::Recursive' => 0,}} - }, - }, auth_ldap => { description => 'LDAP Authentication', prereqs => {runtime => {requires => {'Net::LDAP' => 0}}}, diff --git a/README.md b/README.md new file mode 100644 index 0000000000..2f2b8ba549 --- /dev/null +++ b/README.md @@ -0,0 +1,397 @@ +# BMO: bugzilla.mozilla.org + +BMO is Mozilla's highly customized version of Bugzilla. + +The documentation lives in [docs/en/md](docs/en/md/index.md) and is served +by Bugzilla itself at . + +[![CI status](https://github.com/mozilla-bteam/bmo/actions/workflows/deploy.yml/badge.svg)](https://github.com/mozilla-bteam/bmo/actions) + +If you want to contribute to BMO, you can fork this repo and get a local copy +of BMO running in a few minutes using Docker. + +## Using Docker (For Development) + +This repository contains a docker-compose file that will create a local Bugzilla for testing. + +To use Docker Compose, ensure you have the latest [Docker](https://docs.docker.com/get-started/get-docker/) +install for your environment (Linux, Windows, or macOS). + +``` bash +docker compose up --build +``` + +This command will bring up the main webserver process, database, memcached, and various other +background tasks such as the Push system and the Feed system. The latter two are used for workflow +management between bugzilla.mozilla.org and other external systems. + +For normal development, you can run just the main webserver, database, and memcached by running the +following command instead: + +``` bash +docker compose up --build bmo.test +``` + +After that, you should be able to visit from your browser. +You can login as with the password "password012!" (without +quotes). + +If you want to update the code running in the web container, you do not need to restart everything. +You can run the following command: + +``` bash +docker compose exec bmo.test rsync -avz --exclude .git --exclude local /mnt/sync/ /app/ +``` + +The Mojolicious morbo development server, used by the web container, will notice any code changes and +restart itself. + +The third-party front-end libraries (jQuery, Prism, mermaid, and so on) are not committed to the +repository. They are generated at image build time, so they exist in the container but not in your +checkout, and the `rsync` above leaves them alone. See [Front-end Libraries](#front-end-libraries) for how to add or +upgrade one. + +If you are using Visual Studio Code, these `docker compose` commands will come in handy as the +editor's [tasks](https://code.visualstudio.com/docs/editor/tasks) that can be found under the Terminal menu. The update command is assigned to the +default build task so it can be executed by simply hitting Ctrl+Shift+B on Windows/Linux or +Command+Shift+B on macOS. An [extension bundle](https://marketplace.visualstudio.com/items?itemName=dylanwh.bugzilla) for VS Code is also available. + +## Docker Container + +This repository is also a runnable docker container. + +### Container Arguments + +Currently, the entry point takes a single command argument. +This can be **httpd** or **shell**. + +**httpd** +This will start the web server listening for connections on `$PORT` + +**shell** +This will start an interactive shell in the container. Useful for debugging. + +### Environmental Variables + +**PORT** +This must be a value >= 1024. The httpd will listen on this port for incoming +plain-text HTTP connections. +Default: 8000 + +**MOJO_REVERSE_PROXY** +This tells the backend that it is behind a proxy. +Default: 1 + +**MOJO_HEARTBEAT_INTERVAL** +How often (in seconds) will the manager process send a heartbeat to the workers. +Default: 10 + +**MOJO_HEARTBEAT_TIMEOUT** +Maximum amount of time in seconds before a worker without a heartbeat will be stopped gracefully +Default: 120 + +**MOJO_INACTIVITY_TIMEOUT** +Maximum amount of time in seconds a connection can be inactive before getting closed. +Default: 120 + +**MOJO_WORKERS** +Number of worker processes. A good rule of thumb is two worker processes per +CPU core for applications that perform mostly non-blocking operations, +blocking operations often require more and benefit from decreasing +concurrency with "MOJO_CLIENTS" (often as low as 1). Note that during zero +downtime software upgrades there will be twice as many workers active for a +short amount of time. +Default: 1 + +**MOJO_SPARE** +Temporarily spawn up to this number of additional workers if there is a +need. This allows for new workers to be started while old ones are still +shutting down gracefully, drastically reducing the performance cost of +worker restarts. +Default: 1 + +**MOJO_CLIENTS** +Maximum number of accepted connections each worker process is allowed to +handle concurrently, before stopping to accept new incoming connections. Note +that high concurrency works best with applications that perform mostly +non-blocking operations, to optimize for blocking operations you can decrease +this value and increase "MOJO_WORKERS" instead for better performance. +Default: 200 + +**BUGZILLA_ALLOW_INSECURE_HTTP** +This should never be set in production. It allows oauth over http. + +**BMO_urlbase** +The public URL for this instance. Note that if this begins with `https://` +and BMO_inbound_proxies is set to `*` Bugzilla will believe the connection to it +is using SSL. + +**BMO_canonical_urlbase** +The public URL for the production instance, if different from urlbase above. + +**BMO_attachment_base** +This is the URL for attachments. +When the allow_attachment_display parameter is on, it is possible for a +malicious attachment to steal your cookies or perform an attack on Bugzilla +using your credentials. + +If you would like additional security on attachments to avoid this, set this +parameter to an alternate URL for your Bugzilla that is not the same as +urlbase. That is, a different domain name that resolves to this +exact same Bugzilla installation. + +For added security, you can insert %bugid% into the URL, which will be +replaced with the ID of the current bug that the attachment is on, when you +access an attachment. This will limit attachments to accessing only other +attachments on the same bug. Remember, though, that all those possible domain +names (such as 1234.your.domain.com) must point to this same Bugzilla +instance. + +**BMO_db_driver** +What SQL database to use. Default is mysql. List of supported databases can be +obtained by listing Bugzilla/DB directory - every module corresponds to one +supported database and the name of the module (before ".pm") corresponds to a +valid value for this variable. + +**BMO_db_host** +The DNS name or IP address of the host that the database server runs on. + +**BMO_db_name** +The name of the database. + +**BMO_db_user** +The database user to connect as. + +**BMO_db_pass** +The password for the user above. + +**BMO_site_wide_secret** +This secret key is used by your installation for the creation and +validation of encrypted tokens. These tokens are used to implement +security features in Bugzilla, to protect against certain types of attacks. +It's very important that this key is kept secret. + +**BMO_jwt_secret** +This secret key is used by your installation for the creation and validation +of jwts. It's very important that this key is kept secret and it should be +different from the site_wide_secret. Changing this will invalidate all issued +jwts, so all oauth clients will need to start over. As such it should be a +high level of entropy, as it probably won't change for a very long time. + +**BMO_inbound_proxies** +This is a list of IP addresses that we expect proxies to come from. +This can be `*` if only the load balancer can connect to this container. +Setting this to `*` means that BMO will trust the X-Forwarded-For header. + +**BMO_memcached_namespace** +The global namespace for the memcached servers. + +**BMO_memcached_servers** +A list of memcached servers (IP addresses or host names). Can be empty. + +**BMO_shadowdb** +The database name of the read-only database. + +**BMO_shadowdbhost** +The hostname or IP address of the read-only database. + +**BMO_shadowdbport** +The port of the read-only database. + +**BMO_setrlimit** +This is a JSON object and can set any limit described in [BSD::Resource](https://metacpan.org/pod/BSD::Resource). +Typically it used for setting RLIMIT_AS, and the default value is `{ "RLIMIT_AS": 2000000000 }`. + +**BMO_size_limit** +This is the max amount of unshared memory the worker processes are allowed to +use before they will exit. Minimum 750000 (750MiB) + +**BMO_mail_delivery_method** +Usually configured on the MTA section of admin interface, but may be set here for testing purposes. +Valid values are None, Test, Sendmail, or SMTP. +If set to Test, email will be appended to the /app/data/mailer.testfile. + +**BMO_use_mailer_queue** +Usually configured on the MTA section of the admin interface, you may change this here for testing purposes. +Should be 1 or 0. If 1, the job queue will be used. For testing, only set to 0 if the BMO_mail_delivery_method is None or Test. + +**USE_NYTPROF** +Write [Devel::NYTProf](https://metacpan.org/pod/Devel::NYTProf) profiles out for each request. +These will be named /app/data/nytprof.$host.$script.$n.$pid, where $host is +the hostname of the container, script is the name of the script (without +extension), $n is a number starting from 1 and incrementing for each +request to the worker process, and $pid is the worker process id. + +**NYTPROF_DIR** +Alternative location to store profiles from the above option. + +**LOG4PERL_CONFIG_FILE** +Filename of [Log::Log4perl](https://metacpan.org/pod/Log::Log4perl) config file. +It defaults to log4perl-json.conf. +If the file is given as a relative path, it will be relative to the /app/conf/ directory. + +**LOG4PERL_STDERR_DISABLE** +Boolean. By default log messages are logged as plain text to `STDERR`. +Setting this to a true value disables this behavior. + +Note: For programs that run using the `cereal` log aggregator, this environment +variable will be ignored. + +### Logging Configuration + +How Bugzilla logs is entirely configured by the environmental variable +`LOG4PERL_CONFIG_FILE`. This config file should be familiar to someone +familiar with log4j, and it is extensively documented in [Log::Log4perl](https://metacpan.org/pod/Log::Log4perl). + +Many examples are provided in the `conf/` directory. + +If multiple processes will need to log, it should be configured to log to a socket on port 5880. +This will be the "cereal" daemon, which will only be started for jobqueue and httpd-type containers. + +The example log config files will often be configured to log to stderr +themselves. To prevent duplicate lines (or corrupted log messages), stderr +logging should be filtered on the existence of the LOG4PERL_STDERR_DISABLE +environmental variable. + +Logging configuration also controls which errors are sent to Sentry. + +## Development Tips + +### Test Suite + +Bugzilla comes with several integrated test suites that do basic sanity checks to more involved web UI testing. To +execute the tests, run the following commands: + +Basic sanity tests + +``` bash +docker compose -f docker-compose.test.yml down && docker compose -f docker-compose.test.yml run --no-deps bmo.test test_sanity +``` + +Webservices API tests + +``` bash +docker compose -f docker-compose.test.yml down && docker compose -f docker-compose.test.yml run bmo.test test_webservices +``` + +Selenium Web UI tests + +``` bash +docker compose -f docker-compose.test.yml down && docker compose -f docker-compose.test.yml run bmo.test test_selenium +``` + +### Testing Emails + +Configure your MTA setting you want to use by going to +and changing the mail_delivery_method to 'Test'. With this option, all mail will be appended to a +`data/mailer.testfile`. To see the emails being sent: + +``` bash +docker compose run bmo.test cat /app/data/mailer.testfile +``` + +### Front-end Libraries + +The third-party front-end libraries BMO serves — their scripts, stylesheets, images and icon fonts — +are generated from the versions pinned in `package.json` and `package-lock.json`. None of the +generated files are committed: the `assets` stage in the `Dockerfile` runs +`scripts/build-frontend.mjs` and the result is copied over `/app/js` in the image. Node exists +only in that stage, so the runtime image stays Node-free. + +This means a Dependabot pull request that bumps a library is complete on its own — there is nothing +to regenerate and commit, and CI tests the upgraded library as-is. Because a library's stylesheet is +generated from the same package as its script, the two cannot drift apart, so review upgrades for +visual changes as well as behavioural ones. Treat major bumps (jquery 4.x, mermaid 11.x, +devbridge-autocomplete 2.x) as manual, tested reviews. + +To add a new library: + +1. Add it to `dependencies` in `package.json`, pinned to an exact version, then run + `npm install` to update `package-lock.json`. + +2. Add an entry to `TARGETS` in `scripts/build-frontend.mjs` mapping the path BMO serves it from + (relative to `js/`) to the file inside `node_modules`. The mapping is explicit because the + names BMO serves do not always match the names upstream ships, and because only the files BMO + actually needs belong in the image: + + ``` javascript + 'lib/newlib.min.js': 'newlib/dist/newlib.min.js', + 'lib/newlib.css': 'newlib/dist/newlib.min.css', + ``` + + A library whose stylesheet references images or fonts by relative URL needs those too. Copy the + whole directory by adding it to `TARGET_DIRS` instead, so the assets land next to the + stylesheet that references them — this is how contextMenu's icon font and jQuery UI's images are + handled: + + ``` javascript + 'jquery/plugins/contextMenu/font': 'jquery-contextmenu/dist/font', + ``` + +3. If the library lands in a directory that also holds committed files, add the generated paths to + `.gitignore`. Adding to an existing generated directory such as `js/lib/` needs no change, + since the whole directory is already ignored. + +4. Load it from the template that needs it, the same as any other asset: + + ``` text + [% javascript_urls.push('js/lib/newlib.min.js') %] + [% style_urls.push('js/lib/newlib.css') %] + ``` + +jQuery plugins are a special case. `template/en/default/global/header.html.tmpl` builds their +paths by convention from the name pushed onto the `jquery` array: + + js/jquery/plugins//-min.js + +So a plugin's `TARGETS` entry has to follow that layout, and templates load it with +`[% jquery.push('name') %]` rather than a literal path. `js/jquery/plugins/bPopup/` is the one +library still vendored in the repository, because it is not published to npm. + +To rebuild after changing any of this, rebuild the image. If you want the generated files in your +working tree — to serve BMO from a checkout directly, for instance — run: + +``` bash +npm ci && npm run build +``` + +### Technical Details + +This Docker environment is a very scaled-down version of production BMO. +It uses roughly the same Perl dependencies as production. It is also +configured to use memcached. The push connector and Phabricator feed daemon +are running but connect to local test services rather than production systems. + +It includes a couple example products, some fake users, and some of BMO's +real groups. Email is disabled for all users; however, it is safe to enable +email as the box is configured to send all email to the 'admin' user on the +container. + +## Administrative Tasks + +### Generating cpanfile and cpanfile.snapshot files + +``` bash +docker build -t bmo-cpanfile -f Dockerfile.cpanfile . +docker run -it -v "$(pwd):/app/result" bmo-cpanfile cp cpanfile cpanfile.snapshot /app/result +``` + +### Generating a new bmo-perl-slim base image + +The `bmo-perl-slim` base image is stored in Google Artifact Registry. It +contains just the Perl dependencies in `/app/local` and other Debian packages +needed. Whenever the `cpanfile` and `cpanfile.snapshot` files have been +changed by the above steps after a successful merge, a new image will need to +be built and pushed. + +This is handled by the `BMO Perl Slim` GitHub Actions workflow +(`.github/workflows/perl-slim.yml`), which can be triggered manually via +`workflow_dispatch`. It builds the image and pushes it to Google Artifact +Registry with a date-stamped tag. + +After the new image is pushed, update the `FROM` line in `Dockerfile` to +reference the new tag. Create a PR, review and commit the change. + +## Support + +You can chat with the BMO team on [Matrix](https://chat.mozilla.org/#/room/#bmo:mozilla.org). diff --git a/README.rst b/README.rst deleted file mode 100644 index 780609573f..0000000000 --- a/README.rst +++ /dev/null @@ -1,442 +0,0 @@ -========================= -BMO: bugzilla.mozilla.org -========================= - -BMO is Mozilla's highly customized version of Bugzilla. - -.. image:: https://readthedocs.org/projects/bmo/badge/?version=latest - :target: https://bmo.readthedocs.io/en/latest/?badge=latest - :alt: Documentation Status - -.. image:: https://github.com/mozilla-bteam/bmo/actions/workflows/deploy.yml/badge.svg - :target: https://github.com/mozilla-bteam/bmo/actions - -.. contents:: -.. - 1. Using Docker Compose (For Development) - 2. Docker Container - 2.1 Container Arguments - 2.2 Environmental Variables - 2.3 Logging Configuration - 3. Development Tips - 3.1 Testing Emails - 4. Administrative Tasks - 4.1 Generating cpanfile and cpanfile.snapshot files - 4.2 Generating a new bmo-perl-slim base image - 5. Support - -If you want to contribute to BMO, you can fork this repo and get a local copy -of BMO running in a few minutes using Docker. - - -Using Docker (For Development) -============================== - -This repository contains a docker-compose file that will create a local Bugzilla for testing. - -To use Docker Compose, ensure you have the latest `Docker `_ -install for your environment (Linux, Windows, or macOS). - -.. code-block:: bash - - docker compose up --build - -This command will bring up the main webserver process, database, memcached, and various other -background tasks such as the Push system and the Feed system. The latter two are used for workflow -management between bugzilla.mozilla.org and other external systems. - -For normal development, you can run just the main webserver, database, and memcached by running the -following command instead: - -.. code-block:: bash - - docker compose up --build bmo.test - -After that, you should be able to visit http://localhost:8000/ from your browser. -You can login as admin@mozilla.bugs with the password "password012!" (without -quotes). - -If you want to update the code running in the web container, you do not need to restart everything. -You can run the following command: - -.. code-block:: bash - - docker compose exec bmo.test rsync -avz --exclude .git --exclude local /mnt/sync/ /app/ - -The Mojolicious morbo development server, used by the web container, will notice any code changes and -restart itself. - -The third-party front-end libraries (jQuery, Prism, mermaid, and so on) are not committed to the -repository. They are generated at image build time, so they exist in the container but not in your -checkout, and the ``rsync`` above leaves them alone. See `Front-end Libraries`_ for how to add or -upgrade one. - -If you are using Visual Studio Code, these ``docker compose`` commands will come in handy as the -editor's `tasks`_ that can be found under the Terminal menu. The update command is assigned to the -default build task so it can be executed by simply hitting Ctrl+Shift+B on Windows/Linux or -Command+Shift+B on macOS. An `extension bundle`_ for VS Code is also available. - -.. _`tasks`: https://code.visualstudio.com/docs/editor/tasks -.. _`extension bundle`: https://marketplace.visualstudio.com/items?itemName=dylanwh.bugzilla - - -Docker Container -================ - -This repository is also a runnable docker container. - -Container Arguments -------------------- - -Currently, the entry point takes a single command argument. -This can be **httpd** or **shell**. - -httpd - This will start the web server listening for connections on ``$PORT`` -shell - This will start an interactive shell in the container. Useful for debugging. - - -Environmental Variables ------------------------ - -PORT - This must be a value >= 1024. The httpd will listen on this port for incoming - plain-text HTTP connections. - Default: 8000 - -MOJO_REVERSE_PROXY - This tells the backend that it is behind a proxy. - Default: 1 - -MOJO_HEARTBEAT_INTERVAL - How often (in seconds) will the manager process send a heartbeat to the workers. - Default: 10 - -MOJO_HEARTBEAT_TIMEOUT - Maximum amount of time in seconds before a worker without a heartbeat will be stopped gracefully - Default: 120 - -MOJO_INACTIVITY_TIMEOUT - Maximum amount of time in seconds a connection can be inactive before getting closed. - Default: 120 - -MOJO_WORKERS - Number of worker processes. A good rule of thumb is two worker processes per - CPU core for applications that perform mostly non-blocking operations, - blocking operations often require more and benefit from decreasing - concurrency with "MOJO_CLIENTS" (often as low as 1). Note that during zero - downtime software upgrades there will be twice as many workers active for a - short amount of time. - Default: 1 - -MOJO_SPARE - Temporarily spawn up to this number of additional workers if there is a - need. This allows for new workers to be started while old ones are still - shutting down gracefully, drastically reducing the performance cost of - worker restarts. - Default: 1 - -MOJO_CLIENTS - Maximum number of accepted connections each worker process is allowed to - handle concurrently, before stopping to accept new incoming connections. Note - that high concurrency works best with applications that perform mostly - non-blocking operations, to optimize for blocking operations you can decrease - this value and increase "MOJO_WORKERS" instead for better performance. - Default: 200 - -BUGZILLA_ALLOW_INSECURE_HTTP - This should never be set in production. It allows oauth over http. - -BMO_urlbase - The public URL for this instance. Note that if this begins with https:// - and BMO_inbound_proxies is set to '*' Bugzilla will believe the connection to it - is using SSL. - -BMO_canonical_urlbase - The public URL for the production instance, if different from urlbase above. - -BMO_attachment_base - This is the URL for attachments. - When the allow_attachment_display parameter is on, it is possible for a - malicious attachment to steal your cookies or perform an attack on Bugzilla - using your credentials. - - If you would like additional security on attachments to avoid this, set this - parameter to an alternate URL for your Bugzilla that is not the same as - urlbase. That is, a different domain name that resolves to this - exact same Bugzilla installation. - - For added security, you can insert %bugid% into the URL, which will be - replaced with the ID of the current bug that the attachment is on, when you - access an attachment. This will limit attachments to accessing only other - attachments on the same bug. Remember, though, that all those possible domain - names (such as 1234.your.domain.com) must point to this same Bugzilla - instance. - -BMO_db_driver - What SQL database to use. Default is mysql. List of supported databases can be - obtained by listing Bugzilla/DB directory - every module corresponds to one - supported database and the name of the module (before ".pm") corresponds to a - valid value for this variable. - -BMO_db_host - The DNS name or IP address of the host that the database server runs on. - -BMO_db_name - The name of the database. - -BMO_db_user - The database user to connect as. - -BMO_db_pass - The password for the user above. - -BMO_site_wide_secret - This secret key is used by your installation for the creation and - validation of encrypted tokens. These tokens are used to implement - security features in Bugzilla, to protect against certain types of attacks. - It's very important that this key is kept secret. - -BMO_jwt_secret - This secret key is used by your installation for the creation and validation - of jwts. It's very important that this key is kept secret and it should be - different from the site_wide_secret. Changing this will invalidate all issued - jwts, so all oauth clients will need to start over. As such it should be a - high level of entropy, as it probably won't change for a very long time. - -BMO_inbound_proxies - This is a list of IP addresses that we expect proxies to come from. - This can be '*' if only the load balancer can connect to this container. - Setting this to '*' means that BMO will trust the X-Forwarded-For header. - -BMO_memcached_namespace - The global namespace for the memcached servers. - -BMO_memcached_servers - A list of memcached servers (IP addresses or host names). Can be empty. - -BMO_shadowdb - The database name of the read-only database. - -BMO_shadowdbhost - The hostname or IP address of the read-only database. - -BMO_shadowdbport - The port of the read-only database. - -BMO_setrlimit - This is a JSON object and can set any limit described in https://metacpan.org/pod/BSD::Resource. - Typically it used for setting RLIMIT_AS, and the default value is ``{ "RLIMIT_AS": 2000000000 }``. - -BMO_size_limit - This is the max amount of unshared memory the worker processes are allowed to - use before they will exit. Minimum 750000 (750MiB) - -BMO_mail_delivery_method - Usually configured on the MTA section of admin interface, but may be set here for testing purposes. - Valid values are None, Test, Sendmail, or SMTP. - If set to Test, email will be appended to the /app/data/mailer.testfile. - -BMO_use_mailer_queue - Usually configured on the MTA section of the admin interface, you may change this here for testing purposes. - Should be 1 or 0. If 1, the job queue will be used. For testing, only set to 0 if the BMO_mail_delivery_method is None or Test. - -USE_NYTPROF - Write `Devel::NYTProf`_ profiles out for each request. - These will be named /app/data/nytprof.$host.$script.$n.$pid, where $host is - the hostname of the container, script is the name of the script (without - extension), $n is a number starting from 1 and incrementing for each - request to the worker process, and $pid is the worker process id. - -NYTPROF_DIR - Alternative location to store profiles from the above option. - -LOG4PERL_CONFIG_FILE - Filename of `Log::Log4perl`_ config file. - It defaults to log4perl-json.conf. - If the file is given as a relative path, it will be relative to the /app/conf/ directory. - -.. _`Devel::NYTProf`: https://metacpan.org/pod/Devel::NYTProf - -.. _`Log::Log4perl`: https://metacpan.org/pod/Log::Log4perl - -LOG4PERL_STDERR_DISABLE - Boolean. By default log messages are logged as plain text to `STDERR`. - Setting this to a true value disables this behavior. - - Note: For programs that run using the `cereal` log aggregator, this environment - variable will be ignored. - - -Logging Configuration ---------------------- - -How Bugzilla logs is entirely configured by the environmental variable -`LOG4PERL_CONFIG_FILE`. This config file should be familiar to someone -familiar with log4j, and it is extensively documented in `Log::Log4perl`_. - -Many examples are provided in the ``conf/`` directory. - -If multiple processes will need to log, it should be configured to log to a socket on port 5880. -This will be the "cereal" daemon, which will only be started for jobqueue and httpd-type containers. - -The example log config files will often be configured to log to stderr -themselves. To prevent duplicate lines (or corrupted log messages), stderr -logging should be filtered on the existence of the LOG4PERL_STDERR_DISABLE -environmental variable. - -Logging configuration also controls which errors are sent to Sentry. - - -Development Tips -================ - -Test Suite ----------- - -Bugzilla comes with several integrated test suites that do basic sanity checks to more involved web UI testing. To -execute the tests, run the following commands: - -Basic sanity tests - -.. code-block:: bash - - docker compose -f docker-compose.test.yml down && docker compose -f docker-compose.test.yml run --no-deps bmo.test test_sanity - -Webservices API tests - -.. code-block:: bash - - docker compose -f docker-compose.test.yml down && docker compose -f docker-compose.test.yml run bmo.test test_webservices - -Selenium Web UI tests - -.. code-block:: bash - - docker compose -f docker-compose.test.yml down && docker compose -f docker-compose.test.yml run bmo.test test_selenium - -Testing Emails --------------- - -Configure your MTA setting you want to use by going to http://localhost:8000/editparams.cgi?section=mta -and changing the mail_delivery_method to 'Test'. With this option, all mail will be appended to a -``data/mailer.testfile``. To see the emails being sent: - -.. code-block:: bash - - docker compose run bmo.test cat /app/data/mailer.testfile - -Front-end Libraries -------------------- - -The third-party front-end libraries BMO serves — their scripts, stylesheets, images and icon fonts — -are generated from the versions pinned in ``package.json`` and ``package-lock.json``. None of the -generated files are committed: the ``assets`` stage in the ``Dockerfile`` runs -``scripts/build-frontend.mjs`` and the result is copied over ``/app/js`` in the image. Node exists -only in that stage, so the runtime image stays Node-free. - -This means a Dependabot pull request that bumps a library is complete on its own — there is nothing -to regenerate and commit, and CI tests the upgraded library as-is. Because a library's stylesheet is -generated from the same package as its script, the two cannot drift apart, so review upgrades for -visual changes as well as behavioural ones. Treat major bumps (jquery 4.x, mermaid 11.x, -devbridge-autocomplete 2.x) as manual, tested reviews. - -To add a new library: - -1. Add it to ``dependencies`` in ``package.json``, pinned to an exact version, then run - ``npm install`` to update ``package-lock.json``. - -2. Add an entry to ``TARGETS`` in ``scripts/build-frontend.mjs`` mapping the path BMO serves it from - (relative to ``js/``) to the file inside ``node_modules``. The mapping is explicit because the - names BMO serves do not always match the names upstream ships, and because only the files BMO - actually needs belong in the image: - - .. code-block:: javascript - - 'lib/newlib.min.js': 'newlib/dist/newlib.min.js', - 'lib/newlib.css': 'newlib/dist/newlib.min.css', - - A library whose stylesheet references images or fonts by relative URL needs those too. Copy the - whole directory by adding it to ``TARGET_DIRS`` instead, so the assets land next to the - stylesheet that references them — this is how contextMenu's icon font and jQuery UI's images are - handled: - - .. code-block:: javascript - - 'jquery/plugins/contextMenu/font': 'jquery-contextmenu/dist/font', - -3. If the library lands in a directory that also holds committed files, add the generated paths to - ``.gitignore``. Adding to an existing generated directory such as ``js/lib/`` needs no change, - since the whole directory is already ignored. - -4. Load it from the template that needs it, the same as any other asset: - - .. code-block:: text - - [% javascript_urls.push('js/lib/newlib.min.js') %] - [% style_urls.push('js/lib/newlib.css') %] - -jQuery plugins are a special case. ``template/en/default/global/header.html.tmpl`` builds their -paths by convention from the name pushed onto the ``jquery`` array:: - - js/jquery/plugins//-min.js - -So a plugin's ``TARGETS`` entry has to follow that layout, and templates load it with -``[% jquery.push('name') %]`` rather than a literal path. ``js/jquery/plugins/bPopup/`` is the one -library still vendored in the repository, because it is not published to npm. - -To rebuild after changing any of this, rebuild the image. If you want the generated files in your -working tree — to serve BMO from a checkout directly, for instance — run: - -.. code-block:: bash - - npm ci && npm run build - -Technical Details ------------------ - -This Docker environment is a very scaled-down version of production BMO. -It uses roughly the same Perl dependencies as production. It is also -configured to use memcached. The push connector and Phabricator feed daemon -are running but connect to local test services rather than production systems. - -It includes a couple example products, some fake users, and some of BMO's -real groups. Email is disabled for all users; however, it is safe to enable -email as the box is configured to send all email to the 'admin' user on the -container. - - -Administrative Tasks -==================== - -Generating cpanfile and cpanfile.snapshot files ------------------------------------------------ - -.. code-block:: bash - - docker build -t bmo-cpanfile -f Dockerfile.cpanfile . - docker run -it -v "$(pwd):/app/result" bmo-cpanfile cp cpanfile cpanfile.snapshot /app/result - -Generating a new bmo-perl-slim base image ------------------------------------------------------- - -The ``bmo-perl-slim`` base image is stored in Google Artifact Registry. It -contains just the Perl dependencies in ``/app/local`` and other Debian packages -needed. Whenever the ``cpanfile`` and ``cpanfile.snapshot`` files have been -changed by the above steps after a successful merge, a new image will need to -be built and pushed. - -This is handled by the ``BMO Perl Slim`` GitHub Actions workflow -(``.github/workflows/perl-slim.yml``), which can be triggered manually via -``workflow_dispatch``. It builds the image and pushes it to Google Artifact -Registry with a date-stamped tag. - -After the new image is pushed, update the ``FROM`` line in ``Dockerfile`` to -reference the new tag. Create a PR, review and commit the change. - - -Support -============================== - -You can chat with the BMO team on `Matrix `_. diff --git a/chart.cgi b/chart.cgi index d8f9ed7c75..0be4378aa0 100755 --- a/chart.cgi +++ b/chart.cgi @@ -69,7 +69,7 @@ if (grep(/^cmd-/, $cgi->param())) { my $action = $cgi->param('action'); my $series_id = $cgi->param('series_id'); -$vars->{'doc_section'} = 'reporting.html#charts'; +$vars->{'doc_section'} = 'using/reports-and-charts.html#charts'; # Because some actions are chosen by buttons, we can't encode them as the value # of the action param, because that value is localization-dependent. So, we diff --git a/conf/checksetup_answers.txt b/conf/checksetup_answers.txt index 251d0f3fb2..def44b5d3f 100644 --- a/conf/checksetup_answers.txt +++ b/conf/checksetup_answers.txt @@ -10,7 +10,6 @@ $answer{'default_bug_type'} = '--'; $answer{'defaultpriority'} = '--'; $answer{'defaultseverity'} = 'normal'; $answer{'diffpath'} = '/usr/bin'; -$answer{'docs_urlbase'} = 'https://bmo.readthedocs.io/en/latest/'; $answer{'index_html'} = 0; $answer{'insidergroup'} = 'admin'; $answer{'interdiffbin'} = '/usr/bin/interdiff'; diff --git a/conf/checksetup_answers_suite.txt b/conf/checksetup_answers_suite.txt index 0e38da1e15..bd5bfdb535 100644 --- a/conf/checksetup_answers_suite.txt +++ b/conf/checksetup_answers_suite.txt @@ -10,7 +10,6 @@ $answer{'default_bug_type'} = '--'; $answer{'defaultpriority'} = '--'; $answer{'defaultseverity'} = 'normal'; $answer{'diffpath'} = '/usr/bin'; -$answer{'docs_urlbase'} = 'https://bmo.readthedocs.io/en/latest/'; $answer{'index_html'} = 0; $answer{'insidergroup'} = 'admin'; $answer{'interdiffbin'} = '/usr/bin/interdiff'; diff --git a/contribute.json b/contribute.json index dd0f8698fc..c8ae3f0c82 100644 --- a/contribute.json +++ b/contribute.json @@ -18,7 +18,7 @@ ], "participate": { "home": "https://wiki.mozilla.org/BMO", - "docs": "https://bmo.readthedocs.io" + "docs": "https://bugzilla.mozilla.org/docs" }, "bugs": { "list": "https://bugzilla.mozilla.org/buglist.cgi?bug_status=NEW&product=bugzilla.mozilla.org", diff --git a/describekeywords.cgi b/describekeywords.cgi index 10d442d49a..635fae86c7 100755 --- a/describekeywords.cgi +++ b/describekeywords.cgi @@ -46,7 +46,7 @@ my $can_see_security = Bugzilla->user->in_group('core-security-release'); my $keywords = Bugzilla::Keyword->get_all_with_bug_count(); foreach my $keyword (@$keywords) { $keyword->{'bug_count'} = 0 - if $keyword->name =~ /^(?:sec|csec|wsec|opsec)-/ && !$can_see_security; + if $keyword->is_security_keyword && !$can_see_security; } $vars->{'keywords'} = $keywords; diff --git a/docs/en/Makefile b/docs/en/Makefile deleted file mode 100644 index fc9af11e01..0000000000 --- a/docs/en/Makefile +++ /dev/null @@ -1,158 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = . - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) rst -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) rst - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Bugzilla.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Bugzilla.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/Bugzilla" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Bugzilla" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' to have that step done automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/pdf - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/pdf all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/pdf." - -pdf: - $(SPHINXBUILD) -b pdf -t enable_rst2pdf $(ALLSPHINXOPTS) $(BUILDDIR)/pdf - @echo - @echo "Build finished. The PDF file is in $(BUILDDIR)/pdf." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/txt - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/txt." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." diff --git a/docs/en/md/about/index.md b/docs/en/md/about/index.md new file mode 100644 index 0000000000..48d0cd4857 --- /dev/null +++ b/docs/en/md/about/index.md @@ -0,0 +1,92 @@ +# About This Documentation + +This is the documentation for version 4.2 of Bugzilla, a bug-tracking system +from Mozilla. Bugzilla is an enterprise-class piece of software that tracks +millions of bugs and issues for thousands of organizations around the world. + +The most current version of this document can always be found on the [Bugzilla +website](https://www.bugzilla.org/docs/). + +## Evaluating Bugzilla + +If you want to try out Bugzilla to see if it meets your needs, you can do so on +[Mozilla’s Bugzilla (BMO) test server](https://bugzilla-dev.allizom.org/), +though it comes with various Mozilla-specific customizations. The easiest way +to explore the admin tools and more is [running a minimum local copy of +BMO](https://github.com/mozilla-bteam/bmo/blob/master/README.md) using Docker. +We are not offering any online vanilla test environment at this time. + +The [Bugzilla FAQ](https://wiki.mozilla.org/Bugzilla:FAQ) may also be helpful, +as it answers a number of questions people sometimes have about whether +Bugzilla is for them. + +## Getting More Help + +If this document does not answer your questions, we run a [Mozilla +forum](https://www.mozilla.org/about/forums/#support-bugzilla) which can be +accessed as a newsgroup, mailing list, or over the web as a Google Group. +Please [search +it](https://groups.google.com/forum/#!forum/mozilla.support.bugzilla) first, +and then ask your question there. + +If you need a guaranteed response, commercial support is +[available](https://www.bugzilla.org/support/consulting.html) for Bugzilla from +a number of people and organizations. + +## Document Conventions + +This document uses the following conventions: + +> [!WARNING] +> This is a warning—something you should be aware of. + +> [!NOTE] +> This is just a note, for your information. + +A filename or a path to a filename is displayed like this: +`/path/to/filename.ext` + +A command to type in the shell is displayed like this: `command --arguments` + +A sample of code is illustrated like this: + + First Line of Code + Second Line of Code + ... + +This documentation is maintained in [GitHub-flavored +Markdown](https://github.github.com/gfm/) in the `docs/en/md` directory of +the BMO source tree, and is served directly by Bugzilla itself. Please file +any bugs you find in the [Bugzilla +Documentation](https://bugzilla.mozilla.org/enter_bug.cgi?product=Bugzilla;component=Documentation) +component in Mozilla's installation of Bugzilla. If you also want to make a +patch, that would be wonderful. Changes are best submitted as pull requests +against the [BMO repository](https://github.com/mozilla-bteam/bmo). There is +a [Style Guide](../style.md) to help you write any new text and markup. + +## License + +Bugzilla is [free](http://www.gnu.org/philosophy/free-sw.html) and [open +source](http://opensource.org/osd) software, which means (among other things) +that you can download it, install it, and run it for any purpose whatsoever +without the need for license or payment. Isn't that refreshing? + +Bugzilla's code is made available under the [Mozilla Public License +2.0](http://www.mozilla.org/MPL/2.0/) (MPL), specifically the variant which is +Incompatible with Secondary Licenses. However, again, if you only want to +install and run Bugzilla, you don't need to worry about that; it's only +relevant if you redistribute the code or any changes you make. + +Bugzilla's documentation is made available under the [Creative Commons CC-BY-SA +International License 4.0](https://creativecommons.org/licenses/by-sa/4.0/), or +any later version. + +## Credits + +The people listed below have made significant contributions to the creation of +this documentation: + +Andrew Pearson, Ben FrantzDale, Byron Jones, Dave Lawrence, Dave Miller, Dawn +Endico, Eric Hanson, Gervase Markham, Jacob Steenhagen, Joe Robins, Kevin +Brannen, Martin Wulffeld, Matthew P. Barnson, Ron Teitelbaum, Shane Travis, +Spencer Smith, Tara Hernandez, Terry Weissman, Vlad Dascalu, Zach Lipton. diff --git a/docs/en/md/administering/categorization.md b/docs/en/md/administering/categorization.md new file mode 100644 index 0000000000..9f728fb8b1 --- /dev/null +++ b/docs/en/md/administering/categorization.md @@ -0,0 +1,327 @@ +# Classifications, Products, Components, Versions, and Milestones + +Bugs in Bugzilla are classified into one of a set of admin-defined Components. +Components are themselves each part of a single Product. Optionally, Products +can be part of a single Classification, adding a third level to the hierarchy. + +## Classifications + +Classifications are used to group several related products into one distinct +entity. + +For example, if a company makes computer games, they could have a +classification of "Games", and a separate product for each game. This company +might also have a `Common` classification, containing products representing +units of technology used in multiple games, and perhaps an `Other` +classification containing a few special products that represent items that are +not actually shipping products (for example, "Website", or "Administration"). + +The classifications layer is disabled by default; it can be turned on or off +using the `useclassification` parameter in the *Bug Fields* section of +[Parameters](parameters.md). + +Access to the administration of classifications is controlled using the +*editclassifications* system group, which defines a privilege for creating, +destroying, and editing classifications. + +When activated, classifications will introduce an additional step when filling +bugs (dedicated to classification selection), and they will also appear in the +advanced search form. + +## Products + +Products usually represent real-world shipping products. Many of Bugzilla's +settings are configurable on a per-product basis. + +When creating or editing products the following options are available: + +Product +The name of the product + +Description +A brief description of the product + +Open for bug entry +Deselect this box to prevent new bugs from being entered against this product. + +Enable the UNCONFIRMED status in this product +Select this option if you want to use the UNCONFIRMED status (see +[Workflow](workflow.md)) + +Default milestone +Select the default milestone for this product. + +Version +Specify the default version for this product. + +Create chart datasets for this product +Select to make chart datasets available for this product. + +It is compulsory to create at least one [component](#components) in a +product, and so you will be asked for the details of that too. + +When editing a product you can change all of the above, and there is also a +link to edit Group Access Controls; see [Assigning Group Controls to +Products](#assigning-group-controls-to-products). + +### Creating New Products + +To create a new product: + +1. Select `Administration` from the footer and then choose `Products` from the + main administration page. +2. Select the `Add` link in the bottom right. +3. Enter the details as outlined above. + +### Editing Products + +To edit an existing product, click the "Products" link from the +"Administration" page. If the `useclassification` parameter is turned on, a +table of existing classifications is displayed, including an "Unclassified" +category. The table indicates how many products are in each classification. +Click on the classification name to see its products. If the +`useclassification` parameter is not in use, the table lists all products +directly. The product table summarizes the information defined when the product +was created. Click on the product name to edit these properties, and to access +links to other product attributes such as the product's components, versions, +milestones, and group access controls. + +### Adding or Editing Components, Versions and Target Milestones + +To add new or edit existing Components, Versions, or Target Milestones to a +Product, select the "Edit Components", "Edit Versions", or "Edit Milestones" +links from the "Edit Product" page. A table of existing Components, Versions, +or Milestones is displayed. Click on an item name to edit the properties of +that item. Below the table is a link to add a new Component, Version, or +Milestone. + +For more information on components, see [Components](#components). + +For more information on versions, see [Versions](#versions). + +For more information on milestones, see [Milestones](#milestones). + +### Assigning Group Controls to Products + +On the `Edit Product` page, there is a link called +`Edit Group Access Controls`. The settings on this page control the +relationship of the groups to the product being edited. + +Group Access Controls are an important aspect of using groups for isolating +products and restricting access to bugs filed against those products. For more +information on groups, including how to create, edit, add users to, and alter +permission of, see [Groups and Security](groups.md). + +After selecting the "Edit Group Access Controls" link from the "Edit Product" +page, a table containing all user-defined groups for this Bugzilla installation +is displayed. The system groups that are created when Bugzilla is installed are +not applicable to Group Access Controls. Below is description of what each of +these fields means. + +Groups may be applicable (i.e. bugs in this product can be associated with this +group), default (i.e. bugs in this product are in this group by default), and +mandatory (i.e. bugs in this product must be associated with this group) for +each product. Groups can also control access to bugs for a given product, or be +used to make bugs for a product totally read-only unless the group restrictions +are met. The best way to understand these relationships is by example. See +[Common Applications of Group Controls](#common-applications-of-group-controls) for +examples of product and group relationships. + +> [!NOTE] +> Products and Groups are not limited to a one-to-one relationship. Multiple +> groups can be associated with the same product, and groups can be associated +> with more than one product. + +If any group has *Entry* selected, then the product will restrict bug entry to +only those users who are members of *all* the groups with *Entry* selected. + +If any group has *Canedit* selected, then the product will be read-only for any +users who are not members of *all* of the groups with *Canedit* selected. +*Only* users who are members of all the *Canedit* groups will be able to edit +bugs for this product. This is an additional restriction that enables +finer-grained control over products rather than just all-or-nothing access +levels. + +The following settings let you choose privileges on a *per-product basis*. This +is a convenient way to give privileges to some users for some products only, +without having to give them global privileges which would affect all products. + +Any group having *editcomponents* selected allows users who are in this group +to edit all aspects of this product, including components, milestones, and +versions. + +Any group having *canconfirm* selected allows users who are in this group to +confirm bugs in this product. + +Any group having *editbugs* selected allows users who are in this group to edit +all fields of bugs in this product. + +The *MemberControl* and *OtherControl* are used in tandem to determine which +bugs will be placed in this group. The only allowable combinations of these two +parameters are listed in a table on the "Edit Group Access Controls" page. +Consult this table for details on how these fields can be used. Examples of +different uses are described below. + +### Common Applications of Group Controls + +The use of groups is best explained by providing examples that illustrate +configurations for common use cases. The examples follow a common syntax: +*Group: Entry, MemberControl, OtherControl, CanEdit, EditComponents, +CanConfirm, EditBugs*, where "Group" is the name of the group being edited for +this product. The other fields all correspond to the table on the "Edit Group +Access Controls" page. If any of these options are not listed, it means they +are not checked. + +#### Basic Product/Group Restriction + +Suppose there is a product called "Bar". You would like to make it so that only +users in the group "Foo" can enter bugs in the "Bar" product. Additionally, +bugs filed in product "Bar" must be visible only to users in "Foo" (plus, by +default, the reporter, assignee, and CC list of each bug) at all times. +Furthermore, only members of group "Foo" should be able to edit bugs filed +against product "Bar", even if other users could see the bug. This arrangement +would achieved by the following: + + Product Bar: + foo: ENTRY, MANDATORY/MANDATORY, CANEDIT + +Perhaps such strict restrictions are not needed for product "Bar". Instead, you +would like to make it so that only members of group "Foo" can enter bugs in +product "Bar", but bugs in "Bar" are not required to be restricted in +visibility to people in "Foo". Anyone with permission to edit a particular bug +in product "Bar" can put the bug in group "Foo", even if they themselves are +not in "Foo". + +Furthermore, anyone in group "Foo" can edit all aspects of the components of +product "Bar", can confirm bugs in product "Bar", and can edit all fields of +any bug in product "Bar". That would be done like this: + + Product Bar: + foo: ENTRY, SHOWN/SHOWN, EDITCOMPONENTS, CANCONFIRM, EDITBUGS + +#### General User Access With Security Group + +To permit any user to file bugs against "Product A", and to permit any user to +submit those bugs into a group called "Security": + + Product A: + security: SHOWN/SHOWN + +#### General User Access With A Security Product + +To permit any user to file bugs against product called "Security" while keeping +those bugs from becoming visible to anyone outside the group "SecurityWorkers" +(unless a member of the "SecurityWorkers" group removes that restriction): + + Product Security: + securityworkers: DEFAULT/MANDATORY + +#### Product Isolation With a Common Group + +To permit users of "Product A" to access the bugs for "Product A", users of +"Product B" to access the bugs for "Product B", and support staff, who are +members of the "Support Group" to access both, three groups are needed: + +1. Support Group: Contains members of the support staff. +2. AccessA Group: Contains users of product A and the Support group. +3. AccessB Group: Contains users of product B and the Support group. + +Once these three groups are defined, the product group controls can be set to: + + Product A: + AccessA: ENTRY, MANDATORY/MANDATORY + Product B: + AccessB: ENTRY, MANDATORY/MANDATORY + +Perhaps the "Support Group" wants more control. For example, the "Support +Group" could be permitted to make bugs inaccessible to users of both groups +"AccessA" and "AccessB". Then, the "Support Group" could be permitted to +publish bugs relevant to all users in a third product (let's call it "Product +Common") that is read-only to anyone outside the "Support Group". In this way +the "Support Group" could control bugs that should be seen by both groups. That +configuration would be: + + Product A: + AccessA: ENTRY, MANDATORY/MANDATORY + Support: SHOWN/NA + Product B: + AccessB: ENTRY, MANDATORY/MANDATORY + Support: SHOWN/NA + Product Common: + Support: ENTRY, DEFAULT/MANDATORY, CANEDIT + +#### Make a Product Read Only + +Sometimes a product is retired and should no longer have new bugs filed against +it (for example, an older version of a software product that is no longer +supported). A product can be made read-only by creating a group called +"readonly" and adding products to the group as needed: + + Product A: + ReadOnly: ENTRY, NA/NA, CANEDIT + +> [!NOTE] +> For more information on Groups outside of how they relate to products see +> [Groups and Security](groups.md). + +## Components + +Components are subsections of a Product. E.g. the computer game you are +designing may have a "UI" component, an "API" component, a "Sound System" +component, and a "Plugins" component, each overseen by a different programmer. +It often makes sense to divide Components in Bugzilla according to the natural +divisions of responsibility within your Product or company. + +Each component has a default assignee and, if you turned it on in the +[Parameters](parameters.md), a QA Contact. The default assignee should be +the primary person who fixes bugs in that component. The QA Contact should be +the person who will ensure these bugs are completely fixed. The Assignee, QA +Contact, and Reporter will get email when new bugs are created in this +Component and when these bugs change. Default Assignee and Default QA Contact +fields only dictate the *default assignments*; these can be changed on bug +submission, or at any later point in a bug's life. + +To create a new Component: + +1. Select the `Edit components` link from the `Edit product` page. +2. Select the `Add` link in the bottom right. +3. Fill out the `Component` field, a short `Description`, the + `Default Assignee`, `Default CC List`, and `Default QA Contact` (if + enabled). The `Component Description` field may contain a limited subset of + HTML tags. The `Default Assignee` field must be a login name already + existing in the Bugzilla database. + +## Versions + +Versions are the revisions of the product, such as "Flinders 3.1", "Flinders +95", and "Flinders 2000". Version is not a multi-select field; the usual +practice is to select the earliest version known to have the bug. + +To create and edit Versions: + +1. From the "Edit product" screen, select "Edit Versions". +2. You will notice that the product already has the default version + "undefined". Click the "Add" link in the bottom right. +3. Enter the name of the Version. This field takes text only. Then click the + "Add" button. + +## Milestones + +Milestones are "targets" that you plan to get a bug fixed by. For example, if +you have a bug that you plan to fix for your 3.0 release, it would be assigned +the milestone of 3.0. + +> [!NOTE] +> Milestone options will only appear for a Product if you turned on the +> `usetargetmilestone` parameter in the "Bug Fields" tab of the +> [Parameters](parameters.md) page. + +To create new Milestones and set Default Milestones: + +1. Select "Edit milestones" from the "Edit product" page. +2. Select "Add" in the bottom right corner. +3. Enter the name of the Milestone in the "Milestone" field. You can + optionally set the "sortkey", which is a positive or negative number + (-32768 to 32767) that defines where in the list this particular milestone + appears. This is because milestones often do not occur in alphanumeric + order; for example, "Future" might be after "Release 1.2". Select "Add". diff --git a/docs/en/md/administering/custom-fields.md b/docs/en/md/administering/custom-fields.md new file mode 100644 index 0000000000..7831b1e1c8 --- /dev/null +++ b/docs/en/md/administering/custom-fields.md @@ -0,0 +1,106 @@ +# Custom Fields + +Custom Fields are fields defined by the administrator, in addition to those +which come with Bugzilla by default. Custom Fields are treated like any other +field—they can be set in bugs and used for search queries. + +Administrators should keep in mind that adding too many fields can make the +user interface more complicated and harder to use. Custom Fields should be +added only when necessary and with careful consideration. + +> [!NOTE] +> Before adding a Custom Field, make sure that Bugzilla cannot already do the +> desired behavior. Many Bugzilla options are not enabled by default, and many +> times Administrators find that simply enabling certain options that already +> exist is sufficient. + +Administrators can manage Custom Fields using the `Custom Fields` link on the +Administration page. The Custom Fields administration page displays a list of +Custom Fields, if any exist, and a link to "Add a new custom field". + +## Adding Custom Fields + +To add a new Custom Field, click the "Add a new custom field" link. This page +displays several options for the new field, described below. + +The following attributes must be set for each new custom field: + +- *Name:* The name of the field in the database, used internally. This name + MUST begin with `cf_` to prevent confusion with standard fields. If this + string is omitted, it will be automatically added to the name entered. +- *Description:* A brief string used as the label for this Custom Field. That + is the string that users will see, and it should be short and explicit. +- *Type:* The type of field to create. There are several types available: + Bug ID: + A field where you can enter the ID of another bug from the same Bugzilla + installation. To point to a bug in a remote installation, use the See Also + field instead. + + Large Text Box: + A multiple line box for entering free text. + + Free Text: + A single line box for entering free text. + + Multiple-Selection Box: + A list box where multiple options can be selected. After creating this field, + it must be edited to add the selection options. See [Viewing/Editing Legal + Values](field-values.md#viewingediting-legal-values) for information about editing legal values. + + Drop Down: + A list box where only one option can be selected. After creating this field, + it must be edited to add the selection options. See [Viewing/Editing Legal + Values](field-values.md#viewingediting-legal-values) for information about editing legal values. + + Date/Time: + A date field. This field appears with a calendar widget for choosing the + date. +- *Sortkey:* Integer that determines in which order Custom Fields are displayed + in the User Interface, especially when viewing a bug. Fields with lower + values are displayed first. +- *Reverse Relationship Description:* When the custom field is of type + `Bug ID`, you can enter text here which will be used as label in the + referenced bug to list bugs which point to it. This gives you the ability to + have a mutual relationship between two bugs. +- *Can be set on bug creation:* Boolean that determines whether this field can + be set on bug creation. If not selected, then a bug must be created before + this field can be set. See [Filing a Bug](../using/filing.md) for information + about filing bugs. +- *Displayed in bugmail for new bugs:* Boolean that determines whether the + value set on this field should appear in bugmail when the bug is filed. This + attribute has no effect if the field cannot be set on bug creation. +- *Is obsolete:* Boolean that determines whether this field should be displayed + at all. Obsolete Custom Fields are hidden. +- *Is mandatory:* Boolean that determines whether this field must be set. For + single and multi-select fields, this means that a (non-default) value must be + selected; for text and date fields, some text must be entered. +- *Field only appears when:* A custom field can be made visible when some + criteria is met. For instance, when the bug belongs to one or more products, + or when the bug is of some given severity. If left empty, then the custom + field will always be visible, in all bugs. +- *Field that controls the values that appear in this field:* When the custom + field is of type `Drop Down` or `Multiple-Selection Box`, you can restrict + the availability of the values of the custom field based on the value of + another field. This criteria is independent of the criteria used in the + `Field only appears when` setting. For instance, you may decide that some + given value `valueY` is only available when the bug status is RESOLVED while + the value `valueX` should always be listed. Once you have selected the field + that should control the availability of the values of this custom field, you + can edit values of this custom field to set the criteria; see + [Viewing/Editing Legal Values](field-values.md#viewingediting-legal-values). + +## Editing Custom Fields + +As soon as a Custom Field is created, its name and type cannot be changed. If +this field is a drop-down menu, its legal values can be set as described in +[Viewing/Editing Legal Values](field-values.md#viewingediting-legal-values). All other attributes +can be edited as described above. + +## Deleting Custom Fields + +Only custom fields that are marked as obsolete, and that have never been used, +can be deleted completely (else the integrity of the bug history would be +compromised). For custom fields marked as obsolete, a "Delete" link will appear +in the `Action` column. If the custom field has been used in the past, the +deletion will be rejected. Marking the field as obsolete, however, is +sufficient to hide it from the user interface entirely. diff --git a/docs/en/md/administering/extensions.md b/docs/en/md/administering/extensions.md new file mode 100644 index 0000000000..506e0e7ffe --- /dev/null +++ b/docs/en/md/administering/extensions.md @@ -0,0 +1,8 @@ +# Installed Extensions + +Bugzilla can be enhanced using extensions (see +[Extensions](../integrating/extensions.md)). If an extension comes with user +documentation in Markdown format under `docs/en/md/extensions/`, it is +listed here. + +Your Bugzilla installation has documentation for the following extensions: diff --git a/docs/en/md/administering/field-values.md b/docs/en/md/administering/field-values.md new file mode 100644 index 0000000000..67e5c296d5 --- /dev/null +++ b/docs/en/md/administering/field-values.md @@ -0,0 +1,34 @@ +# Field Values + +Legal values for the operating system, platform, bug priority and severity, and +custom fields of type `Drop Down` and `Multiple-Selection Box` (see [Custom +Fields](custom-fields.md)), as well as the list of valid bug statuses and +resolutions, can be customized from the same interface. You can add, edit, +disable, and remove the values that can be used with these fields. + +## Viewing/Editing Legal Values + +Editing legal values requires `admin` privileges. Select "Field Values" from +the Administration page. A list of all fields, both system and Custom, for +which legal values can be edited appears. Click a field name to edit its legal +values. + +There is no limit to how many values a field can have, but each value must be +unique to that field. The sortkey is important to display these values in the +desired order. + +When the availability of the values of a custom field is controlled by another +field, you can select from here which value of the other field must be set for +the value of the custom field to appear. + +## Deleting Legal Values + +Legal values from Custom Fields can be deleted, but only if the following two +conditions are respected: + +1. The value is not set as the default for the field. +2. No bug is currently using this value. + +If any of these conditions is not respected, the value cannot be deleted. The +only way to delete these values is to reassign bugs to another value and to set +another value as default for the field. diff --git a/docs/en/md/administering/flags.md b/docs/en/md/administering/flags.md new file mode 100644 index 0000000000..b3d59ab0c1 --- /dev/null +++ b/docs/en/md/administering/flags.md @@ -0,0 +1,132 @@ +# Flags + +If you have the `editcomponents` permission, you can edit Flag Types from the +main administration page. Clicking the **Flags** link will bring you to the +**Administer Flag Types** page. Here, you can select whether you want to create +(or edit) a Bug flag or an Attachment flag. + +The two flag types have the same administration interface, and the interface +for creating a flag and editing a flag have the same set of fields. + +## Flag Properties + +Name +This is the name of the flag. This will be displayed to Bugzilla users who are +looking at or setting the flag. The name may contain any valid Unicode +characters except commas and spaces. + +Description +The description describes the flag in more detail. It is visible in a tooltip +when hovering over a flag either in the **Show Bug** or **Edit Attachment** +pages. This field can be as long as you like and can contain any character you +want. + +Category +You can set a flag to be visible or not visible on any combination of products +and components. + +Default behavior for a newly created flag is to appear on all products and all +components, which is why `__Any__:__Any__` is already entered in the +**Inclusions** box. If this is not your desired behavior, you must either set +some exclusions (for products on which you don't want the flag to appear), or +you must remove `__Any__:__Any__` from the **Inclusions** box and define +products/components specifically for this flag. + +To create an Inclusion, select a Product from the top drop-down box. You may +also select a specific component from the bottom drop-down box. (Setting +`__Any__` for Product translates to "all the products in this Bugzilla". +Selecting `__Any__` in the Component field means "all components in the +selected product.") Selections made, press **Include**, and your +Product/Component pairing will show up in the **Inclusions** box on the right. + +To create an Exclusion, the process is the same: select a Product from the top +drop-down box, select a specific component if you want one, and press +**Exclude**. The Product/Component pairing will show up in the **Exclusions** +box on the right. + +This flag *will* appear and *can* be set for any products/components appearing +in the **Inclusions** box (or which fall under the appropriate `__Any__`). This +flag *will not* appear (and therefore *cannot* be set) on any products +appearing in the **Exclusions** box. *IMPORTANT: Exclusions override +inclusions.* + +You may select a Product without selecting a specific Component, but you cannot +select a Component without a Product. If you do so, Bugzilla will display an +error message, even if all your products have a component by that name. You +will also see an error if you select a Component that does not belong to the +selected Product. + +*Example:* Let's say you have a product called `Jet Plane` that has thousands +of components. You want to be able to ask if a problem should be fixed in the +next model of plane you release. We'll call the flag `fixInNext`. However, one +component in `Jet Plane` is called `Pilot`, and it doesn't make sense to +release a new pilot, so you don't want to have the flag show up in that +component. So, you include `Jet Plane:__Any__` and you exclude +`Jet Plane:Pilot`. + +Sort Key +Flags normally show up in alphabetical order. If you want them to show up in a +different order, you can use this key set the order on each flag. Flags with a +lower sort key will appear before flags with a higher sort key. Flags that have +the same sort key will be sorted alphabetically. + +Active +Sometimes you might want to keep old flag information in the Bugzilla database +but stop users from setting any new flags of this type. To do this, uncheck +**active**. Deactivated flags will still show up in the UI if they are `?`, +`+`, or `-`, but they may only be cleared (unset) and cannot be changed to a +new value. Once a deactivated flag is cleared, it will completely disappear +from a bug/attachment and cannot be set again. + +Requestable +New flags are, by default, "requestable", meaning that they offer users the `?` +option, as well as `+` and `-`. To remove the `?` option, uncheck +"requestable". + +Specifically Requestable +By default this box is checked for new flags, meaning that users may make flag +requests of specific individuals. Unchecking this box will remove the text box +next to a flag; if it is still requestable, then requests cannot target +specific users and are open to anyone (called a request "to the wind" in +Bugzilla). Removing this after specific requests have been made will not remove +those requests; that data will stay in the database (though it will no longer +appear to the user). + +Multiplicable +Any flag with **Multiplicable:guilabel:** set (default for new flags is 'on') +may be set more than once. After being set once, an unset flag of the same type +will appear below it with "addl." (short for "additional") before the name. +There is no limit to the number of times a Multiplicable flags may be set on +the same bug/attachment. + +CC List +If you want certain users to be notified every time this flag is set to `?`, +`-`, or `+`, or is unset, add them here. This is a comma-separated list of +email addresses that need not be restricted to Bugzilla usernames. + +Grant Group +When this field is set to some given group, only users in the group can set the +flag to `+` and `-`. This field does not affect who can request or cancel the +flag. For that, see the **Request Group** field below. If this field is left +blank, all users can set or delete this flag. This field is useful for +restricting which users can approve or reject requests. + +Request Group +When this field is set to some given group, only users in the group can request +or cancel this flag. Note that this field has no effect if the **Grant Group** +field is empty. You can set the value of this field to a different group, but +both fields have to be set to a group for this field to have an effect. + +## Deleting a Flag + +When you are at the **Administer Flag Types** screen, you will be presented +with a list of Bug flags and a list of Attachment Flags. + +To delete a flag, click on the **Delete** link next to the flag description. + +> [!WARNING] +> Once you delete a flag, it is *gone* from your Bugzilla. All the data for +> that flag will be deleted. Everywhere that flag was set, it will disappear, +> and you cannot get that data back. If you want to keep flag data, but don't +> want anybody to set any new flags or change current flags, unset **active** +> in the flag Edit form. diff --git a/docs/en/md/administering/groups.md b/docs/en/md/administering/groups.md new file mode 100644 index 0000000000..e84bc4e620 --- /dev/null +++ b/docs/en/md/administering/groups.md @@ -0,0 +1,168 @@ +# Groups and Security + +Groups allow for separating bugs into logical divisions. Groups are typically +used to isolate bugs that should only be seen by certain people. For example, a +company might create a different group for each one of its customers or +partners. Group permissions could be set so that each partner or customer would +only have access to their own bugs. Or, groups might be used to create variable +access controls for different departments within an organization. Another +common use of groups is to associate groups with products, creating isolation +and access control on a per-product basis. + +Groups and group behaviors are controlled in several places: + +1. The group configuration page. To view or edit existing groups, or to create + new groups, access the "Groups" link from the "Administration" page. This + section of the manual deals primarily with the aspect of group controls + accessed on this page. +2. Global configuration parameters. Bugzilla has several parameters that + control the overall default group behavior and restriction levels. For more + information on the parameters that control group behavior globally, see + [Group Security](parameters.md#group-security). +3. Product association with groups. Most of the functionality of groups and + group security is controlled at the product level. Some aspects of group + access controls for products are discussed in this section, but for more + detail see [Assigning Group Controls to + Products](categorization.md#assigning-group-controls-to-products). +4. Group access for users. See [Assigning Users to + Groups](#assigning-users-to-groups) for details on how users are assigned + group access. + +Group permissions are such that if a bug belongs to a group, only members of +that group can see the bug. If a bug is in more than one group, only members of +*all* the groups that the bug is in can see the bug. For information on +granting read-only access to certain people and full edit access to others, see +[Assigning Group Controls to Products](categorization.md#assigning-group-controls-to-products). + +> [!NOTE] +> By default, bugs can also be seen by the Assignee, the Reporter, and everyone +> on the CC List, regardless of whether or not the bug would typically be +> viewable by them. Visibility to the Reporter and CC List can be overridden +> (on a per-bug basis) by bringing up the bug, finding the section that starts +> with `Users in the roles selected below...` and un-checking the box next to +> either 'Reporter' or 'CC List' (or both). + +## Creating Groups + +To create a new group, follow the steps below: + +1. Select the `Administration` link in the page footer, and then select the + `Groups` link from the Administration page. + +2. A table of all the existing groups is displayed. Below the table is a + description of all the fields. To create a new group, select the + `Add Group` link under the table of existing groups. + +3. There are five fields to fill out. These fields are documented below the + form. Choose a name and description for the group. Decide whether this + group should be used for bugs (in all likelihood this should be selected). + Optionally, choose a regular expression that will automatically add any + matching users to the group, and choose an icon that will help identify + user comments for the group. The regular expression can be useful, for + example, to automatically put all users from the same company into one + group (if the group is for a specific customer or partner). + + > [!NOTE] + > If `User RegExp` is filled out, users whose email addresses match the + > regular expression will automatically be members of the group as long as + > their email addresses continue to match the regular expression. If their + > email address changes and no longer matches the regular expression, they + > will be removed from the group. Versions 2.16 and older of Bugzilla did + > not automatically remove users whose email addresses no longer matched + > the RegExp. + + > [!WARNING] + > If specifying a domain in the regular expression, end the regexp with a + > "\$". Otherwise, when granting access to "@mycompany\\com", access will + > also be granted to 'badperson@mycompany.com.cracker.net'. Use the syntax, + > '@mycompany\\com\$' for the regular expression. + +4. After the new group is created, it can be edited for additional options. + The "Edit Group" page allows for specifying other groups that should be + included in this group and which groups should be permitted to add and + delete users from this group. For more details, see [Editing Groups and + Assigning Group Permissions](#editing-groups-and-assigning-group-permissions). + +## Editing Groups and Assigning Group Permissions + +To access the "Edit Groups" page, select the `Administration` link in the page +footer, and then select the `Groups` link from the Administration page. A table +of all the existing groups is displayed. Click on a group name you wish to edit +or control permissions for. + +The "Edit Groups" page contains the same five fields present when creating a +new group. Below that are two additional sections, "Group Permissions" and +"Mass Remove". The "Mass Remove" option simply removes all users from the group +who match the regular expression entered. The "Group Permissions" section +requires further explanation. + +The "Group Permissions" section on the "Edit Groups" page contains four sets of +permissions that control the relationship of this group to other groups. If the +`usevisibilitygroups` parameter is in use (see +[Parameters](parameters.md)) two additional sets of permissions are +displayed. Each set consists of two select boxes. On the left, a select box +with a list of all existing groups. On the right, a select box listing all +groups currently selected for this permission setting (this box will be empty +for new groups). The way these controls allow groups to relate to one another +is called *inheritance*. Each of the six permissions is described below. + +*Groups That Are a Member of This Group* +Members of any groups selected here will automatically have membership in this +group. In other words, members of any selected group will inherit membership in +this group. + +*Groups That This Group Is a Member Of* +Members of this group will inherit membership to any group selected here. For +example, suppose the group being edited is an Admin group. If there are two +products (Product1 and Product2) and each product has its own group (Group1 and +Group2), and the Admin group should have access to both products, simply select +both Group1 and Group2 here. + +*Groups That Can Grant Membership in This Group* +The members of any group selected here will be able add users to this group, +even if they themselves are not in this group. + +*Groups That This Group Can Grant Membership In* +Members of this group can add users to any group selected here, even if they +themselves are not in the selected groups. + +*Groups That Can See This Group* +Members of any selected group can see the users in this group. This setting is +only visible if the `usevisibilitygroups` parameter is enabled on the Bugzilla +Configuration page. See [Parameters](parameters.md) for information on +configuring Bugzilla. + +*Groups That This Group Can See* +Members of this group can see members in any of the selected groups. This +setting is only visible if the `usevisibilitygroups` parameter is enabled on +the the Bugzilla Configuration page. See [Parameters](parameters.md) for +information on configuring Bugzilla. + +## Assigning Users to Groups + +A User can become a member of a group in several ways: + +1. The user can be explicitly placed in the group by editing the user's + profile. This can be done by accessing the "Users" page from the + "Administration" page. Use the search form to find the user you want to + edit group membership for, and click on their email address in the search + results to edit their profile. The profile page lists all the groups and + indicates if the user is a member of the group either directly or + indirectly. More information on indirect group membership is below. For + more details on User Administration, see [Users](users.md). +2. The group can include another group of which the user is a member. This is + indicated by square brackets around the checkbox next to the group name in + the user's profile. See [Editing Groups and Assigning Group + Permissions](#editing-groups-and-assigning-group-permissions) for details on group inheritance. +3. The user's email address can match the regular expression that has been + specified to automatically grant membership to the group. This is indicated + by "\*" around the check box by the group name in the user's profile. See + [Creating Groups](#creating-groups) for details on the regular + expression option when creating groups. + +## Assigning Group Controls to Products + +The primary functionality of groups is derived from the relationship of groups +to products. The concepts around segregating access to bugs with product group +controls can be confusing. For details and examples on this topic, see +[Assigning Group Controls to Products](categorization.md#assigning-group-controls-to-products). diff --git a/docs/en/md/administering/index.md b/docs/en/md/administering/index.md new file mode 100644 index 0000000000..1d91d77f52 --- /dev/null +++ b/docs/en/md/administering/index.md @@ -0,0 +1,20 @@ +# Administration Guide + +For those with `admin` privileges, Bugzilla can be administered using the +**Administration** link in the header. The administrative controls are divided +into several sections: + +- [Parameters](parameters.md) +- [Default Preferences](preferences.md) +- [Users](users.md) +- [Classifications, Products, Components, Versions, and + Milestones](categorization.md) +- [Flags](flags.md) +- [Custom Fields](custom-fields.md) +- [Field Values](field-values.md) +- [Workflow](workflow.md) +- [Groups and Security](groups.md) +- [Keywords](keywords.md) +- [Whining](whining.md) +- [Quips](quips.md) +- [Installed Extensions](extensions.md) diff --git a/docs/en/md/administering/keywords.md b/docs/en/md/administering/keywords.md new file mode 100644 index 0000000000..7480fd66a1 --- /dev/null +++ b/docs/en/md/administering/keywords.md @@ -0,0 +1,12 @@ +# Keywords + +The administrator can define keywords which can be used to tag and categorize +bugs. For example, the keyword "regression" is commonly used. A company might +have a policy stating all regressions must be fixed by the next release—this +keyword can make tracking those bugs much easier. Keywords are global, rather +than per product. + +Keywords can be created, edited, or deleted by clicking the "Keywords" link in +the admin page. There are two fields for each keyword—the keyword itself and a +brief description. Currently keywords cannot be marked obsolete to prevent +future usage. diff --git a/docs/en/md/administering/parameters.md b/docs/en/md/administering/parameters.md new file mode 100644 index 0000000000..325a239f00 --- /dev/null +++ b/docs/en/md/administering/parameters.md @@ -0,0 +1,704 @@ +# Parameters + +Bugzilla is configured by changing various parameters, accessed from the +**Parameters** link, which is found on the Administration page. The parameters +are divided into several categories, accessed via the menu on the left. + +## General + +maintainer +Email address of the person responsible for maintaining this Bugzilla +installation. The address need not be that of a valid Bugzilla account. + +utf8 +Use UTF-8 (Unicode) encoding for all text in Bugzilla. Installations where this +parameter is set to `off` should set it to `on` only after the data has been +converted from existing legacy character encodings to UTF-8, using the +`contrib/recode.pl` script. + +> [!NOTE] +> If you turn this parameter from `off` to `on`, you must re-run +> `checksetup.pl` immediately afterward. + +announcehtml +Any text in this field will be displayed at the top of every HTML page in this +Bugzilla installation. The text is not wrapped in any tags. For best results, +wrap the text in a `

` tag. Any style attributes from the CSS can be applied. +`

` makes the text red. + +upgrade_notification +Enable or disable a notification on the homepage of this Bugzilla installation +when a newer version of Bugzilla is available. This notification is only +visible to administrators. Choose `disabled` to turn off the notification. +Otherwise, choose which version of Bugzilla you want to be notified about: +`development_snapshot` is the latest release from the master branch, +`latest_stable_release` is the most recent release available on the most recent +stable branch, and `stable_branch_release` is the most recent release on the +branch this installation is based on. + +## Administrative Policies + +This page contains parameters for basic administrative functions. Options +include whether to allow the deletion of bugs and users, and whether to allow +users to change their email address. + +allowbugdeletion +The pages to edit products and components can delete all associated bugs when +you delete a product (or component). Since that is a pretty scary idea, you +have to turn on this option before any such deletions will ever happen. + +allowemailchange +Users can change their own email address through the preferences. Note that the +change is validated by emailing both addresses, so switching this option on +will not let users use an invalid address. + +allowuserdeletion +The user editing pages are capable of letting you delete user accounts. +Bugzilla will issue a warning in case you'd run into inconsistencies when +you're about to do so, but such deletions still remain scary. So, you have to +turn on this option before any such deletions will ever happen. + +last_visit_keep_days +This option controls how many days Bugzilla will remember that users have +visited specific bugs. + +## User Authentication + +This page contains the settings that control how this Bugzilla installation +will do its authentication. Choose what authentication mechanism to use (the +Bugzilla database, or an external source such as LDAP), and set basic +behavioral parameters. For example, choose whether to require users to login to +browse bugs, the management of authentication cookies, and the regular +expression used to validate email addresses. Some parameters are highlighted +below. + +allow_account_creation +Allow new accounts to be created. If off, only administrators can create +accounts. + +auth_env_id +Environment variable used by external authentication system to store a unique +identifier for each user. Leave it blank if there isn't one or if this method +of authentication is not being used. + +auth_env_email +Environment variable used by external authentication system to store each +user's email address. This is a required field for environmental +authentication. Leave it blank if you are not going to use this feature. + +auth_env_realname +Environment variable used by external authentication system to store the user's +real name. Leave it blank if there isn't one or if this method of +authentication is not being used. + +user_info_class +Mechanism(s) to be used for gathering a user's login information. More than one +may be selected. If the first one returns nothing, the second is tried, and so +on. The types are: + +- `CGI`: asks for username and password via CGI form interface. +- `Env`: info for a pre-authenticated user is passed in system environment + variables. + +user_verify_class +Mechanism(s) to be used for verifying (authenticating) information gathered by +user_info_class. More than one may be selected. If the first one cannot find +the user, the second is tried, and so on. The types are: + +- `DB`: Bugzilla's built-in authentication. This is the most common choice. +- `RADIUS`: RADIUS authentication using a RADIUS server. Using this method + requires additional parameters to be set. Please see + [RADIUS](#radius) for more information. +- `LDAP`: LDAP authentication using an LDAP server. Using this method requires + additional parameters to be set. Please see [LDAP](#ldap) for + more information. + +rememberlogin +Controls management of session cookies. + +- `on` - Session cookies never expire (the user has to login only once per + browser). +- `off` - Session cookies last until the users session ends (the user will have + to login in each new browser session). +- `defaulton`/`defaultoff` - Default behavior as described above, but user can + choose whether Bugzilla will remember their login or not. + +requirelogin +If this option is set, all access to the system beyond the front page will +require a login. No anonymous users will be permitted. + +webservice_email_filter +Filter email addresses returned by the WebService API depending on if the user +is logged in or not. This works similarly to how the web UI currently filters +email addresses. If requirelogin is enabled, then this parameter has no effect +as users must be logged in to use Bugzilla anyway. + +emailregexp +Defines the regular expression used to validate email addresses used for login +names. The default attempts to match fully qualified email addresses (i.e. +'user@example.com') in a slightly more restrictive way than what is allowed in +RFC 2822. Another popular value to put here is `^[^@]+`, which means 'local +usernames, no @ allowed.' + +emailregexpdesc +This description is shown to the user to explain which email addresses are +allowed by the `emailregexp` param. + +emailsuffix +This is a string to append to any email addresses when actually sending mail to +that address. It is useful if you have changed the `emailregexp` param to only +allow local usernames, but you want the mail to be delivered to +username@my.local.hostname. + +password_complexity +Set the complexity required for passwords. In all cases must the passwords be +at least 6 characters long. + +- `no_constraints` - No complexity required. +- `bmo` - Passwords must contain at least one letter, a number and a special + character. + +password_check_on_login +If set, Bugzilla will check that the password meets the current complexity +rules and minimum length requirements when the user logs into the Bugzilla web +interface. If it doesn't, the user would not be able to log in, and will +receive a message to reset their password. + +## Attachments + +This page allows for setting restrictions and other parameters regarding +attachments to bugs. For example, control size limitations and whether to allow +pointing to external files via a URI. + +allow_attachment_display +If this option is on, users will be able to view attachments from their +browser, if their browser supports the attachment's MIME type. If this option +is off, users are forced to download attachments, even if the browser is able +to display them. + +If you do not trust your users (e.g. if your Bugzilla is public), you should +either leave this option off, or configure and set the attachment_base +localconfig variable. Untrusted users may upload attachments that could be +potentially damaging if viewed directly in the browser. + +allow_attachment_deletion +If this option is on, administrators will be able to delete the contents of +attachments (i.e. replace the attached file with a 0 byte file), leaving only +the metadata. + +maxattachmentsize +The maximum size (in kilobytes) of attachments to be stored in the database. If +a file larger than this size is attached to a bug, Bugzilla will look at the +`maxlocalattachment` parameter to determine if the file can be stored locally +on the web server. If the file size exceeds both limits, then the attachment is +rejected. Setting both parameters to 0 will prevent attaching files to bugs. + +Some databases have default limits which prevent storing larger attachments in +the database. E.g. MySQL has a parameter called +[max_allowed_packet](http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html), +whose default varies by distribution. Setting `maxattachmentsize` higher than +your current setting for this value will produce an error. + +maxlocalattachment +The maximum size (in megabytes) of attachments to be stored locally on the web +server. If set to a value lower than the `maxattachmentsize` parameter, +attachments will never be kept on the local filesystem. + +Whether you use this feature or not depends on your environment. Reasons to +store some or all attachments as files might include poor database performance +for large binary blobs, ease of backup/restore/browsing, or even +filesystem-level deduplication support. However, you need to be aware of any +limits on how much data your webserver environment can store. If in doubt, +leave the value at 0. + +Note that changing this value does not affect any already-submitted +attachments. + +## Bug Change Policies + +Set policy on default behavior for bug change events. For example, choose which +status to set a bug to when it is marked as a duplicate, and choose whether to +allow bug reporters to set the priority or target milestone. Also allows for +configuration of what changes should require the user to make a comment, +described below. + +duplicate_or_move_bug_status +When a bug is marked as a duplicate of another one, use this bug status. + +letsubmitterchoosepriority +If this is on, then people submitting bugs can choose an initial priority for +that bug. If off, then all bugs initially have the default priority selected +here. + +letsubmitterchoosemilestone +If this is on, then people submitting bugs can choose the Target Milestone for +that bug. If off, then all bugs initially have the default milestone for the +product being filed in. + +musthavemilestoneonaccept +If you are using Target Milestone, do you want to require that the milestone be +set in order for a user to set a bug's status to IN_PROGRESS? + +commenton\* +All these fields allow you to dictate what changes can pass without comment and +which must have a comment from the person who changed them. Often, +administrators will allow users to add themselves to the CC list, accept bugs, +or change the Status Whiteboard without adding a comment as to their reasons +for the change, yet require that most other changes come with an explanation. +Set the "commenton" options according to your site policy. It is a wise idea to +require comments when users resolve, reassign, or reopen bugs at the very +least. + +> [!NOTE] +> It is generally far better to require a developer comment when resolving bugs +> than not. Few things are more annoying to bug database users than having a +> developer mark a bug "fixed" without any comment as to what the fix was (or +> even that it was truly fixed!) + +noresolveonopenblockers +This option will prevent users from resolving bugs as FIXED if they have +unresolved dependencies. Only the FIXED resolution is affected. Users will be +still able to resolve bugs to resolutions other than FIXED if they have +unresolved dependent bugs. + +## Bug Fields + +The parameters in this section determine the default settings of several +Bugzilla fields for new bugs and whether certain fields are used. For example, +choose whether to use the `Target Milestone` field or the `Status Whiteboard` +field. + +useclassification +If this is on, Bugzilla will associate each product with a specific +classification. But you must have `editclassification` permissions enabled in +order to edit classifications. + +usetargetmilestone +Do you wish to use the `Target Milestone` field? + +useqacontact +This allows you to define an email address for each component, in addition to +that of the default assignee, that will be sent carbon copies of incoming bugs. + +usestatuswhiteboard +This defines whether you wish to have a free-form, overwritable field +associated with each bug. The advantage of the `Status Whiteboard` is that it +can be deleted or modified with ease and provides an easily searchable field +for indexing bugs that have some trait in common. + +use_regression_fields +Do you wish to use the `Regressions` and `Regressed by` fields? These allow you +to efficiently track software regressions, which might previously be managed +using the `Depends on` and `Blocks` fields along with the “regression” keyword. + +use_see_also +Do you wish to use the `See Also` field? It allows you mark bugs in other bug +tracker installations as being related. Disabling this field prevents addition +of new relationships, but existing ones will continue to appear. + +require_bug_type +If this is on, users are asked to choose a type when they file a new bug. + +default_bug_type +This is the type that newly entered bugs are set to. + +defaultpriority +This is the priority that newly entered bugs are set to. + +defaultseverity +This is the severity that newly entered bugs are set to. + +defaultplatform +This is the platform that is preselected on the bug entry form. You can leave +this empty; Bugzilla will then use the platform that the browser is running on +as the default. + +defaultopsys +This is the operating system that is preselected on the bug entry form. You can +leave this empty; Bugzilla will then use the operating system that the browser +reports to be running on as the default. + +collapsed_comment_tags +A comma-separated list of tags which, when applied to comments, will cause them +to be collapsed by default. + +last_change_time_non_bot_skip_list +List of user accounts to skip when calculating last changed by a person +timestamp. + +## Group Security + +Bugzilla allows for the creation of different groups, with the ability to +restrict the visibility of bugs in a group to a set of specific users. Specific +products can also be associated with groups, and users restricted to only see +products in their groups. Several parameters are described in more detail +below. Most of the configuration of groups and their relationship to products +is done on the **Groups** and **Product** pages of the **Administration** area. +The options on this page control global default behavior. For more information +on Groups and Group Security, see [Groups and Security](groups.md). + +makeproductgroups +Determines whether or not to automatically create groups when new products are +created. If this is on, the groups will be used for querying bugs. + +chartgroup +The name of the group of users who can use the 'New Charts' feature. +Administrators should ensure that the public categories and series definitions +do not divulge confidential information before enabling this for an untrusted +population. If left blank, no users will be able to use New Charts. + +insidergroup +The name of the group of users who can see/change private comments and +attachments. + +timetrackinggroup +The name of the group of users who can see/change time tracking information. + +querysharegroup +The name of the group of users who are allowed to share saved searches with one +another. For more information on using saved searches, see [Saved +Searches](../using/preferences.md#saved-searches). + +comment_taggers_group +The name of the group of users who can tag comments. Setting this to empty +disables comment tagging. + +debug_group +The name of the group of users who can view the actual SQL query generated when +viewing bug lists and reports. Do not expose this information to untrusted +users. + +usevisibilitygroups +If selected, user visibility will be restricted to members of groups, as +selected in the group configuration settings. Each user-defined group can be +allowed to see members of selected other groups. For details on configuring +groups (including the visibility restrictions) see [Editing Groups and +Assigning Group Permissions](groups.md#editing-groups-and-assigning-group-permissions). + +or_groups +Define the visibility of a bug which is in multiple groups. If this is on +(recommended), a user only needs to be a member of one of the bug's groups in +order to view it. If it is off, a user needs to be a member of all the bug's +groups. Note that in either case, a user's role on the bug (e.g. reporter), if +any, may also affect their permissions. + +## LDAP + +LDAP authentication is a module for Bugzilla's plugin authentication +architecture. This page contains all the parameters necessary to configure +Bugzilla for use with LDAP authentication. + +The existing authentication scheme for Bugzilla uses email addresses as the +primary user ID and a password to authenticate that user. All places within +Bugzilla that require a user ID (e.g. assigning a bug) use the email address. +The LDAP authentication builds on top of this scheme, rather than replacing it. +The initial log-in is done with a username and password for the LDAP directory. +Bugzilla tries to bind to LDAP using those credentials and, if successful, +tries to map this account to a Bugzilla account. If an LDAP mail attribute is +defined, the value of this attribute is used; otherwise, the `emailsuffix` +parameter is appended to the LDAP username to form a full email address. If an +account for this address already exists in the Bugzilla installation, it will +log in to that account. If no account for that email address exists, one is +created at the time of login. (In this case, Bugzilla will attempt to use the +"displayName" or "cn" attribute to determine the user's full name.) After +authentication, all other user-related tasks are still handled by email +address, not LDAP username. For example, bugs are still assigned by email +address and users are still queried by email address. + +> [!WARNING] +> Because the Bugzilla account is not created until the first time a user logs +> in, a user who has not yet logged is unknown to Bugzilla. This means they +> cannot be used as an assignee or QA contact (default or otherwise), added to +> any CC list, or any other such operation. One possible workaround is the +> `bugzilla_ldapsync.rb` script in the `contrib` directory. Another possible +> solution is fixing [bug +> 201069](https://bugzilla.mozilla.org/show_bug.cgi?id=201069). + +Parameters required to use LDAP Authentication: + +user_verify_class (in the Authentication section) +If you want to list `LDAP` here, make sure to have set up the other parameters +listed below. Unless you have other (working) authentication methods listed as +well, you may otherwise not be able to log back in to Bugzilla once you log +out. If this happens to you, you will need to manually set `user_verify_class` +to `DB` in the database. + +LDAPserver +This parameter should be set to the name (and optionally the port) of your LDAP +server. If no port is specified, it assumes the default LDAP port of 389. For +example: `ldap.company.com` or `ldap.company.com:3268` You can also specify a +LDAP URI, so as to use other protocols, such as LDAPS or LDAPI. If the port was +not specified in the URI, the default is either 389 or 636 for 'LDAP' and +'LDAPS' schemes respectively. + +> [!NOTE] +> In order to use SSL with LDAP, specify a URI with "ldaps://". This will force +> the use of SSL over port 636. For example, normal LDAP +> `ldap://ldap.company.com`, LDAP over SSL `ldaps://ldap.company.com`, or LDAP +> over a UNIX domain socket `ldapi://%2fvar%2flib%2fldap_sock`. + +LDAPstarttls +Whether to require encrypted communication once a normal LDAP connection is +achieved with the server. + +LDAPbinddn \[Optional\] +Some LDAP servers will not allow an anonymous bind to search the directory. If +this is the case with your configuration you should set the `LDAPbinddn` +parameter to the user account Bugzilla should use instead of the anonymous +bind. Ex. `cn=default,cn=user:password` + +LDAPBaseDN +The location in your LDAP tree that you would like to search for email +addresses. Your uids should be unique under the DN specified here. Ex. +`ou=People,o=Company` + +LDAPuidattribute +The attribute which contains the unique UID of your users. The value retrieved +from this attribute will be used when attempting to bind as the user to confirm +their password. Ex. `uid` + +LDAPmailattribute +The name of the attribute which contains the email address your users will +enter into the Bugzilla login boxes. Ex. `mail` + +LDAPfilter +LDAP filter to AND with the LDAPuidattribute for filtering the list of valid +users. + +## RADIUS + +RADIUS authentication is a module for Bugzilla's plugin authentication +architecture. This page contains all the parameters necessary for configuring +Bugzilla to use RADIUS authentication. + +> [!NOTE] +> Most caveats that apply to LDAP authentication apply to RADIUS authentication +> as well. See [LDAP](#ldap) for details. + +Parameters required to use RADIUS Authentication: + +user_verify_class (in the Authentication section) +If you want to list `RADIUS` here, make sure to have set up the other +parameters listed below. Unless you have other (working) authentication methods +listed as well, you may otherwise not be able to log back in to Bugzilla once +you log out. If this happens to you, you will need to manually set +`user_verify_class` to `DB` in the database. + +RADIUS_server +The name (and optionally the port) of your RADIUS server. + +RADIUS_secret +The RADIUS server's secret. + +RADIUS_NAS_IP +The NAS-IP-Address attribute to be used when exchanging data with your RADIUS +server. If unspecified, 127.0.0.1 will be used. + +RADIUS_email_suffix +Bugzilla needs an email address for each user account. Therefore, it needs to +determine the email address corresponding to a RADIUS user. Bugzilla offers +only a simple way to do this: it can concatenate a suffix to the RADIUS user +name to convert it into an email address. You can specify this suffix in the +`RADIUS_email_suffix` parameter. If this simple solution does not work for you, +you'll probably need to modify `Bugzilla/Auth/Verify/RADIUS.pm` to match your +requirements. + +## Email + +This page contains all of the parameters for configuring how Bugzilla deals +with the email notifications it sends. See below for a summary of important +options. + +mail_delivery_method +This is used to specify how email is sent, or if it is sent at all. There are +several options included for different MTAs, along with two additional options +that disable email sending. `Test` does not send mail, but instead saves it in +`data/mailer.testfile` for later review. `None` disables email sending +entirely. + +mailfrom +This is the email address that will appear in the "From" field of all emails +sent by this Bugzilla installation. Some email servers require mail to be from +a valid email address; therefore, it is recommended to choose a valid email +address here. + +use_mailer_queue +In a large Bugzilla installation, updating bugs can be very slow because +Bugzilla sends all email at once. If you enable this parameter, Bugzilla will +queue all mail and then send it in the background. This requires that you have +installed certain Perl modules (as listed by `checksetup.pl` for this feature), +and that you are running the `jobqueue.pl` daemon (otherwise your mail won't +get sent). This affects all mail sent by Bugzilla, not just bug updates. + +smtpserver +The SMTP server address, if the `mail_delivery_method` parameter is set to +`SMTP`. Use `localhost` if you have a local MTA running; otherwise, use a +remote SMTP server. Append ":" and the port number if a non-default port is +needed. + +smtp_username +Username to use for SASL authentication to the SMTP server. Leave this +parameter empty if your server does not require authentication. + +smtp_password +Password to use for SASL authentication to the SMTP server. This parameter will +be ignored if the `smtp_username` parameter is left empty. + +smtp_ssl +Enable SSL support for connection to the SMTP server. + +smtp_debug +This parameter allows you to enable detailed debugging output. Log messages are +printed the web server's error log. + +whinedays +Set this to the number of days you want to let bugs go in the CONFIRMED state +before notifying people they have untouched new bugs. If you do not plan to use +this feature, simply do not set up the [whining cron +job](https://bugzilla.readthedocs.io/en/latest/installing/optional-post-install-config.html#installation-whining) +described in the installation instructions, or set this value to "0" (never +whine). + +globalwatchers +This allows you to define specific users who will receive notification each +time any new bug in entered, or when any existing bug changes, subject to the +normal groupset permissions. It may be useful for sending notifications to a +mailing list, for instance. + +## Query Defaults + +This page controls the default behavior of Bugzilla in regards to several +aspects of querying bugs. Options include what the default query options are, +what the "My Bugs" page returns, whether users can freely add bugs to the quip +list, and how many duplicate bugs are needed to add a bug to the "most +frequently reported" list. + +quip_list_entry_control +Controls how easily users can add entries to the quip list. + +- `open` - Users may freely add to the quip list, and their entries will + immediately be available for viewing. +- `moderated` - Quips can be entered but need to be approved by a moderator + before they will be shown. +- `closed` - No new additions to the quips list are allowed. + +mybugstemplate +This is the URL to use to bring up a simple 'all of my bugs' list for a user. +%userid% will get replaced with the login name of a user. Special characters +must be URL encoded. + +defaultquery +This is the default query that initially comes up when you access the advanced +query page. It's in URL-parameter format. + +search_allow_no_criteria +When turned off, a query must have some criteria specified to limit the number +of bugs returned to the user. When turned on, a user is allowed to run a query +with no criteria and get all bugs in the entire installation that they can see. +Turning this parameter on is not recommended on large installations. + +default_search_limit +By default, Bugzilla limits searches done in the web interface to returning +only this many results, for performance reasons. (This only affects the HTML +format of search results—CSV, XML, and other formats are exempted.) Users can +click a link on the search result page to see all the results. + +Usually you should not have to change this—the default value should be +acceptable for most installations. + +max_search_results +The maximum number of bugs that a search can ever return. Tabular and graphical +reports are exempted from this limit, however. + +## Shadow Database + +This page controls whether a shadow database is used. If your Bugzilla is not +large, you will not need these options. + +A standard large database setup involves a single master server and a pool of +read-only slaves (which Bugzilla calls the "shadowdb"). Queries which are not +updating data can be directed to the slave pool, removing the load/locking from +the master, freeing it up to handle writes. Bugzilla will switch to the +shadowdb when it knows it doesn't need to update the database (e.g. when +searching, or displaying a bug to a not-logged-in user). + +Bugzilla does not make sure the shadowdb is kept up to date, so, if you use +one, you will need to set up replication in your database server. + +If your shadowdb is on a different machine, specify `shadowdbhost` and +`shadowdbport`. If it's on the same machine, specify `shadowdbsock`. + +shadowdbhost +The host the shadow database is on. + +shadowdbport +The port the shadow database is on. + +shadowdbsock +The socket used to connect to the shadow database, if the host is the local +machine. + +shadowdb +The database name of the shadow database. + +## User Matching + +The settings on this page control how users are selected and queried when +adding a user to a bug. For example, users need to be selected when assigning +the bug, adding to the CC list, or selecting a QA contact. With the +`usemenuforusers` parameter, it is possible to configure Bugzilla to display a +list of users in the fields instead of an empty text field. If users are +selected via a text box, this page also contains parameters for how user names +can be queried and matched when entered. + +usemenuforusers +If this option is set, Bugzilla will offer you a list to select from (instead +of a text entry field) where a user needs to be selected. This option should +not be enabled on sites where there are a large number of users. + +ajax_user_autocompletion +If this option is set, typing characters in a certain user fields will display +a list of matches that can be selected from. It is recommended to only turn +this on if you are using mod_perl; otherwise, the response will be irritatingly +slow. + +maxusermatches +Provide no more than this many matches when a user is searched for. If set to +'1', no users will be displayed on ambiguous matches. This is useful for +user-privacy purposes. A value of zero means no limit. + +confirmuniqueusermatch +Whether a confirmation screen should be displayed when only one user matches a +search entry. + +## Advanced + +inbound_proxies +When inbound traffic to Bugzilla goes through a proxy, Bugzilla thinks that the +IP address of the proxy is the IP address of every single user. If you enter a +comma-separated list of IPs in this parameter, then Bugzilla will trust any +`X-Forwarded-For` header sent from those IPs, and use the value of that header +as the end user's IP address. + +proxy_url +If this Bugzilla installation is behind a proxy, enter the proxy information +here to enable Bugzilla to access the Internet. Bugzilla requires Internet +access to utilize the `upgrade_notification` parameter. If the proxy requires +authentication, use the syntax: `http://user:pass@proxy_url/`. + +strict_transport_security +Enables the sending of the Strict-Transport-Security header along with HTTP +responses on SSL connections. This adds greater security to your SSL +connections by forcing the browser to always access your domain over SSL and +never accept an invalid certificate. However, it should only be used if you +have the `ssl_redirect` parameter turned on, Bugzilla is the only thing running +on its domain (i.e., your `urlbase` is something like +`http://bugzilla.example.com/`), and you never plan to stop supporting SSL. + +- `off` - Don't send the Strict-Transport-Security header with requests. +- `this_domain_only` - Send the Strict-Transport-Security header with all + requests, but only support it for the current domain. +- `include_subdomains` - Send the Strict-Transport-Security header along with + the includeSubDomains flag, which will apply the security change to all + subdomains. This is especially useful when combined with an `attachment_base` + that exists as (a) subdomain(s) under the main Bugzilla domain. diff --git a/docs/en/md/administering/preferences.md b/docs/en/md/administering/preferences.md new file mode 100644 index 0000000000..a8e67ade5c --- /dev/null +++ b/docs/en/md/administering/preferences.md @@ -0,0 +1,5 @@ +# Default Preferences + +Each user of Bugzilla can set certain preferences about how they want Bugzilla +to behave. Here, you can say whether or not each of the possible preferences is +available to the user and, if it is, what the default value is. diff --git a/docs/en/md/administering/quips.md b/docs/en/md/administering/quips.md new file mode 100644 index 0000000000..7f3df93480 --- /dev/null +++ b/docs/en/md/administering/quips.md @@ -0,0 +1,31 @@ +# Quips + +Quips are small user-defined messages (often quotes or witty sayings) that can +be configured to appear at the top of search results. Each Bugzilla +installation has its own specific quips. Whenever a quip needs to be displayed, +a random selection is made from the pool of already existing quips. + +Quip submission is controlled by `quip_list_entry_control` parameter. It has +several possible values: open, moderated, or closed. In order to enable quips +approval you need to set this parameter to "moderated". In this way, users are +free to submit quips for addition, but an administrator must explicitly approve +them before they are actually used. + +In order to see the user interface for the quips, you can click on a quip when +it is displayed together with the search results. You can also go directly to +the quips.cgi URL (prefixed with the usual web location of the Bugzilla +installation). Once the quip interface is displayed, the "view and edit the +whole quip list" link takes you to the quips administration page, which lists +all quips available in the database. + +Next to each quip there is a checkbox, under the "Approved" column. Quips that +have this checkbox checked are already approved and will appear next to the +search results. The ones that have it unchecked are still preserved in the +database but will not appear on search results pages. User submitted quips have +initially the checkbox unchecked. + +Also, there is a delete link next to each quip, which can be used in order to +permanently delete a quip. + +Display of quips is controlled by the *display_quips* user preference. Possible +values are "on" and "off". diff --git a/docs/en/md/administering/users.md b/docs/en/md/administering/users.md new file mode 100644 index 0000000000..75841a4d99 --- /dev/null +++ b/docs/en/md/administering/users.md @@ -0,0 +1,186 @@ +# Users + +## Creating Admin Users + +When you first run checksetup.pl after installing Bugzilla, it will prompt you +for the username (email address) and password for the first admin user. If for +some reason you delete all the admin users, re-running checksetup.pl will again +prompt you for a username and password and make a new admin. + +If you wish to add more administrative users, add them to the "admin" group. + +## Searching For Users + +If you have `editusers` privileges or if you are allowed to grant privileges +for some groups, the **Users** link will appear in the Administration page. + +The first screen is a search form to search for existing user accounts. You can +run searches based either on the user ID, real name or login name (i.e. the +email address, or just the first part of the email address if the `emailsuffix` +parameter is set). The search can be conducted in different ways using the +listbox to the right of the text entry box. You can match by case-insensitive +substring (the default), regular expression, a *reverse* regular expression +match (which finds every user name which does NOT match the regular +expression), or the exact string if you know exactly who you are looking for. +The search can be restricted to users who are in a specific group. By default, +the restriction is turned off. + +The search returns a list of users matching your criteria. User properties can +be edited by clicking the login name. The Account History of a user can be +viewed by clicking the "View" link in the Account History column. The Account +History displays changes that have been made to the user account, the time of +the change and the user who made the change. For example, the Account History +page will display details of when a user was added or removed from a group. + +## Modifying Users + +Once you have found your user, you can change the following fields: + +- *Login Name*: This is generally the user's full email address. However, if + you have are using the `emailsuffix` parameter, this may just be the user's + login name. Unless you turn off the `allowemailchange` parameter, users can + change their login names themselves (to any valid email address). + +- *Real Name*: The user's real name. Note that Bugzilla does not require this + to create an account. + +- *Password*: You can change the user's password here. Users can automatically + request a new password, so you shouldn't need to do this often. If you want + to disable an account, see Disable Text below. + +- *Bugmail Disabled*: Mark this checkbox to disable bugmail and whinemail + completely for this account. This checkbox replaces the data/nomail file + which existed in older versions of Bugzilla. + +- *Disable Text*: If you type anything in this box, including just a space, the + user is prevented from logging in and from making any changes to bugs via the + web interface. The HTML you type in this box is presented to the user when + they attempt to perform these actions and should explain why the account was + disabled. Users with disabled accounts will continue to receive mail from + Bugzilla; furthermore, they will not be able to log in themselves to change + their own preferences and stop it. If you want an account (disabled or + active) to stop receiving mail, simply check the `Bugmail Disabled` checkbox + above. + + > [!NOTE] + > Even users whose accounts have been disabled can still submit bugs via the + > email gateway, if one exists. The email gateway should *not* be enabled for + > secure installations of Bugzilla. + + > [!WARNING] + > Don't disable all the administrator accounts! + +- *\*: If you have created some groups, e.g. "securitysensitive", + then checkboxes will appear here to allow you to add users to, or remove them + from, these groups. The first checkbox gives the user the ability to add and + remove other users as members of this group. The second checkbox adds the + user themselves as a member of the group. + +- *canconfirm*: This field is only used if you have enabled the "unconfirmed" + status. If you enable this for a user, that user can then move bugs from + "Unconfirmed" to a "Confirmed" status (e.g.: "New" status). + +- *creategroups*: This option will allow a user to create and destroy groups in + Bugzilla. + +- *editbugs*: Unless a user has this bit set, they can only edit those bugs for + which they are the assignee or the reporter. Even if this option is + unchecked, users can still add comments to bugs. + +- *editcomponents*: This flag allows a user to create new products and + components, modify existing products and components, and destroy those that + have no bugs associated with them. If a product or component has bugs + associated with it, those bugs must be moved to a different product or + component before Bugzilla will allow them to be destroyed. + +- *editkeywords*: If you use Bugzilla's keyword functionality, enabling this + feature allows a user to create and destroy keywords. A keyword must be + removed from any bugs upon which it is currently set before it can be + destroyed. + +- *edittriageowners*: This flag will allow a user to edit the triage owner + values of components. + +- *editusers*: This flag allows a user to do what you're doing right now: edit + other users. This will allow those with the right to do so to remove + administrator privileges from other users or grant them to themselves. Enable + with care. + +- *tweakparams*: This flag allows a user to change Bugzilla's Params (using + `editparams.cgi`.) + +- *\*: This allows an administrator to specify the products in + which a user can see bugs. If you turn on the `makeproductgroups` parameter + in the Group Security Panel in the Parameters page, then Bugzilla creates one + group per product (at the time you create the product), and this group has + exactly the same name as the product itself. Note that for products that + already exist when the parameter is turned on, the corresponding group will + not be created. The user must still have the `editbugs` privilege to edit + bugs in these products. + +## Creating New Users + +### Self-Registration + +By default, users can create their own user accounts by clicking the +`New Account` link at the bottom of each page (assuming they aren't logged in +as someone else already). If you want to disable this self-registration, you +have to edit the `allow_account_creation` parameter in the `Configuration` +page; see [Parameters](parameters.md). + +### Administrator Registration + +Users with `editusers` privileges, such as administrators, can create user +accounts for other users: + +1. After logging in, click the "Users" link at the footer of the query page, + and then click "Add a new user". + +2. Fill out the form presented. This page is self-explanatory. When done, + click "Submit". + + > [!NOTE] + > Adding a user this way will *not* send an email informing them of their + > username and password. While useful for creating dummy accounts (watchers + > which shuttle mail to another system, for instance, or email addresses + > which are a mailing list), in general it is preferable to log out and use + > the `New Account` button to create users, as it will pre-populate all the + > required fields and also notify the user of their account name and + > password. + +## Deleting Users + +If the `allowuserdeletion` parameter is turned on (see +[Parameters](parameters.md)) then you can also delete user accounts. Note +that, most of the time, this is not the best thing to do. If only a warning in +a yellow box is displayed, then the deletion is safe. If a warning is also +displayed in a red box, then you should NOT try to delete the user account, +else you will get referential integrity problems in your database, which can +lead to unexpected behavior, such as bugs not appearing in bug lists anymore, +or data displaying incorrectly. You have been warned! + +## Impersonating Users + +There may be times when an administrator would like to do something as another +user. The `sudo` feature may be used to do this. + +> [!NOTE] +> To use the sudo feature, you must be in the *bz_sudoers* group. By default, +> all administrators are in this group. + +If you have access to this feature, you may start a session by going to the +Edit Users page, Searching for a user and clicking on their login. You should +see a link below their login name titled "Impersonate this user". Click on the +link. This will take you to a page where you will see a description of the +feature and instructions for using it. After reading the text, simply enter the +login of the user you would like to impersonate, provide a short message +explaining why you are doing this, and press the button. + +As long as you are using this feature, everything you do will be done as if you +were logged in as the user you are impersonating. + +> [!WARNING] +> The user you are impersonating will not be told about what you are doing. If +> you do anything that results in mail being sent, that mail will appear to be +> from the user you are impersonating. You should be extremely careful while +> using this feature. diff --git a/docs/en/md/administering/whining.md b/docs/en/md/administering/whining.md new file mode 100644 index 0000000000..5993d30209 --- /dev/null +++ b/docs/en/md/administering/whining.md @@ -0,0 +1,134 @@ +# Whining + +Whining is a feature in Bugzilla that can regularly annoy users at specified +times. Using this feature, users can execute saved searches at specific times +(e.g. the 15th of the month at midnight) or at regular intervals (e.g. every 15 +minutes on Sundays). The results of the searches are sent to the user, either +as a single email or as one email per bug, along with some descriptive text. + +> [!WARNING] +> Throughout this section it will be assumed that all users are members of the +> bz_canusewhines group, membership in which is required in order to use the +> Whining system. You can easily make all users members of the bz_canusewhines +> group by setting the User RegExp to ".\*" (without the quotes). +> +> Also worth noting is the bz_canusewhineatothers group. Members of this group +> can create whines for any user or group in Bugzilla using an extended form of +> the whining interface. Features only available to members of the +> bz_canusewhineatothers group will be noted in the appropriate places. + +> [!NOTE] +> For whining to work, a special Perl script must be executed at regular +> intervals. More information on this is available in +> [Whining](https://bugzilla.readthedocs.io/en/latest/installing/optional-post-install-config.html#installation-whining). + +> [!NOTE] +> This section does not cover the whineatnews.pl script. See [Whining at +> Untriaged +> Bugs](https://bugzilla.readthedocs.io/en/latest/installing/optional-post-install-config.html#installation-whining-cron) +> for more information on The Whining Cron. + +## The Event + +The whining system defines an "Event" as one or more queries being executed at +regular intervals, with the results of said queries (if there are any) being +emailed to the user. Events are created by clicking on the "Add new event" +button. + +Once a new event is created, the first thing to set is the "Email subject +line". The contents of this field will be used in the subject line of every +email generated by this event. In addition to setting a subject, space is +provided to enter some descriptive text that will be included at the top of +each message (to help you in understanding why you received the email in the +first place). + +The next step is to specify when the Event is to be run (the Schedule) and what +searches are to be performed (the Searches). + +## Whining Schedule + +Each whining event is associated with zero or more schedules. A schedule is +used to specify when the search (specified below) is to be run. A new event +starts out with no schedules (which means it will never run, as it is not +scheduled to run). To add a schedule, press the "Add a new schedule" button. + +Each schedule includes an interval, which you use to tell Bugzilla when the +event should be run. An event can be run on certain days of the week, certain +days of the month, during weekdays (defined as Monday through Friday), or every +day. + +> [!WARNING] +> Be careful if you set your event to run on the 29th, 30th, or 31st of the +> month, as your event may not run exactly when expected. If you want your +> event to run on the last day of the month, select "Last day of the month" as +> the interval. + +Once you have specified the day(s) on which the event is to be run, you should +now specify the time at which the event is to be run. You can have the event +run at a certain hour on the specified day(s), or every hour, half-hour, or +quarter-hour on the specified day(s). + +If a single schedule does not execute an event as many times as you would want, +you can create another schedule for the same event. For example, if you want to +run an event on days whose numbers are divisible by seven, you would need to +add four schedules to the event, setting the schedules to run on the 7th, 14th, +21st, and 28th (one day per schedule) at whatever time (or times) you choose. + +> [!NOTE] +> If you are a member of the bz_canusewhineatothers group, then you will be +> presented with another option: "Mail to". Using this you can control who will +> receive the emails generated by this event. You can choose to send the emails +> to a single user (identified by email address) or a single group (identified +> by group name). To send to multiple users or groups, create a new schedule +> for each additional user/group. + +## Whining Searches + +Each whining event is associated with zero or more searches. A search is any +saved search to be run as part of the specified schedule (see above). You start +out without any searches associated with the event (which means that the event +will not run, as there will never be any results to return). To add a search, +press the "Add a search" button. + +The first field to examine in your newly added search is the Sort field. +Searches are run, and results included, in the order specified by the Sort +field. Searches with smaller Sort values will run before searches with bigger +Sort values. + +The next field to examine is the Search field. This is where you choose the +actual search that is to be run. Instead of defining search parameters here, +you are asked to choose from the list of saved searches (the same list that +appears at the bottom of every Bugzilla page). You are only allowed to choose +from searches that you have saved yourself (the default saved search, "My +Bugs", is not a valid choice). If you do not have any saved searches, you can +take this opportunity to create one (see [Bug Lists](../using/finding.md#bug-lists)). + +> [!NOTE] +> When running searches, the whining system acts as if you are the user +> executing the search. This means that the whining system will ignore bugs +> that match your search but that you cannot access. + +Once you have chosen the saved search to be executed, give the search a +descriptive title. This title will appear in the email, above the results of +the search. If you choose "One message per bug", the search title will appear +at the top of each email that contains a bug matching your search. + +Finally, decide if the results of the search should be sent in a single email, +or if each bug should appear in its own email. + +> [!WARNING] +> Think carefully before checking the "One message per bug" box. If you create +> a search that matches thousands of bugs, you will receive thousands of +> emails! + +## Saving Your Changes + +Once you have defined at least one schedule and created at least one search, go +ahead and "Update/Commit". This will save your Event and make it available for +immediate execution. + +> [!NOTE] +> If you ever feel like deleting your event, you may do so using the "Remove +> Event" button in the upper-right corner of each Event. You can also modify an +> existing event, so long as you "Update/Commit" after completing your +> modifications. diff --git a/docs/en/md/administering/workflow.md b/docs/en/md/administering/workflow.md new file mode 100644 index 0000000000..d2e3bcf6ca --- /dev/null +++ b/docs/en/md/administering/workflow.md @@ -0,0 +1,33 @@ +# Workflow + +The bug status workflow—which statuses are valid transitions from which other +statuses—can be customized. + +You need to begin by defining the statuses and resolutions you want to use (see +[Field Values](field-values.md)). By convention, these are in all capital +letters. + +Only one bug status, UNCONFIRMED, can never be renamed nor deleted. However, it +can be disabled entirely on a per-product basis (see [Classifications, +Products, Components, Versions, and Milestones](categorization.md)). The +status referred to by the `duplicate_or_move_bug_status` parameter, if set, is +also undeletable. To make it deletable, simply set the value of that parameter +to a different status. + +Aside from the empty value, two resolutions, DUPLICATE and FIXED, cannot be +renamed or deleted. (FIXED could be if we fixed [bug +1007605](https://bugzilla.mozilla.org/show_bug.cgi?id=1007605).) + +Once you have defined your statuses, you can configure the workflow of how a +bug moves between them. The workflow configuration page displays all existing +bug statuses twice: first on the left for the starting status, and on the top +for the target status in the transition. If the checkbox is checked, then the +transition from the left to the top status is legal; if it's unchecked, that +transition is forbidden. + +The status used as the `duplicate_or_move_bug_status` parameter (normally +RESOLVED or its equivalent) is required to be a legal transition from every +other bug status, and so this is enforced on the page. + +The "View Comments Required on Status Transitions" link below the table lets +you set which transitions require a comment from the user. diff --git a/docs/en/md/api/core/v1/attachment.md b/docs/en/md/api/core/v1/attachment.md new file mode 100644 index 0000000000..ae87d58f6e --- /dev/null +++ b/docs/en/md/api/core/v1/attachment.md @@ -0,0 +1,359 @@ +# Attachments + +The Bugzilla API for creating, changing, and getting the details of +attachments. + +## Get Attachment + +This allows you to get data about attachments, given a list of bugs and/or +attachment IDs. Private attachments will only be returned if you are in the +appropriate group or if you are the submitter of the attachment. + +**Request** + +To get all current attachments for a bug: + +``` text +GET /rest/bug/(bug_id)/attachment +``` + +To get a specific attachment based on attachment ID: + +``` text +GET /rest/bug/attachment/(attachment_id) +``` + +One of the below must be specified. + +| name | type | description | +|-------------------|------|------------------------| +| **bug_id** | int | Integer bug ID. | +| **attachment_id** | int | Integer attachment ID. | + +**Response** + +``` js +{ + "bugs" : { + "1345" : [ + { (attachment) }, + { (attachment) } + ], + "9874" : [ + { (attachment) }, + { (attachment) } + ], + }, + "attachments" : { + "234" : { (attachment) }, + "123" : { (attachment) }, + } +} +``` + +An object containing two elements: `bugs` and `attachments`. + +The attachments for the bug that you specified in the `bug_id` argument in +input are returned in `bugs` on output. `bugs` is a object that has integer bug +IDs for keys and the values are arrays of objects as attachments. (Fields for +attachments are described below.) + +For the attachment that you specified directly in `attachment_id`, they are +returned in `attachments` on output. This is a object where the attachment ids +point directly to objects describing the individual attachment. + +The fields for each attachment (where it says `(attachment)` in the sample +response above) are: + +| name | type | description | +|----|----|----| +| data | base64 | The raw data of the attachment, encoded as Base64. | +| size | int | The length (in bytes) of the attachment. | +| creation_time | datetime | The time the attachment was created. | +| last_change_time | datetime | The last time the attachment was modified. | +| id | int | The numeric ID of the attachment. | +| bug_id | int | The numeric ID of the bug that the attachment is attached to. | +| file_name | string | The file name of the attachment. | +| summary | string | A short string describing the attachment. | +| content_type | string | The MIME type of the attachment. | +| is_private | boolean | `true` if the attachment is private (only visible to a certain group called the "insidergroup", `false` otherwise. | +| is_obsolete | boolean | `true` if the attachment is obsolete, `false` otherwise. | +| is_patch | boolean | `true` if the attachment is a patch, `false` otherwise. | +| creator | string | The login name of the user that created the attachment. | +| creator_detail | object | An object containing detailed user information for the creator. To see the keys included in the user detail object, see [Get Bug](bug.md#get-bug). | +| flags | array | Array of objects, each containing the information about the flag currently set for each attachment. Each flag object contains items described in the Flag object below. | + +Flag object: + +| name | type | description | +|----|----|----| +| id | int | The ID of the flag. | +| name | string | The name of the flag. | +| type_id | int | The type ID of the flag. | +| creation_date | datetime | The timestamp when this flag was originally created. | +| modification_date | datetime | The timestamp when the flag was last modified. | +| status | string | The current status of the flag such as ?, +, or -. | +| setter | string | The login name of the user who created or last modified the flag. | +| requestee | string | The login name of the user this flag has been requested to be granted or denied. Note, this field is only returned if a requestee is set. | + +**Errors** + +This method can throw all the same errors as [Get +Bug](bug.md#get-bug). In addition, it can also throw the following +error: + +- 304 (Auth Failure, Attachment is Private) You specified the id of a private + attachment in the "attachment_ids" argument, and you are not in the "insider + group" that can see private attachments. + +## Create Attachment + +This allows you to add an attachment to a bug in Bugzilla. + +**Request** + +To create attachment on a current bug: + +``` text +POST /rest/bug/(bug_id)/attachment +``` + +``` js +{ + "ids" : [ 35 ], + "is_patch" : true, + "comment" : "This is a new attachment comment", + "summary" : "Test Attachment", + "content_type" : "text/plain", + "data" : "(Some base64 encoded content)", + "file_name" : "test_attachment.patch", + "obsoletes" : [], + "is_private" : false, + "flags" : [ + { + "name" : "review", + "status" : "?", + "requestee" : "user@bugzilla.org", + "new" : true + } + ] +} +``` + +The params to include in the POST body, as well as the returned data format, +are the same as below. The `bug_id` param will be overridden as it it pulled +from the URL path. + +| name | type | description | +|----|----|----| +| **ids** | array | The IDs or aliases of bugs that you want to add this attachment to. The same attachment and comment will be added to all these bugs. | +| **data** | base64 | The content of the attachment. You must encode it in base64 using an appropriate client library such as `MIME::Base64` for Perl. | +| **file_name** | string | The "file name" that will be displayed in the UI for this attachment and also downloaded copies will be given. | +| **summary** | string | A short string describing the attachment. | +| **content_type** | string | The MIME type of the attachment, like `text/plain` or `image/png`. | +| comment | string | A comment to add along with this attachment. | +| is_markdown | boolean | If `true`, the `comment` will be rendered as Markdown. Defaults to the system `use_markdown` setting. | +| is_patch | boolean | `true` if Bugzilla should treat this attachment as a patch. If you specify this, you do not need to specify a `content_type`. The `content_type` of the attachment will be forced to `text/plain`. Defaults to `false` if not specified. | +| is_private | boolean | `true` if the attachment should be private (restricted to the "insidergroup"), `false` if the attachment should be public. Defaults to `false` if not specified. | +| flags | array | Flags objects to add to the attachment. The object format is described in the Flag object below. | +| bug_flags | array | Flag objects to add to the attachment's bug. See the `flags` param for [Create Bug](bug.md#create-bug) for the object format. | + +Flag object: + +To create a flag, at least the `status` and the `type_id` or `name` must be +provided. An optional requestee can be passed if the flag type is requestable +to a specific user. + +| name | type | description | +|----|----|----| +| name | string | The name of the flag type. | +| type_id | int | The internal flag type ID. | +| status | string | The flags new status (i.e. "?", "+", "-" or "X" to clear a flag). | +| requestee | string | The login of the requestee if the flag type is requestable to a specific user. | + +**Response** + +``` js +{ + "ids" : [ + "2797" + ] +} +``` + +| name | type | description | +|------|-------|-------------------------| +| ids | array | Attachment IDs created. | + +**Errors** + +This method can throw all the same errors as [Get +Bug](bug.md#get-bug), plus: + +- 129 (Flag Status Invalid) The flag status is invalid. +- 130 (Flag Modification Denied) You tried to request, grant, or deny a flag + but only a user with the required permissions may make the change. +- 131 (Flag not Requestable from Specific Person) You can't ask a specific + person for the flag. +- 133 (Flag Type not Unique) The flag type specified matches several flag + types. You must specify the type id value to update or add a flag. +- 134 (Inactive Flag Type) The flag type is inactive and cannot be used to + create new flags. +- 140 (Markdown Disabled) You tried to set the "is_markdown" flag of the + comment to true but the Markdown feature is not enabled. +- 600 (Attachment Too Large) You tried to attach a file that was larger than + Bugzilla will accept. +- 601 (Invalid MIME Type) You specified a "content_type" argument that was + blank, not a valid MIME type, or not a MIME type that Bugzilla accepts for + attachments. +- 603 (File Name Not Specified) You did not specify a valid for the "file_name" + argument. +- 604 (Summary Required) You did not specify a value for the "summary" + argument. +- 606 (Empty Data) You set the "data" field to an empty string. + +## Update Attachment + +This allows you to update attachment metadata in Bugzilla. + +**Request** + +To update attachment metadata on a current attachment: + +``` text +PUT /rest/bug/attachment/(attachment_id) +``` + +``` js +{ + "ids" : [ 2796 ], + "summary" : "Test XML file", + "comment" : "Changed this from a patch to a XML file", + "content_type" : "text/xml", + "is_patch" : 0 +} +``` + +| name | type | description | +|-------------------|-------|------------------------------------------------| +| **attachment_id** | int | Integer attachment ID. | +| **ids** | array | The IDs of the attachments you want to update. | + +| name | type | description | +|----|----|----| +| file_name | string | The "file name" that will be displayed in the UI for this attachment. | +| summary | string | A short string describing the attachment. | +| comment | string | An optional comment to add to the attachment's bug. | +| is_markdown | boolean | If `true`, the `comment` will be rendered as Markdown. Defaults to the system `use_markdown` setting. | +| content_type | string | The MIME type of the attachment, like `text/plain` or `image/png`. | +| is_patch | boolean | `true` if Bugzilla should treat this attachment as a patch. If you specify this, you do not need to specify a `content_type`. The `content_type` of the attachment will be forced to `text/plain`. | +| is_private | boolean | `true` if the attachment should be private (restricted to the "insidergroup"), `false` if the attachment should be public. | +| is_obsolete | boolean | `true` if the attachment is obsolete, `false` otherwise. | +| flags | array | An array of Flag objects with changes to the flags. The object format is described in the Flag object below. | +| bug_flags | array | An optional array of Flag objects with changes to the flags of the attachment's bug. See the `flags` param for [Update Bug](bug.md#update-bug) for the object format. | + +Flag object: + +The following values can be specified. At least the `status` and one of +`type_id`, `id`, or `name` must be specified. If a type_id or name matches a +single currently set flag, the flag will be updated unless `new` is specified. + +| name | type | description | +|----|----|----| +| name | string | The name of the flag that will be created or updated. | +| type_id | int | The internal flag type ID that will be created or updated. You will need to specify the `type_id` if more than one flag type of the same name exists. | +| status | string | The flags new status (i.e. "?", "+", "-" or "X" to clear a flag). | +| requestee | string | The login of the requestee if the flag type is requestable to a specific user. | +| id | int | Use ID to specify the flag to be updated. You will need to specify the `id` if more than one flag is set of the same name. | +| new | boolean | Set to true if you specifically want a new flag to be created. | + +**Response** + +``` js +{ + "attachments" : [ + { + "changes" : { + "content_type" : { + "added" : "text/xml", + "removed" : "text/plain" + }, + "is_patch" : { + "added" : "0", + "removed" : "1" + }, + "summary" : { + "added" : "Test XML file", + "removed" : "test patch" + } + }, + "id" : 2796, + "last_change_time" : "2014-09-29T14:41:53Z" + } + ] +} +``` + +`attachments` (array) Change objects with the following items: + + + + + + + + + + + + + + + + + + + + + + + + + + +
nametypedescription
idintThe ID of the attachment that was updated.
last_change_timedatetimeThe exact time that this update was done at, for this attachment. If no +update was done (that is, no fields had their values changed and no comment was +added) then this will instead be the last time the attachment was updated.
changesobject

The changes that were actually done on this attachment. The keys are the +names of the fields that were changed, and the values are an object with two +items:

+
    +
  • added: (string) The values that were added to this field. Possibly a +comma-and-space-separated list if multiple values were added.
  • +
  • removed: (string) The values that were removed from this field.
  • +
+ +**Errors** + +This method can throw all the same errors as [Get +Bug](bug.md#get-bug), plus: + +- 129 (Flag Status Invalid) The flag status is invalid. +- 130 (Flag Modification Denied) You tried to request, grant, or deny a flag + but only a user with the required permissions may make the change. +- 131 (Flag not Requestable from Specific Person) You can't ask a specific + person for the flag. +- 132 (Flag not Unique) The flag specified has been set multiple times. You + must specify the id value to update the flag. +- 133 (Flag Type not Unique) The flag type specified matches several flag + types. You must specify the type id value to update or add a flag. +- 134 (Inactive Flag Type) The flag type is inactive and cannot be used to + create new flags. +- 140 (Markdown Disabled) You tried to set the "is_markdown" flag of the + "comment" to true but Markdown feature is not enabled. +- 601 (Invalid MIME Type) You specified a "content_type" argument that was + blank, not a valid MIME type, or not a MIME type that Bugzilla accepts for + attachments. +- 603 (File Name Not Specified) You did not specify a valid for the "file_name" + argument. +- 604 (Summary Required) You did not specify a value for the "summary" + argument. diff --git a/docs/en/md/api/core/v1/bug-user-last-visit.md b/docs/en/md/api/core/v1/bug-user-last-visit.md new file mode 100644 index 0000000000..a2d7765108 --- /dev/null +++ b/docs/en/md/api/core/v1/bug-user-last-visit.md @@ -0,0 +1,101 @@ +# Bug User Last Visited + +## Update Last Visited + +Update the last-visited time for the specified bug and current user. + +**Request** + +To update the time for a single bug id: + +``` text +POST /rest/bug_user_last_visit/(id) +``` + +To update one or more bug ids at once: + +``` text +POST /rest/bug_user_last_visit +``` + +``` js +{ + "ids" : [35,36,37] +} +``` + +| name | type | description | +|---------|-------|--------------------------------| +| **id** | int | An integer bug id. | +| **ids** | array | One or more bug ids to update. | + +**Response** + +``` js +[ + { + "id" : 100, + "last_visit_ts" : "2014-10-16T17:38:24Z" + } +] +``` + +An array of objects containing the items: + +| name | type | description | +|---------------|----------|----------------------------------------------| +| id | int | The bug id. | +| last_visit_ts | datetime | The timestamp the user last visited the bug. | + +**Errors** + +- 1300 (User Not Involved with Bug) The caller's account is not involved with + the bug id provided. + +## Get Last Visited + +**Request** + +Get the last-visited timestamp for one or more specified bug ids or get a list +of the last 20 visited bugs and their timestamps. + +To return the last-visited timestamp for a single bug id: + +``` text +GET /rest/bug_user_last_visit/(id) +``` + +To return more than one specific bug timestamps: + +``` text +GET /rest/bug_user_last_visit/123?ids=234&ids=456 +``` + +To return all the timestamps stored during the retention period: + +``` text +GET /rest/bug_user_last_visit +``` + +| name | type | description | +|---------|-------|--------------------------------------| +| **id** | int | An integer bug id. | +| **ids** | array | One or more optional bug ids to get. | + +**Response** + +``` js +[ + { + "id" : 100, + "last_visit_ts" : "2014-10-16T17:38:24Z" + } +] +``` + +An array of objects containing the following items: + +| name | type | description | +|---------------|----------|----------------------------------------------| +| id | int | The bug id. | +| last_visit_ts | datetime | The timestamp the user last visited the bug. | diff --git a/docs/en/md/api/core/v1/bug.md b/docs/en/md/api/core/v1/bug.md new file mode 100644 index 0000000000..db88547913 --- /dev/null +++ b/docs/en/md/api/core/v1/bug.md @@ -0,0 +1,1235 @@ +# Bugs + +The REST API for creating, changing, and getting the details of bugs. + +This part of the Bugzilla REST API allows you to file new bugs in Bugzilla and +to get information about existing bugs. + +## Get Bug + +Gets information about particular bugs in the database. + +**Request** + +To get information about a particular bug using its ID or alias: + +``` text +GET /rest/bug/(id_or_alias) +``` + +You can also use [Search Bugs](#search-bugs) to return more than +one bug at a time by specifying bug IDs as the search terms. + +``` text +GET /rest/bug?id=12434,43421 +``` + +| name | type | description | +|-----------------|-------|------------------------------------------| +| **id_or_alias** | mixed | An integer bug ID or a bug alias string. | + +**Response** + +``` js +{ + "faults": [], + "bugs": [ + { + "assigned_to_detail": { + "id": 2, + "real_name": "Test User", + "nick": "user", + "name": "user@bugzilla.org", + "email": "user@bugzilla.org" + }, + "flags": [ + { + "type_id": 11, + "modification_date": "2014-09-28T21:03:47Z", + "name": "blocker", + "status": "?", + "id": 2906, + "setter": "user@bugzilla.org", + "creation_date": "2014-09-28T21:03:47Z" + } + ], + "resolution": "INVALID", + "id": 35, + "type": "defect", + "qa_contact": "", + "triage_owner": "", + "version": "1.0", + "status": "RESOLVED", + "creator": "user@bugzilla.org", + "cf_drop_down": "---", + "summary": "test bug", + "last_change_time": "2014-09-23T19:12:17Z", + "platform": "All", + "url": "", + "classification": "Unclassified", + "cc_detail": [ + { + "id": 786, + "real_name": "Foo Bar", + "nick": "foo", + "name": "foo@bar.com", + "email": "foo@bar.com" + }, + ], + "priority": "P1", + "is_confirmed": true, + "creation_time": "2000-07-25T13:50:04Z", + "assigned_to": "user@bugzilla.org", + "flags": [], + "alias": null, + "cf_large_text": "", + "groups": [], + "op_sys": "All", + "cf_bug_id": null, + "depends_on": [], + "is_cc_accessible": true, + "is_open": false, + "cf_qa_list_4": "---", + "keywords": [], + "cc": [ + "foo@bar.com", + ], + "see_also": [], + "deadline": null, + "is_creator_accessible": true, + "whiteboard": "", + "dupe_of": null, + "duplicates": [], + "target_milestone": "---", + "cf_mulitple_select": [], + "component": "SaltSprinkler", + "severity": "critical", + "cf_date": null, + "product": "FoodReplicator", + "creator_detail": { + "id": 28, + "real_name": "hello", + "nick": "namachi", + "name": "user@bugzilla.org", + "email": "namachi@netscape.com" + }, + "cf_free_text": "", + "blocks": [], + "regressed_by": [], + "regressions": [], + "comment_count": 12 + } + ] +} +``` + +`bugs` (array) Each bug object contains information about the bugs with valid +ids containing the following items: + +These fields are returned by default or by specifying `_default` in +`include_fields`. + +| name | type | description | +|----|----|----| +| actual_time | double | The total number of hours that this bug has taken so far. If you are not in the time-tracking group, this field will not be included in the return value. | +| alias | string | The unique alias of this bug. A `null` value will be returned if this bug has no alias. | +| assigned_to | string | The login name of the user to whom the bug is assigned. | +| assigned_to_detail | object | An object containing detailed user information for the assigned_to. To see the keys included in the user detail object, see below. | +| blocks | array | The IDs of bugs that are "blocked" by this bug. | +| cc | array | The login names of users on the CC list of this bug. | +| cc_detail | array | Array of objects containing detailed user information for each of the cc list members. To see the keys included in the user detail object, see below. | +| classification | string | The name of the current classification the bug is in. | +| component | string | The name of the current component of this bug. | +| creation_time | datetime | When the bug was created. | +| creator | string | The login name of the person who filed this bug (the reporter). | +| creator_detail | object | An object containing detailed user information for the creator. To see the keys included in the user detail object, see below. | +| deadline | string | The day that this bug is due to be completed, in the format `YYYY-MM-DD`. | +| depends_on | array | The IDs of bugs that this bug "depends on". | +| dupe_of | int | The bug ID of the bug that this bug is a duplicate of. If this bug isn't a duplicate of any bug, this will be null. | +| duplicates | array | The ids of bugs that are marked as duplicate of this bug. | +| estimated_time | double | The number of hours that it was estimated that this bug would take. If you are not in the time-tracking group, this field will not be included in the return value. | +| flags | array | An array of objects containing the information about flags currently set for the bug. Each flag objects contains the following items | +| groups | array | The names of all the groups that this bug is in. | +| id | int | The unique numeric ID of this bug. | +| is_cc_accessible | boolean | If true, this bug can be accessed by members of the CC list, even if they are not in the groups the bug is restricted to. | +| is_confirmed | boolean | `true` if the bug has been confirmed. Usually this means that the bug has at some point been moved out of the `UNCONFIRMED` status and into another open status. | +| is_open | boolean | `true` if this bug is open, `false` if it is closed. | +| is_creator_accessible | boolean | If `true`, this bug can be accessed by the creator of the bug, even if they are not a member of the groups the bug is restricted to. | +| keywords | array | Each keyword that is on this bug. | +| last_change_time | datetime | When the bug was last changed. | +| comment_count | int | Number of comments associated with the bug. | +| op_sys | string | The name of the operating system that the bug was filed against. | +| platform | string | The name of the platform (hardware) that the bug was filed against. | +| priority | string | The priority of the bug. | +| product | string | The name of the product this bug is in. | +| qa_contact | string | The login name of the current QA Contact on the bug. | +| qa_contact_detail | object | An object containing detailed user information for the qa_contact. To see the keys included in the user detail object, see below. | +| regressed_by | array | The IDs of bugs that introduced this bug. | +| regressions | array | The IDs of bugs that are introduced by this bug. | +| remaining_time | double | The number of hours of work remaining until work on this bug is complete. If you are not in the time-tracking group, this field will not be included in the return value. | +| resolution | string | The current resolution of the bug, or an empty string if the bug is open. | +| see_also | array | The URLs in the See Also field on the bug. | +| severity | string | The current severity of the bug. | +| status | string | The current status of the bug. | +| summary | string | The summary of this bug. | +| target_milestone | string | The milestone that this bug is supposed to be fixed by, or for closed bugs, the milestone that it was fixed for. | +| type | string | The type of the bug. | +| update_token | string | The token that you would have to pass to the `process_bug.cgi` page in order to update this bug. This changes every time the bug is updated. This field is not returned to logged-out users. | +| url | string | A URL that demonstrates the problem described in the bug, or is somehow related to the bug report. | +| version | string | The version the bug was reported against. | +| whiteboard | string | The value of the "status whiteboard" field on the bug. | + +Custom fields: + +Every custom field in this installation will also be included in the return +value. Most fields are returned as strings. However, some field types have +different return values. + +Normally custom fields are returned by default similar to normal bug fields or +you can specify only custom fields by using `_custom` in `include_fields`. + +Extra fields: + +These fields are returned only by specifying `_extra` or the field name in +`include_fields`. + +| name | type | description | +|----|----|----| +| attachments | array | Each array item is an Attachment object. See [Get Attachment](attachment.md#get-attachment) for details of the object. | +| comments | array | Each array item is a Comment object. See [Get Comments](comment.md#get-comments) for details of the object. | +| counts | object | An object containing the numbers of the items in the following fields: `attachments`, `cc`, `comments`, `keywords`, `blocks`, `depends_on`, `regressed_by`, `regressions` and `duplicates`. | +| description | string | The description (initial comment) of the bug. | +| filed_via | string | How the bug was filed, e.g. `standard_form`. | +| history | array | Each array item is a History object. See [Bug History](#bug-history) for details of the object. | +| tags | array | Each array item is a tag name. Note that tags are personal to the currently logged in user and are not the same as comment tags. | +| triage_owner | string | The login name of the Triage Owner of the bug's component. | +| triage_owner_detail | object | An object containing detailed user information for the `triage_owner`. To see the keys included in the user detail object, see below. | +| last_change_time_non_bot | datetime | When the bug was last changed human and not a bot. | + +User object: + +| name | type | description | +|----|----|----| +| id | int | The user ID for this user. | +| real_name | string | The 'real' name for this user, if any. | +| nick | string | The user's nickname. Currently this is extracted from the real_name, name or email field. | +| name | string | The user's Bugzilla login. | +| email | string | The user's email address. Currently this is the same value as the name. | + +Flag object: + +| name | type | description | +|----|----|----| +| id | int | The ID of the flag. | +| name | string | The name of the flag. | +| type_id | int | The type ID of the flag. | +| creation_date | datetime | The timestamp when this flag was originally created. | +| modification_date | datetime | The timestamp when the flag was last modified. | +| status | string | The current status of the flag. | +| setter | string | The login name of the user who created or last modified the flag. | +| requestee | string | The login name of the user this flag has been requested to be granted or denied. Note, this field is only returned if a requestee is set. | + +Custom field object: + +You can specify to only return custom fields by specifying `_custom` or the +field name in `include_fields`. + +- Bug ID Fields: (int) +- Multiple-Selection Fields: (array of strings) +- Date/Time Fields: (datetime) + +**Errors** + +- 100 (Invalid Bug Alias) If you specified an alias and there is no bug with + that alias. +- 101 (Invalid Bug ID) The bug_id you specified doesn't exist in the database. +- 102 (Access Denied) You do not have access to the bug_id you specified. + +## Bug History + +Gets the history of changes for particular bugs in the database. + +**Request** + +To get the history for a specific bug ID: + +``` text +GET /rest/bug/(id)/history +``` + +To get the history for a bug since a specific date: + +``` text +GET /rest/bug/(id)/history?new_since=YYYY-MM-DD +``` + +| name | type | description | +|-----------|----------|--------------------------------------------------| +| **id** | mixed | An integer bug ID or alias. | +| new_since | datetime | A datetime timestamp to only show history since. | + +**Response** + +``` js +{ + "bugs": [ + { + "alias": null, + "history": [ + { + "when": "2014-09-23T19:12:17Z", + "who": "user@bugzilla.org", + "changes": [ + { + "added": "P1", + "field_name": "priority", + "removed": "P2" + }, + { + "removed": "blocker", + "field_name": "severity", + "added": "critical" + } + ] + }, + { + "when": "2014-09-28T21:03:47Z", + "who": "user@bugzilla.org", + "changes": [ + { + "added": "blocker?", + "removed": "", + "field_name": "flagtypes.name" + } + ] + } + ], + "id": 35 + } + ] +} +``` + +`bugs` (array) Bug objects each containing the following items: + +| name | type | description | +|----|----|----| +| id | int | The numeric ID of the bug. | +| alias | string | The unique alias of this bug. A `null` value will be returned if this bug has no alias. | +| history | array | An array of History objects. | + +History object: + +| name | type | description | +|----|----|----| +| when | datetime | The date the bug activity/change happened. | +| who | string | The login name of the user who performed the bug change. | +| changes | array | An array of Change objects which contain all the changes that happened to the bug at this time (as specified by `when`). | + +Change object: + +| name | type | description | +|----|----|----| +| field_name | string | The name of the bug field that has changed. | +| removed | string | The previous value of the bug field which has been deleted by the change. | +| added | string | The new value of the bug field which has been added by the change. | +| attachment_id | int | The ID of the attachment that was changed. This only appears if the change was to an attachment, otherwise `attachment_id` will not be present in this object. | + +**Errors** + +Same as [Get Bug](#get-bug). + +## Search Bugs + +Allows you to search for bugs based on particular criteria. + +**Request** + +To search for bugs: + +``` text +GET /rest/bug +``` + +Unless otherwise specified in the description of a parameter, bugs are returned +if they match *exactly* the criteria you specify in these parameters. That is, +we don't match against substrings--if a bug is in the "Widgets" product and you +ask for bugs in the "Widg" product, you won't get anything. + +Criteria are joined in a logical AND. That is, you will be returned bugs that +match *all* of the criteria, not bugs that match *any* of the criteria. + +Each parameter can be either the type it says, or a list of the types it says. +If you pass an array, it means "Give me bugs with *any* of these values." For +example, if you wanted bugs that were in either the "Foo" or "Bar" products, +you'd pass: + +``` text +GET /rest/bug?product=Foo&product=Bar +``` + +Some Bugzillas may treat your arguments case-sensitively, depending on what +database system they are using. Most commonly, though, Bugzilla is not +case-sensitive with the arguments passed (because MySQL is the most-common +database to use with Bugzilla, and MySQL is not case sensitive). + +In addition to the fields listed below, you may also use criteria that is +similar to what is used in the Advanced Search screen of the Bugzilla UI. This +includes fields specified by `Search by Change History` and `Custom Search`. +The easiest way to determine what the field names are and what format Bugzilla +expects is to first construct your query using the Advanced Search UI, execute +it and use the query parameters in they URL as your query for the REST call. + +| name | type | description | +|----|----|----| +| alias | string | The unique alias of this bug. A `null` value will be returned if this bug has no alias. | +| assigned_to | string | The login name of a user that a bug is assigned to. | +| component | string | The name of the Component that the bug is in. Note that if there are multiple Components with the same name, and you search for that name, bugs in *all* those Components will be returned. If you don't want this, be sure to also specify the `product` argument. | +| count_only | boolean | If set to true, an object with a single key called "bug_count" will be returned which is the number of bugs that matched the search. | +| creation_time | datetime | Searches for bugs that were created at this time or later. May not be an array. | +| creator | string | The login name of the user who created the bug. You can also pass this argument with the name `reporter`, for backwards compatibility with older Bugzillas. | +| description | string | The description (initial comment) of the bug. | +| filed_via | string | Searches for bugs that were created with this method. | +| id | int | The numeric ID of the bug. | +| last_change_time | datetime | Searches for bugs that were modified at this time or later. May not be an array. | +| limit | int | Limit the number of results returned. If the value is unset, zero or greater than the maximum value set by the administrator, which is 10,000 by default, then the maximum value will be used instead. This is a preventive measure against DoS-like attacks on Bugzilla. Use the `offset` argument described below to retrieve more results. | +| longdescs.count | int | The number of comments a bug has. The bug's description is the first comment. For example, to find bugs which someone has commented on after they have been filed, search on `longdescs.count` *greater than* 1. | +| offset | int | Used in conjunction with the `limit` argument, `offset` defines the starting position for the search. For example, given a search that would return 100 bugs, setting `limit` to 10 and `offset` to 10 would return bugs 11 through 20 from the set of 100. | +| op_sys | string | The "Operating System" field of a bug. | +| platform | string | The Platform (sometimes called "Hardware") field of a bug. | +| priority | string | The Priority field on a bug. | +| product | string | The name of the Product that the bug is in. | +| quicksearch | string | Search for bugs using quicksearch syntax. | +| resolution | string | The current resolution--only set if a bug is closed. You can find open bugs by searching for bugs with an empty resolution. | +| severity | string | The Severity field on a bug. | +| status | string | The current status of a bug (not including its resolution, if it has one, which is a separate field above). | +| summary | string | Searches for substrings in the single-line Summary field on bugs. If you specify an array, then bugs whose summaries match *any* of the passed substrings will be returned. Note that unlike searching in the Bugzilla UI, substrings are not split on spaces. So searching for `foo bar` will match "This is a foo bar" but not "This foo is a bar". `['foo', 'bar']`, would, however, match the second item. | +| tags | string | Searches for a bug with the specified tag. If you specify an array, then any bugs that match *any* of the tags will be returned. Note that tags are personal to the currently logged in user. | +| target_milestone | string | The Target Milestone field of a bug. Note that even if this Bugzilla does not have the Target Milestone field enabled, you can still search for bugs by Target Milestone. However, it is likely that in that case, most bugs will not have a Target Milestone set (it defaults to "---" when the field isn't enabled). | +| qa_contact | string | The login name of the bug's QA Contact. Note that even if this Bugzilla does not have the QA Contact field enabled, you can still search for bugs by QA Contact (though it is likely that no bug will have a QA Contact set, if the field is disabled). | +| triage_owner | string | The login name of the Triage Owner of a bug's component. | +| type | string | The Type field on a bug. | +| url | string | The "URL" field of a bug. | +| version | string | The Version field of a bug. | +| whiteboard | string | Search the "Status Whiteboard" field on bugs for a substring. Works the same as the `summary` field described above, but searches the Status Whiteboard field. | + +**Response** + +The same as [Get Bug](#get-bug). + +**Errors** + +If you specify an invalid value for a particular field, you just won't get any +results for that value. + +- 1000 (Parameters Required) You may not search without any search terms. + +## Create Bug + +This allows you to create a new bug in Bugzilla. If you specify any invalid +fields, an error will be thrown stating which field is invalid. If you specify +any fields you are not allowed to set, they will just be set to their defaults +or ignored. + +You cannot currently set all the items here that you can set on enter_bug.cgi. + +The WebService interface may allow you to set things other than those listed +here, but realize that anything undocumented here may likely change in the +future. + +**Request** + +To create a new bug in Bugzilla. + +``` text +POST /rest/bug +``` + +``` js +{ + "product" : "TestProduct", + "component" : "TestComponent", + "version" : "unspecified", + "summary" : "'This is a test bug - please disregard", + "alias" : "SomeAlias", + "op_sys" : "All", + "priority" : "P1", + "platform" : "All", + "type" : "defect" +} +``` + +Some params must be set, or an error will be thrown. These params are marked in +**bold**. + +Some parameters can have defaults set in Bugzilla, by the administrator. If +these parameters have defaults set, you can omit them. These parameters are +marked (defaulted). + +Clients that want to be able to interact uniformly with multiple Bugzillas +should always set both the params marked required and those marked (defaulted), +because some Bugzillas may not have defaults set for (defaulted) parameters, +and then this method will throw an error if you don't specify them. + +| name | type | description | +|----|----|----| +| **product** | string | The name of the product the bug is being filed against. | +| **component** | string | The name of a component in the product above. | +| **summary** | string | A brief description of the bug being filed. | +| **version** | string | A version of the product above; the version the bug was found in. | +| description | string | (defaulted) The description (initial comment) of the bug. Some Bugzilla installations require this to not be blank. | +| filed_via | string | (defaulted) How the bug is being filed. It will be `api` by default when filing through the API. | +| op_sys | string | (defaulted) The operating system the bug was discovered on. | +| platform | string | (defaulted) What type of hardware the bug was experienced on. | +| priority | string | (defaulted) What order the bug will be fixed in by the developer, compared to the developer's other bugs. | +| severity | string | (defaulted) How severe the bug is. | +| **type** | string | The basic category of the bug. Some Bugzilla installations require this to be specified. | +| alias | string | The alias for the bug that can be used instead of a bug number when accessing this bug. Must be unique in all of this Bugzilla. | +| assigned_to | string | A user to assign this bug to, if you don't want it to be assigned to the component owner. | +| cc | array | An array of usernames to CC on this bug. | +| comment_is_private | boolean | If set to true, the description is private, otherwise it is assumed to be public. | +| groups | array | An array of group names to put this bug into. You can see valid group names on the Permissions tab of the Preferences screen, or, if you are an administrator, in the Groups control panel. If you don't specify this argument, then the bug will be added into all the groups that are set as being "Default" for this product. (If you want to avoid that, you should specify `groups` as an empty array.) | +| qa_contact | string | If this installation has QA Contacts enabled, you can set the QA Contact here if you don't want to use the component's default QA Contact. | +| status | string | The status that this bug should start out as. Note that only certain statuses can be set on bug creation. | +| resolution | string | If you are filing a closed bug, then you will have to specify a resolution. You cannot currently specify a resolution of `DUPLICATE` for new bugs, though. That must be done with [Update Bug](#update-bug). | +| target_milestone | string | A valid target milestone for this product. | +| flags | array | Flags objects to add to the bug. The object format is described in the Flag object below. | +| keywords | array | One or more valid keywords to add to this bug. | +| dependson | array | One or more valid bug ids that this bug depends on. | +| blocked | array | One or more valid bug ids that this bug blocks. | +| regressed_by | array | One or more valid bug ids that introduced this bug. | + +Flag object: + +To create a flag, at least the `status` and the `type_id` or `name` must be +provided. An optional requestee can be passed if the flag type is requestable +to a specific user. + +| name | type | description | +|----|----|----| +| name | string | The name of the flag type. | +| type_id | int | The internal flag type ID. | +| status | string | The flags new status (i.e. "?", "+", "-" or "X" to clear flag). | +| requestee | string | The login of the requestee if the flag type is requestable to a specific user. | + +In addition to the above parameters, if your installation has any custom +fields, you can set them just by passing in the name of the field and its value +as a string. + +**Response** + +``` js +{ + "id" : 12345 +} +``` + +| name | type | description | +|------|------|----------------------------------------| +| id | int | This is the ID of the newly-filed bug. | + +**Errors** + +- 51 (Invalid Object) You specified a field value that is invalid. The error + message will have more details. +- 103 (Invalid Alias) The alias you specified is invalid for some reason. See + the error message for more details. +- 104 (Invalid Field) One of the drop-down fields has an invalid value, or a + value entered in a text field is too long. The error message will have more + detail. +- 105 (Invalid Component) You didn't specify a component. +- 106 (Invalid Product) Either you didn't specify a product, this product + doesn't exist, or you don't have permission to enter bugs in this product. +- 107 (Invalid Summary) You didn't specify a summary for the bug. +- 116 (Dependency Loop) You specified values in the "blocks" and "depends_on" + fields, or the "regressions" and "regressed_by" fields, that would cause a + circular dependency between bugs. +- 120 (Group Restriction Denied) You tried to restrict the bug to a group which + does not exist, or which you cannot use with this product. +- 129 (Flag Status Invalid) The flag status is invalid. +- 130 (Flag Modification Denied) You tried to request, grant, or deny a flag + but only a user with the required permissions may make the change. +- 131 (Flag not Requestable from Specific Person) You can't ask a specific + person for the flag. +- 133 (Flag Type not Unique) The flag type specified matches several flag + types. You must specify the type id value to update or add a flag. +- 134 (Inactive Flag Type) The flag type is inactive and cannot be used to + create new flags. +- 135 (Bug Type Required) You didn't specify a type for the bug. +- 504 (Invalid User) Either the QA Contact, Assignee, or CC lists have some + invalid user in them. The error message will have more details. + +## Update Bug + +Allows you to update the fields of a bug. Automatically sends emails out about +the changes. + +**Request** + +To update the fields of a current bug. + +``` text +PUT /rest/bug/(id_or_alias) +``` + +``` js +{ + "ids" : [35], + "status" : "IN_PROGRESS", + "keywords" : { + "add" : ["funny", "stupid"] + } +} +``` + +The params to include in the PUT body as well as the returned data format, are +the same as below. You must specify an ID or alias of a bug to update in the +URL path. You can also specify the `ids` param and they will be combined so you +can edit more than one bug at a time. + +| name | type | description | +|-----------------|-------|---------------------------------------------------------| +| **id_or_alias** | mixed | An integer bug ID or alias. | +| **ids** | array | The IDs or aliases of the bugs that you want to modify. | + +All following fields specify the values you want to set on the bugs you are +updating. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
nametypedescription
aliasstringThe alias for the bug that can be used instead of a bug number when +accessing this bug. Must be unique in all of this Bugzilla.
assigned_tostringThe full login name of the user this bug is assigned to.
blocksobject(Same as regressed_by below)
depends_onobject(Same as regressed_by below)
regressionsobject(Same as regressed_by below)
regressed_byobject

These specify the bugs that this bug blocks, depends on, regresses, or +is regressed by, respectively. To set these, you should pass an object as the +value. The object may contain the following items:

+
    +
  • add (array) Bug IDs to add to this field.
  • +
  • remove (array) Bug IDs to remove from this field. If the bug +IDs are not already in the field, they will be ignored.
  • +
  • set (array of) An exact set of bug IDs to set this field to, +overriding the current value. If you specify set, then +add and remove will be ignored.
  • +
ccobject

The users on the cc list. To modify this field, pass an object, which +may have the following items:

+
    +
  • add (array) User names to add to the CC list. They must be +full user names, and an error will be thrown if you pass in an invalid user +name.
  • +
  • remove (array) User names to remove from the CC list. They +must be full user names, and an error will be thrown if you pass in an invalid +user name.
  • +
is_cc_accessiblebooleanWhether or not users in the CC list are allowed to access the bug, even if +they aren't in a group that can normally access the bug.
commentobject

A comment on the change. The object may contain the following items:

+
    +
  • body (string) The actual text of the comment. For +compatibility with the parameters to Create +Comments, you can also call this field comment, if you +want.
  • +
  • is_private (boolean) Whether the comment is private or not. If +you try to make a comment private and you don't have the permission to, an +error will be thrown.
  • +
comment_is_privateobject

This is how you update the privacy of comments that are already on a +bug. This is a object, where the keys are the int ID of comments +(not their count on a bug, like #1, #2, #3, but their globally-unique ID, as +returned by Get Comments and the value is a +boolean which specifies whether that comment should become private +(true) or public (false).

+

The comment IDs must be valid for the bug being updated. Thus, it is not +practical to use this while updating multiple bugs at once, as a single comment +ID will never be valid on multiple bugs.

componentstringThe Component the bug is in.
deadlinedateThe Deadline field is a date specifying when the bug must be completed by, +in the format YYYY-MM-DD.
dupe_ofintThe bug that this bug is a duplicate of. If you want to mark a bug as a +duplicate, the safest thing to do is to set this value and not set the +status or resolution fields. They will automatically +be set by Bugzilla to the appropriate values for duplicate bugs.
estimated_timedoubleThe total estimate of time required to fix the bug, in hours. This is the +total estimate, not the amount of time remaining to fix it.
flagsarrayAn array of Flag change objects. The items needed are described below.
groupsobject

The groups a bug is in. To modify this field, pass an object, which may +have the following items:

+
    +
  • add (array) The names of groups to add. Passing in an invalid +group name or a group that you cannot add to this bug will cause an error to be +thrown.
  • +
  • remove (array) The names of groups to remove. Passing in an +invalid group name or a group that you cannot remove from this bug will cause +an error to be thrown.
  • +
keywordsobject

Keywords on the bug. To modify this field, pass an object, which may +have the following items:

+
    +
  • add (array) The names of keywords to add to the field on the +bug. Passing something that isn't a valid keyword name will cause an error to +be thrown.
  • +
  • remove (array) The names of keywords to remove from the field +on the bug. Passing something that isn't a valid keyword name will cause an +error to be thrown.
  • +
  • set (array) An exact set of keywords to set the field to, on +the bug. Passing something that isn't a valid keyword name will cause an error +to be thrown. Specifying set overrides add and +remove.
  • +
op_sysstringThe Operating System ("OS") field on the bug.
platformstringThe Platform or "Hardware" field on the bug.
prioritystringThe Priority field on the bug.
productstring

The name of the product that the bug is in. If you change this, you will +probably also want to change target_milestone, +version, and component, since those have different +legal values in every product.

+

If you cannot change the target_milestone field, it will be +reset to the default for the product, when you move a bug to a new product.

+

You may also wish to add or remove groups, as which groups are valid on a +bug depends on the product. Groups that are not valid in the new product will +be automatically removed, and groups which are mandatory in the new product +will be automatically added, but no other automatic group changes will be +done.

+
+Note: +

Users can only move a bug into a product if they would normally have +permission to file new bugs in that product.

+
qa_contactstringThe full login name of the bug's QA Contact.
is_creator_accessiblebooleanWhether or not the bug's reporter is allowed to access the bug, even if +they aren't in a group that can normally access the bug.
remaining_timedoubleHow much work time is remaining to fix the bug, in hours. If you set +work_time but don't explicitly set remaining_time, +then the work_time will be deducted from the bug's +remaining_time.
reset_assigned_tobooleanIf true, the assigned_to field will be reset to the default +for the component that the bug is in. (If you have set the component at the +same time as using this, then the component used will be the new component, not +the old one.)
reset_qa_contactbooleanIf true, the qa_contact field will be reset to the default for +the component that the bug is in. (If you have set the component at the same +time as using this, then the component used will be the new component, not the +old one.)
resolutionstring

The current resolution. May only be set if you are closing a bug or if +you are modifying an already-closed bug. Attempting to set the resolution to +any value (even an empty or null string) on an open bug will cause an +error to be thrown.

+
+Note: +

If you change the status field to an open status, the +resolution field will automatically be cleared, so you don't have to clear it +manually.

+
see_alsoobject

The See Also field on a bug, specifying URLs to bugs in other bug +trackers. To modify this field, pass an object, which may have the following +items:

+
    +
  • add (array) URLs to add to the field. Each URL must be a valid +URL to a bug-tracker, or an error will be thrown.
  • +
  • remove (array) URLs to remove from the field. Invalid URLs +will be ignored.
  • +
severitystringThe Severity field of a bug.
statusstringThe status you want to change the bug to. Note that if a bug is changing +from open to closed, you should also specify a resolution.
summarystringThe Summary field of the bug.
target_milestonestringThe bug's Target Milestone.
typestringThe Type field on the bug.
urlstringThe "URL" field of a bug.
versionstringThe bug's Version field.
whiteboardstringThe Status Whiteboard field of a bug.
work_timedoubleThe number of hours worked on this bug as part of this change. If you set +work_time but don't explicitly set remaining_time, +then the work_time will be deducted from the bug's +remaining_time.
+ +You can also set the value of any custom field by passing its name as a +parameter, and the value to set the field to. For multiple-selection fields, +the value should be an array of strings. + +Flag change object: + +The following values can be specified. At least the `status` and one of +`type_id`, `id`, or `name` must be specified. If a `type_id` or `name` matches +a single currently set flag, the flag will be updated unless `new` is +specified. + +| name | type | description | +|----|----|----| +| name | string | The name of the flag that will be created or updated. | +| type_id | int | The internal flag type ID that will be created or updated. You will need to specify the `type_id` if more than one flag type of the same name exists. | +| **status** | string | The flags new status (i.e. "?", "+", "-" or "X" to clear a flag). | +| requestee | string | The login of the requestee if the flag type is requestable to a specific user. | +| id | int | Use ID to specify the flag to be updated. You will need to specify the `id` if more than one flag is set of the same name. | +| new | boolean | Set to true if you specifically want a new flag to be created. | + +**Response** + +``` js +{ + "bugs" : [ + { + "alias" : null, + "changes" : { + "keywords" : { + "added" : "funny, stupid", + "removed" : "" + }, + "status" : { + "added" : "IN_PROGRESS", + "removed" : "CONFIRMED" + } + }, + "id" : 35, + "last_change_time" : "2014-09-29T14:25:35Z" + } + ] +} +``` + +`bugs` (array) This points to an array of objects with the following items: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
nametypedescription
idintThe ID of the bug that was updated.
aliasstringThe alias of the bug that was updated, if this bug has any alias.
last_change_timedatetimeThe exact time that this update was done at, for this bug. If no update was +done (that is, no fields had their values changed and no comment was added) +then this will instead be the last time the bug was updated.
changesobject

The changes that were actually done on this bug. The keys are the names +of the fields that were changed, and the values are an object with two +keys:

+
    +
  • added (string) The values that were added to this field, +possibly a comma-and-space-separated list if multiple values were added.
  • +
  • removed (string) The values that were removed from this field, +possibly a comma-and-space-separated list if multiple values were removed.
  • +
+ +Currently, some fields are not tracked in changes: `comment`, +`comment_is_private`, and `work_time`. This means that they will not show up in +the return value even if they were successfully updated. This may change in a +future version of Bugzilla. + +**Errors** + +This method can throw all the same errors as [Get +Bug](#get-bug), plus: + +- 129 (Flag Status Invalid) The flag status is invalid. +- 130 (Flag Modification Denied) You tried to request, grant, or deny a flag + but only a user with the required permissions may make the change. +- 131 (Flag not Requestable from Specific Person) You can't ask a specific + person for the flag. +- 132 (Flag not Unique) The flag specified has been set multiple times. You + must specify the id value to update the flag. +- 133 (Flag Type not Unique) The flag type specified matches several flag + types. You must specify the type id value to update or add a flag. +- 134 (Inactive Flag Type) The flag type is inactive and cannot be used to + create new flags. +- 140 (Markdown Disabled) You tried to set the "is_markdown" flag of the + "comment" to true but Markdown feature is not enabled. +- 601 (Invalid MIME Type) You specified a "content_type" argument that was + blank, not a valid MIME type, or not a MIME type that Bugzilla accepts for + attachments. +- 603 (File Name Not Specified) You did not specify a valid for the "file_name" + argument. +- 604 (Summary Required) You did not specify a value for the "summary" + argument. + +## Graph + +Return a graph of bug relationships such as dependencies, regressions, and +duplicates. By default, resolved bugs are not returned but can be if needed. +The bug ID provided will be the root node of the graph. + +**Request** + +To return a graph of dependencies (default) for a given bug. Each bug in the +tree will include basic information about the bug such as status, summary, etc. + +``` text +GET /rest/bug/1156/graph +``` + +To return a simple graph that only includes the bug IDs, then pass +`ids_only=1`. Note, this will be faster for very large graphs. + +``` text +GET /rest/bug/1156/graph?ids_only=1 +``` + +The default is the dependencies graph. To return the graph for other types, +pass the `relationship={dependencies,regressions,duplicates}` parameter. + +``` text +GET /rest/bug/1156/graph?relationship=regressions +``` + +| name | type | description | +|----|----|----| +| ids_only | boolean | Do not return simple bug data with each bug ID in the tree. Default: False | +| depth | int | Limit the depth of the graph. Default: 3, Max: 9 | +| show_resolved | boolean | Enable if you want to also see RESOLVED bugs in the graph. Default: False | +| relationship | string | One of "dependencies", "duplicates", or "regressions". Default: "dependencies" | + +**Response** + +The default return object will be an object with two trees based on the type of +relationship selected. For dependencies, it will be `blocked` and `dependson`. +For regressions, it will be be `regresses` and `regressed_by`. And for +duplicates, it will be `dupe_of` and `dupe`. + +``` js +{ + "blocked": { + "2": { + "3": { + "bug": { + "alias": null, + "id": 3, + "is_confirmed": 1, + "op_sys": "Unspecified", + "platform": "Unspecified", + "priority": "--", + "resolution": "", + "severity": "normal", + "status": "NEW", + "summary": "Another new test bug", + "target_milestone": "---", + "type": "defect", + "url": "", + "version": "unspecified", + "whiteboard": "" + } + }, + "bug": { + "alias": null, + "id": 2, + "is_confirmed": 1, + "op_sys": "Unspecified", + "platform": "Unspecified", + "priority": "--", + "resolution": "", + "severity": "normal", + "status": "NEW", + "summary": "this is a new test bug", + "target_milestone": "---", + "type": "defect", + "url": "", + "version": "unspecified", + "whiteboard": "" + } + }, + "bug": { + "alias": null, + "id": 1, + "is_confirmed": 1, + "op_sys": "Unspecified", + "platform": "Unspecified", + "priority": "--", + "resolution": "", + "severity": "normal", + "status": "NEW", + "summary": "This is a new test bug", + "target_milestone": "---", + "type": "defect", + "url": "", + "version": "unspecified", + "whiteboard": "" + } + }, + "dependson": {} +} +``` + +The following response, is what will happen if `ids_only=1` is passed. + +``` js +{ + "blocked": { + "2": { + "3": {} + } + }, + "dependson": {} +} +``` + +## Possible Duplicates + +Gets a list of possible duplicate bugs. + +**Request** + +To search by similar bug. + +``` text +GET /rest/bug/possible_duplicates?id=1234567 +``` + +To search by a similar bug summary directly. + +``` text +GET /rest/bug/possible_duplicates?summary=Similar+Bug+Summary +``` + +| name | type | description | +|----|----|----| +| id | int | The id of a bug to find duplicates of. | +| summary | string | A summary to search for duplicates of, only used if no bug id is given. | +| product | string | A product group to limit the search in. | +| limit | int | Limit the number of results returned. If the value is unset, zero or greater than the maximum value set by the administrator, which is 10,000 by default, then the maximum value will be used instead. This is a preventive measure against DoS-like attacks on Bugzilla. | + +**Response** + +``` js +{ + "bugs": [ + { + "alias": null, + "history": [ + { + "when": "2014-09-23T19:12:17Z", + "who": "user@bugzilla.org", + "changes": [ + { + "added": "P1", + "field_name": "priority", + "removed": "P2" + }, + { + "removed": "blocker", + "field_name": "severity", + "added": "critical" + } + ] + }, + { + "when": "2014-09-28T21:03:47Z", + "who": "user@bugzilla.org", + "changes": [ + { + "added": "blocker?", + "removed": "", + "field_name": "flagtypes.name" + } + ] + } + ], + "id": 35 + } + ] +} +``` + +`bugs` (array) Bug objects each containing the following items. If a bug id was +used to query this endpoint, that bug will not be in the list returned. + +| name | type | description | +|----|----|----| +| id | int | The numeric ID of the bug. | +| alias | string | The unique alias of this bug. A `null` value will be returned if this bug has no alias. | +| history | array | An array of History objects. | + +History object: + +| name | type | description | +|----|----|----| +| when | datetime | The date the bug activity/change happened. | +| who | string | The login name of the user who performed the bug change. | +| changes | array | An array of Change objects which contain all the changes that happened to the bug at this time (as specified by `when`). | + +Change object: + +| name | type | description | +|----|----|----| +| field_name | string | The name of the bug field that has changed. | +| removed | string | The previous value of the bug field which has been deleted by the change. | +| added | string | The new value of the bug field which has been added by the change. | +| attachment_id | int | The ID of the attachment that was changed. This only appears if the change was to an attachment, otherwise `attachment_id` will not be present in this object. | diff --git a/docs/en/md/api/core/v1/bugzilla.md b/docs/en/md/api/core/v1/bugzilla.md new file mode 100644 index 0000000000..b4395b4f53 --- /dev/null +++ b/docs/en/md/api/core/v1/bugzilla.md @@ -0,0 +1,203 @@ +# Bugzilla Information + +These methods are used to get general configuration information about this +Bugzilla instance. + +## Version + +Returns the current version of Bugzilla. Normally in the format of `X.X` or +`X.X.X`. For example, `4.4` for the initial release of a new branch. Or `4.4.6` +for a minor release on the same branch. + +**Request** + +``` text +GET /rest/version +``` + +**Response** + +``` js +{ + "version": "4.5.5+" +} +``` + +| name | type | description | +|---------|--------|--------------------------------------| +| version | string | The current version of this Bugzilla | + +## Extensions + +Gets information about the extensions that are currently installed and enabled +in this Bugzilla. + +**Request** + +``` text +GET /rest/extensions +``` + +**Response** + +``` js +{ + "extensions": { + "Voting": { + "version": "4.5.5+" + }, + "BmpConvert": { + "version": "1.0" + } + } +} +``` + + + + + + + + + + + + + + + + +
nametypedescription
extensionsobject

An object containing the extensions enabled as keys. Each extension +object contains the following keys:

+
    +
  • version (string) The version of the extension.
  • +
+ +## Timezone + +Returns the timezone in which Bugzilla expects to receive dates and times on +the API. Currently hard-coded to UTC ("+0000"). This is unlikely to change. + +**Request** + +``` text +GET /rest/timezone +``` + +``` js +{ + "timezone": "+0000" +} +``` + +**Response** + +| name | type | description | +|----------|--------|-----------------------------------------------------------------| +| timezone | string | The timezone offset as a string in (+/-)XXXX (RFC 2822) format. | + +## Time + +Gets information about what time the Bugzilla server thinks it is, and what +timezone it's running in. + +**Request** + +``` text +GET /rest/time +``` + +**Response** + +``` js +{ + "web_time_utc": "2014-09-26T18:01:30Z", + "db_time": "2014-09-26T18:01:30Z", + "web_time": "2014-09-26T18:01:30Z", + "tz_offset": "+0000", + "tz_short_name": "UTC", + "tz_name": "UTC" +} +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
nametypedescription
db_timestring

The current time in UTC, according to the Bugzilla database server.

+

Note that Bugzilla assumes that the database and the webserver are running +in the same time zone. However, if the web server and the database server +aren't synchronized or some reason, this is the time that you should +rely on or doing searches and other input to the WebService.

web_timestring

This is the current time in UTC, according to Bugzilla's web server.

+

This might be different by a second from db_time since this +comes from a different source. If it's any more different than a second, then +there is likely some problem with this Bugzilla instance. In this case you +should rely on the db_time, not the +web_time.

web_time_utcstringIdentical to web_time. (Exists only for +backwards-compatibility with versions of Bugzilla before 3.6.)
tz_namestringThe literal string UTC. (Exists only for +backwards-compatibility with versions of Bugzilla before 3.6.)
tz_short_namestringThe literal string UTC. (Exists only for +backwards-compatibility with versions of Bugzilla before 3.6.)
tz_offsetstringThe literal string +0000. (Exists only for +backwards-compatibility with versions of Bugzilla before 3.6.)
+ +## Job Queue Status + +Reports the status of the job queue. + +**Request** + +``` text +GET /rest/jobqueue_status +``` + +This method requires an authenticated user. + +**Response** + +``` js +{ + "total": 12, + "errors": 0 +} +``` + +| name | type | description | +|--------|---------|-----------------------------------------------------| +| total | integer | The total number of jobs in the job queue. | +| errors | integer | The number of errors produced by jobs in the queue. | diff --git a/docs/en/md/api/core/v1/classification.md b/docs/en/md/api/core/v1/classification.md new file mode 100644 index 0000000000..560d72d887 --- /dev/null +++ b/docs/en/md/api/core/v1/classification.md @@ -0,0 +1,67 @@ +# Classifications + +This part of the Bugzilla API allows you to deal with the available +classifications. You will be able to get information about them as well as +manipulate them. + +## Get Classification + +Returns an object containing information about a set of classifications. + +**Request** + +To return information on a single classification using the ID or name: + +``` text +GET /rest/classification/(id_or_name) +``` + +| name | type | description | +|----------------|-------|---------------------------------------| +| **id_or_name** | mixed | An Integer classification ID or name. | + +**Response** + +``` js +{ + "classifications": [ + { + "sort_key": 0, + "description": "Unassigned to any classifications", + "products": [ + { + "id": 2, + "name": "FoodReplicator", + "description": "Software that controls a piece of hardware that will create any food item through a voice interface." + }, + { + "description": "Silk, etc.", + "name": "Spider Secretions", + "id": 4 + } + ], + "id": 1, + "name": "Unclassified" + } + ] +} +``` + +`classifications` (array) Each object is a classification that the user is +authorized to see and has the following items: + +| name | type | description | +|----|----|----| +| id | int | The ID of the classification. | +| name | string | The name of the classification. | +| description | string | The description of the classification. | +| sort_key | int | The value which determines the order the classification is sorted. | +| products | array | Products the user is authorized to access within the classification. The product object keys are described below. | + +Product object: + +| name | type | description | +|-------------|--------|---------------------------------| +| name | string | The name of the product. | +| id | int | The ID of the product. | +| description | string | The description of the product. | diff --git a/docs/en/md/api/core/v1/comment.md b/docs/en/md/api/core/v1/comment.md new file mode 100644 index 0000000000..cfa2b9616e --- /dev/null +++ b/docs/en/md/api/core/v1/comment.md @@ -0,0 +1,470 @@ +# Comments + +## Get Comments + +This allows you to get data about comments, given a bug ID or comment ID. + +**Request** + +To get all comments for a particular bug using the bug ID or alias: + +``` text +GET /rest/bug/(id_or_alias)/comment +``` + +To get a specific comment based on the comment ID: + +``` text +GET /rest/bug/comment/(comment_id) +``` + +| name | type | description | +|----|----|----| +| **id_or_alias** | mixed | A single integer bug ID or alias. | +| **comment_id** | int | A single integer comment ID. | +| new_since | datetime | If specified, the method will only return comments *newer* than this time. This only affects comments returned from the `ids` argument. You will always be returned all comments you request in the `comment_ids` argument, even if they are older than this date. | + +**Response** + +``` js +{ + "bugs": { + "35": { + "comments": [ + { + "time": "2000-07-25T13:50:04Z", + "text": "test bug to fix problem in removing from cc list.", + "bug_id": 35, + "count": 0, + "attachment_id": null, + "is_private": false, + "tags": [], + "creator": "user@bugzilla.org", + "creation_time": "2000-07-25T13:50:04Z", + "reactions": { + "+1": 3, + "heart": 2, + "tada": 1 + }, + "id": 75 + } + ] + } + }, + "comments": {} +} +``` + +Two items are returned: + +`bugs` This is used for bugs specified in `ids`. This is an object, where the +keys are the numeric IDs of the bugs, and the value is a object with a single +key, `comments`, which is an array of comments. (The format of comments is +described below.) + +Any individual bug will only be returned once, so if you specify an ID multiple +times in `ids`, it will still only be returned once. + +`comments` Each individual comment requested in `comment_ids` is returned here, +in a object where the numeric comment ID is the key, and the value is the +comment. (The format of comments is described below.) + +A "comment" as described above is a object that contains the following items: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
nametypedescription
idintThe globally unique ID for the comment.
bug_idintThe ID of the bug that this comment is on.
attachment_idintIf the comment was made on an attachment, this will be the ID of that +attachment. Otherwise it will be null.
countintThe number of the comment local to the bug. The Description is 0, comments +start with 1.
textstringThe body of the comment, including any special text (such as "this bug was +marked as a duplicate of...").
raw_textstringThe body of the comment without any special additional text.
creatorstringThe login name of the comment's author.
timedatetimeThe time (in Bugzilla's timezone) that the comment was added.
creation_timedatetime

This is exactly same as the time key. Use this field +instead of time for consistency with other methods including Get Bug and Get Attachment.

+

For compatibility, time is still usable. However, please note +that time may be deprecated and removed in a future +release.

is_privatebooleantrue if this comment is private (only visible to a certain +group called the "insidergroup"), false otherwise.
is_markdownbooleantrue if this comment is markdown. false if this +comment is plaintext.
edit_countint

The number of times this comment has been edited. 0 if the +comment has never been edited.

+

Only present for users who are allowed to edit other people's comments. +Revisions hidden by an edit-comments admin are only counted for members of the +edit-comments admins group.

last_change_timedatetime

The time (in Bugzilla's timezone) of the most recent edit to this +comment, or null if the comment has never been edited.

+

Only present for users who are allowed to edit other people's comments, and +follows the same rules as edit_count for hidden +revisions.

reactionsobjectAn object containing reacted emoji names and corresponding counts. To +retrieve reacted users, use Get +Comment Reactions.
+ +**Errors** + +This method can throw all the same errors as [Get +Bug](bug.md#get-bug). In addition, it can also throw the following +errors: + +- 110 (Comment Is Private) You specified the id of a private comment in the + "comment_ids" argument, and you are not in the "insider group" that can see + private comments. +- 111 (Invalid Comment ID) You specified an id in the "comment_ids" argument + that is invalid--either you specified something that wasn't a number, or + there is no comment with that id. + +## Create Comments + +This allows you to add a comment to a bug in Bugzilla. All comments created via +the API will be considered Markdown (specifically GitHub Flavored Markdown). + +**Request** + +To create a comment on a current bug. + +``` text +POST /rest/bug/(id)/comment +``` + +``` js +{ + "ids" : [123,..], + "comment" : "This is an additional comment", + "is_private" : false, + "is_markdown" : true +} +``` + +`ids` is optional in the data example above and can be used to specify adding a +comment to more than one bug at the same time. + +| name | type | description | +|----|----|----| +| **id** | int | The ID or alias of the bug to append a comment to. | +| ids | array | List of integer bug IDs to add the comment to. | +| **comment** | string | The comment to append to the bug. If this is empty or all whitespace, an error will be thrown saying that you did not set the `comment` parameter. | +| is_private | boolean | If set to true, the comment is private, otherwise it is assumed to be public. | +| is_markdown | boolean | If true, the comment will be rendered as markdown. Defaults to the system `use_markdown` setting. | +| work_time | double | Adds this many hours to the "Hours Worked" on the bug. If you are not in the time tracking group, this value will be ignored. | + +**Response** + +``` js +{ + "id" : 789 +} +``` + +| name | type | description | +|------|------|----------------------------------| +| id | int | ID of the newly-created comment. | + +**Errors** + +- 54 (Hours Worked Too Large) You specified a "work_time" larger than the + maximum allowed value of "99999.99". +- 100 (Invalid Bug Alias) If you specified an alias and there is no bug with + that alias. +- 101 (Invalid Bug ID) The id you specified doesn't exist in the database. +- 109 (Bug Edit Denied) You did not have the necessary rights to edit the bug. +- 113 (Can't Make Private Comments) You tried to add a private comment, but + don't have the necessary rights. +- 114 (Comment Too Long) You tried to add a comment longer than the maximum + allowed length (65,535 characters). +- 140 (Markdown Disabled) You tried to set the "is_markdown" flag to true but + the Markdown feature is not enabled. + +## Get Comment Reactions + +Gets reactions left on a comment with reacted users’ details. + +**Request** + +To get the reactions attached to a comment: + +``` text +GET /rest/bug/comment/(comment_id)/reactions +``` + +| name | type | description | +|----------------|------|------------------------------| +| **comment_id** | int | A single integer comment ID. | + +**Response** + +``` js +{ + "+1": [ + { + "id": 2, + "real_name": "Test User", + "nick": "user", + "name": "user@bugzilla.org", + "email": "user@bugzilla.org" + } + ] +} +``` + +An object containing the comment's reactions, where the key is a reacted emoji +name, and the value is an array of reacted users, which are the same as user +objects returned by [Get Bug](bug.md#get-bug). + +**Errors** + +This method can throw all of the errors that [Get +Comments](#get-comments) throws, plus: + +- 136 (Comment Reactions Disabled) Comment reactions are not enabled on this + Bugzilla instance. + +## Update Comment Reactions + +Adds or removes reactions from a comment. + +**Request** + +To update the reactions attached to a comment: + +``` text +PUT /rest/bug/comment/(comment_id)/reactions +``` + +Example: + +``` js +{ + "add" : ["+1", "smile"] +} +``` + +| name | type | description | +|----------------|-------|-------------------------------------------| +| **comment_id** | int | The ID of the comment to update. | +| add | array | The reactions to attach to the comment. | +| remove | array | The reactions to detach from the comment. | + +Supported reactions: `+1`, `-1`, `tada`, `smile`, `sad` and `heart`. + +**Response** + +Same as [Get Comment Reactions](#get-comment-reactions). + +**Errors** + +This method can throw all of the errors that [Get +Comments](#get-comments) throws, plus: + +- 136 (Comment Reactions Disabled) Comment reactions are not enabled on this + Bugzilla instance. +- 137 (Invalid Comment Reaction) The comment reaction provided is not + supported. + +## Search Comment Tags + +Searches for tags which contain the provided substring. + +**Request** + +To search for comment tags: + +``` text +GET /rest/bug/comment/tags/(query) +``` + +Example: + +``` text +GET /rest/bug/comment/tags/spa +``` + +| name | type | description | +|----|----|----| +| **query** | string | Only tags containing this substring will be returned. | +| limit | int | If provided will return no more than `limit` tags. Defaults to `10`. | + +**Response** + +``` js +[ + "spam" +] +``` + +An array of matching tags. + +**Errors** + +This method can throw all of the errors that [Get Bug](bug.md#get-bug) +throws, plus: + +- 125 (Comment Tagging Disabled) Comment tagging support is not available or + enabled. + +## Update Comment Tags + +Adds or removes tags from a comment. + +**Request** + +To update the tags comments attached to a comment: + +``` text +PUT /rest/bug/comment/(comment_id)/tags +``` + +Example: + +``` js +{ + "comment_id" : 75, + "add" : ["spam", "bad"] +} +``` + +| name | type | description | +|----------------|-------|--------------------------------------| +| **comment_id** | int | The ID of the comment to update. | +| add | array | The tags to attach to the comment. | +| remove | array | The tags to detach from the comment. | + +**Response** + +``` js +[ + "bad", + "spam" +] +``` + +An array of strings containing the comment's updated tags. + +**Errors** + +This method can throw all of the errors that [Get Bug](bug.md#get-bug) +throws, plus: + +- 125 (Comment Tagging Disabled) Comment tagging support is not available or + enabled. +- 126 (Invalid Comment Tag) The comment tag provided was not valid (e.g. + contains invalid characters). +- 127 (Comment Tag Too Short) The comment tag provided is shorter than the + minimum length. +- 128 (Comment Tag Too Long) The comment tag provided is longer than the + maximum length. + +## Render Comment + +Returns the HTML rendering of the provided comment text. + +**Request** + +``` text +POST /rest/bug/comment/render +``` + +Example: + +``` js +{ + "id" : 2345, + "text" : "This issue has been fixed in bug 1234." +} +``` + +| name | type | description | +|----------|--------|--------------------------------------------------| +| **text** | string | Comment text to render. | +| id | int | The ID of the bug to render the comment against. | + +**Response** + +``` js +{ + "html" : "This issue has been fixed in
bug 1234." +] +``` + +| name | type | description | +|------|--------|-------------------------------------| +| html | string | Text containing the HTML rendering. | + +**Errors** + +This method can throw all of the errors that [Get Bug](bug.md#get-bug) +throws. diff --git a/docs/en/md/api/core/v1/component.md b/docs/en/md/api/core/v1/component.md new file mode 100644 index 0000000000..7ef89144d0 --- /dev/null +++ b/docs/en/md/api/core/v1/component.md @@ -0,0 +1,160 @@ +# Components + +This part of the Bugzilla API looks at individual components and also allows +updating their information. + +## Get Component + +This allows you to retrieve information about a specific component. + +**Request** + +To get information about the General component under the Firefox product: + +``` text +GET /rest/component/Firefox/General +``` + +To get information about a component where the product name contains a slash +(/) character. Named parameters must be used instead of path based parameters. + +``` text +GET /rest/component?product=Firefox%20%2F%20Bugs&component=General +``` + +**Response** + +``` js +{ + "default_assignee": "nobody@mozilla.org", + "default_bug_type": "--", + "default_qa_contact": "", + "description": "For bugs in Firefox which do not fit into other more specific Firefox components", + "id": 2, + "is_active": true, + "name": "General", + "team_name": "Mozilla", + "triage_owner": "admin@mozilla.bugs" +} +``` + + + +Component Object + +| name | type | description | +|----|----|----| +| id | int | An integer ID uniquely identifying the component in this installation only. | +| name | string | The name of the component. | +| description | string | A description of the component, which may contain HTML. | +| is_active | boolean | A boolean indicating if the component is active. | +| default_bug_type | string | The default type for bugs filed under this component. | +| default_assignee | string | The login of the default assignee for the component. | +| default_qa_contact | string | The login of the default qa contact for the component. | +| triage_owner | string | The login of the default triage owner for the component. | +| team_name | string | The team name the component belongs to. | +| bug_description_template | string | The string included in the comment field of a new bug when the component is selected. | + +## Create Component + +This allows you to create a new component under a specific product in Bugzilla. + +**Request** + +To create a new component called `TestComponent` under the `Firefox` product: + +``` text +{ + "name" : "TestComponent", + "description" : "This is a new test component", + "default_assignee" : "admin@mozilla.bugs", + "team_name" : "Mozilla" +} +``` + +| name | type | description | +|----|----|----| +| name | string | The name of the component. | +| description | string | A description of the component, which may contain HTML. | +| default_bug_type | string | The default type for bugs filed under this component. If empty, then product's default bug type is used. (optional). | +| default_assignee | string | The login of the default assignee for the component. | +| default_qa_contact | string | The login of the default qa contact for the component (optional). | +| triage_owner | string | The login of the triage owner for the component (optional). | +| team_name | string | The team name the component belongs to. | +| bug_description_template | string | The string included in the comment field of a new bug when the component is selected (optional). | + +**Response** + +``` js +{ + "default_assignee": "admin@mozilla.bugs", + "default_bug_type": "--", + "default_qa_contact": "", + "description": "This is a new test component", + "id": 2, + "is_active": true, + "name": "TestComponent", + "team_name": "Mozilla", + "triage_owner": "" +} +``` + +A component object [rest_component_object](#rest_component_object) is +returned. + +## Update Component + +This allows you to update an existing component in Bugzilla. + +**Request** + +``` text +PUT /rest/component/Firefox/General +``` + +To update information about a component where the product name contains a slash +(/) character. Named parameters must be used instead of path based parameters. + +``` text +PUT /rest/component?product=Firefox%20%2F%20Bugs&component=General +``` + +The body of the request should look similar to below. + +``` js +{ + "default_assignee" : "admin@mozilla.bugs", + "triage_owner" : "nobody@mozilla.org" +} +``` + +| name | type | description | +|----|----|----| +| name | string | The name of this component. | +| description | string | A description for this component. Allows some simple HTML. | +| default_assignee | string | The login of the default assignee for the component. | +| default_qa_contact | string | The login of the default qa contact for the component. | +| default_bug_type | string | The default type for bugs filed under this component. If empty, then product's default bug type is used. | +| is_active | boolean | `true` if you want the component to be active. `false` if not. | +| triage_owner | string | The login of the triage owner for the component. | +| team_name | string | The team name the component belongs to. | +| bug_description_template | string | The string included in the comment field of a new bug when the component is selected. | + +**Response** + +``` js +{ + "default_assignee": "admin@mozilla.bugs", + "default_bug_type": "--", + "default_qa_contact": "", + "description": "For bugs in Firefox which do not fit into other more specific Firefox components", + "id": 2, + "is_active": true, + "name": "General", + "team_name": "Mozilla", + "triage_owner": "nobody@mozilla.org", +} +``` + +A component object [rest_component_object](#rest_component_object) is +returned. diff --git a/docs/en/md/api/core/v1/field.md b/docs/en/md/api/core/v1/field.md new file mode 100644 index 0000000000..dfef9c50c5 --- /dev/null +++ b/docs/en/md/api/core/v1/field.md @@ -0,0 +1,306 @@ +# Bug Fields + +The Bugzilla API for getting details about bug fields. + +## Fields + +Get information about valid bug fields, including the lists of legal values for +each field. + +**Request** + +To get information about all fields: + +``` text +GET /rest/field/bug +``` + +To get information related to a single field: + +``` text +GET /rest/field/bug/(id_or_name) +``` + +| name | type | description | +|------------|-------|------------------------------------------------------------| +| id_or_name | mixed | An integer field ID or string representing the field name. | + +**Response** + +``` js +{ + "fields": [ + { + "display_name": "Priority", + "name": "priority", + "type": 2, + "is_mandatory": false, + "value_field": null, + "values": [ + { + "sortkey": 100, + "sort_key": 100, + "visibility_values": [], + "name": "P1" + }, + { + "sort_key": 200, + "name": "P2", + "visibility_values": [], + "sortkey": 200 + }, + { + "sort_key": 300, + "visibility_values": [], + "name": "P3", + "sortkey": 300 + }, + { + "sort_key": 400, + "name": "P4", + "visibility_values": [], + "sortkey": 400 + }, + { + "name": "P5", + "visibility_values": [], + "sort_key": 500, + "sortkey": 500 + } + ], + "visibility_values": [], + "visibility_field": null, + "is_on_bug_entry": false, + "is_custom": false, + "id": 13 + } + ] +} +``` + +`field` (array) Field objects each containing the following items: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
nametypedescription
idintAn integer ID uniquely identifying this field in this installation +only.
typeint

The number of the fieldtype. The following values are defined:

+
    +
  • 0 Field type unknown
  • +
  • 1 Single-line string field
  • +
  • 2 Single value field
  • +
  • 3 Multiple value field
  • +
  • 4 Multi-line text value
  • +
  • 5 Date field with time
  • +
  • 6 Bug ID field
  • +
  • 7 See Also field
  • +
  • 8 Keywords field
  • +
  • 9 Date field
  • +
  • 10 Integer field
  • +
is_custombooleantrue when this is a custom field, false +otherwise.
namestringThe internal name of this field. This is a unique identifier for this +field. If this is not a custom field, then this name will be the same across +all Bugzilla installations.
display_namestringThe name of the field, as it is shown in the user interface.
is_mandatorybooleantrue if the field must have a value when filing new bugs. +Also, mandatory fields cannot have their value cleared when updating bugs.
is_on_bug_entrybooleanFor custom fields, this is true if the field is shown when you +enter a new bug. For standard fields, this is currently always +false, even if the field shows up when entering a bug. (To know +whether or not a standard field is valid on bug entry, see Create Bug.
visibility_fieldstringThe name of a field that controls the visibility of this field in the user +interface. This field only appears in the user interface when the named field +is equal to one of the values is visibility_values. Can be +null.
visibility_valuesarrayThis field is only shown when visibility_field matches one of +these string values. When visibility_field is null, then this is +an empty array.
value_fieldstringThe name of the field that controls whether or not particular values of the +field are shown in the user interface. Can be null.
valuesarrayObjects representing the legal values for select-type (drop-down and +multiple-selection) fields. This is also populated for the +component, version, target_milestone, +and keywords fields, but not for the product field +(you must use get_accessible_products for that). For fields that +aren't select-type fields, this will simply be an empty array. Each object +contains the items described in the Value object below.
+ +Value object: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
nametypedescription
namestringThe actual value--this is what you would specify for this field in +create, etc.
sort_keyintValues, when displayed in a list, are sorted first by this integer and then +secondly by their name.
visibility_valuesarrayIf value_field is defined for this field, then this value is +only shown if the value_field is set to one of the values listed +in this array. Note that for per-product fields, value_field is +set to product and visibility_values will reflect +which product(s) this value appears in.
is_activebooleanThis value is defined only for certain product-specific fields such as +version, target_milestone or component. When true, the value is active; +otherwise the value is not active.
descriptionstringThe description of the value. This item is only included for the +keywords field.
is_openbooleanFor bug_status values, determines whether this status +specifies that the bug is "open" (true) or "closed" +(false). This item is only included for the +bug_status field.
can_change_toarray

For bug_status values, this is an array of objects that +determine which statuses you can transition to from this status. (This item is +only included for the bug_status field.)

+

Each object contains the following items:

+
    +
  • name: (string) The name of the new status
  • +
  • comment_required: (boolean) true if a comment is required when +you change a bug into this status using this transition.
  • +
+ +**Errors** + +- 51 (Invalid Field Name or Id) You specified an invalid field name or id. + +## Legal Values + +**DEPRECATED** Use ''Fields'' instead. + +Tells you what values are allowed for a particular field. + +**Request** + +To get information on the values for a field based on field name: + +``` text +GET /rest/field/bug/(field)/values +``` + +To get information based on field name and a specific product: + +``` text +GET /rest/field/bug/(field)/(product_id)/values +``` + +| name | type | description | +|----|----|----| +| field | string | The name of the field you want information about. This should be the same as the name you would use in [Create Bug](bug.md#create-bug), below. | +| product_id | int | If you're picking a product-specific field, you have to specify the ID of the product you want the values for. | + +**Response** + +``` js +{ + "values": [ + "P1", + "P2", + "P3", + "P4", + "P5" + ] +} +``` + +| name | type | description | +|----|----|----| +| values | array | The legal values for this field. The values will be sorted as they normally would be in Bugzilla. | + +**Errors** + +- 106 (Invalid Product) You were required to specify a product, and either you + didn't, or you specified an invalid product (or a product that you can't + access). +- 108 (Invalid Field Name) You specified a field that doesn't exist or isn't a + drop-down field. diff --git a/docs/en/md/api/core/v1/flag-activity.md b/docs/en/md/api/core/v1/flag-activity.md new file mode 100644 index 0000000000..5867533ff4 --- /dev/null +++ b/docs/en/md/api/core/v1/flag-activity.md @@ -0,0 +1,151 @@ +# Flag Activity + +This API provides information about activity relating to bug and attachment +flags. + +## Get Flag Activity + +**Request** + +There are a variety of methods for querying flag activity based on different +criteria. + +``` text +GET /rest/review/flag_activity/(flag_id) +``` + +Fetches activity for the given flag as specified by its id. + +``` text +GET /rest/review/flag_activity/requestee/(requestee) +``` + +Fetches activity for flags where the requestee matches the given Bugzilla +login. + +``` text +GET /rest/review/flag_activity/setter/(requestee) +``` + +Fetches activity for flags where the setter matches the given Bugzilla login. + +``` text +GET /rest/review/flag_activity/type_id/(type_id) +``` + +Fetches activity for all flags of the type specified by its id. + +``` text +GET /rest/review/flag_activity/type_name/(type_name) +``` + +Fetches activity for all flags of the type specified by its name. + +``` text +GET /rest/review/flag_activity +``` + +Fetches activity for all flags. + +There are also query parameters that can be used to further filter the +response: + +| name | type | description | +|--------|------|-----------------------------------------------------| +| limit | int | Number of entries to return. | +| offset | int | Number of entries to skip before returning results. | +| after | date | Display activity occurring on or after this date. | +| before | date | Display activity occurring before this date. | + +Note that if `offset` is specified, `limit` must be given as well. + +There is a site-specific maximum number of entries that will be returned +regardless of the value given for `limit`. This is also the default if `limit` +is not specified. + +For example, to get the first 100 flag-activity entries that occurred on or +after 2018-01-01 for flag ID 42: + +``` text +GET /rest/review/flag_activity/42?limit=100&after=2018-01-01 +``` + +**Response** + +``` js +[ + { + "attachment_id": null, + "bug_id": 1395127, + "creation_time": "2018-10-10 12:41:00", + "flag_id": 1637223, + "id": 1449303, + "requestee": { + "id": 123, + "name": "user@mozilla.com", + "nick": "user", + "real_name": "J. Random User" + }, + "setter": { + "id": 123, + "name": "user@mozilla.com", + "nick": "user", + "real_name": "J. Random User" + }, + "status": "?", + "type": { + "description": "Set this flag when the bug is in need of additional information.", + "id": 800, + "is_active": true, + "is_multiplicable": true, + "is_requesteeble": true, + "name": "needinfo", + "type": "bug" + } + } +] +``` + +An object containing a list of flags. The fields for each flag are as follows: + +| name | type | description | +|---------------|----------|------------------------------------------------------| +| attachment_id | int | The numeric ID of the associated attachment, if any. | +| bug_id | int | The numeric ID of the associated bug. | +| creation_time | datetime | The time the flag status changed. | +| flag_id | int | The numeric ID of this flag instance. | +| id | int | The numeric ID of this flag-activity event. | +| requestee | object | Data about the user of which the flag was requested. | +| setter | object | Data about the user who set the flag. | +| status | string | Status of the flag: "?", "+", or "-". | +| type | object | Data about the type of flag. | + +The requestee and setter objects have the following fields: + +| name | type | description | +|----|----|----| +| id | int | The unique ID of the user. | +| name | string | The login of the user (typically an email address). | +| real_name | string | The real name of the user, if set. | +| nick | string | The user's nickname. Currently this is extracted the real_name, name or email field. | + +The type object has the following fields: + +| name | type | description | +|----|----|----| +| description | string | A plain-English description of the flag type. | +| id | int | The numeric ID of the flag type. | +| is_active | boolean | Indicates if the flag type can be used. | +| is_multiplicable | boolean | Indicates if more than one flags of this type can be set on a bug/attachment. | +| is_requesteeble | boolean | Indicates if this flag type supports a requestee. | +| name | string | Short descriptive name of this flag type. | +| type | string | The object to which this flag type can be applied (e.g. "bug", "attachment"). | + +**Errors** + +If a nonexistent but properly specified (i.e. integer value) flag or flag-type +ID is given, a 200 OK response will be returned with an empty array. In other +cases, different response codes may be returned: + +- 400 (Bad Request): An invalid flag or flag-type ID was given, or `offset` was + given without a value for `limit`. diff --git a/docs/en/md/api/core/v1/general.md b/docs/en/md/api/core/v1/general.md new file mode 100644 index 0000000000..8c98f9cee1 --- /dev/null +++ b/docs/en/md/api/core/v1/general.md @@ -0,0 +1,205 @@ +# General + +This is the standard REST API for external programs that want to interact with +Bugzilla. It provides a REST interface to various Bugzilla functions. + +## Basic Information + +**Data Format** + +The REST API only supports JSON input, and either JSON or JSONP output. So +objects sent and received must be in JSON format. + +If you need JSONP output, you must set the `Accept: application/javascript` +HTTP header and add a `callback` parameter to name your callback. + +Parameters may also be passed in as part of the query string for non-GET +requests and will override any matching parameters in the request body. + +Example request which returns the current version of Bugzilla: + +``` http +GET /rest/version HTTP/1.1 +Host: bugzilla.example.com +``` + +Example response: + +``` http +HTTP/1.1 200 OK +Vary: Accept +Content-Type: application/json + +{ + "version" : "4.2.9+" +} +``` + +**Errors** + +When an error occurs over REST, an object is returned with the key `error` set +to `true`. + +The error contents look similar to: + +``` js +{ + "error": true, + "message": "Some message here", + "code": 123 +} +``` + + + +BMO's Varnish front end rejects request targets longer than 8 KiB, including +the path and query string, with a plain-text `414 URI Too Long` response +instead of the JSON error object described above. This limit accommodates +roughly 1,000 seven-digit bug IDs in the `id` parameter for `GET /rest/bug`, +depending on the other parameters. Keep request targets below the limit and +split large queries into multiple requests. + +## Common Data Types + +The Bugzilla API uses the following various types of parameters: + +| type | description | +|----|----| +| int | Integer. | +| double | A floating-point number. | +| string | A string. | +| email | A string representing an email address. This value, when returned, may be filtered based on if the user is logged in or not. | +| date | A specific date. Example format: `YYYY-MM-DD`. | +| datetime | A date/time. Timezone should be in UTC unless otherwise noted. Example format: `YYYY-MM-DDTHH24:MI:SSZ`. | +| boolean | `true` or `false`. | +| base64 | A base64-encoded string. This is the only way to transfer binary data via the API. | +| array | An array. There may be mixed types in an array. `[` and `]` are used to represent the beginning and end of arrays. | +| object | A mapping of keys to values. Called a "hash", "dict", or "map" in some other programming languages. The keys are strings, and the values can be any type. `{` and `}` are used to represent the beginning and end of objects. | + +Parameters that are required will be displayed in **bold** in the parameters +table for each API method. + +## Authentication + +Some methods do not require you to log in. An example of this is [Get +Bug](bug.md#get-bug). However, authenticating yourself allows you to +see non-public information, for example, a bug that is not publicly visible. + +To authenticate yourself, you will need to use API keys: + +**API Keys** + +You can specify 'X-BUGZILLA-API-KEY' header with the API key as a value to any +request, and you will be authenticated as that user if the key is correct and +has not been revoked. + +You can set up an API key by using the [API Keys tab](../../../using/preferences.md#api-keys) in the +Preferences pages. + +Send only one authentication method with each request. BMO does not combine +credentials or choose the strongest method when more than one is supplied. In +particular, legacy `Bugzilla_login` and `Bugzilla_password` credentials take +precedence over an API key. Once BMO selects those credentials, it does not +fall back to the API key if password authentication fails. + +If the account has the **Require API key authentication for API requests** +preference enabled, a request containing both valid username/password +credentials and a valid API key fails with an +`API key authentication is required` error because BMO selected the +username/password credentials first. Remove the username/password credentials +and send only the API key; do not disable the preference. + +**WARNING**: It should be noted that additional authentication methods exist, +but they are **not recommended** for use and are likely to be deprecated in +future versions of BMO, due to security concerns. These additional methods +include the following: + +> - api key via `Bugzilla_api_key` or simply `api_key` in query parameters. + +## Useful Parameters + +Many calls take common arguments. These are documented below and linked from +the individual calls where these parameters are used. + + + +**Including Fields** + +Many calls return an array of objects with various fields in the objects. (For +example, [Get Bug](bug.md#get-bug) returns a list of `bugs` that have +fields like `id`, `summary`, `creation_time`, etc.) + +These parameters allow you to limit what fields are present in the objects, to +improve performance or save some bandwidth. + +`include_fields`: The (case-sensitive) names of fields in the response data. +Only the fields specified in the object will be returned, the rest will not be +included. Fields should be comma delimited. + +Invalid field names are ignored. + +Example request to [Get User](user.md#get-user): + +``` text +GET /rest/user/1?include_fields=id,name +``` + +would return something like: + +``` js +{ + "users" : [ + { + "id" : 1, + "name" : "user@domain.com" + } + ] +} +``` + +**Excluding Fields** + +`exclude_fields`: The (case-sensitive) names of fields in the return value. The +fields specified will not be included in the returned objects. Fields should be +comma delimited. + +Invalid field names are ignored. + +Specifying fields here overrides `include_fields`, so if you specify a field in +both, it will be excluded, not included. + +Example request to [Get User](user.md#get-user): + +``` js +GET /rest/user/1?exclude_fields=name +``` + +would return something like: + +``` js +{ + "users" : [ + { + "id" : 1, + "real_name" : "John Smith" + } + ] +} +``` + +Some calls support specifying "subfields". If a call states that it supports +"subfield" restrictions, you can restrict what information is returned within +the first field. For example, if you call [Get +Product](product.md#get-product) with an `include_fields` of +`components.name`, then only the component name would be returned (and nothing +else). You can include the main field, and exclude a subfield. + +There are several shortcut identifiers to ask for only certain groups of fields +to be returned or excluded: + +| value | description | +|----|----| +| `_all` | All possible fields are returned if this is specified in `include_fields`. | +| `_default` | Default fields are returned if `include_fields` is empty or this is specified. This is useful if you want the default fields in addition to a field that is not normally returned. | +| `_extra` | Extra fields are not returned by default and need to be manually specified in `include_fields` either by exact field name, or adding `_extra`. | +| `_custom` | Custom fields are normally returned by default unless this is added to `exclude_fields`. Also you can use it in `include_fields` if for example you want specific field names plus all custom fields. Custom fields are normally only relevant to bug objects. | diff --git a/docs/en/md/api/core/v1/github.md b/docs/en/md/api/core/v1/github.md new file mode 100644 index 0000000000..0062513803 --- /dev/null +++ b/docs/en/md/api/core/v1/github.md @@ -0,0 +1,262 @@ +# Github + +## Pull Requests + +This API endpoint is for creating attachments in a bug that are redirect links +to a specific Github pull request. This allows a bug viewer to click on the +Github link and be automatically redirected to the pull request. + +**Github Setup Instructions** + +- Create or identify a Bugzilla bot account to own this webhook. The bot + account should be least-privileged — grant it only the permissions needed for + the integration. +- A BMO admin must add that bot account to the `github-webhook-bot` group via + the Users admin UI (`/editusers.cgi`). +- Log in as the bot account and go to Preferences \> API Keys. +- Create a new API key with a descriptive label (e.g. + `github-webhook-mozilla-bteam-bmo`). Copy the key value — it will only be + shown once. + +> [!WARNING] +> This API key also grants full access to the Bugzilla REST API as the bot +> account. Treat it as a credential: store it only in the GitHub webhook secret +> field and never share it. + +- From the repository main page, click on the Settings tab. +- Click on Webhooks from the left side menu. +- Click on the Add Webhook button near the top right. +- For the payload url, enter + `https://bugzilla.mozilla.org/rest/github/pull_request`. +- Choose `application/json` for the content type. +- Enter the Bugzilla API key you created above as the webhook secret. +- Make sure Enable SSL is turned on. +- Select "Let me select individual events" and only enable changes for "Pull + Requests". +- Make sure at the bottom that "Active" is checked on. +- Save the webhook. + +> [!NOTE] +> If a webhook secret is ever compromised, revoke the affected API key from the +> bot account's Preferences \> API Keys page. Only that single webhook is +> affected — all other bot accounts' webhooks continue to work without any +> changes. + +> [!NOTE] +> Past pull requests will not automatically get a link created in the bug. New +> pull requests should get the link automatically when the pull request is +> first created. + +> [!NOTE] +> The API endpoint looks at the pull request title for the bug id so make sure +> the title is formatted correctly to allow the bug id to be determined. +> Examples are: `Bug 1234:`, `Bug - 1234`, `bug 1234`, or `Bug 1234 -`. + +**Request** + +The endpoint will error for any requests that do not have `X-GitHub-Event` +header with either the value `pull_request` or `ping`. Ping events can happen +when a webhook is first created. In that case, Bugzilla will return success if +the signature checks out. + +``` text +POST /rest/github/pull_request +``` + +``` js +{ + "pull_request": { + "html_url": "https://github.com/mozilla-bteam/bmo/pull/1943", + "number": 1943, + "title": "Bug 1234567 - Some really bad bug which should be fixed" + } +} +``` + +The above example is only a small amount of the full data that is sent. + +Some params must be set, or an error will be thrown. The required params are +marked in **bold**. + +| name | type | description | +|----|----|----| +| **pull_request** | Object | Object containing data about the current pull request. | +| **pull_request.html_url** | string | A fully qualified link to the pull request. | +| **pull_request.number** | int | The pull request ID unique to the repository. | +| **pull_request.title** | string | The full title of the current pull request containing the bug report ID. | + +**Response** + +Operation was completed successfully. + +``` js +{ + "error": 0 + "id": 22 +} +``` + +| name | type | description | +|-------|---------|-----------------------------------------------------| +| error | boolean | Whether the operation was successful or not. | +| id | int | ID of the pre-existing or newly-created attachment. | + +An error condition occurred. + +``` js +{ + "error": 1 + "message": "The pull request title did not contain a valid bug ID." +} +``` + +| name | type | description | +|---------|---------|---------------------------------------------------| +| error | boolean | Whether the operation was successful or not. | +| message | string | A message detailing what the error condition was. | + +## Push Comments + +This API endpoint is for adding comments to a bug when a push is made to a +linked Github repository. The comment will be short and specially formatted +using pieces of information from the full JSON sent to Bugzilla by the push +event. If the bug does not have the keyword `leave-open` set, the bug will be +resolved as FIXED. Also, the `qe-verify` flag will be set to +`+` for the bug unless the `?no-qe-verify=1` query +parameter is passed in the URL. For some specific repositories, a Firefox +status flag may be set to FIXED. + +**Github Setup Instructions** + +- Create or identify a Bugzilla bot account to own this webhook. The bot + account should be least-privileged — grant it only the permissions needed for + the integration. +- A BMO admin must add that bot account to the `github-webhook-bot` group via + the Users admin UI (`/editusers.cgi`). +- Log in as the bot account and go to Preferences \> API Keys. +- Create a new API key with a descriptive label (e.g. + `github-webhook-mozilla-bteam-bmo-push`). Copy the key value — it will only + be shown once. + +> [!WARNING] +> This API key also grants full access to the Bugzilla REST API as the bot +> account. Treat it as a credential: store it only in the GitHub webhook secret +> field and never share it. + +- From the repository main page, click on the Settings tab. +- Click on Webhooks from the left side menu. +- Click on the Add Webhook button near the top right. +- For the payload url, enter + `https://bugzilla.mozilla.org/rest/github/push_comment`. +- Add `?no-qe-verify=1` to the URL if you do not want the `qe-verify` flag set. +- Choose `application/json` for the content type. +- Enter the Bugzilla API key you created above as the webhook secret. +- Make sure Enable SSL is turned on. +- Select "Let me select individual events" and only enable changes for + "Pushes". +- Make sure at the bottom that "Active" is checked on. +- Save the webhook. + +> [!NOTE] +> If a webhook secret is ever compromised, revoke the affected API key from the +> bot account's Preferences \> API Keys page. Only that single webhook is +> affected — all other bot accounts' webhooks continue to work without any +> changes. + +> [!NOTE] +> The API endpoint looks at the commit messages for the bug ID so make sure the +> message is formatted correctly to allow the bug ID to be determined. Examples +> are: `Bug 1234:`, `Bug - 1234`, `bug 1234`, or `Bug 1234 -`. + +**Request** + +The endpoint will error for any events that do not have `X-GitHub-Event` header +with either the value `push` or `ping`. Ping events can happen when a webhook +is first created. In that case, Bugzilla will return success if the signature +checks out. + +``` text +POST /rest/github/push_comment +``` + +``` js +{ + "ref": "refs/heads/master", + "repository": { + "full_name": "mozilla-bteam/bmo", + "html_url": "https://github.com/mozilla-bteam/bmo", + "description": "bugzilla.mozilla.org source - report issues here: https://bugzilla.mozilla.org/enter_bug.cgi?product=bugzilla.mozilla.org", + }, + "commits": [ + { + "message": "Bug 1803939 - Webhook URL field is too short", + "url": "https://github.com/mozilla-bteam/bmo/commit/b4edfe9343e1474e0a6959531d2362078ea6ee84", + "author": { + "name": "dklawren", + "username": "dklawren" + }, + "added": [], + "removed": [], + "modified": [ + "extensions/Webhooks/Extension.pm", + "extensions/Webhooks/template/en/default/account/prefs/webhooks.html.tmpl" + ] + } + ] +} +``` + +The above example is only a small amount of the full data that is sent. + +> [!NOTE] +> Only the first line of the commit message will be used on the bug comment. + +Some params must be set, or an error will be thrown. The required params are +marked in **bold**. + +| name | type | description | +|----|----|----| +| **ref** | string | The branch (ref) that the commit was pushed to (ex: refs/heads/master). | +| **repository.full_name** | string | The name of the Github repository. | +| **commits** | array | An array of commit objects that were pushed. | +| **commits.\.message** | string | The full commit message containing the bug report ID. | +| **commits.\.url** | string | The full URL to the commit on Github. | +| **commits.\.author.username** | string | The user name of the commit author. | + +**Response** + +Operation was completed successfully. + +``` js +{ + "bugs": { + 1803939: [ + { + "text": "Authored by https:\/\/github.com\/dklawren\nhttps:\/\/github.com\/mozilla-bteam\/bmo\/commit\/4ef4caed5bc22a734bd9ec15aaac87c19ef6e80e\nBug 1803939 - Webhook URL field is too short" + } + ] + }, + "error": 0 +} +``` + +| name | type | description | +|----|----|----| +| error | boolean | Whether the operation was successful or not. | +| bugs | object | Object containing bug IDs as object keys. | +| bugs.\ | array | List of comment objects that were added to the bug \. | +| bugs.\.\.text | string | The comment text that was added to the bug \. | + +An error condition occurred. + +``` js +{ + "error": 1 + "message": "The push commit message did not contain a valid bug ID." +} +``` + +| name | type | description | +|---------|---------|---------------------------------------------------| +| error | boolean | Whether the operation was successful or not. | +| message | string | A message detailing what the error condition was. | diff --git a/docs/en/md/api/core/v1/group.md b/docs/en/md/api/core/v1/group.md new file mode 100644 index 0000000000..54852fc34f --- /dev/null +++ b/docs/en/md/api/core/v1/group.md @@ -0,0 +1,261 @@ +# Groups + +The API for creating, changing, and getting information about groups. + +## Create Group + +This allows you to create a new group in Bugzilla. You must be authenticated +and be in the *creategroups* group to perform this action. + +**Request** + +``` text +POST /rest/group +``` + +``` js +{ + "name" : "secret-group", + "description" : "Too secret for you!", + "is_active" : true +} +``` + +Some params must be set, or an error will be thrown. The required params are +marked in **bold**. + +| name | type | description | +|----|----|----| +| **name** | string | A short name for this group. Must be unique. This is not usually displayed in the user interface, except in a few places. | +| **description** | string | A human-readable name for this group. Should be relatively short. This is what will normally appear in the UI as the name of the group. | +| user_regexp | string | A regular expression. Any user whose Bugzilla username matches this regular expression will automatically be granted membership in this group. | +| is_active | boolean | `true` if new group can be used for bugs, `false` if this is a group that will only contain users and no bugs will be restricted to it. | +| icon_url | string | A URL pointing to a small icon used to identify the group. This icon will show up next to users' names in various parts of Bugzilla if they are in this group. | + +**Response** + +``` js +{ + "id": 22 +} +``` + +| name | type | description | +|------|------|--------------------------------| +| id | int | ID of the newly-created group. | + +**Errors** + +- 800 (Empty Group Name) You must specify a value for the "name" field. +- 801 (Group Exists) There is already another group with the same "name". +- 802 (Group Missing Description) You must specify a value for the + "description" field. +- 803 (Group Regexp Invalid) You specified an invalid regular expression in the + "user_regexp" field. + +## Update Group + +This allows you to update a group in Bugzilla. You must be authenticated and be +in the *creategroups* group to perform this action. + +**Request** + +To update a group using the group ID or name: + +``` text +PUT /rest/group/(id_or_name) +``` + +``` js +{ + "name" : "secret-group", + "description" : "Too secret for you! (updated description)", + "is_active" : false +} +``` + +You can edit a single group by passing the ID or name of the group in the URL. +To edit more than one group, you can specify addition IDs or group names using +the `ids` or `names` parameters respectively. + +One of the below must be specified. + +| name | type | description | +|----------------|-------|----------------------------| +| **id_or_name** | mixed | Integer group or name. | +| **ids** | array | IDs of groups to update. | +| **names** | array | Names of groups to update. | + +The following parameters specify the new values you want to set for the +group(s) you are updating. + +| name | type | description | +|----|----|----| +| name | string | A new name for the groups. If you try to set this while updating more than one group, an error will occur, as group names must be unique. | +| description | string | A new description for the groups. This is what will appear in the UI as the name of the groups. | +| user_regexp | string | A new regular expression for email. Will automatically grant membership to these groups to anyone with an email address that matches this Perl regular expression. | +| is_active | boolean | Set if groups are active and eligible to be used for bugs. `true` if bugs can be restricted to this group, `false` otherwise. | +| icon_url | string | A URL pointing to an icon that will appear next to the name of users who are in this group. | + +**Response** + +``` js +{ + "groups": [ + { + "changes": { + "description": { + "added": "Too secret for you! (updated description)", + "removed": "Too secret for you!" + }, + "is_active": { + "removed": "1", + "added": "0" + } + }, + "id": "22" + } + ] +} +``` + +`groups` (array) Group change objects, each containing the following items: + + + + + + + + + + + + + + + + + + + + + +
nametypedescription
idintThe ID of the group that was updated.
changesobject

The changes that were actually done on this group. The keys are the +names of the fields that were changed, and the values are an object with two +items:

+
    +
  • added: (string) The values that were added to this field, possibly a +comma-and-space-separated list if multiple values were added.
  • +
  • removed: (string) The values that were removed from this field, possibly a +comma-and-space-separated list if multiple values were removed.
  • +
+ +**Errors** + +The same as [Create Group](#create-group). + +## Get Group + +Returns information about Bugzilla groups. + +**Request** + +To return information about a specific group ID or name: + +``` text +GET /rest/group/(id_or_name) +``` + +You can also return information about more than one specific group by using the +following in your query string: + +``` text +GET /rest/group?ids=1&ids=2&ids=3 +GET /group?names=ProductOne&names=Product2 +``` + +If neither IDs nor names are passed, and you are in the creategroups or +editusers group, then all groups will be retrieved. Otherwise, only groups that +you have bless privileges for will be returned. + +| name | type | description | +|----|----|----| +| id_or_name | mixed | Integer group ID or name. | +| ids | array | Integer IDs of groups. | +| names | array | Names of groups. | +| membership | boolean | Set to 1 then a list of members of the passed groups names and IDs will be returned. | + +**Response** + +``` js +{ + "groups": [ + { + "membership": [ + { + "real_name": "Bugzilla User", + "nick": "user", + "can_login": true, + "name": "user@bugzilla.org", + "login_denied_text": "", + "id": 85, + "email_enabled": false, + "email": "user@bugzilla.org" + }, + ], + "is_active": true, + "description": "Test Group", + "user_regexp": "", + "is_bug_group": true, + "name": "TestGroup", + "id": 9 + } + ] +} +``` + +If the user is a member of the *creategroups* group they will receive +information about all groups or groups matching the criteria that they passed. +You have to be in the creategroups group unless you're requesting membership +information. + +If the user is not a member of the *creategroups* group, but they are in the +"editusers" group or have bless privileges to the groups they require +membership information for, the is_active, is_bug_group and user_regexp values +are not supplied. + +The return value will be an object containing group names as the keys; each +value will be an object that describes the group and has the following items: + +| name | type | description | +|----|----|----| +| id | int | The unique integer ID that Bugzilla uses to identify this group. Even if the name of the group changes, this ID will stay the same. | +| name | string | The name of the group. | +| description | string | The description of the group. | +| is_bug_group | int | Whether this group is to be used for bug reports or is only administrative specific. | +| user_regexp | string | A regular expression that allows users to be added to this group if their login matches. | +| is_active | int | Whether this group is currently active or not. | +| users | array | User objects that are members of this group; only returned if the user sets the `membership` parameter to 1. Each user object has the items describe in the User object below. | + +User object: + +| name | type | description | +|----|----|----| +| id | int | The ID of the user. | +| real_name | string | The actual name of the user. | +| nick | string | The user's nickname. Currently this is extracted from the real_name, name or email field. | +| email | string | The email address of the user. | +| name | string | The login name of the user. Note that in some situations this is different than their email. | +| can_login | boolean | A boolean value to indicate if the user can login into Bugzilla. | +| email_enabled | boolean | A boolean value to indicate if bug-related mail will be sent to the user or not. | +| disabled_text | string | A text field that holds the reason for disabling a user from logging into Bugzilla. If empty, then the user account is enabled; otherwise it is disabled/closed. | + +**Errors** + +- 51 (Invalid Object) A non existing group name was passed to the function, as + a result no group object existed for that invalid name. +- 805 (Cannot view groups) Logged-in users are not authorized to edit Bugzilla + groups as they are not members of the creategroups group in Bugzilla, or they + are not authorized to access group member's information as they are not + members of the "editusers" group or can bless the group. diff --git a/docs/en/md/api/core/v1/index.md b/docs/en/md/api/core/v1/index.md new file mode 100644 index 0000000000..7b753e8328 --- /dev/null +++ b/docs/en/md/api/core/v1/index.md @@ -0,0 +1,17 @@ +# Core API v1 + +- [Attachments](attachment.md) +- [Bugs](bug.md) +- [Bug User Last Visited](bug-user-last-visit.md) +- [Bugzilla Information](bugzilla.md) +- [Classifications](classification.md) +- [Comments](comment.md) +- [Components](component.md) +- [Bug Fields](field.md) +- [Flag Activity](flag-activity.md) +- [General](general.md) +- [Github](github.md) +- [Groups](group.md) +- [Products](product.md) +- [Users](user.md) +- [Reminders](reminders.md) diff --git a/docs/en/md/api/core/v1/product.md b/docs/en/md/api/core/v1/product.md new file mode 100644 index 0000000000..864befce8d --- /dev/null +++ b/docs/en/md/api/core/v1/product.md @@ -0,0 +1,396 @@ +# Products + +This part of the Bugzilla API allows you to list the available products and get +information about them. + +## List Products + +Returns a list of the IDs of the products the user can search on. + +**Request** + +To get a list of product IDs a user can select such as for querying bugs: + +``` text +GET /rest/product_selectable +``` + +To get a list of product IDs a user can enter a bug against: + +``` text +GET /rest/product_enterable +``` + +To get a list of product IDs a user can search or enter bugs against. + +``` text +GET /rest/product_accessible +``` + +**Response** + +``` js +{ + "ids": [ + "2", + "3", + "19", + "1", + "4" + ] +} +``` + +| name | type | description | +|------|-------|------------------------------| +| ids | array | List of integer product IDs. | + +## Get Product + +Returns a list of information about the products passed to it. + +**Request** + +To return information about a specific type of products such as `accessible`, +`selectable`, or `enterable`: + +``` text +GET /rest/product?type=accessible +``` + +To return information about a specific product by `id` or `name`: + +``` text +GET /rest/product/(id_or_name) +``` + +You can also return information about more than one product by using the +following parameters in your query string: + +``` text +GET /rest/product?ids=1&ids=2&ids=3 +GET /rest/product?names=ProductOne&names=Product2 +``` + +| name | type | description | +|----|----|----| +| id_or_name | mixed | Integer product ID or product name. | +| ids | array | Product IDs | +| names | array | Product names | +| type | string | The group of products to return. Valid values are `accessible` (default), `selectable`, and `enterable`. `type` can be a single value or an array of values if more than one group is needed with duplicates removed. | + +**Response** + +``` js +{ + "products": [ + { + "id": 1, + "default_bug_type": "defect", + "default_milestone": "---", + "default_version": "unspecified", + "components": [ + { + "is_active": true, + "default_assigned_to": "admin@bugzilla.org", + "default_bug_type": "defect", + "id": 1, + "sort_key": 0, + "name": "TestComponent", + "flag_types": { + "bug": [ + { + "is_active": true, + "grant_group": null, + "cc_list": "", + "is_requestable": true, + "id": 3, + "is_multiplicable": true, + "name": "needinfo", + "request_group": null, + "is_requesteeble": true, + "sort_key": 0, + "description": "needinfo" + } + ], + "attachment": [ + { + "description": "Review", + "is_multiplicable": true, + "name": "review", + "is_requesteeble": true, + "request_group": null, + "sort_key": 0, + "cc_list": "", + "grant_group": null, + "is_requestable": true, + "id": 2, + "is_active": true + } + ] + }, + "default_qa_contact": "", + "triage_owner": "", + "team_name": "Mozilla", + "description": "This is a test component." + } + ], + "is_active": true, + "classification": "Unclassified", + "versions": [ + { + "id": 1, + "name": "unspecified", + "is_active": true, + "sort_key": 0 + } + ], + "description": "This is a test product.", + "has_unconfirmed": true, + "milestones": [ + { + "name": "---", + "is_active": true, + "sort_key": 0, + "id": 1 + } + ], + "name": "TestProduct" + } + ] +} +``` + +`products` (array) Each product object has the following items: + +| name | type | description | +|----|----|----| +| id | int | An integer ID uniquely identifying the product in this installation only. | +| name | string | The name of the product. This is a unique identifier for the product. | +| description | string | A description of the product, which may contain HTML. | +| is_active | boolean | A boolean indicating if the product is active. | +| default_bug_type | string | The default type for bugs filed under this product. | +| default_milestone | string | The name of the default milestone for the product. | +| default_version | string | The name of the default version for the product. | +| has_unconfirmed | boolean | Indicates whether the UNCONFIRMED bug status is available for this product. | +| classification | string | The classification name for the product. | +| components | array | Each component object has the items described in the Component object below. | +| versions | array | Each object describes a version, and has the following items: `name`, `sort_key` and `is_active`. | +| milestones | array | Each object describes a milestone, and has the following items: `name`, `sort_key` and `is_active`. | + +If the user tries to access a product that is not in the list of accessible +products for the user, or a product that does not exist, that is silently +ignored, and no information about that product is returned. + +Component object: + +| name | type | description | +|----|----|----| +| id | int | An integer ID uniquely identifying the component in this installation only. | +| name | string | The name of the component. This is a unique identifier for this component. | +| description | string | A description of the component, which may contain HTML. | +| default_assigned_to | string | The login name of the user to whom new bugs will be assigned by default. | +| default_bug_type | string | The default type for bugs filed under this component. | +| default_qa_contact | string | The login name of the user who will be set as the QA Contact for new bugs by default. Empty string if the QA contact is not defined. | +| triage_owner | string | The login name of the user who is named as the Triage Owner of the component. Empty string if the Triage Owner is not defined. | +| team_name | string | The team name that is the owner of the component. | +| sort_key | int | Components, when displayed in a list, are sorted first by this integer and then secondly by their name. | +| is_active | boolean | A boolean indicating if the component is active. Inactive components are not enabled for new bugs. | +| flag_types | object | An object containing two items `bug` and `attachment` that each contains an array of objects, where each describes a flagtype. The flagtype items are described in the Flagtype object below. | + +Flagtype object: + +| name | type | description | +|----|----|----| +| id | int | Returns the ID of the flagtype. | +| name | string | Returns the name of the flagtype. | +| description | string | Returns the description of the flagtype. | +| cc_list | string | Returns the concatenated CC list for the flagtype, as a single string. | +| sort_key | int | Returns the sortkey of the flagtype. | +| is_active | boolean | Returns whether the flagtype is active or disabled. Flags being in a disabled flagtype are not deleted. It only prevents you from adding new flags to it. | +| is_requestable | boolean | Returns whether you can request for the given flagtype (i.e. whether the '?' flag is available or not). | +| is_requesteeble | boolean | Returns whether you can ask someone specifically or not. | +| is_multiplicable | boolean | Returns whether you can have more than one flag for the given flagtype in a given bug/attachment. | +| grant_group | int | the group ID that is allowed to grant/deny flags of this type. If the item is not included all users are allowed to grant/deny this flagtype. | +| request_group | int | The group ID that is allowed to request the flag if the flag is of the type requestable. If the item is not included all users are allowed request this flagtype. | + +To return information about components in products, you can use the `.` +property accesssor in your request: + +``` text +/rest/product?type=enterable&include_fields=id,name,components.name,components.id,components.is_active,components.description +``` + +## Create Product + +This allows you to create a new product in Bugzilla. + +**Request** + +``` text +POST /rest/product +``` + +``` js +{ + "name" : "AnotherProduct", + "description" : "Another Product", + "classification" : "Unclassified", + "is_open" : false, + "has_unconfirmed" : false, + "default_version" : "unspecified" +} +``` + +Some params must be set, or an error will be thrown. The required params are +marked in bold. + +| name | type | description | +|----|----|----| +| **name** | string | The name of this product. Must be globally unique within Bugzilla. | +| **description** | string | A description for this product. Allows some simple HTML. | +| has_unconfirmed | boolean | Allow the UNCONFIRMED status to be set on bugs in this product. Default: true. | +| classification | string | The name of the Classification which contains this product. | +| default_bug_type | string | The default type for bugs filed under this product. Each component can override this value. | +| default_milestone | string | The default milestone for this product. Default '---'. | +| default_version | string | The default version for this product. Default 'unspecified'. The old name `version` is still accepted for backward compatibility. | +| is_open | boolean | `true` if the product is currently allowing bugs to be entered into it. Default: `true`. | +| create_series | boolean | `true` if you want series for New Charts to be created for this new product. Default: `true`. | + +**Response** + +``` js +{ + "id": 20 +} +``` + +Returns an object with the following items: + +| name | type | description | +|------|------|--------------------------------| +| id | int | ID of the newly-filed product. | + +**Errors** + +- 51 (Classification does not exist) You must specify an existing + classification name. +- 700 (Product blank name) You must specify a non-blank name for this product. +- 701 (Product name too long) The name specified for this product was longer + than the maximum allowed length. +- 702 (Product name already exists) You specified the name of a product that + already exists. (Product names must be globally unique in Bugzilla.) +- 703 (Product must have description) You must specify a description for this + product. + +## Update Product + +This allows you to update a product in Bugzilla. + +**Request** + +``` text +PUT /rest/product/(id_or_name) +``` + +You can edit a single product by passing the ID or name of the product in the +URL. To edit more than one product, you can specify addition IDs or product +names using the `ids` or `names` parameters respectively. + +``` js +{ + "ids" : [123], + "name" : "BarName", + "has_unconfirmed" : false +} +``` + +One of the below must be specified. + +| name | type | description | +|----------------|-------|------------------------------------------------------| +| **id_or_name** | mixed | Integer product ID or name. | +| **ids** | array | Numeric IDs of the products that you wish to update. | +| **names** | array | Names of the products that you wish to update. | + +The following parameters specify the new values you want to set for the +product(s) you are updating. + +| name | type | description | +|----|----|----| +| name | string | A new name for this product. If you try to set this while updating more than one product, an error will occur, as product names must be unique. | +| default_bug_type | string | The default type for bugs filed under this product. Each component can override this value. | +| default_milestone | string | When a new bug is filed, what milestone does it get by default if the user does not choose one? Must represent a milestone that is valid for this product. | +| default_version | string | When a new bug is filed, what version does it get by default if the user does not choose one? Must represent a version that is valid for this product. | +| description | string | Update the long description for these products to this value. | +| has_unconfirmed | boolean | Allow the UNCONFIRMED status to be set on bugs in products. | +| is_open | boolean | `true` if the product is currently allowing bugs to be entered into it, `false` otherwise. | + +**Response** + +``` js +{ + "products" : [ + { + "id" : 123, + "changes" : { + "name" : { + "removed" : "FooName", + "added" : "BarName" + }, + "has_unconfirmed" : { + "removed" : "1", + "added" : "0" + } + } + } + ] +} +``` + +`products` (array) Product change objects containing the following items: + + + + + + + + + + + + + + + + + + + + + +
nametypedescription
idintThe ID of the product that was updated.
changesobject

The changes that were actually done on this product. The keys are the +names of the fields that were changed, and the values are an object with two +items:

+
    +
  • added: (string) The value that this field was changed to.
  • +
  • removed: (string) The value that was previously set in this field.
  • +
+ +Booleans will be represented with the strings '1' and '0' for changed values as +they are stored as strings in the database currently. + +**Errors** + +- 700 (Product blank name) You must specify a non-blank name for this product. +- 701 (Product name too long) The name specified for this product was longer + than the maximum allowed length. +- 702 (Product name already exists) You specified the name of a product that + already exists. (Product names must be globally unique in Bugzilla.) +- 703 (Product must have description) You must specify a description for this + product. +- 705 (Product must define a default milestone) You must define a default + milestone. +- 706 (Product must define a default version) You must define a default + version. diff --git a/docs/en/md/api/core/v1/reminders.md b/docs/en/md/api/core/v1/reminders.md new file mode 100644 index 0000000000..d1bec9a8a4 --- /dev/null +++ b/docs/en/md/api/core/v1/reminders.md @@ -0,0 +1,149 @@ +# Reminders + +This part of the Bugzilla API allows creating, listing, and removing of +Bugzilla reminders. + +## Get Reminder + +This allows you to retrieve information about a specific reminder. + +**Request** + +``` text +GET /rest/reminder/123 +``` + +**Response** + +``` js +{ + "id": 123, + "bug_id": 456, + "note": "This is a reminder note", + "reminder_ts": "2024-06-08", + "creation_ts": "2024-06-07", + "sent": false +} +``` + +To get all reminders for your account: + +``` text +GET /rest/reminder +``` + +**Response** + +``` js +{ + "reminders": [ + { + "id": 123, + "bug_id": 456, + "note": "This is a reminder note", + "reminder_ts": "2024-06-08", + "creation_ts": "2024-06-07", + "sent": false + } + ] +} +``` + + + +Reminder Object + +| name | type | description | +|----|----|----| +| id | int | An integer ID uniquely identifying the reminder in this installation only. | +| bug_id | int | Bug ID associated with the reminder. | +| note | string | A descriptive note associated with the reminder. | +| reminder_ts | date | The date when the reminder will be sent out. | +| creation_ts | date | The date when the reminder was originally created. | +| sent | boolean | A boolean value that is set to true when delivered. | + +## Create Reminder + +This allows you to create a new reminder associated with a specific bug in +Bugzilla. + +**Request** + +To create a new reminder: + +``` text +{ + "bug_id": 456, + "note" : "This is a reminder note", + "reminder_ts" : "2024-06-08" +} +``` + + + + + + + + + + + + + + + + + + + + + + + + + + +
nametypedescription
bug_idint
+

Bug ID associated with the reminder.

+
notestring
+

A descriptive note associated with the reminder.

+
reminder_tsdate
+

The date when the reminder will be sent out.

+
+ +**Response** + +``` js +{ + "id": 123, + "bug_id": 456, + "note": "This is a reminder note", + "reminder_ts": "2024-06-08", + "creation_ts": "2024-06-07", + "sent": false +} +``` + +A reminder object [rest_reminder_object](#rest_reminder_object) is +returned. + +## Remove Reminder + +This allows you to remove an existing reminder in Bugzilla. + +**Request** + +``` text +DELETE /rest/reminder/123 +``` + +**Response** + +If the removal of the reminder was successful, it should look like: + +``` js +{ + "success": 1 +} +``` diff --git a/docs/en/md/api/core/v1/user.md b/docs/en/md/api/core/v1/user.md new file mode 100644 index 0000000000..f7309605de --- /dev/null +++ b/docs/en/md/api/core/v1/user.md @@ -0,0 +1,420 @@ +# Users + +This part of the Bugzilla API allows you to create user accounts, get +information about user accounts and to log in or out using an existing account. + +## Login + +Logging in with a username and password is required for many Bugzilla +installations, in order to search for private bugs, post new bugs, etc. This +method allows you to retrieve a token that can be used as authentication for +subsequent API calls. Otherwise you will need to pass your `login` and +`password` with each call. + +This method will be going away in the future in favor of using *API keys*. + +**Request** + +``` text +GET /rest/login?login=foo@example.com&password=toosecrettoshow +``` + +| name | type | description | +|--------------|--------|------------------------| +| **login** | string | The user's login name. | +| **password** | string | The user's password. | + +**Response** + +``` js +{ + "token": "786-OLaWfBisMY", + "id": 786 +} +``` + +| name | type | description | +|----|----|----| +| id | int | Numeric ID of the user that was logged in. | +| token | string | Token which can be passed in the parameters as authentication in other calls. The token can be sent along with any future requests to the webservice, for the duration of the session, i.e. til [Logout](#logout) is called. | + +**Errors** + +- 300 (Invalid Username or Password) The username does not exist, or the + password is wrong. +- 301 (Login Disabled) The ability to login with this account has been + disabled. A reason may be specified with the error. +- 305 (New Password Required) The current password is correct, but the user is + asked to change their password. +- 50 (Param Required) A login or password parameter was not provided. + +## Logout + +Log out the user. Basically it invalidates the token provided so it cannot be +re-used. Does nothing if the token is not in use. + +**Request** + +``` text +GET /rest/logout?token=1234-VWvO51X69r +``` + + + + + + + + + + + + + + + + +
nametypedescription
tokenstring
+

The user's token used for authentication.

+
+ +## Valid Login + +This method will verify whether a client's current login token is still valid +or have expired. A valid username that matches must be provided as well. + +**Request** + +``` text +GET /rest/valid_login?login=foo@example.com&token=1234-VWvO51X69r +``` + +| name | type | description | +|-----------|--------|-----------------------------------------------------------------| +| **login** | string | The login name that matches the provided token. | +| token | string | Persistent login token currently being used for authentication. | + +**Response** + +Returns true/false depending on if the current token is valid for the provided +username. + +## Create User + +Creates a user account directly in Bugzilla, password and all. Instead of this, +you should use **Offer Account by Email** when possible because that makes sure +that the email address specified can actually receive an email. This function +does not check that. You must be authenticated and be in the *editusers* group +to perform this action. + +**Request** + +``` text +POST /rest/user +``` + +``` js +{ + "email" : "user@bugzilla.org", + "full_name" : "Test User", + "password" : "K16ldRr922I1" +} +``` + +| name | type | description | +|----|----|----| +| **email** | string | The email address for the new user. | +| full_name | string | The user's full name. Will be set to empty if not specified. | +| password | string | The password for the new user account, in plain text. It will be stripped of leading and trailing whitespace. If blank or not specified, the new created account will exist in Bugzilla but will not be allowed to log in using DB authentication until a password is set either by the user (through resetting their password) or by the administrator. | + +**Response** + +``` js +{ + "id": 58707 +} +``` + +| name | type | description | +|------|------|----------------------------------------------| +| id | int | The numeric ID of the user that was created. | + +**Errors** + +- 502 (Password Too Short) The password specified is too short. (Usually, this + means the password is under three characters.) + +## Update User + +Updates an existing user account in Bugzilla. You must be authenticated and be +in the *editusers* group to perform this action. + +**Request** + +``` text +PUT /rest/user/(id_or_name) +``` + +You can edit a single user by passing the ID or login name of the user in the +URL. To edit more than one user, you can specify addition IDs or login names +using the `ids` or `names` parameters respectively. + +| name | type | description | +|----|----|----| +| **id_or_name** | mixed | Either the ID or the login name of the user to update. | +| **ids** | array | Additional IDs of users to update. | +| **names** | array | Additional login names of users to update. | +| full_name | string | The new name of the user. | +| email | string | The email of the user. Note that email used to login to Bugzilla. Also note that you can only update one user at a time when changing the login name / email. (An error will be thrown if you try to update this field for multiple users at once.) | +| password | string | The password of the user. | +| email_enabled | boolean | A boolean value to enable/disable sending bug-related mail to the user. | +| login_denied_text | string | A text field that holds the reason for disabling a user from logging into Bugzilla. If empty, then the user account is enabled; otherwise it is disabled/closed. | +| groups | object | These specify the groups that this user is directly a member of. To set these, you should pass an object as the value. The object's items are described in the Groups update objects below. | +| bless_groups | object | This is the same as groups but affects what groups a user has direct membership to bless that group. It takes the same inputs as groups. | + +Groups and bless groups update object: + +| name | type | description | +|----|----|----| +| add | array | The group IDs or group names that the user should be added to. | +| remove | array | The group IDs or group names that the user should be removed from. | +| set | array | Integers or strings which are an exact set of group IDs and group names that the user should be a member of. This does not remove groups from the user when the person making the change does not have the bless privilege for the group. | + +If you specify `set`, then `add` and `remove` will be ignored. A group in both +the `add` and `remove` list will be added. Specifying a group that the user +making the change does not have bless rights will generate an error. + +**Response** + +- users: (array) List of user change objects with the following items: + + + + + + + + + + + + + + + + + + + + + +
nametypedescription
idintThe ID of the user that was updated.
changesobject

The changes that were actually done on this user. The keys are the names +of the fields that were changed, and the values are an object with two +items:

+
    +
  • added: (string) The values that were added to this field, possibly a +comma-and-space-separated list if multiple values were added.
  • +
  • removed: (string) The values that were removed from this field, possibly a +comma-and-space-separated list if multiple values were removed.
  • +
+ +**Errors** + +- 51 (Bad Login Name) You passed an invalid login name in the "names" array. +- 304 (Authorization Required) Logged-in users are not authorized to edit other + users. + +## Get User + +Gets information about user accounts in Bugzilla. + +**Request** + +To get information about a single user in Bugzilla: + +``` text +GET /rest/user/(id_or_name) +``` + +To get multiple users by name or ID: + +``` text +GET /rest/user?names=foo@bar.com&names=test@bugzilla.org +GET /rest/user?ids=123&ids=321 +``` + +To get user matching a search string: + +``` text +GET /rest/user?match=foo +``` + +To get user by using an integer ID value or by using `match`, you must be +authenticated. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
nametypedescription
id_or_namemixedAn integer user ID or login name of the user.
idsarrayInteger user IDs. Logged=out users cannot pass this parameter to this +function. If they try, they will get an error. Logged=in users will get an +error if they specify the ID of a user they cannot see.
namesarrayLogin names.
matcharray

This works just like "user matching" in Bugzilla itself. Users will be +returned whose real name or login name contains any one of the specified +strings. Users that you cannot see will not be included in the returned +list.

+

Most installations have a limit on how many matches are returned for each +string; the default is 1000 but can be changed by the Bugzilla +administrator.

+

Logged-out users cannot use this argument, and an error will be thrown if +they try. (This is to make it harder for spammers to harvest email addresses +from Bugzilla, and also to enforce the user visibility restrictions that are +implemented on some Bugzillas.)

limitintLimit the number of users matched by the match parameter. If +the value is greater than the system limit, the system limit will be used. This +parameter is only valid when using the match parameter.
group_idsarrayNumeric IDs for groups that a user can be in.
groupsarrayNames of groups that a user can be in. If group_ids or +groups are specified, they limit the return value to users who are +in any of the groups specified.
include_disabledbooleanBy default, when using the match parameter, disabled users are +excluded from the returned results unless their full username is identical to +the match string. Setting include_disabled to true +will include disabled users in the returned results even if their username +doesn't fully match the input string.
permissivebooleanWhen querying for users using names, do not fail the entire request if one +or more errors occur. A `faults` list is included +that contains the individual errors.
+ +**Response** + +- users: (array) Each object describes a user and has the following items: + +| name | type | description | +|----|----|----| +| id | int | The unique integer ID that Bugzilla uses to represent this user. Even if the user's login name changes, this will not change. | +| real_name | string | The actual name of the user. May be blank. | +| nick | string | The user's nickname. Currently this is extracted from the real_name, name or email field. | +| email | string | The email address of the user. | +| name | string | The login name of the user. Note that in some situations this is different than their email. | +| can_login | boolean | A boolean value to indicate if the user can login into Bugzilla. | +| email_enabled | boolean | A boolean value to indicate if bug-related mail will be sent to the user or not. Only users in the *disableusers* group can see this field. | +| login_denied_text | string | A text field that holds the reason for disabling a user from logging into Bugzilla. If empty then the user account is enabled; otherwise it is disabled/closed. Only users in the *disableusers* group can see this field. | +| groups | array | Groups the user is a member of. If the currently logged in user is querying their own account or is a member of a privileged permission group, the array will contain all the groups that the user is a member of. Otherwise, the array will only contain groups that the logged in user can bless. Each object describes the group and contains the items described in the Group object below. | +| saved_searches | array | User's saved searches, each having the following Search object items described below. | +| saved_reports | array | User's saved reports, each having the following Search object items described below. | +| last_seen_date | datetime | The time when the user last loaded any page. | +| last_activity_time | datetime | The time when the user last made a change to a bug. | +| creation_time | datetime | The time when the user's account was created. | +| ldap_email | string | The LDAP email address attached to the account based on Duo Security (special permissions needed). | + +Group object: + +| name | type | description | +|-------------|--------|-------------------------------| +| id | int | The group ID | +| name | string | The name of the group | +| description | string | The description for the group | + +Search object: + +| name | type | description | +|-------|--------|------------------------------------------------------| +| id | int | An integer ID uniquely identifying the saved report. | +| name | string | The name of the saved report. | +| query | string | The CGI parameters for the saved report. | + +If you are not authenticated when you call this function, you will only be +returned the `id`, `name`, `real_name` and `nick` items. If you are +authenticated and not in 'editusers' group, you will only be returned the `id`, +`name`, `real_name`, `nick`, `email`, `can_login` and `groups` items. The +groups returned are filtered based on your permission to bless each group. The +`saved_searches` and `saved_reports` items are only returned if you are +querying your own account, even if you are in the editusers group. + +**Errors** + +- 51 (Bad Login Name or Group ID) You passed an invalid login name in the + "names" array or a bad group ID in the "group_ids" argument. +- 52 (Invalid Parameter) The value used must be an integer greater than zero. +- 304 (Authorization Required) You are logged in, but you are not authorized to + see one of the users you wanted to get information about by user id. +- 505 (User Access By Id or User-Matching Denied) Logged-out users cannot use + the "ids" or "match" arguments to this function. +- 804 (Invalid Group Name) You passed a group name in the "groups" argument + which either does not exist or you do not belong to it. + +## Who Am I + +Allows for validating a user's API key, token, or username and password. If +successfully authenticated, it returns simple information about the logged in +user. + +**Request** + +``` text +GET /rest/whoami +``` + +**Response** + +``` js +{ + "id" : "1234", + "name" : "user@bugzilla.org", + "real_name" : "Test User", + "nick" : "user" +} +``` + +| name | type | description | +|----|----|----| +| id | int | The unique integer ID that Bugzilla uses to represent this user. Even if the user's login name changes, this will not change. | +| real_name | string | The actual name of the user. May be blank. | +| nick | string | The user's nickname. Currently this is extracted from the real_name, name or email field. | +| name | string | string The login name of the user. | diff --git a/docs/en/md/api/index.md b/docs/en/md/api/index.md new file mode 100644 index 0000000000..172ddbdea1 --- /dev/null +++ b/docs/en/md/api/index.md @@ -0,0 +1,8 @@ +# WebService API Reference + +This Bugzilla installation has the following WebService APIs available (as of +the last time you compiled the documentation): + +- [Integration Best Practices](integration.md) +- [Core API v1](core/v1/index.md) +- [Webhooks API v1](../extensions/Webhooks/api/v1/index.md) diff --git a/docs/en/md/api/integration.md b/docs/en/md/api/integration.md new file mode 100644 index 0000000000..b99327af19 --- /dev/null +++ b/docs/en/md/api/integration.md @@ -0,0 +1,107 @@ +# Integration Best Practices + +## Use supported interfaces + +Use the [documented native REST API](core/v1/index.md) for new +integrations. BzAPI remains available as a compatibility layer, but it is +deprecated. Existing BzAPI integrations should migrate to the native REST API. +If immediate migration is not possible, use BMO's built-in `/bzapi/` +compatibility endpoint prefix instead of the retired standalone BzAPI service. +The compatibility layer performs additional request and response translation. + +Do not rely on scraped HTML, bug lists exported as CSV or XML, or undocumented +endpoints when your integration requires a stable interface. Use documented +REST API methods that are not marked experimental. See the [API +overview](../integrating/apis.md) for the other interfaces that Bugzilla provides. + +## Use a dedicated bot account + +Do not reuse a person's account for automation. Human accounts may acquire +privileges that the integration does not need. Request a dedicated bot account +by [filing an Administration +bug](https://bugzilla.mozilla.org/enter_bug.cgi?product=bugzilla.mozilla.org&component=Administration). +Grant the account only the privileges required by the integration. + +Authenticate with an API key in the `X-BUGZILLA-API-KEY` request header. Do not +put API keys in URLs, where they can be captured in logs and browser history. +See [REST API authentication](core/v1/general.md#authentication) for details. + +## Poll responsibly + +Following the [original BMO integration +policy](https://wiki.mozilla.org/index.php?title=BMO/Integration_Best_Practice&oldid=1148498), +do not poll BMO more frequently than once every five minutes. If an integration +needs lower-latency updates, use the [Webhooks +API](../extensions/Webhooks/api/v1/index.md). Contact the BMO team in the +[BMO Matrix channel](https://chat.mozilla.org/#/room/#bmo:mozilla.org) to +discuss requirements that the documented webhooks do not meet. + +Authenticate polling and batch-read requests. BMO applies per-IP rate limits to +anonymous reads. The request that reaches a limit can return a JSON HTTP 400 +rate-limit error, while subsequent requests from the blocked IP can return an +HTML HTTP 429 response. When either response occurs, retry with exponential +backoff and jitter. BMO does not currently send a `Retry-After` header. Apply +the same backoff to transient 5xx responses. + +Poll incrementally instead of repeating a full search. The `last_change_time` +parameter to [Search Bugs](core/v1/bug.md#search-bugs) returns bugs modified at +or after the supplied timestamp. Bug searches may use a read replica, while +`GET /rest/time` reads the primary database. Because BMO does not guarantee a +maximum replication lag, an integration that requires a guaranteed polling +window should confirm the current operational guidance with the BMO team. A +polling cycle should: + +- obtain BMO's current `db_time` from [GET /rest/time](core/v1/bugzilla.md#time) + before searching; +- search from at least five minutes before the previous successful cycle's + recorded time to provide headroom for replica lag and one-second timestamp + precision; +- pass `order=bug_id` and choose an explicit page size below BMO's current + 10,000-result search cap, such as `limit=1000`. BMO silently lowers limits + above the cap, so never use a larger requested value as the termination + threshold. Page with `limit` and `offset` until a page contains fewer bugs + than the chosen page size. The response does not indicate when more results + are available. Do not use `limit=0` for paging; it discards the supplied + `offset` and the search remains capped; +- collect the bug IDs from every page, then fetch and process every unique bug + before saving the new `db_time`; and +- discard the de-duplication set after each cycle. If a bug appears in a later + cycle, fetch it again even when its `last_change_time` matches the value + previously processed, because multiple changes can occur within the API's + one-second timestamp precision. + +## Minimize requests and responses + +Request only the fields the integration uses by setting +[include_fields](core/v1/general.md#rest-include-fields). This reduces response size and +server work. For polling searches, use `include_fields=id,last_change_time` and +fetch the full bugs after all pages have been collected. + +Combine requests when possible. For example, request multiple bug IDs in one +call with `GET /rest/bug?id=123,456` instead of issuing one request per bug. +Keep each batch below both [BMO's request-target size +limit](core/v1/general.md#rest-query-string-limit) and the search result cap. This search +silently omits bugs that do not exist or that the caller cannot see, and +requests above the result cap may also omit IDs because the results were +truncated. For batches within these limits, compare the returned IDs with the +requested set and treat missing IDs as not visible, not as deleted. In +contrast, `GET /rest/bug/` returns an explicit error for a missing or +invisible bug. + +Whenever a search is paged with `limit` and `offset`, pass a stable `order` +such as `order=bug_id`. + +## Write searches that survive configuration changes + +Do not hard-code every open or closed status. Use `status=__open__` to search +all open bugs and `status=__closed__` to search all closed bugs. New workflow +statuses can then be added without breaking the integration. + +Similarly, do not enumerate every resolution when searching for bugs that were +closed without being fixed. Use the custom-search parameters +`status=__closed__&f1=resolution&o1=notequals&v1=FIXED`. This allows new +non-fixed resolutions to be introduced without changing the integration. + +When combining `last_change_time` with custom-search parameters, number the +`f` charts contiguously starting with `f1`. Gaps in the numbering can cause +the generated change-time chart to replace an existing chart. diff --git a/docs/en/md/extensions/Webhooks/api/v1/index.md b/docs/en/md/extensions/Webhooks/api/v1/index.md new file mode 100644 index 0000000000..37d3c70846 --- /dev/null +++ b/docs/en/md/extensions/Webhooks/api/v1/index.md @@ -0,0 +1,3 @@ +# Webhooks API v1 + +- [Webhooks](webhooks.md) diff --git a/docs/en/md/extensions/Webhooks/api/v1/webhooks.md b/docs/en/md/extensions/Webhooks/api/v1/webhooks.md new file mode 100644 index 0000000000..72387c3f0c --- /dev/null +++ b/docs/en/md/extensions/Webhooks/api/v1/webhooks.md @@ -0,0 +1,50 @@ +# Webhooks + +These methods are used to access information about and update your configured +webhooks. + +NOTE: You will need to pass in a valid API key with the +`X-Bugzilla-API-Key` header to perform an +operations. + +## List + +Returns a list of your currently configured webhooks. + +**Request** + +``` text +GET /rest/webhooks/list +``` + +**Response** + +``` js +{ + "webhooks": [ + { + "component": "General", + "creator": "admin@mozilla.bugs", + "enabled": true, + "errors": 0, + "event": "create,change,attachment,comment", + "id": 1, + "name": "Test Webhooks", + "product": "Firefox", + "url": "http://server.example.com" + } + ] +} +``` + +| name | type | description | +|----|----|----| +| id | integer | The integer ID of the webhook. | +| creator | string | The account which created the webhook. | +| name | string | The name of the webhook. | +| url | string | The URL that is called when the webhook executes. | +| event | string | Comma delimited list of bug events that the webhook will execute. | +| product | string | The product for which the webhook will execute. | +| component | string | The component for which the webhook will execute. | +| enabled | boolean | Whether the webhook is current enabled or not. | +| errors | integer | Current count of any errors encounted when executing the webhook. | diff --git a/docs/en/md/extensions/Webhooks/index-user.md b/docs/en/md/extensions/Webhooks/index-user.md new file mode 100644 index 0000000000..06cf7f446a --- /dev/null +++ b/docs/en/md/extensions/Webhooks/index-user.md @@ -0,0 +1,352 @@ +# Webhooks + +A webhook is a callback triggered by one or more events. When an event occurs, +Bugzilla sends an HTTP POST request to a configured URL. + +Bugzilla webhooks can be triggered when a bug is created or changed. The +webhook payload contains information about the bug and the event so another web +application can respond to it. + +For example, a webhook could: + +- Update a copy of a Bugzilla bug in another system, such as Jira. +- Send a message to a chat service, such as Matrix or Slack. + +## Creating a webhook + +The **Webhooks** preferences tab is available only when webhooks are enabled +and your account belongs to the group configured by the Bugzilla administrator. + +1. Log in to your Bugzilla account. +2. Go to **Preferences**, then select the **Webhooks** tab. +3. Fill in the webhook parameters: + Name + A descriptive name for the webhook, such as "Jira webhook for new and + updated bugs in Core::Graphics". + + URL + The URL that will receive and process the webhook. + + Events + The bug events that will trigger the webhook: + + - When a new bug is created. + - When an existing bug is modified. + - When a new attachment is created. + - When an existing attachment is modified. + - When a new comment is created. + + Filters + Bug properties that determine which bugs the webhook receives: + + Product + The product containing the bugs you want to receive. The **Any** option is + available only to members of a group configured by the Bugzilla + administrator. + + Component + The component containing the bugs you want to receive. Select **Any** to + receive bugs from every component in the product. + + API keys + If the endpoint requires authentication, you can provide a header and API + key for the endpoint. For example, for the following header: + + Authorization: Token zQ5TSBzq7tTZMtKYq9K1ZqJMjifKx3cPL7pIGk9Q + + enter `Authorization` as the API Key Header and + `Token zQ5TSBzq7tTZMtKYq9K1ZqJMjifKx3cPL7pIGk9Q` as the API Key Value. + + Bugzilla adds the header only when both values are set. If either value is + empty, Bugzilla sends the webhook without the authentication header. +4. Click **Add**. + +Registered webhooks appear on the same preferences tab. To delete one or more +webhooks, select them in the **Your webhooks** table and click **Remove +selected**. + +You can also enable or disable each webhook from this table. If a webhook has +queued messages, the error count links to a page where you can inspect the +queue and delete individual messages. + +## Delivered webhooks + +When a webhook is triggered, Bugzilla sends an HTTP POST request containing a +JSON payload. The payload includes the webhook ID, webhook name, event +information, and information about the bug that matched the event and filters. + +Bugzilla ordinarily sends a webhook only if its owner can see the affected bug +and its product. A public-to-private transition can also be sent using the +bug's previous public state so the receiving system can remove information that +is no longer public. When a bug becomes public again, Bugzilla sends an +`is_private` modification event containing its current public data. When a +payload's bug is private, its details are reduced to the bug ID and privacy +status. Private comments and attachments are sent only when the webhook owner +is authorized to see them; their payloads are also reduced to IDs and privacy +status. The receiving system must use the REST API with suitable credentials to +retrieve additional details. + +Webhooks are generally delivered in event timestamp order, but the relative +order of events with the same timestamp is not guaranteed. Bug creation and +modification events each produce a separate request. The `changes` field is +sent for ordinary public modification events and describes changes made to the +event target, such as the bug or attachment. Private modification payloads omit +this field. A public-to-private transition reports only the synthetic +`is_private` change. + +The payloads below are representative. Bug objects can also contain custom +fields configured for their product and component. + +### Public bug request + +``` json +{ + "bug": { + "alias": "", + "assigned_to": "nobody@mozilla.org", + "assigned_to_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "classification": "Client Software", + "component": "Sync", + "creation_time": "2020-10-16T06:24:06", + "creator": "nobody@mozilla.org", + "creator_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "flags": [], + "id": 1629704, + "is_private": false, + "keywords": [], + "last_change_time": "2020-10-16T06:26:21", + "operating_system": "Unspecified", + "platform": "Unspecified", + "priority": "P1", + "product": "Firefox", + "qa_contact": "nobody@mozilla.org", + "qa_contact_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "resolution": "", + "see_also": [], + "severity": "--", + "status": "NEW", + "summary": "Webhook Test - Disregard", + "target_milestone": "---", + "type": "defect", + "url": "", + "version": "unspecified", + "whiteboard": "" + }, + "event": { + "action": "modify", + "routing_key": "bug.modify:priority", + "target": "bug", + "time": "2020-07-24T20:11:22", + "user": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "changes": [ + { + "field": "priority", + "removed": "P3", + "added": "P1" + } + ] + }, + "webhook_id": 23, + "webhook_name": "test-bug" +} +``` + +### Private bug request + +``` json +{ + "bug": { + "id": 2, + "is_private": true + }, + "event": { + "action": "modify", + "routing_key": "bug.modify:priority", + "target": "bug", + "time": "2020-07-24T20:11:22", + "user": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + } + }, + "webhook_id": 23, + "webhook_name": "test-bug" +} +``` + +### Response + +Bugzilla treats any HTTP 2xx response as successful. + +### New comment + +``` json +{ + "bug": { + "alias": "", + "assigned_to": "nobody@mozilla.org", + "assigned_to_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "classification": "Client Software", + "comment": { + "body": "another test comment", + "creation_time": "2020-10-16T06:28:41", + "id": 14748073, + "is_private": false, + "number": 2 + }, + "component": "Sync", + "creation_time": "2020-10-16T06:24:06", + "creator": "nobody@mozilla.org", + "creator_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "flags": [], + "id": 1629704, + "is_private": false, + "keywords": [], + "last_change_time": "2020-10-16T06:26:21", + "operating_system": "Unspecified", + "platform": "Unspecified", + "priority": "", + "product": "Firefox", + "qa_contact": "", + "resolution": "", + "see_also": [], + "severity": "--", + "status": "NEW", + "summary": "Webhook Test - Disregard", + "target_milestone": "---", + "type": "defect", + "url": "", + "version": "unspecified", + "whiteboard": "" + }, + "event": { + "action": "create", + "routing_key": "comment.create", + "target": "comment", + "time": "2020-10-16T06:28:41", + "user": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + } + }, + "webhook_id": 23, + "webhook_name": "test-comment" +} +``` + +### New attachment + +``` json +{ + "bug": { + "alias": "", + "assigned_to": "nobody@mozilla.org", + "assigned_to_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "attachment": { + "content_type": "text/plain", + "creation_time": "2020-10-16T07:08:12", + "description": "test attachment", + "file_name": "file_1629704.txt", + "flags": [], + "id": 9180115, + "is_obsolete": false, + "is_patch": false, + "is_private": false, + "last_change_time": "2020-10-16T07:08:12" + }, + "classification": "Client Software", + "component": "Sync", + "creation_time": "2020-10-16T06:24:06", + "creator": "nobody@mozilla.org", + "creator_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "flags": [], + "id": 1629704, + "is_private": false, + "keywords": [], + "last_change_time": "2020-10-16T06:26:21", + "operating_system": "Unspecified", + "platform": "Unspecified", + "priority": "", + "product": "Firefox", + "qa_contact": "", + "resolution": "", + "see_also": [], + "severity": "--", + "status": "NEW", + "summary": "Webhook Test - Disregard", + "target_milestone": "---", + "type": "defect", + "url": "", + "version": "unspecified", + "whiteboard": "" + }, + "event": { + "action": "create", + "routing_key": "attachment.create", + "target": "attachment", + "time": "2020-10-16T07:08:12", + "user": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + } + }, + "webhook_id": 23, + "webhook_name": "test-attachment" +} +``` + +## Errors and retries + +If an endpoint does not return an HTTP 2xx response, or if delivery fails for +another reason, Bugzilla puts the message in the webhook's queue. After each +failed queued attempt, it schedules the next attempt using a backoff counter +shared by the webhook's queued messages. Starting the delivery daemon or +re-enabling the webhook resets this counter. From a reset state, delays are 5 +seconds after the first failure, then 25, 125, and 625 seconds. After later +failures, the delay is 15 minutes. A successful delivery does not reset the +counter, so a later failure can start with a longer delay. The delivery daemon +polls every 30 seconds, so an attempt can occur later than its scheduled time. + +If a message remains stuck, later messages for that webhook remain queued until +the blocking message succeeds, is manually deleted, or is discarded because the +webhook owner is no longer authorized to receive it. + +Administrators can configure a per-message attempt limit and an exempt group. +Unless the exemption applies, Bugzilla disables the webhook and emails its +owner when a queued message reaches the limit. The owner can re-enable it from +the **Webhooks** preferences tab after fixing the problem. diff --git a/docs/en/md/index.md b/docs/en/md/index.md new file mode 100644 index 0000000000..55d4dad294 --- /dev/null +++ b/docs/en/md/index.md @@ -0,0 +1,68 @@ +# BMO Documentation (bugzilla.mozilla.org) + +## [About This Documentation](about/index.md) + +Evaluating Bugzilla, getting more help, and how this documentation is +maintained. + +## [User Guide](using/index.md) + +- [Creating an Account](using/creating-an-account.md) +- [Filing a Bug](using/filing.md) +- [Understanding a Bug](using/understanding.md) +- [Editing a Bug](using/editing.md) +- [Finding Bugs](using/finding.md) +- [Reports and Charts](using/reports-and-charts.md) +- [Pro Tips](using/tips.md) +- [User Preferences](using/preferences.md) +- [Two-Factor Authentication](using/two-factor-authentication.md) +- [Installed Extensions](using/extensions.md) + +## [Administration Guide](administering/index.md) + +- [Parameters](administering/parameters.md) +- [Default Preferences](administering/preferences.md) +- [Users](administering/users.md) +- [Classifications, Products, Components, Versions, and + Milestones](administering/categorization.md) +- [Flags](administering/flags.md) +- [Custom Fields](administering/custom-fields.md) +- [Field Values](administering/field-values.md) +- [Workflow](administering/workflow.md) +- [Groups and Security](administering/groups.md) +- [Keywords](administering/keywords.md) +- [Whining](administering/whining.md) +- [Quips](administering/quips.md) +- [Installed Extensions](administering/extensions.md) + +## [Integration and Customization Guide](integrating/index.md) + +- [Customization FAQ](integrating/faq.md) +- [Languages](integrating/languages.md) +- [Skins](integrating/skins.md) +- [Templates](integrating/templates.md) +- [Extensions](integrating/extensions.md) +- [APIs](integrating/apis.md) +- [Adding an Auth0 Custom Social Integration](integrating/auth0.md) + +## [WebService API Reference](api/index.md) + +- [Integration Best Practices](api/integration.md) +- [Core API v1](api/core/v1/index.md) + - [Attachments](api/core/v1/attachment.md) + - [Bugs](api/core/v1/bug.md) + - [Bug User Last Visited](api/core/v1/bug-user-last-visit.md) + - [Bugzilla Information](api/core/v1/bugzilla.md) + - [Classifications](api/core/v1/classification.md) + - [Comments](api/core/v1/comment.md) + - [Components](api/core/v1/component.md) + - [Bug Fields](api/core/v1/field.md) + - [Flag Activity](api/core/v1/flag-activity.md) + - [General](api/core/v1/general.md) + - [Github](api/core/v1/github.md) + - [Groups](api/core/v1/group.md) + - [Products](api/core/v1/product.md) + - [Users](api/core/v1/user.md) + - [Reminders](api/core/v1/reminders.md) +- [Webhooks API v1](extensions/Webhooks/api/v1/index.md) + - [Webhooks](extensions/Webhooks/api/v1/webhooks.md) diff --git a/docs/en/md/integrating/apis.md b/docs/en/md/integrating/apis.md new file mode 100644 index 0000000000..4b2995c63a --- /dev/null +++ b/docs/en/md/integrating/apis.md @@ -0,0 +1,29 @@ +# APIs + +Bugzilla has a number of APIs that you can call in your code to extract +information from and put information into Bugzilla. Some are deprecated and +will soon be removed. Which one to use? Short answer: the [REST WebService API +v1](../api/index.md) should be used for all new integrations, but keep an eye out +for version 2, coming soon. + +For BMO-specific operational guidance, see [Integration Best +Practices](../api/integration.md). + +The APIs currently available are as follows: + +## Ad-Hoc APIs + +Various pages on Bugzilla are available in machine-parsable formats as well as +HTML. For example, bugs can be downloaded as XML, and buglists as CSV. CSV is +useful for spreadsheet import. There should be links on the HTML page to +alternate data formats where they are available. + +## REST + +Bugzilla has a [REST API](../api/index.md) which is the currently-recommended API +for integrating with Bugzilla. The current REST API is version 1. It is stable, +and so will not be changed in a backwardly-incompatible way. + +**This is the currently-recommended API for new development.** + +Endpoint: `/rest` diff --git a/docs/en/md/integrating/auth0.md b/docs/en/md/integrating/auth0.md new file mode 100644 index 0000000000..23c8d80076 --- /dev/null +++ b/docs/en/md/integrating/auth0.md @@ -0,0 +1,39 @@ +# Adding an Auth0 Custom Social Integration + +Bugzilla can be added as a 'Custom Social Connection'. + +| Parameter | Example(s) | Notes | +|----|----|----| +| Name | BMO-Stage | Whatever makes you happy | +| Client ID | aaaaaaaaaaaaaaaaaaaa | Ask your Bugzilla admin to create one for you. | +| Client Secret | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | Same as above. | +| Authorization URL | | Note the HTTP client must use the correct HOST header. | +| Token URL | | (none) | +| Scope | user:read | As of this writing, this is the only scope available. | +| Fetch User Profile | (see below) | (none) | + +``` javascript +function (access_token, ctx, callback) { + request.get('https://bugzilla.allizom.org/api/user/profile', { + 'headers': { + 'Authorization': 'Bearer ' + access_token, + 'User-Agent': 'Auth0' + } + }, function (e, r, b) { + if (e) { + return callback(e); + } + if (r.statusCode !== 200) { + return callback(new Error(`StatusCode: ${r.statusCode}`)); + } + var profile = JSON.parse(b); + callback(null, { + user_id: profile.id, + nickname: profile.nick, + name: profile.name, + email: profile.login, + email_verified: true + }); + }); +} +``` diff --git a/docs/en/md/integrating/extensions.md b/docs/en/md/integrating/extensions.md new file mode 100644 index 0000000000..03afda0039 --- /dev/null +++ b/docs/en/md/integrating/extensions.md @@ -0,0 +1,179 @@ +# Extensions + +One of the best ways to customize Bugzilla is by using a Bugzilla Extension. +Extensions can modify both the code and UI of Bugzilla in a way that can be +distributed to other Bugzilla users and ported forward to future versions of +Bugzilla with minimal effort. We maintain a [list of available +extensions](https://wiki.mozilla.org/Bugzilla:Addons) written by other people +on our wiki. You would need to make sure that the extension in question works +with your version of Bugzilla. + +Or, you can write your own extension. See the [Bugzilla Extension +documentation](https://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/Extension.html) +for the core documentation on how to do that. It would make sense to read the +section on [Templates](templates.md). There is also a sample extension in +`$BUGZILLA_HOME/extensions/Example/` which gives examples of how to use all the +code hooks. + +This section explains how to achieve some common tasks using the Extension +APIs. + +## Adding A New Page to Bugzilla + +There are occasions where it's useful to add a new page to Bugzilla which has +little or no relation to other pages, and perhaps doesn't use very much +Bugzilla data. A help page, or a custom report for example. The best mechanism +for this is to use `page.cgi` and the `page_before_template` hook. + +## Altering Data On An Existing Page + +The `template_before_process` hook can be used to tweak the data displayed on a +particular existing page, if you know what template is used. It has access to +all the template variables before they are passed to the templating engine. + +## Adding New Fields To Bugs + +To add new fields to a bug, you need to do the following: + +- Add an `install_update_db` hook to add the fields by calling + `Bugzilla::Field->create` (only if the field doesn't already exist). Here's + what it might look like for a single field: + + ``` perl + my $field = new Bugzilla::Field({ name => $name }); + return if $field; + + $field = Bugzilla::Field->create({ + name => $name, + description => $description, + type => $type, # From list in Constants.pm + enter_bug => 0, + buglist => 0, + custom => 1, + }); + ``` + +- Push the name of the field onto the relevant arrays in the `bug_columns` and + `bug_fields` hooks. + +- If you want direct accessors, or other functions on the object, you need to + add a BEGIN block to your Extension.pm: + + ``` perl + BEGIN { + *Bugzilla::Bug::is_foopy = \&_bug_is_foopy; + } + + ... + + sub _bug_is_foopy { + return $_[0]->{'is_foopy'}; + } + ``` + +- You don't have to change `Bugzilla/DB/Schema.pm`. + +- You can use `bug_end_of_create`, `bug_end_of_create_validators`, and + `bug_end_of_update` to create or update the values for your new field. + +## Adding New Fields To Other Things + +If you are adding the new fields to an object other than a bug, you need to go +a bit lower-level. With reference to the instructions above: + +- In `install_update_db`, use `bz_add_column` instead +- Push on the columns in `object_columns` and `object_update_columns` instead + of `bug_columns`. +- Add validators for the values in `object_validators` + +The process for adding accessor functions is the same. + +You can use the hooks `object_end_of_create`, +`object_end_of_create_validators`, `object_end_of_set_all`, and +`object_end_of_update` to create or update the values for the new object fields +you have added. In the hooks you can check the object type being operated on +and skip any objects you don't care about. For example, if you added a new +field to the `products` table: + +``` perl +sub object_end_of_create { + my ($self, $args) = @_; + my $class = $args->{'class'}; + my $object = $args->{'object'}; + if ($class->isa('Bugzilla::Product') { + [...] + } +} +``` + +You will need to do this filtering for most of the hooks whose names begin with +`object_`. + +## Adding Admin Configuration Panels + +If you add new functionality to Bugzilla, it may well have configurable options +or parameters. The way to allow an administrator to set those is to add a new +configuration panel. + +As well as using the `config_add_panels` hook, you will need a template to +define the UI strings for the panel. See the templates in +`template/en/default/admin/params` for examples, and put your own template in +`template/en/default/admin/params` in your extension's directory. + +You can access param values from Templates using: + + [% Param('param_name') %] + +and from code using: + +``` perl +Bugzilla->params->{'param_name'} +``` + +## Adding User Preferences + +To add a new user preference: + +- Call + `add_setting('setting_name', ['some_option', 'another_option'], 'some_option')` + in the `install_before_final_checks` hook. (The last parameter is the name of + the option which should be the default.) +- Add descriptions for the identifiers for your setting and choices + (setting_name, some_option etc.) to the hash defined in + `global/setting-descs.none.tmpl`. Do this in a template hook: + `hook/global/setting-descs-settings.none.tmpl`. Your code can see the hash + variable; just set more members in it. +- To change behavior based on the setting, reference it in templates using + `[% user.settings.setting_name.value %]`. Reference it in code using + `$user->settings->{'setting_name'}->{'value'}`. The value will be one of the + option tag names (e.g. some_option). + +## Altering Who Can Change What + +Companies often have rules about which employees, or classes of employees, are +allowed to change certain things in the bug system. For example, only the bug's +designated QA Contact may be allowed to VERIFY the bug. Bugzilla has been +designed to make it easy for you to write your own custom rules to define who +is allowed to make what sorts of value transition. + +By default, assignees, QA owners and users with *editbugs* privileges can edit +all fields of bugs, except group restrictions (unless they are members of the +groups they are trying to change). Bug reporters also have the ability to edit +some fields, but in a more restrictive manner. Other users, without *editbugs* +privileges, cannot edit bugs, except to comment and add themselves to the CC +list. + +Because this kind of change is such a common request, we have added a specific +hook for it that [Extensions](extensions.md) can call. It's called +`bug_check_can_change_field`, and it's documented [in the Hooks +documentation](https://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/Hook.html#bug_check_can_change_field). + +## Checking Syntax + +It's not immediately obvious how to check the syntax of your extension's Perl +modules, if it contains any. Running `checksetup.pl` might do some of it, but +the errors aren't necessarily massively informative. + +`perl -Mlib=lib -MBugzilla -e 'BEGIN { Bugzilla->extensions; } use Bugzilla::Extension::ExtensionName::Class;'` + +(run from `$BUGZILLA_HOME`) is what you need. diff --git a/docs/en/md/integrating/faq.md b/docs/en/md/integrating/faq.md new file mode 100644 index 0000000000..1d9c409dca --- /dev/null +++ b/docs/en/md/integrating/faq.md @@ -0,0 +1,23 @@ +# Customization FAQ + +How do I... + +...add a new field on a bug? Use [Custom Fields](../administering/custom-fields.md) or, if +you just want new form fields on bug entry but don't need Bugzilla to track the +field separately thereafter, you can use a [custom bug entry +form](templates.md#custom-bug-entry). + +...change the name of a built-in bug field? [Edit](templates.md) the +relevant value in the template +`template/en/default/global/field-descs.none.tmpl`. + +...use a word other than 'bug' to describe bugs? [Edit or +override](templates.md) the appropriate values in the template +`template/en/default/global/variables.none.tmpl`. + +...call the system something other than 'Bugzilla'? [Edit or +override](templates.md) the appropriate value in the template +`template/en/default/global/variables.none.tmpl`. + +...alter who can change what field when? See [Altering Who Can Change +What](extensions.md#altering-who-can-change-what). diff --git a/docs/en/md/integrating/index.md b/docs/en/md/integrating/index.md new file mode 100644 index 0000000000..fadb89b044 --- /dev/null +++ b/docs/en/md/integrating/index.md @@ -0,0 +1,15 @@ +# Integration and Customization Guide + +You may find that Bugzilla already does what you want it to do, you just need +to configure it correctly. Read the [Administration +Guide](../administering/index.md) sections carefully to see if that's the case for +you. If not, then this chapter explains how to use the available mechanisms for +integration and customization. + +- [Customization FAQ](faq.md) +- [Languages](languages.md) +- [Skins](skins.md) +- [Templates](templates.md) +- [Extensions](extensions.md) +- [APIs](apis.md) +- [Adding an Auth0 Custom Social Integration](auth0.md) diff --git a/docs/en/md/integrating/languages.md b/docs/en/md/integrating/languages.md new file mode 100644 index 0000000000..ba23fdf15b --- /dev/null +++ b/docs/en/md/integrating/languages.md @@ -0,0 +1,17 @@ +# Languages + +Bugzilla's templates can be localized, although it's a [big +job](https://wiki.mozilla.org/Bugzilla:L10n:Guide). If you have a localized set +of templates for your version of Bugzilla, Bugzilla can support multiple +languages at once. In that case, Bugzilla honours the user's `Accept-Language` +HTTP header when deciding which language to serve. If multiple languages are +installed, a menu will display in the header allowing the user to manually +select a different language. If they do this, their choice will override the +`Accept-Language` header. + +Many language templates can be obtained from [the localization section of the +Bugzilla website](https://www.bugzilla.org/download.html#localizations). +Instructions for submitting new languages are also available from that +location. There's also a [list of localization +teams](https://wiki.mozilla.org/Bugzilla:L10n:Localization_Teams); you might +want to contact someone to ask about the status of their localization. diff --git a/docs/en/md/integrating/skins.md b/docs/en/md/integrating/skins.md new file mode 100644 index 0000000000..9dcbfbbb2f --- /dev/null +++ b/docs/en/md/integrating/skins.md @@ -0,0 +1,23 @@ +# Skins + +Bugzilla supports skins - ways of changing the look of the UI without altering +its underlying structure. It ships with two - "Classic" and "Dusk". You can +find some more listed [on the +wiki](https://wiki.mozilla.org/Bugzilla:Addons#Skins), and there are a couple +more which are part of +[bugzilla.mozilla.org](http://git.mozilla.org/?p=webtools/bmo/bugzilla.git). +However, in each case you may need to check that the skin supports the version +of Bugzilla you have. + +To create a new custom skin, make a directory that contains all the same CSS +file names as `skins/standard/`, and put your directory in `skins/contrib/`. +Then, add your CSS to the appropriate files. + +After you put the directory there, make sure to run `checksetup.pl` so that it +can set the file permissions correctly. + +After you have installed the new skin, it will show up as an option in the +user's **Preferences**, on the **General** tab. If you would like to force a +particular skin on all users, just select that skin in the **Default +Preferences** in the **Administration** UI, and then uncheck "Enabled" on the +preference, so users cannot change it. diff --git a/docs/en/md/integrating/templates.md b/docs/en/md/integrating/templates.md new file mode 100644 index 0000000000..e2fd55c9a3 --- /dev/null +++ b/docs/en/md/integrating/templates.md @@ -0,0 +1,246 @@ +# Templates + +Bugzilla uses a system of templates to define its user interface. The standard +templates can be modified, replaced or overridden. You can also use template +hooks in an [extension](extensions.md) to add or modify the behavior of +templates using a stable interface. + +## Template Directory Structure + +The template directory structure starts with top level directory named +`template`, which contains a directory for each installed localization. +Bugzilla comes with English templates, so the directory name is `en`, and we +will discuss `template/en` throughout the documentation. Below `template/en` is +the `default` directory, which contains all the standard templates shipped with +Bugzilla. + +> [!WARNING] +> A directory `data/template` also exists; this is where Template Toolkit puts +> the compiled versions (i.e. Perl code) of the templates. *Do not* directly +> edit the files in this directory, or all your changes will be lost the next +> time Template Toolkit recompiles the templates. + +## Choosing a Customization Method + +If you want to edit Bugzilla's templates, the first decision you must make is +how you want to go about doing so. There are three choices, and which you use +depends mainly on the scope of your modifications, and the method you plan to +use to upgrade Bugzilla. + +1. You can directly edit the templates found in `template/en/default`. +2. You can copy the templates to be modified into a mirrored directory + structure under `template/en/custom`. Templates in this directory structure + automatically override any identically-named and identically-located + templates in the `template/en/default` directory. (The `custom` directory + does not exist by default and must be created if you want to use it.) +3. You can use the hooks built into many of the templates to add or modify the + UI from an [extension](extensions.md). Hooks generally don't go away + and have a stable interface. + +The third method is the best if there are hooks in the appropriate places and +the change you want to do is possible using hooks. It's not very easy to modify +existing UI using hooks; they are most commonly used for additions. You can +make modifications if you add JS code which then makes the modifications when +the page is loaded. You can remove UI by adding CSS to hide it. + +Unlike code hooks, there is no requirement to document template hooks, so you +just have to open up the template and see (search for `Hook.process`). + +If there are no hooks available, then the second method of customization should +be used if you are going to make major changes, because it is guaranteed that +the contents of the `custom` directory will not be touched during an upgrade, +and you can then decide whether to revert to the standard templates, continue +using yours, or make the effort to merge your changes into the new versions by +hand. It's also good for entirely new files, and for a few files like +`bug/create/user-message.html.tmpl` which are designed to be entirely replaced. + +Using the second method, your user interface may break if incompatible changes +are made to the template interface. Templates do change regularly and so +interface changes are not individually documented, and you would need to work +out what had changed and adapt your template accordingly. + +For minor changes, the convenience of the first method is hard to beat. When +you upgrade Bugzilla, `git` will merge your changes into the new version for +you. On the downside, if the merge fails then Bugzilla will not work properly +until you have fixed the problem and re-integrated your code. + +Also, you can see what you've changed using `git diff`, which you can't if you +fork the file into the `custom` directory. + +## How To Edit Templates + +> [!NOTE] +> If you are making template changes that you intend on submitting back for +> inclusion in standard Bugzilla, you should read the relevant sections of the +> [Developers' Guide](https://www.bugzilla.org/docs/developer.html). + +Bugzilla uses a templating system called Template Toolkit. The syntax of the +language is beyond the scope of this guide. It's reasonably easy to pick up by +looking at the current templates; or, you can read the manual, available on the +[Template Toolkit home page](http://www.template-toolkit.org). + +One thing you should take particular care about is the need to properly HTML +filter data that has been passed into the template. This means that if the data +can possibly contain special HTML characters such as `<`, and the data was not +intended to be HTML, they need to be converted to entity form, i.e. `<`. You +use the `html` filter in the Template Toolkit to do this (or the `uri` filter +to encode special characters in URLs). If you forget, you may open up your +installation to cross-site scripting attacks. + +You should run `./checksetup.pl` after editing any templates. Failure to do so +may mean either that your changes are not picked up, or that the permissions on +the edited files are wrong so the webserver can't read them. + +## Template Formats and Types + +Some CGI's have the ability to use more than one template. For example, +`buglist.cgi` can output itself as two formats of HTML (complex and simple). +Each of these is a separate template. The mechanism that provides this feature +is extensible - you can create new templates to add new formats. + +You might use this feature to e.g. add a custom bug entry form for a particular +subset of users or a particular type of bug. + +Bugzilla can also support different types of output - e.g. bugs are available +as HTML and as XML, and this mechanism is extensible also to add new content +types. However, instead of using such interfaces or enhancing Bugzilla to add +more, you would be better off using the [WebService API +Reference](../api/index.md) to integrate with Bugzilla. + +To see if a CGI supports multiple output formats and types, grep the CGI for +`get_format`. If it's not present, adding multiple format/type support isn't +too hard - see how it's done in other CGIs, e.g. `config.cgi`. + +To make a new format template for a CGI which supports this, open a current +template for that CGI and take note of the INTERFACE comment (if present.) This +comment defines what variables are passed into this template. If there isn't +one, I'm afraid you'll have to read the template and the code to find out what +information you get. + +Write your template in whatever markup or text style is appropriate. + +You now need to decide what content type you want your template served as. The +content types are defined in the `Bugzilla/Constants.pm` file in the +`contenttypes` constant. If your content type is not there, add it. Remember +the three- or four-letter tag assigned to your content type. This tag will be +part of the template filename. + +Save your new template as `-..tmpl`. Try +out the template by calling the CGI as `.cgi?format=`. Add +`&ctype=` if the type is not HTML. + +## Particular Templates + +There are a few templates you may be particularly interested in customizing for +your installation. + +`index.html.tmpl`: +This is the Bugzilla front page. + +`global/header.html.tmpl`: +This defines the header that goes on all Bugzilla pages. The header includes +the banner, which is what appears to users and is probably what you want to +edit instead. However the header also includes the HTML HEAD section, so you +could for example add a stylesheet or META tag by editing the header. + +`global/banner.html.tmpl`: +This contains the `banner`, the part of the header that appears at the top of +all Bugzilla pages. The default banner is reasonably barren, so you'll probably +want to customize this to give your installation a distinctive look and feel. +It is recommended you preserve the Bugzilla version number in some form so the +version you are running can be determined, and users know what docs to read. + +`global/footer.html.tmpl`: +This defines the footer that goes on all Bugzilla pages. Editing this is +another way to quickly get a distinctive look and feel for your Bugzilla +installation. + +`global/variables.none.tmpl`: +This allows you to change the word 'bug' to something else (e.g. "issue") +throughout the interface, and also to change the name Bugzilla to something +else (e.g. "FooCorp Bug Tracker"). + +`list/table.html.tmpl`: +This template controls the appearance of the bug lists created by Bugzilla. +Editing this template allows per-column control of the width and title of a +column, the maximum display length of each entry, and the wrap behavior of long +entries. For long bug lists, Bugzilla inserts a 'break' every 100 bugs by +default; this behavior is also controlled by this template, and that value can +be modified here. + +`bug/create/user-message.html.tmpl`: +This is a message that appears near the top of the bug reporting page. By +modifying this, you can tell your users how they should report bugs. + +`bug/process/midair.html.tmpl`: +This is the page used if two people submit simultaneous changes to the same +bug. The second person to submit their changes will get this page to tell them +what the first person did, and ask if they wish to overwrite those changes or +go back and revisit the bug. The default title and header on this page read +"Mid-air collision detected!" If you work in the aviation industry, or other +environment where this might be found offensive (yes, we have true stories of +this happening) you'll want to change this to something more appropriate for +your environment. + + + +`bug/create/create.html.tmpl` and `bug/create/comment.txt.tmpl`: +You may not wish to go to the effort of creating custom fields in Bugzilla, yet +you want to make sure that each bug report contains a number of pieces of +important information for which there is not a special field. The bug entry +system has been designed in an extensible fashion to enable you to add +arbitrary HTML widgets, such as drop-down lists or textboxes, to the bug entry +page and have their values appear formatted in the initial comment. + +An example of this is the [guided bug submission +form](https://bugzilla-dev.allizom.org/enter_bug.cgi?product=Firefox&format=guided). +The code for this comes with the Bugzilla distribution as an example for you to +copy. It can be found in the files `create-guided.html.tmpl` and +`comment-guided.html.tmpl`. + +A hidden field that indicates the format should be added inside the form in +order to make the template functional. Its value should be the suffix of the +template filename. For example, if the file is called +`create-guided.html.tmpl`, then + + + +is used inside the form. + +So to use this feature, create a custom template for `enter_bug.cgi`. The +default template, on which you could base it, is +`default/bug/create/create.html.tmpl`. Call it +`custom/bug/create/create-.html.tmpl`, and in it, add form inputs +for each piece of information you'd like collected - such as a build number, or +set of steps to reproduce. + +Then, create a template based on `default/bug/create/comment.txt.tmpl`, and +call it `custom/bug/create/comment-.txt.tmpl`. It needs a couple of +lines of boilerplate at the top like this: + + [% USE Bugzilla %] + [% cgi = Bugzilla.cgi % + +Then, this template can reference the form fields you have created using the +syntax `[% cgi.param("field_name") %]`. When a bug report is submitted, the +initial comment attached to the bug report will be formatted according to the +layout of this template. + +For example, if your custom enter_bug template had a field: + + + +and then your comment.txt.tmpl had: + + [% USE Bugzilla %] + [% cgi = Bugzilla.cgi %] + Build Identifier: [%+ cgi.param("buildid") %] + +then something like: + + Build Identifier: 20140303 + +would appear in the initial comment. + +This system allows you to gather structured data in bug reports without the +overhead and UI complexity of a large number of custom fields. diff --git a/docs/en/md/style.md b/docs/en/md/style.md new file mode 100644 index 0000000000..342e007eec --- /dev/null +++ b/docs/en/md/style.md @@ -0,0 +1,73 @@ +# Writing Bugzilla Documentation + +The Bugzilla documentation is written in [GitHub-flavored +Markdown](https://github.github.com/gfm/) and lives in the `docs/en/md` +directory of the BMO source tree. Bugzilla renders it directly at +`/docs/en/md/`, so a page is published simply by landing it in the +repository — there is no separate build step. + +Bugzilla's particular documentation conventions are as follows: + +## Headings and Anchors + +Every page starts with a single `#` heading, which is also used as the +page title in the viewer. Use `##` for sections within a page, and deeper +levels (`###`, `####`) for subsections; try not to go deeper than the +fourth level. + +Headings automatically get GitHub-style anchors: the heading text is +lowercased, spaces become hyphens, and punctuation is dropped. So link to +sections like this: `[Third Level Heading](#third-level-heading)`, or from +another page: `[Searching](using/finding.md#searching-on-relative-dates)`. +If you need an anchor that must survive a heading being reworded, place an +explicit `` element before the heading and +link to that instead. + +## Links Between Pages + +Always link to other documentation pages with relative paths that include +the `.md` extension, e.g. `[User Guide](../using/index.md)`. These links +work both in the in-app viewer and when reading the files on GitHub. +Images live in `docs/en/images/` and are referenced relatively as well, +e.g. `![description](../../images/example.png)`. Give every image a +meaningful description for screen readers. + +## Block Types + +Notes and warnings use GFM alert blockquotes: + +> [!NOTE] +> This is just a note, for your information. + +> [!WARNING] +> This is a warning of a potential serious problem you should be aware of. + +Use both of the above block types sparingly. Consider putting the +information in the main text, omitting it, or (if long) placing it in a +subsidiary file. + +Code blocks are fenced with triple backticks, with the language named so +it can be highlighted: + +``` perl +# This is some Perl code +print "Hello"; +``` + +We currently use `console`, `perl`, and `sql`. Leave the language off for +plain text. + +Use two-space indentation for continuation lines in bulleted lists, and +indent nested lists by two spaces. + +## Inline Conventions + +- A filename or a path to a filename: + `/path/to/{variable-bit-of-path}/filename.ext` +- A command to type in the shell: `command --arguments` +- A parameter value: `DB` +- A group name: `editbugs` +- A bug field name: `Summary` +- Any string from the UI: **Administration** +- A specific BMO bug: [bug + 201069](https://bugzilla.mozilla.org/show_bug.cgi?id=201069) diff --git a/docs/en/md/using/creating-an-account.md b/docs/en/md/using/creating-an-account.md new file mode 100644 index 0000000000..03d0b0aa1f --- /dev/null +++ b/docs/en/md/using/creating-an-account.md @@ -0,0 +1,34 @@ +# Creating an Account + +If you want to use a particular installation of Bugzilla, first you need to +create an account. Ask the administrator responsible for your installation for +the URL you should use to access it. If you're test-driving Bugzilla, you can +use one of the installations on [Mozilla’s Bugzilla (BMO) test +server](https://bugzilla-dev.allizom.org/). + +The process of creating an account is similar to many other websites. + +1. On the home page, click the **New Account** link in the header. Enter your + email address, then click the `Send` button. + + > [!NOTE] + > If the **New Account** link is not available, this means that the + > administrator of the installation has disabled self-registration. Speak + > to the administrator to find out how to get an account. + +2. Within moments, you should receive an email to the address you provided, + which contains your login name (generally the same as the email address), + and a URL to click to confirm your registration. + +3. Once you confirm your registration, Bugzilla will ask you your real name + (optional, but recommended) and ask you to choose a password. Depending on + how your Bugzilla is configured, there may be minimum complexity + requirements for the password. + +4. Now all you need to do is to click the **Log In** link in the header or + footer, enter your email address and the password you just chose into the + login form, and click the **Log in** button. + +You are now logged in. Bugzilla uses cookies to remember you are logged in, so, +unless you have cookies disabled or your IP address changes, you should not +have to log in again during your session. diff --git a/docs/en/md/using/editing.md b/docs/en/md/using/editing.md new file mode 100644 index 0000000000..5009db1385 --- /dev/null +++ b/docs/en/md/using/editing.md @@ -0,0 +1,76 @@ +# Editing a Bug + +## Attachments + +Attachments are used to attach relevant files to bugs - patches, screenshots, +test cases, debugging aids or logs, or anything else binary or too large to fit +into a comment. + +You should use attachments, rather than comments, for large chunks of plain +text data, such as trace, debugging output files, or log files. That way, it +doesn't bloat the bug for everyone who wants to read it, and cause people to +receive large, useless mails. + +You should make sure to trim screenshots. There's no need to show the whole +screen if you are pointing out a single-pixel problem. + +Bugzilla stores and uses a Content-Type for each attachment (e.g. text/html). +To download an attachment as a different Content-Type (e.g. +application/xhtml+xml), you can override this using a 'content_type' parameter +on the URL, e.g. `&content_type=text/plain`. + +Also, you can enter the URL pointing to the attachment instead of uploading the +attachment itself. For example, this is useful if you want to point to an +external application, a website or a very large file. + +It's also possible to create an attachment by pasting text directly in a text +field; Bugzilla will convert it into an attachment. This is pretty useful when +you are copying and pasting, to avoid the extra step of saving the text in a +temporary file. + +## Flags + +To set a flag, select either **+** or **-** from the drop-down menu next to the +name of the flag in the **Flags** list. The meaning of these values are +flag-specific and thus cannot be described in this documentation, but by way of +example, setting a flag named **review** **+** may indicate that the +bug/attachment has passed review, while setting it to **-** may indicate that +the bug/attachment has failed review. + +To unset a flag, click its drop-down menu and select the blank value. Note that +marking an attachment as obsolete automatically cancels all pending requests +for the attachment. + +If your administrator has enabled requests for a flag, request a flag by +selecting **?** from the drop-down menu and then entering the username of the +user you want to set the flag in the text field next to the menu. + +## Time Tracking + +Users who belong to the group specified by the `timetrackinggroup` parameter +have access to time-related fields. Developers can see deadlines and estimated +times to fix bugs, and can provide time spent on these bugs. Users who do not +belong to this group can only see the deadline but not edit it. Other +time-related fields remain invisible to them. + +At any time, a summary of the time spent by developers on bugs is accessible +either from bug lists when clicking the `Time Summary` button or from +individual bugs when clicking the `Summarize time` link in the time tracking +table. The `summarize_time.cgi` page lets you view this information either per +developer or per bug and can be split on a month basis to have greater details +on how time is spent by developers. + +As soon as a bug is marked as RESOLVED, the remaining time expected to fix the +bug is set to zero. This lets QA people set it again for their own usage, and +it will be set to zero again when the bug is marked as VERIFIED. + +## Life Cycle of a Bug + +The life cycle of a bug, also known as workflow, is customizable to match the +needs of your organization (see [Workflow](../administering/workflow.md)). The image below +contains a graphical representation of the default workflow using the default +bug statuses. If you wish to customize this image for your site, the [diagram +file](../../images/bzLifecycle.xml) is available in +[Dia's](http://www.gnome.org/projects/dia) native XML format. + +![image](../../images/bzLifecycle.png) diff --git a/docs/en/md/using/extensions.md b/docs/en/md/using/extensions.md new file mode 100644 index 0000000000..416ebd8f78 --- /dev/null +++ b/docs/en/md/using/extensions.md @@ -0,0 +1,10 @@ +# Installed Extensions + +Bugzilla can be enhanced using extensions (see +[Extensions](../integrating/extensions.md)). If an extension comes with user +documentation in Markdown format under `docs/en/md/extensions/`, it is +listed here. + +Your Bugzilla installation has documentation for the following extensions: + +- [Webhooks](../extensions/Webhooks/index-user.md) diff --git a/docs/en/md/using/filing.md b/docs/en/md/using/filing.md new file mode 100644 index 0000000000..7df36f6bba --- /dev/null +++ b/docs/en/md/using/filing.md @@ -0,0 +1,75 @@ +# Filing a Bug + +## Reporting a New Bug + +Years of bug writing experience has been distilled for your reading pleasure +into the [Bug report writing +guidelines](https://bugzilla.mozilla.org/page.cgi?id=bug-writing.html). While +some of the advice is Mozilla-specific, the basic principles of reporting +Reproducible, Specific bugs and isolating the Product you are using, the +Version of the Product, the Component which failed, the Hardware Platform, and +Operating System you were using at the time of the failure go a long way toward +ensuring accurate, responsible fixes for the bug that bit you. + +> [!NOTE] +> If you want to file a test bug to see how Bugzilla works, you can do so on +> [Mozilla’s Bugzilla (BMO) test server](https://bugzilla-dev.allizom.org/). +> Please don’t do it on any production Bugzilla installation. + +The procedure for filing a bug is as follows: + +1. Click the **New** link available in the header or footer of pages, or the + **File a Bug** link on the home page. + +2. First, you have to select the product in which you found a bug. + +3. You now see a form where you can specify the component (part of the product + which is affected by the bug you discovered; if you have no idea, just + select **General** if such a component exists), the version of the program + you were using, the operating system and platform your program is running + on and the severity of the bug (if the bug you found crashes the program, + it's probably a major or a critical bug; if it's a typo somewhere, that's + something pretty minor; if it's something you would like to see + implemented, then that's an enhancement). + +4. You also need to provide a short but descriptive summary of the bug you + found. "My program is crashing all the time" is a very poor summary and + doesn't help developers at all. Try something more meaningful or your bug + will probably be ignored due to a lack of precision. In the Description, + give a detailed list of steps to reproduce the problem you encountered. Try + to limit these steps to a minimum set required to reproduce the problem. + This will make the life of developers easier, and the probability that they + consider your bug in a reasonable timeframe will be much higher. + + > [!NOTE] + > Try to make sure that everything in the Summary is also in the + > Description. Summaries are often updated and this will ensure your + > original information is easily accessible. + +5. As you file the bug, you can also attach a document (testcase, patch, or + screenshot of the problem). + +6. Depending on the Bugzilla installation you are using and the product in + which you are filing the bug, you can also request developers to consider + your bug in different ways (such as requesting review for the patch you + just attached, requesting your bug to block the next release of the + product, and many other product-specific requests). + +7. Now is a good time to read your bug report again. Remove all misspellings; + otherwise, your bug may not be found by developers running queries for some + specific words, and so your bug would not get any attention. Also make sure + you didn't forget any important information developers should know in order + to reproduce the problem, and make sure your description of the problem is + explicit and clear enough. When you think your bug report is ready to go, + the last step is to click the **Submit Bug** button to add your report into + the database. + +## Clone an Existing Bug + +Bugzilla allows you to "clone" an existing bug. The newly created bug will +inherit most settings from the old bug. This allows you to track similar +concerns that require different handling in a new bug. To use this, go to the +bug that you want to clone, then click the **Clone This Bug** link on the bug +page. This will take you to the **Enter Bug** page that is filled with the +values that the old bug has. You can then change the values and/or text if +needed. diff --git a/docs/en/md/using/finding.md b/docs/en/md/using/finding.md new file mode 100644 index 0000000000..1ac696dfe8 --- /dev/null +++ b/docs/en/md/using/finding.md @@ -0,0 +1,296 @@ +# Finding Bugs + +Bugzilla has a number of different search options. + +> [!NOTE] +> Bugzilla queries are case-insensitive and accent-insensitive when used with +> either MySQL or Oracle databases. When using Bugzilla with PostgreSQL, +> however, some queries are case sensitive. This is due to the way PostgreSQL +> handles case and accent sensitivity. + +## Quicksearch + +Quicksearch is a single-text-box query tool. You'll find it in Bugzilla's +header or footer. + +Quicksearch uses metacharacters to indicate what is to be searched. For +example, typing + +> `foo|bar` + +into Quicksearch would search for "foo" or "bar" in the summary and status +whiteboard of a bug; adding + +> `:BazProduct` + +would search only in that product. + +You can also use it to go directly to a bug by entering its number or its +alias. + +## Simple Search + +Simple Search is good for finding one particular bug. It works like internet +search engines - just enter some keywords and off you go. + +## Advanced Search + +The Advanced Search page is used to produce a list of all bugs fitting exact +criteria. You can play with it on [Mozilla’s Bugzilla (BMO) test +server](https://bugzilla-dev.allizom.org/query.cgi?format=advanced). + +Advanced Search has controls for selecting different possible values for all of +the fields in a bug, as described above. For some fields, multiple values can +be selected. In those cases, Bugzilla returns bugs where the content of the +field matches any one of the selected values. If none is selected, then the +field can take any value. + +After a search is run, you can save it as a Saved Search, which will appear in +the page footer. If you are in the group defined by the "querysharegroup" +parameter, you may share your queries with other users; see [Saved +Searches](preferences.md#saved-searches) for more details. + +## Custom Search + +Highly advanced querying is done using the **Custom Search** feature of the +**Advanced Search** page. + +The search criteria here further restrict the set of results returned by a +query, over and above those defined in the fields at the top of the page. It is +thereby possible to search for bugs based on elaborate combinations of +criteria. + +The simplest custom searches have only one term. These searches permit the +selected *field* to be compared using a selectable *operator* to a specified +*value*. Much of this could be reproduced using the standard fields. However, +you can then combine terms using "Match All" (AND) or "Match Any" (OR), using +groups for combining and priority, in order to construct searches of almost +arbitrary complexity. + +There are three fields in each row (known as a "term") of a custom search: + +- *Field:* the name of the field being searched +- *Operator:* the comparison operator +- *Value:* the value to which the field is being compared + +The list of available *fields* contains all the fields defined for a bug, +including any custom fields, and then also some pseudo-fields like **Assignee +Real Name**, **Days Since Bug Changed**, **Time Since Assignee Touched** and +other things it may be useful to search on. + +There are a wide range of *operators* available, not all of which may make +sense for a particular field. There are various string-matching operations +(including regular expressions), numerical comparisons (which also work for +dates), and also the ability to search for change information—when a field +changed, what it changed from or to, and who did it. There are special +operators for **is empty** and **is not empty**, because Bugzilla can't tell +the difference between a value field left blank on purpose and one left blank +by accident. + +You can have an arbitrary number of rows and groups, and rearrange them by +dragging and dropping the handle on each item. You can even duplicate an item +by holding the Alt key while dragging it. The radio buttons above them define +how they relate — **Match All**, **Match All (Same Field)** or **Match Any**. +The difference between the first and second can be illustrated with a comment +search. If you have a search: + + Comment contains the string "Fred" + Comment contains the string "Barney" + +then under the first regime (match separately) the search would return bugs +where "Fred" appeared in one comment and "Barney" in the same or any other +comment, whereas under the second (match against the same field), both strings +would need to occur in exactly the same comment. + +### Negation + +At first glance, negation seems redundant. Rather than searching for: + + NOT ( summary contains the string "foo" ) + +one could search for: + + summary does not contain the string "foo" + +However, the search: + + CC does not contain the string "@mozilla.org" + +would find every bug where anyone on the CC list did not contain "@mozilla.org" +while: + + NOT ( CC contains the string "@mozilla.org" ) + +would find every bug where there was nobody on the CC list who did contain the +string. Similarly, the use of negation also permits complex expressions to be +built using terms OR'd together and then negated. Negation permits queries such +as: + + NOT ( ( product equals "Update" ) + OR + ( component equals "Documentation" ) + ) + +to find bugs that are neither in the **Update** product or in the +**Documentation** component or: + + NOT ( ( commenter equals "%assignee%" ) + OR + (component equals "Documentation" ) + ) + +to find non-documentation bugs on which the assignee has never commented. + +### Pronoun Substitution + +Sometimes, a query needs to compare a user-related field (such as **Reporter**) +with a role-specific user (such as the user running the query or the user to +whom each bug is assigned). For example, you may want to find all bugs that are +assigned to the person who reported them. + +When the **Custom Search** operator is either **equals** or **notequals**, the +value can be `%reporter%`, `%triageowner%`, `%assignee%`, `%qacontact%`, +`%user%` or `%self%`. These are known as "pronouns". The `%user%` pronoun and +its alias `%self%` refer to the user who is executing the query (that's you) +or, in the case of whining reports, the user who will be the recipient of the +report. The `%reporter%`, `%triageowner%`, `%assignee%` and `%qacontact%` +pronouns refer to the corresponding fields in the bug. + +This feature also lets you search by a user's group memberships. If the +operator is either **equals**, **notequals** or **anyexact**, you can search +for whether a user belongs (or not) to the specified group. The group name must +be entered using "%group.foo%" syntax, where "foo" is the group name. So if you +are looking for bugs reported by any user being in the "editbugs" group, then +you can use: + + reporter equals "%group.editbugs%" + +### Searching for Bugs Restricted to Groups + +When administrators set up products, they can establish one or more groups that +bugs in the product can be associated with. If a bug is associated with a group +then only users who are members of the group can see it. + +This restriction is mostly used for security-related bugs, or internal tickets. + +In order to search for bugs restricted to a group, you must be a member of the +group. + +Visit [the Permissions +page](https://bugzilla.mozilla.org/userprefs.cgi?tab=permissions) to find the +groups you belong to, then search using the clause + +> Group is equal to "%group.groupname%" + +to list the bugs restricted to `groupname`. + +### Searching on Relative Dates + +In order to conduct searches over a window of time, you can use *relative +dates* in query values. + +The relative date values are of the form `nnV` +where `nn` is a positive or negative integer and +`V` is one of: + +- `h` – for hours +- `d` – for days +- `w` – for weeks +- `m` – for months +- `y` – for years + +A value of `1d` means 24 hours in the future from +the time of the search. + +A value of `-1d` means 24 hours in the past from +the time of the search. + +These relative values can be used when the **Custom Search** operator is one +of: + +- **is less than** +- **is less than or equal to** +- **is greater than** +- **is greater than or equal to** + +and the field compared is a Datetime type. + +To find bugs opened in the last 24 hours, you could search on: + +> Opened is less than "-1d" + +To find bugs opened during the current day (UTC), + +> Opened is less than "-0ds" + +Appending `s` to a relative date means *start of*. + +You may also use relative dates for when a field changed. In the **Custom +Search** operator that would be + +- **changed after** +- **changed before** + +To find bugs whose **priority** changed in the last seven days, search on: + +> Priority changed after "-1w" + +You can also search for a change to a particular value over a relative date +using the **Search by Change History** operator. + +To find the bugs `RESOLVED` as +`WONTFIX` in the current year to date, you would +search on + +> Resolution changed to "WONTFIX" between "-0ys" and "NOW" + +## Bug Lists + +The result of a search is a list of matching bugs. + +The format of the list is configurable. For example, it can be sorted by +clicking the column headings. Other useful features can be accessed using the +links at the bottom of the list: + +Long Format: +this gives you a large page with a non-editable summary of the fields of each +bug. + +XML (icon): +get the buglist in an XML format. + +CSV (icon): +get the buglist as comma-separated values, for import into e.g. a spreadsheet. + +Feed (icon): +get the buglist as an Atom feed. Copy this link into your favorite feed reader. +If you are using Firefox, you can also save the list as a live bookmark by +clicking the live bookmark icon in the status bar. To limit the number of bugs +in the feed, add a limit=n parameter to the URL. + +iCalendar (icon): +Get the buglist as an iCalendar file. Each bug is represented as a to-do item +in the imported calendar. + +Change Columns: +change the bug attributes which appear in the list. + +Change Several Bugs At Once: +If your account is sufficiently empowered, and more than one bug appears in the +bug list, this link is displayed and lets you easily make the same change to +all the bugs in the list - for example, changing their assignee. + +Send Mail to Bug Assignees: +If more than one bug appears in the bug list and there are at least two +distinct bug assignees, this link is displayed which lets you easily send an +e-mail to the assignees of all bugs on the list. + +Edit Search: +If you didn't get exactly the results you were looking for, you can return to +the Query page through this link and make small revisions to the query you just +made so you get more accurate results. + +Remember Search As: +You can give a search a name and remember it; the name will appear as an +auto-completion in the search field in the header of Bugzilla pages giving you +quick access to run it again later. diff --git a/docs/en/md/using/index.md b/docs/en/md/using/index.md new file mode 100644 index 0000000000..17e73c8551 --- /dev/null +++ b/docs/en/md/using/index.md @@ -0,0 +1,12 @@ +# User Guide + +- [Creating an Account](creating-an-account.md) +- [Filing a Bug](filing.md) +- [Understanding a Bug](understanding.md) +- [Editing a Bug](editing.md) +- [Finding Bugs](finding.md) +- [Reports and Charts](reports-and-charts.md) +- [Pro Tips](tips.md) +- [User Preferences](preferences.md) +- [Two-Factor Authentication](two-factor-authentication.md) +- [Installed Extensions](extensions.md) diff --git a/docs/en/md/using/preferences.md b/docs/en/md/using/preferences.md new file mode 100644 index 0000000000..6cf9ce0cae --- /dev/null +++ b/docs/en/md/using/preferences.md @@ -0,0 +1,168 @@ +# User Preferences + +Once logged in, you can customize various aspects of Bugzilla via the +"Preferences" link in the page footer. The preferences are split into a number +of tabs, detailed in the sections below. + +## General Preferences + +This tab allows you to change several default settings of Bugzilla. +Administrators have the power to remove preferences from this list, so you may +not see all the preferences available. + +Each preference should be self-explanatory. + +## Email Preferences + +This tab allows you to enable or disable email notification on specific events. + +In general, users have almost complete control over how much (or how little) +email Bugzilla sends them. If you want to receive the maximum amount of email +possible, click the `Enable All Mail` button. If you don't want to receive any +email from Bugzilla at all, click the `Disable All Mail` button. + +> [!NOTE] +> A Bugzilla administrator can stop a user from receiving bugmail by clicking +> the `Bugmail Disabled` checkbox when editing the user account. This is a +> drastic step best taken only for disabled accounts, as it overrides the +> user's individual mail preferences. + +There are two global options -- `Email me when someone asks me to set a flag` +and `Email me when someone sets a flag I asked for`. These define how you want +to receive bugmail with regards to flags. Their use is quite straightforward: +enable the checkboxes if you want Bugzilla to send you mail under either of the +above conditions. + +If you'd like to set your bugmail to something besides 'Completely ON' and +'Completely OFF', the `Field/recipient specific options` table allows you to do +just that. The rows of the table define events that can happen to a bug -- +things like attachments being added, new comments being made, the priority +changing, etc. The columns in the table define your relationship with the bug - +reporter, assignee, QA contact (if enabled) or CC list member. + +To fine-tune your bugmail, decide the events for which you want to receive +bugmail; then decide if you want to receive it all the time (enable the +checkbox for every column) or only when you have a certain relationship with a +bug (enable the checkbox only for those columns). For example, if you didn't +want to receive mail when someone added themselves to the CC list, you could +uncheck all the boxes in the `CC Field Changes` line. As another example, if +you never wanted to receive email on bugs you reported unless the bug was +resolved, you would uncheck all boxes in the `Reporter` column except for the +one on the `The bug is resolved or verified` row. + +> [!NOTE] +> Bugzilla adds the `X-Bugzilla-Reason` header to all bugmail it sends, +> describing the recipient's relationship (AssignedTo, Reporter, QAContact, CC, +> or Voter) to the bug. This header can be used to do further client-side +> filtering. + +Bugzilla has a feature called `User Watching`. When you enter one or more +comma-delineated user accounts (usually email addresses) into the text entry +box, you will receive a copy of all the bugmail those users are sent (security +settings permitting). This powerful functionality enables seamless transitions +as developers change projects or users go on holiday. + +Each user listed in the `Users watching you` field has you listed in their +`Users to watch` list and can get bugmail according to your relationship to the +bug and their `Field/recipient specific options` setting. + +Lastly, you can define a list of bugs on which you no longer wish to receive +any email, ever. (You can also add bugs to this list individually by checking +the "Ignore Bug Mail" checkbox on the bug page for that bug.) This is useful +for ignoring bugs where you are the reporter, as that's a role it's not +possible to stop having. + +## Saved Searches + +On this tab you can view and run any Saved Searches that you have created, and +any Saved Searches that other members of the group defined in the +`querysharegroup` parameter have shared. Saved Searches can be added to the +page footer from this screen. If somebody is sharing a Search with a group they +are allowed to [assign users to](../administering/groups.md), the sharer may opt to have +the Search show up in the footer of the group's direct members by default. + +## Account Information + +On this tab, you can change your basic account information, including your +password, email address and real name. For security reasons, in order to change +anything on this page you must type your *current* password into the `Password` +field at the top of the page. If you attempt to change your email address, a +confirmation email is sent to both the old and new addresses with a link to use +to confirm the change. This helps to prevent account hijacking. + +## API Keys + +API keys allow you to give a "token" to some external software so it can log in +to the WebService API as you without knowing your password. You can then revoke +that token if you stop using the web service, and you don't need to change your +password everywhere. + +You can create more than one API key if required. Each API key has an optional +description which can help you record what it is used for. + +On this page, you can unrevoke, revoke, make sticky, and change the description +of existing API keys for your login. A revoked key means that it cannot be +used. The description is optional and purely for your information. + +Sticky API keys may only be used from one IP address, which reduces the risk of +the key being leaked. The IP address is the one the key was last used from. The +expected workflow is that the sticky bit will be set once your application (or +script) is setup. The sticky attribute may only be set, it can't ever be unset. + +You can also create a new API key by selecting the checkbox under the 'New API +key' section of the page. + +## Permissions + +This is a purely informative page which outlines your current permissions on +this installation of Bugzilla. + +A complete list of permissions in a default install of Bugzilla is below. Your +administrator may have defined other permissions. Only users with *editusers* +privileges can change the permissions of other users. + +admin +Indicates user is an Administrator. + +bz_canusewhineatothers +Indicates user can configure whine reports for other users. + +bz_canusewhines +Indicates user can configure whine reports for self. + +bz_quip_moderators +Indicates user can moderate quips. + +bz_sudoers +Indicates user can perform actions as other users. + +bz_sudo_protect +Indicates user cannot be impersonated by other users. + +canconfirm +Indicates user can confirm a bug or mark it a duplicate. + +creategroups +Indicates user can create and destroy groups. + +editbugs +Indicates user can edit all bug fields. + +editclassifications +Indicates user can create, destroy and edit classifications. + +editcomponents +Indicates user can create, destroy and edit products, components, versions, +milestones and flag types. + +editkeywords +Indicates user can create, destroy and edit keywords. + +edittriageowners +Indicates user can edit the triage owner values for components. + +editusers +Indicates user can create, disable and edit users. + +tweakparams +Indicates user can change [Parameters](../administering/parameters.md). diff --git a/docs/en/md/using/reports-and-charts.md b/docs/en/md/using/reports-and-charts.md new file mode 100644 index 0000000000..058515e51c --- /dev/null +++ b/docs/en/md/using/reports-and-charts.md @@ -0,0 +1,92 @@ +# Reports and Charts + +As well as the standard buglist, Bugzilla has two more ways of viewing sets of +bugs. These are the reports (which give different views of the current state of +the database) and charts (which plot the changes in particular sets of bugs +over time). + +## Reports + +A report is a view of the current state of the bug database. + +You can run either an HTML-table-based report, or a graphical +line/pie/bar-chart-based one. The two have different pages to define them but +are close cousins - once you've defined and viewed a report, you can switch +between any of the different views of the data at will. + +Both report types are based on the idea of defining a set of bugs using the +standard search interface and then choosing some aspect of that set to plot on +the horizontal and/or vertical axes. You can also get a form of 3-dimensional +report by choosing to have multiple images or tables. + +So, for example, you could use the search form to choose "all bugs in the +WorldControl product" and then plot their severity against their component to +see which component has had the largest number of bad bugs reported against it. + +Once you've defined your parameters and hit **Generate Report**, you can switch +between HTML, CSV, Bar, Line and Pie. (Note: Pie is only available if you +didn't define a vertical axis, as pie charts don't have one.) The other +controls are fairly self-explanatory; you can change the size of the image if +you find text is overwriting other text, or the bars are too thin to see. + +## Charts + +A chart is a view of the state of the bug database over time. + +Bugzilla currently has two charting systems - Old Charts and New Charts. Old +Charts have been part of Bugzilla for a long time; they chart each status and +resolution for each product, and that's all. They are deprecated, and going +away soon - we won't say any more about them. New Charts are the future - they +allow you to chart anything you can define as a search. + +> [!NOTE] +> Both charting forms require the administrator to set up the data-gathering +> script. If you can't see any charts, ask them whether they have done so. + +An individual line on a chart is called a data set. All data sets are organized +into categories and subcategories. The data sets that Bugzilla defines +automatically use the Product name as a **Category** and Component names as +**Subcategories**, but there is no need for you to follow that naming scheme +with your own charts if you don't want to. + +Data sets may be public or private. Everyone sees public data sets in the list, +but only their creator sees private data sets. Only administrators can make +data sets public. No two data sets, even two private ones, can have the same +set of category, subcategory and name. So if you are creating private data +sets, one idea is to have the **Category** be your username. + +### Creating Charts + +You create a chart by selecting a number of data sets from the list and +pressing **Add To List** for each. In the **List Of Data Sets To Plot**, you +can define the label that data set will have in the chart's legend and also ask +Bugzilla to **Sum** a number of data sets (e.g. you could **Sum** data sets +representing **RESOLVED**, **VERIFIED** and **CLOSED** in a particular product +to get a data set representing all the resolved bugs in that product.) + +If you've erroneously added a data set to the list, select it using the +checkbox and click **Remove**. Once you add more than one data set, a **Grand +Total** line automatically appears at the bottom of the list. If you don't want +this, simply remove it as you would remove any other line. + +You may also choose to plot only over a certain date range, and to cumulate the +results, that is, to plot each one using the previous one as a baseline so the +top line gives a sum of all the data sets. It's easier to try than to explain +:-) + +Once a data set is in the list, you can also perform certain actions on it. For +example, you can edit the data set's parameters (name, frequency etc.) if it's +one you created or if you are an administrator. + +Once you are happy, click **Chart This List** to see the chart. + +### Creating New Data Sets + +You may also create new data sets of your own. To do this, click the **create a +new data set** link on the **Create Chart** page. This takes you to a +search-like interface where you can define the search that Bugzilla will plot. +At the bottom of the page, you choose the category, sub-category and name of +your new data set. + +If you have sufficient permissions, you can make the data set public, and +reduce the frequency of data collection to less than the default of seven days. diff --git a/docs/en/md/using/tips.md b/docs/en/md/using/tips.md new file mode 100644 index 0000000000..ae1489b958 --- /dev/null +++ b/docs/en/md/using/tips.md @@ -0,0 +1,46 @@ +# Pro Tips + +This section distills some Bugzilla tips and best practices that have been +developed. + +## Autolinkification + +Bugzilla comments are plain text - so typing \ will produce less-than, U, +greater-than rather than underlined text. However, Bugzilla will automatically +make hyperlinks out of certain sorts of text in comments. For example, the text +`https://www.bugzilla.org` will be turned into a link: +. Other strings which get linkified in the obvious +manner are: + +- bug 12345 +- bugs 123, 456, 789 +- comment 7 +- comments 1, 2, 3, 4 +- bug 23456, comment 53 +- attachment 4321 +- mailto:george@example.com +- george@example.com +- ftp://ftp.mozilla.org +- Most other sorts of URL + +A corollary here is that if you type a bug number in a comment, you should put +the word "bug" before it, so it gets autolinkified for the convenience of +others. + +## Comments + +If you are changing the fields on a bug, only comment if either you have +something pertinent to say or Bugzilla requires it. Otherwise, you may spam +people unnecessarily with bugmail. To take an example: a user can set up their +account to filter out messages where someone just adds themselves to the CC +field of a bug (which happens a lot). If you come along, add yourself to the CC +field, and add a comment saying "Adding self to CC", then that person gets a +pointless piece of mail they would otherwise have avoided. + +Don't use signs in comments. Signing your name ("Bill") is acceptable, if you +do it out of habit, but full mail/news-style four line ASCII art creations are +not. + +If you feel a bug you filed was incorrectly marked as a DUPLICATE of another, +please question it in your bug, not the bug it was duped to. Feel free to CC +the person who duped it if they are not already CCed. diff --git a/docs/en/md/using/two-factor-authentication.md b/docs/en/md/using/two-factor-authentication.md new file mode 100644 index 0000000000..d5f68f06b0 --- /dev/null +++ b/docs/en/md/using/two-factor-authentication.md @@ -0,0 +1,266 @@ +# Two-Factor Authentication + +Two-factor authentication (2FA) protects your account with two independent +credentials: your password and a second factor. If someone learns your +password, they still cannot sign in without access to your second factor. + +BMO supports two methods: + +- **Time-based one-time passwords (TOTP)** are available unless your account + belongs to a group that requires Duo. A TOTP application generates a new + six-digit code every 30 seconds. +- **Duo Security** is available to eligible Mozilla-affiliated accounts. Some + Mozilla groups require their members to use Duo. + +For the strongest separation between factors, keep your password and TOTP +generator on different devices or in different applications. A password manager +that stores both your BMO password and TOTP secret is convenient and still +protects against some attacks, but anyone who compromises that password manager +may obtain both factors. + +After you enable 2FA, BMO asks for second-factor verification when you sign in +and when you perform sensitive account actions, such as changing your email +address or password, creating an API key, or relaxing API authentication +requirements. Enabling or disabling 2FA also signs out your other BMO sessions. + +Enabling 2FA turns on the **Require API key authentication for API requests** +preference. Applications and scripts that use the BMO API should authenticate +with an [API key](preferences.md#api-keys) instead of your password. You can turn this +preference off after verifying with your second factor, but doing so is not +recommended. + +## Required 2FA Enrollment + +If BMO displays a 2FA enrollment deadline, enable 2FA before the date shown. +After that deadline, BMO restricts your account to the 2FA preferences page +until enrollment is complete. + +Some accounts are required to use Duo. If an account is used for automation and +Duo is not appropriate, [file a bug in the bugzilla.mozilla.org Administration +component](https://bugzilla.mozilla.org/enter_bug.cgi?product=bugzilla.mozilla.org&component=Administration) +with details about the bot and its requirements to request an exception. + +## Choose a Method + +Before you begin: + +- Make sure you know your current BMO password. +- For TOTP, install a TOTP application on a device you control and set the + device's date and time automatically. +- For Duo, complete enrollment at + [login.mozilla.com](https://login.mozilla.com/) and have your Duo username + ready. + +Open [BMO's Two-Factor Authentication +preferences](https://bugzilla.mozilla.org/userprefs.cgi?tab=mfa), or open +**Preferences** and select the **Two-Factor Authentication** tab. Choose an +available method. + +![BMO Two-Factor Authentication preferences showing TOTP and Duo choices](../../images/mfa-method-selection.png) + +*Choose TOTP or, if your account is eligible, Duo Security.* + +You must have a password on your BMO account before you can enable 2FA. If your +account does not have one, use **Reset Password** and follow the link sent to +your email address. + +## Configure TOTP + +[Google Authenticator](https://support.google.com/accounts/answer/1066447), +[FreeOTP](https://freeotp.github.io/), and other applications compatible with +the TOTP standard can generate BMO verification codes. The exact labels vary by +application, but the enrollment process is the same: + +1. Click **Time-based One-Time Password (TOTP)**. +2. Enter your current BMO password. +3. In your TOTP application, add a new account and choose the option to scan a + QR code. Allow camera access if the application requests it. +4. Point the device's camera at the QR code shown by BMO. The application + should add a BMO entry and begin showing a new six-digit code every 30 + seconds. +5. If you cannot scan the QR code, click **Show as text** above it to display + the secret, then choose manual entry in your TOTP application and enter + that secret. +6. Enter the six-digit code shown by your TOTP application. +7. Click **Submit Changes**. + +BMO returns to the 2FA preferences page and shows TOTP as enabled. Generate +recovery codes before signing out or removing the BMO entry from your TOTP +application. + +![BMO TOTP enrollment form with a QR code and verification fields](../../images/mfa-totp-enrollment.png) + +*Scan the QR code, then verify enrollment with your password and a current +six-digit code.* + +> [!WARNING] +> The QR code and manual secret can generate verification codes for your +> account. Do not save screenshots of them or share them with anyone. + +## Configure Duo + +Duo appears only when BMO marks your account as eligible. This includes Mozilla +employees and members of groups required to use Duo; having a Mozilla LDAP +account alone does not guarantee eligibility. Before enabling Duo in BMO, +enroll your account at [login.mozilla.com](https://login.mozilla.com/). + +1. Click **Duo Security**. +2. Enter your current BMO password. +3. Enter your Mozilla Duo username, which is generally your Mozilla LDAP + username and may differ from your BMO email address. +4. Click **Submit Changes**. +5. Complete the Duo Universal Prompt. + +The Duo application and a TOTP application are not interchangeable. When BMO +shows the Duo Universal Prompt, approve the request using a method enrolled in +Duo; do not enter a TOTP code created for BMO. + +If your group requires Duo, BMO does not offer the option to disable it in your +2FA preferences. Contact [Mozilla Service +Desk](https://mozilla-hub.atlassian.net/servicedesk/customer/portal/1) if you +need help with your Duo enrollment or device. + +## Sign In and Confirm Sensitive Changes + +After entering your email address and password, BMO completes sign-in using the +method configured on your account: + +- TOTP users enter the current six-digit code from their TOTP application. An + unused BMO recovery code also works in this field. +- Duo users complete the Duo Universal Prompt using an enrolled Duo method. BMO + recovery codes do not replace this prompt. + +BMO asks you to verify again before sensitive account changes. Read the prompt +carefully and use the same method. Never approve an unexpected Duo request or +give a TOTP or recovery code to another person. + +## Generate Recovery Codes + +For TOTP accounts, recovery codes let you verify your identity if your normal +second factor is lost, unavailable, or replaced. Generate them immediately +after enabling TOTP. + +1. Return to the **Two-Factor Authentication** preferences tab. +2. Click **Generate Printable Recovery Codes**. +3. Enter your current password and either a current TOTP code or an unused + recovery code. +4. Click **Generate Printable Recovery Codes** again to submit the form. +5. Print the codes and store them in a secure offline location. + +![BMO preferences showing enabled TOTP and the recovery-code button](../../images/mfa-enabled.png) + +*Generate recovery codes from the preferences page after enabling 2FA.* + +![BMO printable recovery-code page showing ten single-use codes](../../images/mfa-recovery-codes.png) + +*BMO displays ten printable recovery codes.* + +Each recovery code is a nine-digit, single-use code. Enter one in the same +field that normally accepts your TOTP code. Generating a new set immediately +invalidates every code from the previous set. + +Do not store recovery codes with your password or on the device that provides +your second factor. If you are unsure whether your codes remain private, +generate and print a new set. + +BMO recovery codes cannot replace a Duo verification, even though the 2FA +preferences page offers Duo users the recovery-code generator. Duo users should +configure more than one authentication method in Duo and contact [Mozilla +Service Desk](https://mozilla-hub.atlassian.net/servicedesk/customer/portal/1) +if none of those methods are available. + +## Troubleshooting + +### TOTP Code Is Rejected + +1. Make sure you are using the code from the BMO entry in your TOTP + application, not a Duo passcode or a code for another service. +2. Set the device's date and time automatically. TOTP depends on an accurate + clock. +3. If the displayed code is about to expire, wait for the next code and enter + it promptly. +4. Enter only the six digits shown by the application. + +If current codes continue to fail and you are already signed in, use an unused +recovery code to [disable and re-enable +TOTP](#change-or-disable-2fa). If you are signed out, you need two +unused recovery codes: one to sign in and another to disable TOTP. Otherwise, +contact the BMO administrators. + +### Duo Prompt Does Not Load + +Content-blocking or privacy extensions can prevent the Duo Universal Prompt +from loading. Temporarily allow the Duo page, reload BMO, and try again. Also +confirm that the Duo username configured in BMO belongs to your Mozilla +account. + +If the prompt still does not load, or none of your enrolled Duo methods is +available, contact [Mozilla Service +Desk](https://mozilla-hub.atlassian.net/servicedesk/customer/portal/1). + +### No 2FA Method Is Available + +BMO requires a password before it can enable 2FA. If your account signs in +through an external identity provider and does not yet have a BMO password, use +**Reset Password** on the 2FA preferences page and follow the link sent to your +email address. + +## If You Lose Your Device + +If you use TOTP and have recovery codes: + +1. Sign in with your password and one unused recovery code. +2. Open the **Two-Factor Authentication** preferences tab. +3. Click **Disable Two-factor Authentication**. +4. Enter your current password and verify with another unused recovery code. +5. Click **Submit Changes**. +6. Enable 2FA again with your replacement device and generate a new set of + recovery codes. + +If you use Duo and still have another enrolled Duo device or recovery method, +use it in the Duo Universal Prompt. Duo users who cannot access an enrolled +method should contact [Mozilla Service +Desk](https://mozilla-hub.atlassian.net/servicedesk/customer/portal/1). + +If you have lost both your second factor and all recovery codes, contact [the +BMO administrators](mailto:bugzilla-admin@mozilla.org). You will need to +provide enough information to establish that you own the account. Account +recovery is not guaranteed. + +## Change or Disable 2FA + +If your account permits changing methods, first disable the current method, +then enable the new one. You must enter your current password and verify with +your current second factor. TOTP users may verify with an unused recovery code +instead. There is a brief period when your account is not protected by 2FA, so +complete the new enrollment immediately. + +When you enable or disable 2FA, BMO signs out every other session while keeping +your current session active. You can also review and end sessions from BMO's +[Sessions +preferences](https://bugzilla.mozilla.org/userprefs.cgi?tab=sessions). + +## Frequently Asked Questions + +### Can I Move TOTP to a New Device? + +If both devices are available, use your TOTP application's supported transfer +process, then confirm that the new device produces working BMO codes before +removing the old entry. Otherwise, disable TOTP while the old device still +works, enable it again with the new device, and generate new recovery codes. +BMO does not display the original TOTP secret again after enrollment. + +### Can I Store TOTP in My Password Manager? + +Yes, if your password manager supports it, but this places your password and +second factor in the same security boundary. A separate TOTP application or +device provides stronger protection if your password manager is compromised. +Whichever approach you choose, keep recovery codes separately in a secure +offline location. + +### Why Did My API Client Stop Working? + +Enabling 2FA also enables the **Require API key authentication for API +requests** preference. Password-authenticated scripts may therefore stop +working. Create an [API key](preferences.md#api-keys) for the client rather than +weakening this preference. diff --git a/docs/en/md/using/understanding.md b/docs/en/md/using/understanding.md new file mode 100644 index 0000000000..de1c9a803a --- /dev/null +++ b/docs/en/md/using/understanding.md @@ -0,0 +1,254 @@ +# Understanding a Bug + +The core of Bugzilla is the screen which displays a particular bug. Note that +the labels for most fields are hyperlinks; clicking them will take you to +context-sensitive help on that particular field. Fields marked \* may not be +present on every installation of Bugzilla. + +*Summary:* +A one-sentence summary of the problem, displayed in the header next to the bug +number. + +*Status (and Resolution):* +These define exactly what state the bug is in—from not even being confirmed as +a bug, through to being fixed and the fix confirmed by Quality Assurance. The +different possible values for Status and Resolution on your installation should +be documented in the context-sensitive help for those items. + +*Alias:* +A unique short text name for the bug, which can be used instead of the bug +number. + +*Product and Component*: +Bugs are divided up by Product and Component, with a Product having one or more +Components in it. + +*Version:* +The "Version" field usually contains the numbers or names of released versions +of the product. It is used to indicate the version(s) affected by the bug +report. + +*Hardware (Platform and OS):* +These indicate the computing environment where the bug was found. + +*Importance (Priority and Severity):* +The Priority field is used to prioritize bugs, either by the assignee, or +someone else with authority to direct their time such as a project manager. +It's a good idea not to change this on other people's bugs. The default values +are P1 to P5. + +The Severity field indicates how severe the problem is—from blocker +("application unusable") to trivial ("minor cosmetic issue"). You can also use +this field to indicate whether a bug is an enhancement request. + +*\*Target Milestone:* +A future version by which the bug is to be fixed. e.g. The Bugzilla Project's +milestones for future Bugzilla versions are 4.4, 5.0, 6.0, etc. Milestones are +not restricted to numbers, though—you can use any text strings, such as dates. + +*Assigned To:* +The person responsible for fixing the bug. + +*\*QA Contact:* +The person responsible for quality assurance on this bug. + +*URL:* +A URL associated with the bug, if any. + +*\*Whiteboard:* +A free-form text area for adding short notes and tags to a bug. + +*Keywords:* +The administrator can define keywords which you can use to tag and categorize +bugs—e.g. `crash` or `regression`. + +*Personal Tags:* +Unlike Keywords which are global and visible by all users, Personal Tags are +personal and can only be viewed and edited by their author. Editing them won't +send any notifications to other users. Use them to tag and keep track of sets +of bugs that you personally care about, using your own classification system. + +*Dependencies (Depends On and Blocks):* +If this bug cannot be fixed unless other bugs are fixed (depends on), or this +bug stops other bugs being fixed (blocks), their numbers are recorded here. + +Clicking the **Dependency tree** link shows the dependency relationships of the +bug as a tree structure. You can change how much depth to show, and you can +hide resolved bugs from this page. You can also collapse/expand dependencies +for each non-terminal bug on the tree view, using the \[-\]/\[+\] buttons that +appear before the summary. + +*Opened:* +The person who filed the bug, and the date and time they did it. + +*Updated:* +The date and time the bug was last changed. + +*CC List:* +A list of people who get mail when the bug changes, in addition to the +Reporter, Assignee and QA Contact (if enabled). + +*Ignore Bug Mail:* +Set this if you want never to get bugmail from this bug again. See also [Email +Preferences](preferences.md#email-preferences). + +*\*See Also:* +Bugs, in this Bugzilla, other Bugzillas, or other bug trackers, that are +related to this one. + +*Flags:* +A flag is a kind of status that can be set on bugs or attachments to indicate +that the bugs/attachments are in a certain state. Each installation can define +its own set of flags that can be set on bugs or attachments. See +[Flags](#flags). + +*\*Time Tracking:* +This form can be used for time tracking. To use this feature, you have to be a +member of the group specified by the `timetrackinggroup` parameter. See [Time +Tracking](editing.md#time-tracking) for more information. + +Orig. Est.: +This field shows the original estimated time. + +Current Est.: +This field shows the current estimated time. This number is calculated from +`Hours Worked` and `Hours Left`. + +Hours Worked: +This field shows the number of hours worked. + +Hours Left: +This field shows the `Current Est.` -`Hours Worked`. This value + +`Hours Worked` will become the new Current Est. + +%Complete: +This field shows what percentage of the task is complete. + +Gain: +This field shows the number of hours that the bug is ahead of the `Orig. Est.`. + +Deadline: +This field shows the deadline for this bug. + +*Attachments:* +You can attach files (e.g. test cases or patches) to bugs. If there are any +attachments, they are listed in this section. See +[Attachments](editing.md#attachments) for more information. + +*Additional Comments:* +You can add your two cents to the bug discussion here, if you have something +worthwhile to say. + +## Flags + +Flags are a way to attach a specific status to a bug or attachment, either `+` +or `-`. The meaning of these symbols depends on the name of the flag itself, +but contextually they could mean pass/fail, accept/reject, approved/denied, or +even a simple yes/no. If your site allows requestable flags, then users may set +a flag to `?` as a request to another user that they look at the bug/attachment +and set the flag to its correct status. + +A set flag appears in bug reports and on "edit attachment" pages with the +abbreviated username of the user who set the flag prepended to the flag name. +For example, if Jack sets a "review" flag to `+`, it appears as **Jack: review +\[ + \]**. + +A requested flag appears with the user who requested the flag prepended to the +flag name and the user who has been requested to set the flag appended to the +flag name within parentheses. For example, if Jack asks Jill for review, it +appears as **Jack: review \[ ? \] (Jill)**. + +You can browse through open requests made of you and by you by selecting **My +Requests** from the footer. You can also look at open requests limited by other +requesters, requestees, products, components, and flag names. Note that you can +use '-' for requestee to specify flags with no requestee set. + +### A Simple Example + +A developer might want to ask their manager, "Should we fix this bug before we +release version 2.0?" They might want to do this for a *lot* of bugs, so they +decide to streamline the process. So: + +1. The Bugzilla administrator creates a flag type called blocking2.0 for bugs + in your product. It shows up on the **Show Bug** screen as the text + **blocking2.0** with a drop-down box next to it. The drop-down box contains + four values: an empty space, `?`, `-`, and `+`. +2. The developer sets the flag to `?`. +3. The manager sees the **blocking2.0** flag with a `?` value. +4. If the manager thinks the feature should go into the product before version + 2.0 can be released, they set the flag to `+`. Otherwise, they set it to + `-`. +5. Now, every Bugzilla user who looks at the bug knows whether or not the bug + needs to be fixed before release of version 2.0. + +### About Flags + +Flags can have four values: + +`?` +A user is requesting that a status be set. (Think of it as 'A question is being +asked'.) + +`-` +The status has been set negatively. (The question has been answered `no`.) + +`+` +The status has been set positively. (The question has been answered `yes`.) + +`_` +`unset` actually shows up as a blank space. This just means that nobody has +expressed an opinion (or asked someone else to express an opinion) about the +matter covered by this flag. + +### Flag Requests + +If a flag has been defined as **requestable**, and a user has enough privileges +to request it (see below), the user can set the flag's status to `?`. This +status indicates that someone (a.k.a. "the requester") is asking someone else +to set the flag to either `+` or `-`. + +If a flag has been defined as **specifically requestable**, a text box will +appear next to the flag into which the requester may enter a Bugzilla username. +That named person (a.k.a. "the requestee") will receive an email notifying them +of the request, and pointing them to the bug/attachment in question. + +If a flag has *not* been defined as **specifically requestable**, then no such +text box will appear. A request to set this flag cannot be made of any specific +individual; these requests are open for anyone to answer. In Bugzilla this is +known as "asking the wind". A requester may ask the wind on any flag simply by +leaving the text box blank. + +### Attachment Flags + +There are two types of flags: bug flags and attachment flags. + +Attachment flags are used to ask a question about a specific attachment on a +bug. + +Many Bugzilla installations use this to request that one developer review +another developer's code before they check it in. They attach the code to a bug +report, and then set a flag on that attachment called **review** to **review? +reviewer@example.com**. reviewer@example.com is then notified by email that +they have to check out that attachment and approve it or deny it. + +For a Bugzilla user, attachment flags show up in three places: + +1. On the list of attachments in the **Show Bug** screen, you can see the + current state of any flags that have been set to `?`, `+`, or `-`. You can + see who asked about the flag (the requester), and who is being asked (the + requestee). +2. When you edit an attachment, you can see any settable flag, along with any + flags that have already been set. The **Edit Attachment** screen is where + you set flags to `?`, `-`, `+`, or unset them. +3. Requests are listed in the **Request Queue**, which is accessible from the + **My Requests** link (if you are logged in) or **Requests** link (if you + are logged out) visible on all pages. + +### Bug Flags + +Bug flags are used to set a status on the bug itself. You can see Bug Flags in +the **Show Bug** and **Requests** screens, as described above. + +Only users with enough privileges (see below) may set flags on bugs. This +doesn't necessarily include the assignee, reporter, or users with the +`editbugs` permission. diff --git a/docs/en/rst/_static/bugzilla.css b/docs/en/rst/_static/bugzilla.css deleted file mode 100644 index 06f5c83752..0000000000 --- a/docs/en/rst/_static/bugzilla.css +++ /dev/null @@ -1,21 +0,0 @@ -@import 'default.css'; - -dt { font-weight: bold; } - -/* Custom roles */ -.param { font-weight: bold; } -.paramval { font-family: monospace; } -.group { font-family: monospace; } -.field { font-weight: bold; } -.command { font-family: monospace; font-size: 130% } - -.admonition-todo { - background-color: lightpink; - border: 2px darkred solid; -} - -/* Make Buggie's antenna not take up so much space */ -.logo { - display: block; - margin-top: -20px; -} diff --git a/docs/en/rst/about/index.rst b/docs/en/rst/about/index.rst deleted file mode 100644 index 6e16772c0a..0000000000 --- a/docs/en/rst/about/index.rst +++ /dev/null @@ -1,133 +0,0 @@ -.. _about: - -======================== -About This Documentation -======================== - -This is the documentation for version |version| of Bugzilla, a bug-tracking -system from Mozilla. Bugzilla is an enterprise-class piece of software -that tracks millions of bugs and issues for thousands of organizations around -the world. - -The most current version of this document can always be found on the -`Bugzilla website `_. - -.. _evaluating: - -Evaluating Bugzilla -################### - -If you want to try out Bugzilla to see if it meets your needs, you can do so on -`Mozilla’s Bugzilla (BMO) test server `_, -though it comes with various Mozilla-specific customizations. The easiest way to -explore the admin tools and more is `running a minimum local copy of BMO -`_ using Docker. -We are not offering any online vanilla test environment at this time. - -The `Bugzilla FAQ `_ may also be helpful, -as it answers a number of questions people sometimes have about whether Bugzilla -is for them. - -.. _getting-help: - -Getting More Help -################# - -If this document does not answer your questions, we run a -`Mozilla forum `_ -which can be accessed as a newsgroup, mailing list, or over the web as a -Google Group. Please -`search it `_ -first, and then ask your question there. - -If you need a guaranteed response, commercial support is -`available `_ for Bugzilla -from a number of people and organizations. - -.. _conventions: - -Document Conventions -#################### - -This document uses the following conventions: - -.. warning:: This is a warning—something you should be aware of. - -.. note:: This is just a note, for your information. - -A filename or a path to a filename is displayed like this: -:file:`/path/to/filename.ext` - -A command to type in the shell is displayed like this: -:command:`command --arguments` - -A sample of code is illustrated like this: - -:: - - First Line of Code - Second Line of Code - ... - -This documentation is maintained in -`reStructured Text -`_ format using -the `Sphinx `_ documentation system. It has -recently been rewritten, so it undoubtedly has bugs. Please file any you find, in -the `Bugzilla Documentation -`_ -component in Mozilla's installation of Bugzilla. If you also want to make a -patch, that would be wonderful. Changes are best submitted as diffs, attached -to a bug. There is a :ref:`Style Guide ` to help you write any -new text and markup. - -.. _license: - -License -####### - -Bugzilla is `free `_ and -`open source `_ software, which means (among other -things) that you can download it, install it, and run it for any purpose -whatsoever without the need for license or payment. Isn't that refreshing? - -Bugzilla's code is made available under the -`Mozilla Public License 2.0 `_ (MPL), -specifically the variant which is Incompatible with Secondary Licenses. -However, again, if you only want to install and run Bugzilla, you don't need -to worry about that; it's only relevant if you redistribute the code or any -changes you make. - -Bugzilla's documentation is made available under the -`Creative Commons CC-BY-SA International License 4.0 -`_, -or any later version. - -.. _credits: - -Credits -####### - -The people listed below have made significant contributions to the -creation of this documentation: - -Andrew Pearson, -Ben FrantzDale, -Byron Jones, -Dave Lawrence, -Dave Miller, -Dawn Endico, -Eric Hanson, -Gervase Markham, -Jacob Steenhagen, -Joe Robins, -Kevin Brannen, -Martin Wulffeld, -Matthew P. Barnson, -Ron Teitelbaum, -Shane Travis, -Spencer Smith, -Tara Hernandez, -Terry Weissman, -Vlad Dascalu, -Zach Lipton. diff --git a/docs/en/rst/administering/categorization.rst b/docs/en/rst/administering/categorization.rst deleted file mode 100644 index 383b9341de..0000000000 --- a/docs/en/rst/administering/categorization.rst +++ /dev/null @@ -1,416 +0,0 @@ -.. _categorization: - -=============================================================== -Classifications, Products, Components, Versions, and Milestones -=============================================================== - -Bugs in Bugzilla are classified into one of a set of admin-defined Components. -Components are themselves each part of a single Product. Optionally, Products -can be part of a single Classification, adding a third level to the hierarchy. - -.. _classifications: - -Classifications -############### - -Classifications are used to group several related products into one -distinct entity. - -For example, if a company makes computer games, -they could have a classification of "Games", and a separate -product for each game. This company might also have a -``Common`` classification, containing products representing units of -technology used in multiple games, and perhaps an ``Other`` classification -containing a few special products that represent items that are not actually -shipping products (for example, "Website", or "Administration"). - -The classifications layer is disabled by default; it can be turned -on or off using the :param:`useclassification` parameter -in the *Bug Fields* section of :ref:`parameters`. - -Access to the administration of classifications is controlled using -the *editclassifications* system group, which defines -a privilege for creating, destroying, and editing classifications. - -When activated, classifications will introduce an additional -step when filling bugs (dedicated to classification selection), and they -will also appear in the advanced search form. - -.. _products: - -Products -######## - -Products usually represent real-world shipping products. -Many of Bugzilla's settings are configurable on a per-product basis. - -When creating or editing products the following options are -available: - -Product - The name of the product - -Description - A brief description of the product - -Open for bug entry - Deselect this box to prevent new bugs from being - entered against this product. - -Enable the UNCONFIRMED status in this product - Select this option if you want to use the UNCONFIRMED status - (see :ref:`workflow`) - -Default milestone - Select the default milestone for this product. - -Version - Specify the default version for this product. - -Create chart datasets for this product - Select to make chart datasets available for this product. - -It is compulsory to create at least one :ref:`component ` in a product, and -so you will be asked for the details of that too. - -When editing a product you can change all of the above, and there is also a -link to edit Group Access Controls; see :ref:`product-group-controls`. - -.. _create-product: - -Creating New Products -===================== - -To create a new product: - -#. Select ``Administration`` from the footer and then - choose ``Products`` from the main administration page. - -#. Select the ``Add`` link in the bottom right. - -#. Enter the details as outlined above. - -.. _edit-products: - -Editing Products -================ - -To edit an existing product, click the "Products" link from the -"Administration" page. If the :param:`useclassification` parameter is -turned on, a table of existing classifications is displayed, -including an "Unclassified" category. The table indicates how many products -are in each classification. Click on the classification name to see its -products. If the :param:`useclassification` parameter is not in use, the table -lists all products directly. The product table summarizes the information -defined when the product was created. Click on the product name to edit these -properties, and to access links to other product attributes such as the -product's components, versions, milestones, and group access controls. - -.. _comps-vers-miles-products: - -Adding or Editing Components, Versions and Target Milestones -============================================================ - -To add new or edit existing Components, Versions, or Target Milestones -to a Product, select the "Edit Components", "Edit Versions", or "Edit -Milestones" links from the "Edit Product" page. A table of existing -Components, Versions, or Milestones is displayed. Click on an item name -to edit the properties of that item. Below the table is a link to add -a new Component, Version, or Milestone. - -For more information on components, see :ref:`components`. - -For more information on versions, see :ref:`versions`. - -For more information on milestones, see :ref:`milestones`. - -.. _product-group-controls: - -Assigning Group Controls to Products -==================================== - -On the ``Edit Product`` page, there is a link called -``Edit Group Access Controls``. The settings on this page -control the relationship of the groups to the product being edited. - -Group Access Controls are an important aspect of using groups for -isolating products and restricting access to bugs filed against those -products. For more information on groups, including how to create, edit, -add users to, and alter permission of, see :ref:`groups`. - -After selecting the "Edit Group Access Controls" link from the "Edit -Product" page, a table containing all user-defined groups for this -Bugzilla installation is displayed. The system groups that are created -when Bugzilla is installed are not applicable to Group Access Controls. -Below is description of what each of these fields means. - -Groups may be applicable (i.e. bugs in this product can be associated -with this group), default (i.e. bugs in this product are in this group -by default), and mandatory (i.e. bugs in this product must be associated -with this group) for each product. Groups can also control access -to bugs for a given product, or be used to make bugs for a product -totally read-only unless the group restrictions are met. The best way to -understand these relationships is by example. See -:ref:`group-control-examples` for examples of -product and group relationships. - -.. note:: Products and Groups are not limited to a one-to-one relationship. - Multiple groups can be associated with the same product, and groups - can be associated with more than one product. - -If any group has *Entry* selected, then the -product will restrict bug entry to only those users -who are members of *all* the groups with -*Entry* selected. - -If any group has *Canedit* selected, -then the product will be read-only for any users -who are not members of *all* of the groups with -*Canedit* selected. *Only* users who -are members of all the *Canedit* groups -will be able to edit bugs for this product. This is an additional -restriction that enables finer-grained control over products rather -than just all-or-nothing access levels. - -The following settings let you -choose privileges on a *per-product basis*. -This is a convenient way to give privileges to -some users for some products only, without having -to give them global privileges which would affect -all products. - -Any group having *editcomponents* -selected allows users who are in this group to edit all -aspects of this product, including components, milestones, -and versions. - -Any group having *canconfirm* selected -allows users who are in this group to confirm bugs -in this product. - -Any group having *editbugs* selected allows -users who are in this group to edit all fields of -bugs in this product. - -The *MemberControl* and -*OtherControl* are used in tandem to determine which -bugs will be placed in this group. The only allowable combinations of -these two parameters are listed in a table on the "Edit Group Access Controls" -page. Consult this table for details on how these fields can be used. -Examples of different uses are described below. - -.. _group-control-examples: - -Common Applications of Group Controls -===================================== - -The use of groups is best explained by providing examples that illustrate -configurations for common use cases. The examples follow a common syntax: -*Group: Entry, MemberControl, OtherControl, CanEdit, -EditComponents, CanConfirm, EditBugs*, where "Group" is the name -of the group being edited for this product. The other fields all -correspond to the table on the "Edit Group Access Controls" page. If any -of these options are not listed, it means they are not checked. - -Basic Product/Group Restriction -------------------------------- - -Suppose there is a product called "Bar". You would like to make it so that only -users in the group "Foo" can enter bugs in the "Bar" product. Additionally, -bugs filed in product "Bar" must be visible only to users in "Foo" (plus, by -default, the reporter, assignee, and CC list of each bug) at all times. -Furthermore, only members of group "Foo" should be able to edit bugs filed -against product "Bar", even if other users could see the bug. This arrangement -would achieved by the following: - -:: - - Product Bar: - foo: ENTRY, MANDATORY/MANDATORY, CANEDIT - -Perhaps such strict restrictions are not needed for product "Bar". Instead, -you would like to make it so that only members of group "Foo" can -enter bugs in product "Bar", but bugs in "Bar" are not required to be -restricted in visibility to people in "Foo". Anyone with permission -to edit a particular bug in product "Bar" can put the bug in group "Foo", even -if they themselves are not in "Foo". - -Furthermore, anyone in group "Foo" can edit all aspects of the components of -product "Bar", can confirm bugs in product "Bar", and can edit all fields of -any bug in product "Bar". That would be done like this: - -:: - - Product Bar: - foo: ENTRY, SHOWN/SHOWN, EDITCOMPONENTS, CANCONFIRM, EDITBUGS - -General User Access With Security Group ---------------------------------------- - -To permit any user to file bugs against "Product A", -and to permit any user to submit those bugs into a -group called "Security": - -:: - - Product A: - security: SHOWN/SHOWN - -General User Access With A Security Product -------------------------------------------- - -To permit any user to file bugs against product called "Security" -while keeping those bugs from becoming visible to anyone -outside the group "SecurityWorkers" (unless a member of the -"SecurityWorkers" group removes that restriction): - -:: - - Product Security: - securityworkers: DEFAULT/MANDATORY - -Product Isolation With a Common Group -------------------------------------- - -To permit users of "Product A" to access the bugs for -"Product A", users of "Product B" to access the bugs for -"Product B", and support staff, who are members of the "Support -Group" to access both, three groups are needed: - -#. Support Group: Contains members of the support staff. - -#. AccessA Group: Contains users of product A and the Support group. - -#. AccessB Group: Contains users of product B and the Support group. - -Once these three groups are defined, the product group controls -can be set to: - -:: - - Product A: - AccessA: ENTRY, MANDATORY/MANDATORY - Product B: - AccessB: ENTRY, MANDATORY/MANDATORY - -Perhaps the "Support Group" wants more control. For example, -the "Support Group" could be permitted to make bugs inaccessible to -users of both groups "AccessA" and "AccessB". -Then, the "Support Group" could be permitted to publish -bugs relevant to all users in a third product (let's call it -"Product Common") that is read-only -to anyone outside the "Support Group". In this way the "Support Group" -could control bugs that should be seen by both groups. -That configuration would be: - -:: - - Product A: - AccessA: ENTRY, MANDATORY/MANDATORY - Support: SHOWN/NA - Product B: - AccessB: ENTRY, MANDATORY/MANDATORY - Support: SHOWN/NA - Product Common: - Support: ENTRY, DEFAULT/MANDATORY, CANEDIT - -Make a Product Read Only ------------------------- - -Sometimes a product is retired and should no longer have -new bugs filed against it (for example, an older version of a software -product that is no longer supported). A product can be made read-only -by creating a group called "readonly" and adding products to the -group as needed: - -:: - - Product A: - ReadOnly: ENTRY, NA/NA, CANEDIT - -.. note:: For more information on Groups outside of how they relate to products - see :ref:`groups`. - -.. _components: - -Components -########## - -Components are subsections of a Product. E.g. the computer game -you are designing may have a "UI" -component, an "API" component, a "Sound System" component, and a -"Plugins" component, each overseen by a different programmer. It -often makes sense to divide Components in Bugzilla according to the -natural divisions of responsibility within your Product or -company. - -Each component has a default assignee and, if you turned it on in the :ref:`parameters`, -a QA Contact. The default assignee should be the primary person who fixes bugs in -that component. The QA Contact should be the person who will ensure -these bugs are completely fixed. The Assignee, QA Contact, and Reporter -will get email when new bugs are created in this Component and when -these bugs change. Default Assignee and Default QA Contact fields only -dictate the *default assignments*; -these can be changed on bug submission, or at any later point in -a bug's life. - -To create a new Component: - -#. Select the ``Edit components`` link - from the ``Edit product`` page. - -#. Select the ``Add`` link in the bottom right. - -#. Fill out the ``Component`` field, a - short ``Description``, the - ``Default Assignee``, ``Default CC List``, - and ``Default QA Contact`` (if enabled). - The ``Component Description`` field may contain a - limited subset of HTML tags. The ``Default Assignee`` - field must be a login name already existing in the Bugzilla database. - -.. _versions: - -Versions -######## - -Versions are the revisions of the product, such as "Flinders -3.1", "Flinders 95", and "Flinders 2000". Version is not a multi-select -field; the usual practice is to select the earliest version known to have -the bug. - -To create and edit Versions: - -#. From the "Edit product" screen, select "Edit Versions". - -#. You will notice that the product already has the default - version "undefined". Click the "Add" link in the bottom right. - -#. Enter the name of the Version. This field takes text only. - Then click the "Add" button. - -.. _milestones: - -Milestones -########## - -Milestones are "targets" that you plan to get a bug fixed by. For -example, if you have a bug that you plan to fix for your 3.0 release, it -would be assigned the milestone of 3.0. - -.. note:: Milestone options will only appear for a Product if you turned - on the :param:`usetargetmilestone` parameter in the "Bug Fields" tab of - the :ref:`parameters` page. - -To create new Milestones and set Default Milestones: - -#. Select "Edit milestones" from the "Edit product" page. - -#. Select "Add" in the bottom right corner. - -#. Enter the name of the Milestone in the "Milestone" field. You - can optionally set the "sortkey", which is a positive or negative - number (-32768 to 32767) that defines where in the list this particular - milestone appears. This is because milestones often do not - occur in alphanumeric order; for example, "Future" might be - after "Release 1.2". Select "Add". diff --git a/docs/en/rst/administering/custom-fields.rst b/docs/en/rst/administering/custom-fields.rst deleted file mode 100644 index 29cc72e62e..0000000000 --- a/docs/en/rst/administering/custom-fields.rst +++ /dev/null @@ -1,149 +0,0 @@ -.. _custom-fields: - -Custom Fields -############# - -Custom Fields are fields defined by the administrator, in addition to those -which come with Bugzilla by default. Custom Fields are treated like any other -field—they can be set in bugs and used for search queries. - -Administrators should keep in mind that -adding too many fields can make the user interface more complicated and -harder to use. Custom Fields should be added only when necessary and with -careful consideration. - -.. note:: Before adding a Custom Field, make sure that Bugzilla cannot already - do the desired behavior. Many Bugzilla options are not enabled by - default, and many times Administrators find that simply enabling - certain options that already exist is sufficient. - -Administrators can manage Custom Fields using the -``Custom Fields`` link on the Administration page. The Custom -Fields administration page displays a list of Custom Fields, if any exist, -and a link to "Add a new custom field". - -.. _add-custom-fields: - -Adding Custom Fields -==================== - -To add a new Custom Field, click the "Add a new custom field" link. This -page displays several options for the new field, described below. - -The following attributes must be set for each new custom field: - -- *Name:* - The name of the field in the database, used internally. This name - MUST begin with ``cf_`` to prevent confusion with - standard fields. If this string is omitted, it will - be automatically added to the name entered. - -- *Description:* - A brief string used as the label for this Custom Field. - That is the string that users will see, and it should be - short and explicit. - -- *Type:* - The type of field to create. There are - several types available: - - Bug ID: - A field where you can enter the ID of another bug from - the same Bugzilla installation. To point to a bug in a remote - installation, use the See Also field instead. - Large Text Box: - A multiple line box for entering free text. - Free Text: - A single line box for entering free text. - Multiple-Selection Box: - A list box where multiple options - can be selected. After creating this field, it must be edited - to add the selection options. See - :ref:`edit-values-list` for information about - editing legal values. - Drop Down: - A list box where only one option can be selected. - After creating this field, it must be edited to add the - selection options. See - :ref:`edit-values-list` for information about - editing legal values. - Date/Time: - A date field. This field appears with a - calendar widget for choosing the date. - -- *Sortkey:* - Integer that determines in which order Custom Fields are - displayed in the User Interface, especially when viewing a bug. - Fields with lower values are displayed first. - -- *Reverse Relationship Description:* - When the custom field is of type ``Bug ID``, you can - enter text here which will be used as label in the referenced - bug to list bugs which point to it. This gives you the ability - to have a mutual relationship between two bugs. - -- *Can be set on bug creation:* - Boolean that determines whether this field can be set on - bug creation. If not selected, then a bug must be created - before this field can be set. See :ref:`filing` - for information about filing bugs. - -- *Displayed in bugmail for new bugs:* - Boolean that determines whether the value set on this field - should appear in bugmail when the bug is filed. This attribute - has no effect if the field cannot be set on bug creation. - -- *Is obsolete:* - Boolean that determines whether this field should - be displayed at all. Obsolete Custom Fields are hidden. - -- *Is mandatory:* - Boolean that determines whether this field must be set. - For single and multi-select fields, this means that a (non-default) - value must be selected; for text and date fields, some text - must be entered. - -- *Field only appears when:* - A custom field can be made visible when some criteria is met. - For instance, when the bug belongs to one or more products, - or when the bug is of some given severity. If left empty, then - the custom field will always be visible, in all bugs. - -- *Field that controls the values that appear in this field:* - When the custom field is of type ``Drop Down`` or - ``Multiple-Selection Box``, you can restrict the - availability of the values of the custom field based on the - value of another field. This criteria is independent of the - criteria used in the ``Field only appears when`` - setting. For instance, you may decide that some given value - ``valueY`` is only available when the bug status - is RESOLVED while the value ``valueX`` should - always be listed. - Once you have selected the field that should control the - availability of the values of this custom field, you can - edit values of this custom field to set the criteria; see - :ref:`edit-values-list`. - -.. _edit-custom-fields: - -Editing Custom Fields -===================== - -As soon as a Custom Field is created, its name and type cannot be -changed. If this field is a drop-down menu, its legal values can -be set as described in :ref:`edit-values-list`. All -other attributes can be edited as described above. - -.. _delete-custom-fields: - -Deleting Custom Fields -====================== - -Only custom fields that are marked as obsolete, and that have never -been used, can be deleted completely (else the integrity -of the bug history would be compromised). For custom fields marked -as obsolete, a "Delete" link will appear in the ``Action`` -column. If the custom field has been used in the past, the deletion -will be rejected. Marking the field as obsolete, however, is sufficient -to hide it from the user interface entirely. - diff --git a/docs/en/rst/administering/extensions.rst b/docs/en/rst/administering/extensions.rst deleted file mode 100644 index 62c7ec03db..0000000000 --- a/docs/en/rst/administering/extensions.rst +++ /dev/null @@ -1,18 +0,0 @@ -.. _installed-extensions-admin: - -Installed Extensions -==================== - -Bugzilla can be enhanced using extensions (see :ref:`extensions`). If an -extension comes with documentation in the appropriate format, and you build -your own copy of the Bugzilla documentation using :file:`makedocs.pl`, then -the documentation for your installed extensions will show up here. - -Your Bugzilla installation has the following extensions available (as of the -last time you compiled the documentation): - -.. toctree:: - :maxdepth: 1 - :glob: - - ../extensions/*/index-admin diff --git a/docs/en/rst/administering/field-values.rst b/docs/en/rst/administering/field-values.rst deleted file mode 100644 index b7380cbdf1..0000000000 --- a/docs/en/rst/administering/field-values.rst +++ /dev/null @@ -1,45 +0,0 @@ -.. _field-values: - -Field Values -############ - -Legal values for the operating system, platform, bug priority and -severity, and custom fields of type ``Drop Down`` and -``Multiple-Selection Box`` (see :ref:`custom-fields`), -as well as the list of valid bug statuses and resolutions, can be -customized from the same interface. You can add, edit, disable, and -remove the values that can be used with these fields. - -.. _edit-values-list: - -Viewing/Editing Legal Values -============================ - -Editing legal values requires ``admin`` privileges. -Select "Field Values" from the Administration page. A list of all -fields, both system and Custom, for which legal values -can be edited appears. Click a field name to edit its legal values. - -There is no limit to how many values a field can have, but each value -must be unique to that field. The sortkey is important to display these -values in the desired order. - -When the availability of the values of a custom field is controlled -by another field, you can select from here which value of the other field -must be set for the value of the custom field to appear. - -.. _edit-values-delete: - -Deleting Legal Values -===================== - -Legal values from Custom Fields can be deleted, but only if the -following two conditions are respected: - -#. The value is not set as the default for the field. - -#. No bug is currently using this value. - -If any of these conditions is not respected, the value cannot be deleted. -The only way to delete these values is to reassign bugs to another value -and to set another value as default for the field. diff --git a/docs/en/rst/administering/flags.rst b/docs/en/rst/administering/flags.rst deleted file mode 100644 index 8526f4f260..0000000000 --- a/docs/en/rst/administering/flags.rst +++ /dev/null @@ -1,155 +0,0 @@ -.. _flags-admin: - -Flags -##### - -If you have the :group:`editcomponents` permission, you can -edit Flag Types from the main administration page. Clicking the -:guilabel:`Flags` link will bring you to the :guilabel:`Administer -Flag Types` page. Here, you can select whether you want -to create (or edit) a Bug flag or an Attachment flag. - -The two flag types have the same administration interface, and the interface -for creating a flag and editing a flag have the same set of fields. - -.. _flags-edit: - -Flag Properties -=============== - -Name - This is the name of the flag. This will be displayed - to Bugzilla users who are looking at or setting the flag. - The name may contain any valid Unicode characters except commas - and spaces. - -Description - The description describes the flag in more detail. It is visible - in a tooltip when hovering over a flag either in the :guilabel:`Show Bug` - or :guilabel:`Edit Attachment` pages. This field can be as - long as you like and can contain any character you want. - -Category - You can set a flag to be visible or not visible on any combination of - products and components. - - Default behavior for a newly created flag is to appear on all - products and all components, which is why ``__Any__:__Any__`` - is already entered in the :guilabel:`Inclusions` box. - If this is not your desired behavior, you must either set some - exclusions (for products on which you don't want the flag to appear), - or you must remove ``__Any__:__Any__`` from the :guilabel:`Inclusions` box - and define products/components specifically for this flag. - - To create an Inclusion, select a Product from the top drop-down box. - You may also select a specific component from the bottom drop-down box. - (Setting ``__Any__`` for Product translates to - "all the products in this Bugzilla". - Selecting ``__Any__`` in the Component field means - "all components in the selected product.") - Selections made, press :guilabel:`Include`, and your - Product/Component pairing will show up in the :guilabel:`Inclusions` box on the right. - - To create an Exclusion, the process is the same: select a Product from the - top drop-down box, select a specific component if you want one, and press - :guilabel:`Exclude`. The Product/Component pairing will show up in the - :guilabel:`Exclusions` box on the right. - - This flag *will* appear and *can* be set for any - products/components appearing in the :guilabel:`Inclusions` box - (or which fall under the appropriate ``__Any__``). - This flag *will not* appear (and therefore *cannot* be set) on - any products appearing in the :guilabel:`Exclusions` box. - *IMPORTANT: Exclusions override inclusions.* - - You may select a Product without selecting a specific Component, - but you cannot select a Component without a Product. If you do so, - Bugzilla will display an error message, even if all your products - have a component by that name. You will also see an error if you - select a Component that does not belong to the selected Product. - - *Example:* Let's say you have a product called - ``Jet Plane`` that has thousands of components. You want - to be able to ask if a problem should be fixed in the next model of - plane you release. We'll call the flag ``fixInNext``. - However, one component in ``Jet Plane`` is - called ``Pilot``, and it doesn't make sense to release a - new pilot, so you don't want to have the flag show up in that component. - So, you include ``Jet Plane:__Any__`` and you exclude - ``Jet Plane:Pilot``. - -Sort Key - Flags normally show up in alphabetical order. If you want them to - show up in a different order, you can use this key set the order on each flag. - Flags with a lower sort key will appear before flags with a higher - sort key. Flags that have the same sort key will be sorted alphabetically. - -Active - Sometimes you might want to keep old flag information in the - Bugzilla database but stop users from setting any new flags of this type. - To do this, uncheck :guilabel:`active`. Deactivated - flags will still show up in the UI if they are ``?``, ``+``, or ``-``, but - they may only be cleared (unset) and cannot be changed to a new value. - Once a deactivated flag is cleared, it will completely disappear from a - bug/attachment and cannot be set again. - -Requestable - New flags are, by default, "requestable", meaning that they - offer users the ``?`` option, as well as ``+`` - and ``-``. - To remove the ``?`` option, uncheck "requestable". - -Specifically Requestable - By default this box is checked for new flags, meaning that users may make - flag requests of specific individuals. Unchecking this box will remove the - text box next to a flag; if it is still requestable, then requests - cannot target specific users and are open to anyone (called a - request "to the wind" in Bugzilla). Removing this after specific - requests have been made will not remove those requests; that data will - stay in the database (though it will no longer appear to the user). - -Multiplicable - Any flag with :guilabel:`Multiplicable:guilabel:` set (default for new flags - is 'on') may be set more than once. After being set once, an unset flag - of the same type will appear below it with "addl." (short for - "additional") before the name. There is no limit to the number of - times a Multiplicable flags may be set on the same bug/attachment. - -CC List - If you want certain users to be notified every time this flag is - set to ``?``, ``-``, or ``+``, or is unset, add them here. This is a comma-separated - list of email addresses that need not be restricted to Bugzilla usernames. - -Grant Group - When this field is set to some given group, only users in the group - can set the flag to ``+`` and ``-``. This - field does not affect who can request or cancel the flag. For that, - see the :guilabel:`Request Group` field below. If this field - is left blank, all users can set or delete this flag. This field is - useful for restricting which users can approve or reject requests. - -Request Group - When this field is set to some given group, only users in the group - can request or cancel this flag. Note that this field has no effect - if the :guilabel:`Grant Group` field is empty. You can set the - value of this field to a different group, but both fields have to be - set to a group for this field to have an effect. - -.. _flags-delete: - -Deleting a Flag -=============== - -When you are at the :guilabel:`Administer Flag Types` screen, -you will be presented with a list of Bug flags and a list of Attachment -Flags. - -To delete a flag, click on the :guilabel:`Delete` link next to -the flag description. - -.. warning:: Once you delete a flag, it is *gone* from - your Bugzilla. All the data for that flag will be deleted. - Everywhere that flag was set, it will disappear, - and you cannot get that data back. If you want to keep flag data, - but don't want anybody to set any new flags or change current flags, - unset :guilabel:`active` in the flag Edit form. diff --git a/docs/en/rst/administering/groups.rst b/docs/en/rst/administering/groups.rst deleted file mode 100644 index a14bb689e9..0000000000 --- a/docs/en/rst/administering/groups.rst +++ /dev/null @@ -1,191 +0,0 @@ -.. _groups: - -Groups and Security -################### - -Groups allow for separating bugs into logical divisions. -Groups are typically used -to isolate bugs that should only be seen by certain people. For -example, a company might create a different group for each one of its customers -or partners. Group permissions could be set so that each partner or customer would -only have access to their own bugs. Or, groups might be used to create -variable access controls for different departments within an organization. -Another common use of groups is to associate groups with products, -creating isolation and access control on a per-product basis. - -Groups and group behaviors are controlled in several places: - -#. The group configuration page. To view or edit existing groups, or to - create new groups, access the "Groups" link from the "Administration" - page. This section of the manual deals primarily with the aspect of - group controls accessed on this page. - -#. Global configuration parameters. Bugzilla has several parameters - that control the overall default group behavior and restriction - levels. For more information on the parameters that control - group behavior globally, see :ref:`param-group-security`. - -#. Product association with groups. Most of the functionality of groups - and group security is controlled at the product level. Some aspects - of group access controls for products are discussed in this section, - but for more detail see :ref:`product-group-controls`. - -#. Group access for users. See :ref:`users-and-groups` for - details on how users are assigned group access. - -Group permissions are such that if a bug belongs to a group, only members -of that group can see the bug. If a bug is in more than one group, only -members of *all* the groups that the bug is in can see -the bug. For information on granting read-only access to certain people and -full edit access to others, see :ref:`product-group-controls`. - -.. note:: By default, bugs can also be seen by the Assignee, the Reporter, and - everyone on the CC List, regardless of whether or not the bug would - typically be viewable by them. Visibility to the Reporter and CC List can - be overridden (on a per-bug basis) by bringing up the bug, finding the - section that starts with ``Users in the roles selected below...`` - and un-checking the box next to either 'Reporter' or 'CC List' (or both). - -.. _create-groups: - -Creating Groups -=============== - -To create a new group, follow the steps below: - -#. Select the ``Administration`` link in the page footer, - and then select the ``Groups`` link from the - Administration page. - -#. A table of all the existing groups is displayed. Below the table is a - description of all the fields. To create a new group, select the - ``Add Group`` link under the table of existing groups. - -#. There are five fields to fill out. These fields are documented below - the form. Choose a name and description for the group. Decide whether - this group should be used for bugs (in all likelihood this should be - selected). Optionally, choose a regular expression that will - automatically add any matching users to the group, and choose an - icon that will help identify user comments for the group. The regular - expression can be useful, for example, to automatically put all users - from the same company into one group (if the group is for a specific - customer or partner). - - .. note:: If ``User RegExp`` is filled out, users whose email - addresses match the regular expression will automatically be - members of the group as long as their email addresses continue - to match the regular expression. If their email address changes - and no longer matches the regular expression, they will be removed - from the group. Versions 2.16 and older of Bugzilla did not automatically - remove users whose email addresses no longer matched the RegExp. - - .. warning:: If specifying a domain in the regular expression, end - the regexp with a "$". Otherwise, when granting access to - "@mycompany\\.com", access will also be granted to - 'badperson@mycompany.com.cracker.net'. Use the syntax, - '@mycompany\\.com$' for the regular expression. - -#. After the new group is created, it can be edited for additional options. - The "Edit Group" page allows for specifying other groups that should be included - in this group and which groups should be permitted to add and delete - users from this group. For more details, see :ref:`edit-groups`. - -.. _edit-groups: - -Editing Groups and Assigning Group Permissions -============================================== - -To access the "Edit Groups" page, select the -``Administration`` link in the page footer, -and then select the ``Groups`` link from the Administration page. -A table of all the existing groups is displayed. Click on a group name -you wish to edit or control permissions for. - -The "Edit Groups" page contains the same five fields present when -creating a new group. Below that are two additional sections, "Group -Permissions" and "Mass Remove". The "Mass Remove" option simply removes -all users from the group who match the regular expression entered. The -"Group Permissions" section requires further explanation. - -The "Group Permissions" section on the "Edit Groups" page contains four sets -of permissions that control the relationship of this group to other -groups. If the :param:`usevisibilitygroups` parameter is in use (see -:ref:`parameters`) two additional sets of permissions are displayed. -Each set consists of two select boxes. On the left, a select box -with a list of all existing groups. On the right, a select box listing -all groups currently selected for this permission setting (this box will -be empty for new groups). The way these controls allow groups to relate -to one another is called *inheritance*. -Each of the six permissions is described below. - -*Groups That Are a Member of This Group* - Members of any groups selected here will automatically have - membership in this group. In other words, members of any selected - group will inherit membership in this group. - -*Groups That This Group Is a Member Of* - Members of this group will inherit membership to any group - selected here. For example, suppose the group being edited is - an Admin group. If there are two products (Product1 and Product2) - and each product has its - own group (Group1 and Group2), and the Admin group - should have access to both products, - simply select both Group1 and Group2 here. - -*Groups That Can Grant Membership in This Group* - The members of any group selected here will be able add users - to this group, even if they themselves are not in this group. - -*Groups That This Group Can Grant Membership In* - Members of this group can add users to any group selected here, - even if they themselves are not in the selected groups. - -*Groups That Can See This Group* - Members of any selected group can see the users in this group. - This setting is only visible if the :param:`usevisibilitygroups` parameter - is enabled on the Bugzilla Configuration page. See - :ref:`parameters` for information on configuring Bugzilla. - -*Groups That This Group Can See* - Members of this group can see members in any of the selected groups. - This setting is only visible if the :param:`usevisibilitygroups` parameter - is enabled on the the Bugzilla Configuration page. See - :ref:`parameters` for information on configuring Bugzilla. - -.. _users-and-groups: - -Assigning Users to Groups -========================= - -A User can become a member of a group in several ways: - -#. The user can be explicitly placed in the group by editing - the user's profile. This can be done by accessing the "Users" page - from the "Administration" page. Use the search form to find the user - you want to edit group membership for, and click on their email - address in the search results to edit their profile. The profile - page lists all the groups and indicates if the user is a member of - the group either directly or indirectly. More information on indirect - group membership is below. For more details on User Administration, - see :ref:`users`. - -#. The group can include another group of which the user is - a member. This is indicated by square brackets around the checkbox - next to the group name in the user's profile. - See :ref:`edit-groups` for details on group inheritance. - -#. The user's email address can match the regular expression - that has been specified to automatically grant membership to - the group. This is indicated by "\*" around the check box by the - group name in the user's profile. - See :ref:`create-groups` for details on - the regular expression option when creating groups. - -Assigning Group Controls to Products -==================================== - -The primary functionality of groups is derived from the relationship of -groups to products. The concepts around segregating access to bugs with -product group controls can be confusing. For details and examples on this -topic, see :ref:`product-group-controls`. - diff --git a/docs/en/rst/administering/index.rst b/docs/en/rst/administering/index.rst deleted file mode 100644 index c478193231..0000000000 --- a/docs/en/rst/administering/index.rst +++ /dev/null @@ -1,26 +0,0 @@ -.. _administering: - -==================== -Administration Guide -==================== - -For those with :group:`admin` privileges, Bugzilla can be administered using -the :guilabel:`Administration` link in the header. The administrative -controls are divided into several sections: - -.. toctree:: - :maxdepth: 2 - - parameters - preferences - users - categorization - flags - custom-fields - field-values - workflow - groups - keywords - whining - quips - extensions diff --git a/docs/en/rst/administering/keywords.rst b/docs/en/rst/administering/keywords.rst deleted file mode 100644 index c0cc2afbd7..0000000000 --- a/docs/en/rst/administering/keywords.rst +++ /dev/null @@ -1,16 +0,0 @@ -.. _keywords: - -Keywords -######## - -The administrator can define keywords which can be used to tag and -categorize bugs. For example, the keyword "regression" is commonly used. -A company might have a policy stating all regressions -must be fixed by the next release—this keyword can make tracking those -bugs much easier. Keywords are global, rather than per product. - -Keywords can be created, edited, or deleted by clicking the "Keywords" -link in the admin page. There are two fields for each keyword—the keyword -itself and a brief description. Currently keywords cannot be marked obsolete -to prevent future usage. - diff --git a/docs/en/rst/administering/parameters.rst b/docs/en/rst/administering/parameters.rst deleted file mode 100644 index cf647e5ee8..0000000000 --- a/docs/en/rst/administering/parameters.rst +++ /dev/null @@ -1,688 +0,0 @@ -.. _parameters: - -Parameters -########## - -Bugzilla is configured by changing various parameters, accessed -from the :guilabel:`Parameters` link, which is found on the Administration -page. The parameters are divided into several categories, -accessed via the menu on the left. - -.. _param-required-settings: - -General -======= - -maintainer - Email address of the person - responsible for maintaining this Bugzilla installation. - The address need not be that of a valid Bugzilla account. - -utf8 - Use UTF-8 (Unicode) encoding for all text in Bugzilla. Installations where - this parameter is set to :paramval:`off` should set it to :paramval:`on` only - after the data has been converted from existing legacy character - encodings to UTF-8, using the - :file:`contrib/recode.pl` script. - - .. note:: If you turn this parameter from :paramval:`off` to :paramval:`on`, - you must re-run :file:`checksetup.pl` immediately afterward. - -announcehtml - Any text in this field will be displayed at the top of every HTML page in - this Bugzilla installation. The text is not wrapped in any tags. For best - results, wrap the text in a ``

`` tag. Any style attributes from the CSS - can be applied. ``

`` makes the text red. - -upgrade_notification - Enable or disable a notification on the homepage of this Bugzilla - installation when a newer version of Bugzilla is available. This - notification is only visible to administrators. Choose :paramval:`disabled` - to turn off the notification. Otherwise, choose which version of - Bugzilla you want to be notified about: :paramval:`development_snapshot` is the - latest release from the master branch, :paramval:`latest_stable_release` is the most - recent release available on the most recent stable branch, and - :paramval:`stable_branch_release` is the most recent release on the branch - this installation is based on. - -.. _param-administrative-policies: - -Administrative Policies -======================= - -This page contains parameters for basic administrative functions. -Options include whether to allow the deletion of bugs and users, -and whether to allow users to change their email address. - -allowbugdeletion - The pages to edit products and components can delete all associated bugs when you delete a product (or component). Since that is a pretty scary idea, you have to turn on this option before any such deletions will ever happen. - -allowemailchange - Users can change their own email address through the preferences. Note that the change is validated by emailing both addresses, so switching this option on will not let users use an invalid address. - -allowuserdeletion - The user editing pages are capable of letting you delete user accounts. Bugzilla will issue a warning in case you'd run into inconsistencies when you're about to do so, but such deletions still remain scary. So, you have to turn on this option before any such deletions will ever happen. - -last_visit_keep_days - This option controls how many days Bugzilla will remember that users have visited specific bugs. - -.. _param-user-authentication: - -User Authentication -=================== - -This page contains the settings that control how this Bugzilla -installation will do its authentication. Choose what authentication -mechanism to use (the Bugzilla database, or an external source such -as LDAP), and set basic behavioral parameters. For example, choose -whether to require users to login to browse bugs, the management -of authentication cookies, and the regular expression used to -validate email addresses. Some parameters are highlighted below. - -allow_account_creation - Allow new accounts to be created. If off, only administrators can create accounts. - -auth_env_id - Environment variable used by external authentication system to store a unique identifier for each user. Leave it blank if there isn't one or if this method of authentication is not being used. - -auth_env_email - Environment variable used by external authentication system to store each user's email address. This is a required field for environmental authentication. Leave it blank if you are not going to use this feature. - -auth_env_realname - Environment variable used by external authentication system to store the user's real name. Leave it blank if there isn't one or if this method of authentication is not being used. - -user_info_class - Mechanism(s) to be used for gathering a user's login information. More than one may be selected. If the first one returns nothing, the second is tried, and so on. The types are: - - * :paramval:`CGI`: asks for username and password via CGI form interface. - * :paramval:`Env`: info for a pre-authenticated user is passed in system environment variables. - -user_verify_class - Mechanism(s) to be used for verifying (authenticating) information gathered by user_info_class. More than one may be selected. If the first one cannot find the user, the second is tried, and so on. The types are: - - * :paramval:`DB`: Bugzilla's built-in authentication. This is the most common choice. - * :paramval:`RADIUS`: RADIUS authentication using a RADIUS server. Using this method requires additional parameters to be set. Please see :ref:`param-radius` for more information. - * :paramval:`LDAP`: LDAP authentication using an LDAP server. Using this method requires additional parameters to be set. Please see :ref:`param-ldap` for more information. - -rememberlogin - Controls management of session cookies. - - * :paramval:`on` - Session cookies never expire (the user has to login only once per browser). - * :paramval:`off` - Session cookies last until the users session ends (the user will have to login in each new browser session). - * :paramval:`defaulton`/:paramval:`defaultoff` - Default behavior as described above, but user can choose whether Bugzilla will remember their login or not. - -requirelogin - If this option is set, all access to the system beyond the front page will require a login. No anonymous users will be permitted. - -webservice_email_filter - Filter email addresses returned by the WebService API depending on if the user is logged in or not. This works similarly to how the web UI currently filters email addresses. If requirelogin is enabled, then this parameter has no effect as users must be logged in to use Bugzilla anyway. - -emailregexp - Defines the regular expression used to validate email addresses - used for login names. The default attempts to match fully - qualified email addresses (i.e. 'user\@example.com') in a slightly - more restrictive way than what is allowed in RFC 2822. - Another popular value to put here is :paramval:`^[^@]+`, which means 'local usernames, no @ allowed.' - -emailregexpdesc - This description is shown to the user to explain which email addresses are allowed by the :param:`emailregexp` param. - -emailsuffix - This is a string to append to any email addresses when actually sending mail to that address. It is useful if you have changed the :param:`emailregexp` param to only allow local usernames, but you want the mail to be delivered to username\@my.local.hostname. - -password_complexity - Set the complexity required for passwords. In all cases must the passwords be at least 6 characters long. - - * :paramval:`no_constraints` - No complexity required. - * :paramval:`bmo` - Passwords must contain at least one letter, a number and a special character. - -password_check_on_login - If set, Bugzilla will check that the password meets the current complexity rules and minimum length requirements when the user logs into the Bugzilla web interface. If it doesn't, the user would not be able to log in, and will receive a message to reset their password. - -.. _param-attachments: - -Attachments -=========== - -This page allows for setting restrictions and other parameters -regarding attachments to bugs. For example, control size limitations -and whether to allow pointing to external files via a URI. - -allow_attachment_display - If this option is on, users will be able to view attachments from their browser, if their browser supports the attachment's MIME type. If this option is off, users are forced to download attachments, even if the browser is able to display them. - - If you do not trust your users (e.g. if your Bugzilla is public), you should either leave this option off, or configure and set the attachment_base localconfig variable. Untrusted users may upload attachments that could be potentially damaging if viewed directly in the browser. - -allow_attachment_deletion - If this option is on, administrators will be able to delete the contents - of attachments (i.e. replace the attached file with a 0 byte file), - leaving only the metadata. - -maxattachmentsize - The maximum size (in kilobytes) of attachments to be stored in the database. If a file larger than this size is attached to a bug, Bugzilla will look at the :param:`maxlocalattachment` parameter to determine if the file can be stored locally on the web server. If the file size exceeds both limits, then the attachment is rejected. Setting both parameters to 0 will prevent attaching files to bugs. - - Some databases have default limits which prevent storing larger attachments in the database. E.g. MySQL has a parameter called `max_allowed_packet `_, whose default varies by distribution. Setting :param:`maxattachmentsize` higher than your current setting for this value will produce an error. - -maxlocalattachment - The maximum size (in megabytes) of attachments to be stored locally on the web server. If set to a value lower than the :param:`maxattachmentsize` parameter, attachments will never be kept on the local filesystem. - - Whether you use this feature or not depends on your environment. Reasons to store some or all attachments as files might include poor database performance for large binary blobs, ease of backup/restore/browsing, or even filesystem-level deduplication support. However, you need to be aware of any limits on how much data your webserver environment can store. If in doubt, leave the value at 0. - - Note that changing this value does not affect any already-submitted attachments. - -.. _param-bug-change-policies: - -Bug Change Policies -=================== - -Set policy on default behavior for bug change events. For example, -choose which status to set a bug to when it is marked as a duplicate, -and choose whether to allow bug reporters to set the priority or -target milestone. Also allows for configuration of what changes -should require the user to make a comment, described below. - -duplicate_or_move_bug_status - When a bug is marked as a duplicate of another one, use this bug status. - -letsubmitterchoosepriority - If this is on, then people submitting bugs can choose an initial priority for that bug. If off, then all bugs initially have the default priority selected here. - -letsubmitterchoosemilestone - If this is on, then people submitting bugs can choose the Target Milestone for that bug. If off, then all bugs initially have the default milestone for the product being filed in. - -musthavemilestoneonaccept - If you are using Target Milestone, do you want to require that the milestone be set in order for a user to set a bug's status to IN_PROGRESS? - -commenton* - All these fields allow you to dictate what changes can pass - without comment and which must have a comment from the - person who changed them. Often, administrators will allow - users to add themselves to the CC list, accept bugs, or - change the Status Whiteboard without adding a comment as to - their reasons for the change, yet require that most other - changes come with an explanation. - Set the "commenton" options according to your site policy. It - is a wise idea to require comments when users resolve, reassign, or - reopen bugs at the very least. - - .. note:: It is generally far better to require a developer comment - when resolving bugs than not. Few things are more annoying to bug - database users than having a developer mark a bug "fixed" without - any comment as to what the fix was (or even that it was truly - fixed!) - -noresolveonopenblockers - This option will prevent users from resolving bugs as FIXED if - they have unresolved dependencies. Only the FIXED resolution - is affected. Users will be still able to resolve bugs to - resolutions other than FIXED if they have unresolved dependent - bugs. - -.. _param-bugfields: - -Bug Fields -========== - -The parameters in this section determine the default settings of -several Bugzilla fields for new bugs and whether -certain fields are used. For example, choose whether to use the -:field:`Target Milestone` field or the :field:`Status Whiteboard` field. - -useclassification - If this is on, Bugzilla will associate each product with a specific - classification. But you must have :group:`editclassification` permissions - enabled in order to edit classifications. - -usetargetmilestone - Do you wish to use the :field:`Target Milestone` field? - -useqacontact - This allows you to define an email address for each component, - in addition to that of the default assignee, that will be sent - carbon copies of incoming bugs. - -usestatuswhiteboard - This defines whether you wish to have a free-form, overwritable field - associated with each bug. The advantage of the :field:`Status Whiteboard` - is that it can be deleted or modified with ease and provides an - easily searchable field for indexing bugs that have some trait in - common. - -use_regression_fields - Do you wish to use the :field:`Regressions` and :field:`Regressed by` - fields? These allow you to efficiently track software regressions, - which might previously be managed using the :field:`Depends on` and - :field:`Blocks` fields along with the “regression” keyword. - -use_see_also - Do you wish to use the :field:`See Also` field? It allows you mark bugs - in other bug tracker installations as being related. Disabling this field - prevents addition of new relationships, but existing ones will continue to - appear. - -require_bug_type - If this is on, users are asked to choose a type when they file a new bug. - -default_bug_type - This is the type that newly entered bugs are set to. - -defaultpriority - This is the priority that newly entered bugs are set to. - -defaultseverity - This is the severity that newly entered bugs are set to. - -defaultplatform - This is the platform that is preselected on the bug entry form. - You can leave this empty; Bugzilla will then use the platform that the - browser is running on as the default. - -defaultopsys - This is the operating system that is preselected on the bug entry form. - You can leave this empty; Bugzilla will then use the operating system - that the browser reports to be running on as the default. - -collapsed_comment_tags - A comma-separated list of tags which, when applied to comments, will - cause them to be collapsed by default. - -last_change_time_non_bot_skip_list - List of user accounts to skip when calculating last changed by a person timestamp. - -.. _param-group-security: - -Group Security -============== - -Bugzilla allows for the creation of different groups, with the -ability to restrict the visibility of bugs in a group to a set of -specific users. Specific products can also be associated with -groups, and users restricted to only see products in their groups. -Several parameters are described in more detail below. Most of the -configuration of groups and their relationship to products is done -on the :guilabel:`Groups` and :guilabel:`Product` pages of the -:guilabel:`Administration` area. -The options on this page control global default behavior. -For more information on Groups and Group Security, see -:ref:`groups`. - -makeproductgroups - Determines whether or not to automatically create groups - when new products are created. If this is on, the groups will be - used for querying bugs. - - .. todo:: This is spectacularly unclear. I have no idea what makeproductgroups - does - can someone explain it to me? Convert this item into a bug on checkin. - -chartgroup - The name of the group of users who can use the 'New Charts' feature. Administrators should ensure that the public categories and series definitions do not divulge confidential information before enabling this for an untrusted population. If left blank, no users will be able to use New Charts. - -insidergroup - The name of the group of users who can see/change private comments and attachments. - -timetrackinggroup - The name of the group of users who can see/change time tracking information. - -querysharegroup - The name of the group of users who are allowed to share saved - searches with one another. For more information on using - saved searches, see :ref:`saved-searches`. - -comment_taggers_group - The name of the group of users who can tag comments. Setting this to empty disables comment tagging. - -debug_group - The name of the group of users who can view the actual SQL query generated when viewing bug lists and reports. Do not expose this information to untrusted users. - -usevisibilitygroups - If selected, user visibility will be restricted to members of - groups, as selected in the group configuration settings. - Each user-defined group can be allowed to see members of selected - other groups. - For details on configuring groups (including the visibility - restrictions) see :ref:`edit-groups`. - -or_groups - Define the visibility of a bug which is in multiple groups. If - this is on (recommended), a user only needs to be a member of one - of the bug's groups in order to view it. If it is off, a user - needs to be a member of all the bug's groups. Note that in either - case, a user's role on the bug (e.g. reporter), if any, may also - affect their permissions. - -.. _param-ldap: - -LDAP -==== - -LDAP authentication is a module for Bugzilla's plugin -authentication architecture. This page contains all the parameters -necessary to configure Bugzilla for use with LDAP authentication. - -The existing authentication -scheme for Bugzilla uses email addresses as the primary user ID and a -password to authenticate that user. All places within Bugzilla that -require a user ID (e.g. assigning a bug) use the email -address. The LDAP authentication builds on top of this scheme, rather -than replacing it. The initial log-in is done with a username and -password for the LDAP directory. Bugzilla tries to bind to LDAP using -those credentials and, if successful, tries to map this account to a -Bugzilla account. If an LDAP mail attribute is defined, the value of this -attribute is used; otherwise, the :param:`emailsuffix` parameter is appended to -the LDAP username to form a full email address. If an account for this address -already exists in the Bugzilla installation, it will log in to that account. -If no account for that email address exists, one is created at the time -of login. (In this case, Bugzilla will attempt to use the "displayName" -or "cn" attribute to determine the user's full name.) After -authentication, all other user-related tasks are still handled by email -address, not LDAP username. For example, bugs are still assigned by -email address and users are still queried by email address. - -.. warning:: Because the Bugzilla account is not created until the first time - a user logs in, a user who has not yet logged is unknown to Bugzilla. - This means they cannot be used as an assignee or QA contact (default or - otherwise), added to any CC list, or any other such operation. One - possible workaround is the :file:`bugzilla_ldapsync.rb` - script in the :file:`contrib` - directory. Another possible solution is fixing :bug:`201069`. - -Parameters required to use LDAP Authentication: - -user_verify_class (in the Authentication section) - If you want to list :paramval:`LDAP` here, - make sure to have set up the other parameters listed below. - Unless you have other (working) authentication methods listed as - well, you may otherwise not be able to log back in to Bugzilla once - you log out. - If this happens to you, you will need to manually set - :param:`user_verify_class` to :paramval:`DB` in the database. - -LDAPserver - This parameter should be set to the name (and optionally the - port) of your LDAP server. If no port is specified, it assumes - the default LDAP port of 389. - For example: :paramval:`ldap.company.com` - or :paramval:`ldap.company.com:3268` - You can also specify a LDAP URI, so as to use other - protocols, such as LDAPS or LDAPI. If the port was not specified in - the URI, the default is either 389 or 636 for 'LDAP' and 'LDAPS' - schemes respectively. - - .. note:: In order to use SSL with LDAP, specify a URI with "ldaps://". - This will force the use of SSL over port 636. - For example, normal LDAP :paramval:`ldap://ldap.company.com`, LDAP over - SSL :paramval:`ldaps://ldap.company.com`, or LDAP over a UNIX - domain socket :paramval:`ldapi://%2fvar%2flib%2fldap_sock`. - -LDAPstarttls - Whether to require encrypted communication once a normal LDAP connection - is achieved with the server. - -LDAPbinddn [Optional] - Some LDAP servers will not allow an anonymous bind to search - the directory. If this is the case with your configuration you - should set the :param:`LDAPbinddn` parameter to the user account Bugzilla - should use instead of the anonymous bind. - Ex. :paramval:`cn=default,cn=user:password` - -LDAPBaseDN - The location in - your LDAP tree that you would like to search for email addresses. - Your uids should be unique under the DN specified here. - Ex. :paramval:`ou=People,o=Company` - -LDAPuidattribute - The attribute - which contains the unique UID of your users. The value retrieved - from this attribute will be used when attempting to bind as the - user to confirm their password. - Ex. :paramval:`uid` - -LDAPmailattribute - The name of the - attribute which contains the email address your users will enter - into the Bugzilla login boxes. - Ex. :paramval:`mail` - -LDAPfilter - LDAP filter to AND with the LDAPuidattribute for filtering the list of - valid users. - -.. _param-radius: - -RADIUS -====== - -RADIUS authentication is a module for Bugzilla's plugin -authentication architecture. This page contains all the parameters -necessary for configuring Bugzilla to use RADIUS authentication. - -.. note:: Most caveats that apply to LDAP authentication apply to RADIUS - authentication as well. See :ref:`param-ldap` for details. - -Parameters required to use RADIUS Authentication: - -user_verify_class (in the Authentication section) - If you want to list :paramval:`RADIUS` here, - make sure to have set up the other parameters listed below. - Unless you have other (working) authentication methods listed as - well, you may otherwise not be able to log back in to Bugzilla once - you log out. - If this happens to you, you will need to manually set - :param:`user_verify_class` to :paramval:`DB` in the database. - -RADIUS_server - The name (and optionally the port) of your RADIUS server. - -RADIUS_secret - The RADIUS server's secret. - -RADIUS_NAS_IP - The NAS-IP-Address attribute to be used when exchanging data with your - RADIUS server. If unspecified, 127.0.0.1 will be used. - -RADIUS_email_suffix - Bugzilla needs an email address for each user account. - Therefore, it needs to determine the email address corresponding - to a RADIUS user. - Bugzilla offers only a simple way to do this: it can concatenate - a suffix to the RADIUS user name to convert it into an email - address. - You can specify this suffix in the :param:`RADIUS_email_suffix` parameter. - If this simple solution does not work for you, you'll - probably need to modify - :file:`Bugzilla/Auth/Verify/RADIUS.pm` to match your - requirements. - -.. _param-email: - -Email -===== - -This page contains all of the parameters for configuring how -Bugzilla deals with the email notifications it sends. See below -for a summary of important options. - -mail_delivery_method - This is used to specify how email is sent, or if it is sent at - all. There are several options included for different MTAs, - along with two additional options that disable email sending. - :paramval:`Test` does not send mail, but instead saves it in - :file:`data/mailer.testfile` for later review. - :paramval:`None` disables email sending entirely. - -mailfrom - This is the email address that will appear in the "From" field - of all emails sent by this Bugzilla installation. Some email - servers require mail to be from a valid email address; therefore, - it is recommended to choose a valid email address here. - -use_mailer_queue - In a large Bugzilla installation, updating bugs can be very slow because Bugzilla sends all email at once. If you enable this parameter, Bugzilla will queue all mail and then send it in the background. This requires that you have installed certain Perl modules (as listed by :file:`checksetup.pl` for this feature), and that you are running the :file:`jobqueue.pl` daemon (otherwise your mail won't get sent). This affects all mail sent by Bugzilla, not just bug updates. - -smtpserver - The SMTP server address, if the :param:`mail_delivery_method` - parameter is set to :paramval:`SMTP`. Use :paramval:`localhost` if you have a local MTA - running; otherwise, use a remote SMTP server. Append ":" and the port - number if a non-default port is needed. - -smtp_username - Username to use for SASL authentication to the SMTP server. Leave - this parameter empty if your server does not require authentication. - -smtp_password - Password to use for SASL authentication to the SMTP server. This - parameter will be ignored if the :param:`smtp_username` - parameter is left empty. - -smtp_ssl - Enable SSL support for connection to the SMTP server. - -smtp_debug - This parameter allows you to enable detailed debugging output. - Log messages are printed the web server's error log. - -whinedays - Set this to the number of days you want to let bugs go - in the CONFIRMED state before notifying people they have - untouched new bugs. If you do not plan to use this feature, simply - do not set up the :ref:`whining cron job ` described - in the installation instructions, or set this value to "0" (never whine). - -globalwatchers - This allows you to define specific users who will - receive notification each time any new bug in entered, or when - any existing bug changes, subject to the normal groupset - permissions. It may be useful for sending notifications to a - mailing list, for instance. - -.. _param-querydefaults: - -Query Defaults -============== - -This page controls the default behavior of Bugzilla in regards to -several aspects of querying bugs. Options include what the default -query options are, what the "My Bugs" page returns, whether users -can freely add bugs to the quip list, and how many duplicate bugs are -needed to add a bug to the "most frequently reported" list. - -quip_list_entry_control - Controls how easily users can add entries to the quip list. - - * :paramval:`open` - Users may freely add to the quip list, and their entries will immediately be available for viewing. - * :paramval:`moderated` - Quips can be entered but need to be approved by a moderator before they will be shown. - * :paramval:`closed` - No new additions to the quips list are allowed. - -mybugstemplate - This is the URL to use to bring up a simple 'all of my bugs' list - for a user. %userid% will get replaced with the login name of a - user. Special characters must be URL encoded. - -defaultquery - This is the default query that initially comes up when you access - the advanced query page. It's in URL-parameter format. - -search_allow_no_criteria - When turned off, a query must have some criteria specified to limit the number of bugs returned to the user. When turned on, a user is allowed to run a query with no criteria and get all bugs in the entire installation that they can see. Turning this parameter on is not recommended on large installations. - -default_search_limit - By default, Bugzilla limits searches done in the web interface to returning only this many results, for performance reasons. (This only affects the HTML format of search results—CSV, XML, and other formats are exempted.) Users can click a link on the search result page to see all the results. - - Usually you should not have to change this—the default value should be acceptable for most installations. - -max_search_results - The maximum number of bugs that a search can ever return. Tabular and graphical reports are exempted from this limit, however. - - - -.. _param-shadowdatabase: - -Shadow Database -=============== - -This page controls whether a shadow database is used. If your Bugzilla is -not large, you will not need these options. - -A standard large database setup involves a single master server and a pool of -read-only slaves (which Bugzilla calls the "shadowdb"). Queries which are not -updating data can be directed to the slave pool, removing the load/locking -from the master, freeing it up to handle writes. Bugzilla will switch to the -shadowdb when it knows it doesn't need to update the database (e.g. when -searching, or displaying a bug to a not-logged-in user). - -Bugzilla does not make sure the shadowdb is kept up to date, so, if you use -one, you will need to set up replication in your database server. - -If your shadowdb is on a different machine, specify :param:`shadowdbhost` -and :param:`shadowdbport`. If it's on the same machine, specify -:param:`shadowdbsock`. - -shadowdbhost - The host the shadow database is on. - -shadowdbport - The port the shadow database is on. - -shadowdbsock - The socket used to connect to the shadow database, if the host is the - local machine. - -shadowdb - The database name of the shadow database. - -.. _admin-usermatching: - -User Matching -============= - -The settings on this page control how users are selected and queried -when adding a user to a bug. For example, users need to be selected -when assigning the bug, adding to the CC list, or -selecting a QA contact. With the :param:`usemenuforusers` parameter, it is -possible to configure Bugzilla to -display a list of users in the fields instead of an empty text field. -If users are selected via a text box, this page also -contains parameters for how user names can be queried and matched -when entered. - -usemenuforusers - If this option is set, Bugzilla will offer you a list to select from (instead of a text entry field) where a user needs to be selected. This option should not be enabled on sites where there are a large number of users. - -ajax_user_autocompletion - If this option is set, typing characters in a certain user fields - will display a list of matches that can be selected from. It is - recommended to only turn this on if you are using mod_perl; - otherwise, the response will be irritatingly slow. - -maxusermatches - Provide no more than this many matches when a user is searched for. - If set to '1', no users will be displayed on ambiguous - matches. This is useful for user-privacy purposes. A value of zero - means no limit. - -confirmuniqueusermatch - Whether a confirmation screen should be displayed when only one user matches a search entry. - -.. _admin-advanced: - -Advanced -======== - -inbound_proxies - When inbound traffic to Bugzilla goes through a proxy, Bugzilla thinks that the IP address of the proxy is the IP address of every single user. If you enter a comma-separated list of IPs in this parameter, then Bugzilla will trust any ``X-Forwarded-For`` header sent from those IPs, and use the value of that header as the end user's IP address. - -proxy_url - If this Bugzilla installation is behind a proxy, enter the proxy - information here to enable Bugzilla to access the Internet. Bugzilla - requires Internet access to utilize the - :param:`upgrade_notification` parameter. If the - proxy requires authentication, use the syntax: - :paramval:`http://user:pass@proxy_url/`. - -strict_transport_security - Enables the sending of the Strict-Transport-Security header along with HTTP responses on SSL connections. This adds greater security to your SSL connections by forcing the browser to always access your domain over SSL and never accept an invalid certificate. However, it should only be used if you have the :param:`ssl_redirect` parameter turned on, Bugzilla is the only thing running on its domain (i.e., your :param:`urlbase` is something like :paramval:`http://bugzilla.example.com/`), and you never plan to stop supporting SSL. - - * :paramval:`off` - Don't send the Strict-Transport-Security header with requests. - * :paramval:`this_domain_only` - Send the Strict-Transport-Security header with all requests, but only support it for the current domain. - * :paramval:`include_subdomains` - Send the Strict-Transport-Security header along with the includeSubDomains flag, which will apply the security change to all subdomains. This is especially useful when combined with an :param:`attachment_base` that exists as (a) subdomain(s) under the main Bugzilla domain. diff --git a/docs/en/rst/administering/preferences.rst b/docs/en/rst/administering/preferences.rst deleted file mode 100644 index 0b89c7b13e..0000000000 --- a/docs/en/rst/administering/preferences.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. _default-preferences: - -Default Preferences -################### - -Each user of Bugzilla can set certain preferences about how they want -Bugzilla to behave. Here, you can say whether or not each of the possible -preferences is available to the user and, if it is, what the default value -is. - diff --git a/docs/en/rst/administering/quips.rst b/docs/en/rst/administering/quips.rst deleted file mode 100644 index 789304a33a..0000000000 --- a/docs/en/rst/administering/quips.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. _quips: - -Quips -##### - -Quips are small user-defined messages (often quotes or witty sayings) that -can be configured to appear at the top of search results. Each Bugzilla -installation has its own specific quips. Whenever a quip needs to be -displayed, a random selection is made from the pool of already existing quips. - -Quip submission is controlled by :param:`quip_list_entry_control` -parameter. It has several possible values: open, moderated, or closed. -In order to enable quips approval you need to set this parameter to -"moderated". In this way, users are free to submit quips for addition, -but an administrator must explicitly approve them before they are -actually used. - -In order to see the user interface for the quips, you can -click on a quip when it is displayed together with the search -results. You can also go directly to the quips.cgi URL -(prefixed with the usual web location of the Bugzilla installation). -Once the quip interface is displayed, the "view and edit the whole -quip list" link takes you to the quips administration page, which -lists all quips available in the database. - -Next to each quip there is a checkbox, under the -"Approved" column. Quips that have this checkbox checked are -already approved and will appear next to the search results. -The ones that have it unchecked are still preserved in the -database but will not appear on search results pages. -User submitted quips have initially the checkbox unchecked. - -Also, there is a delete link next to each quip, -which can be used in order to permanently delete a quip. - -Display of quips is controlled by the *display_quips* -user preference. Possible values are "on" and "off". - diff --git a/docs/en/rst/administering/users.rst b/docs/en/rst/administering/users.rst deleted file mode 100644 index 0736640246..0000000000 --- a/docs/en/rst/administering/users.rst +++ /dev/null @@ -1,246 +0,0 @@ -.. _users: - -Users -##### - -.. _defaultuser: - -Creating Admin Users -==================== - -When you first run checksetup.pl after installing Bugzilla, it will -prompt you for the username (email address) and password for the first -admin user. If for some reason you delete all the admin users, -re-running checksetup.pl will again prompt you for a username and -password and make a new admin. - -If you wish to add more administrative users, add them to the "admin" group. - -.. _user-account-search: - -Searching For Users -=================== - -If you have ``editusers`` privileges or if you are allowed -to grant privileges for some groups, the :guilabel:`Users` link -will appear in the Administration page. - -The first screen is a search form to search for existing user -accounts. You can run searches based either on the user ID, real -name or login name (i.e. the email address, or just the first part -of the email address if the :param:`emailsuffix` parameter is set). -The search can be conducted -in different ways using the listbox to the right of the text entry -box. You can match by case-insensitive substring (the default), -regular expression, a *reverse* regular expression -match (which finds every user name which does NOT match the regular -expression), or the exact string if you know exactly who you are -looking for. The search can be restricted to users who are in a -specific group. By default, the restriction is turned off. - -The search returns a list of -users matching your criteria. User properties can be edited by clicking -the login name. The Account History of a user can be viewed by clicking -the "View" link in the Account History column. The Account History -displays changes that have been made to the user account, the time of -the change and the user who made the change. For example, the Account -History page will display details of when a user was added or removed -from a group. - -.. _modifyusers: - -Modifying Users -=============== - -Once you have found your user, you can change the following -fields: - -- *Login Name*: - This is generally the user's full email address. However, if you - have are using the :param:`emailsuffix` parameter, this may - just be the user's login name. Unless you turn off the - :param:`allowemailchange` parameter, users can change their - login names themselves (to any valid email address). - -- *Real Name*: The user's real name. Note that - Bugzilla does not require this to create an account. - -- *Password*: - You can change the user's password here. Users can automatically - request a new password, so you shouldn't need to do this often. - If you want to disable an account, see Disable Text below. - -- *Bugmail Disabled*: - Mark this checkbox to disable bugmail and whinemail completely - for this account. This checkbox replaces the data/nomail file - which existed in older versions of Bugzilla. - -- *Disable Text*: - If you type anything in this box, including just a space, the - user is prevented from logging in and from making any changes to - bugs via the web interface. - The HTML you type in this box is presented to the user when - they attempt to perform these actions and should explain - why the account was disabled. - Users with disabled accounts will continue to receive - mail from Bugzilla; furthermore, they will not be able - to log in themselves to change their own preferences and - stop it. If you want an account (disabled or active) to - stop receiving mail, simply check the - ``Bugmail Disabled`` checkbox above. - - .. note:: Even users whose accounts have been disabled can still - submit bugs via the email gateway, if one exists. - The email gateway should *not* be - enabled for secure installations of Bugzilla. - - .. warning:: Don't disable all the administrator accounts! - -- **: - If you have created some groups, e.g. "securitysensitive", then - checkboxes will appear here to allow you to add users to, or - remove them from, these groups. The first checkbox gives the - user the ability to add and remove other users as members of - this group. The second checkbox adds the user themselves as a member - of the group. - -- *canconfirm*: - This field is only used if you have enabled the "unconfirmed" - status. If you enable this for a user, - that user can then move bugs from "Unconfirmed" to a "Confirmed" - status (e.g.: "New" status). - -- *creategroups*: - This option will allow a user to create and destroy groups in - Bugzilla. - -- *editbugs*: - Unless a user has this bit set, they can only edit those bugs - for which they are the assignee or the reporter. Even if this - option is unchecked, users can still add comments to bugs. - -- *editcomponents*: - This flag allows a user to create new products and components, - modify existing products and components, and destroy those that have - no bugs associated with them. If a product or component has bugs - associated with it, those bugs must be moved to a different product - or component before Bugzilla will allow them to be destroyed. - -- *editkeywords*: - If you use Bugzilla's keyword functionality, enabling this - feature allows a user to create and destroy keywords. A keyword - must be removed from any bugs upon which it is currently set - before it can be destroyed. - -- *edittriageowners*: - This flag will allow a user to edit the triage owner values - of components. - -- *editusers*: - This flag allows a user to do what you're doing right now: edit - other users. This will allow those with the right to do so to - remove administrator privileges from other users or grant them to - themselves. Enable with care. - -- *tweakparams*: - This flag allows a user to change Bugzilla's Params - (using :file:`editparams.cgi`.) - -- **: - This allows an administrator to specify the products - in which a user can see bugs. If you turn on the - :param:`makeproductgroups` parameter in - the Group Security Panel in the Parameters page, - then Bugzilla creates one group per product (at the time you create - the product), and this group has exactly the same name as the - product itself. Note that for products that already exist when - the parameter is turned on, the corresponding group will not be - created. The user must still have the :group:`editbugs` - privilege to edit bugs in these products. - -.. _createnewusers: - -Creating New Users -================== - -.. _self-registration: - -Self-Registration ------------------ - -By default, users can create their own user accounts by clicking the -``New Account`` link at the bottom of each page (assuming -they aren't logged in as someone else already). If you want to disable -this self-registration, you have to edit the :param:`allow_account_creation` -parameter in the ``Configuration`` page; see :ref:`parameters`. - -.. _user-account-creation: - -Administrator Registration --------------------------- - -Users with ``editusers`` privileges, such as administrators, -can create user accounts for other users: - -#. After logging in, click the "Users" link at the footer of - the query page, and then click "Add a new user". - -#. Fill out the form presented. This page is self-explanatory. - When done, click "Submit". - - .. note:: Adding a user this way will *not* - send an email informing them of their username and password. - While useful for creating dummy accounts (watchers which - shuttle mail to another system, for instance, or email - addresses which are a mailing list), in general it is - preferable to log out and use the ``New Account`` - button to create users, as it will pre-populate all the - required fields and also notify the user of their account name - and password. - -.. _user-account-deletion: - -Deleting Users -============== - -If the :param:`allowuserdeletion` parameter is turned on (see -:ref:`parameters`) then you can also delete user accounts. -Note that, most of the time, this is not the best thing to do. If only -a warning in a yellow box is displayed, then the deletion is safe. -If a warning is also displayed in a red box, then you should NOT try -to delete the user account, else you will get referential integrity -problems in your database, which can lead to unexpected behavior, -such as bugs not appearing in bug lists anymore, or data displaying -incorrectly. You have been warned! - -.. _impersonatingusers: - -Impersonating Users -=================== - -There may be times when an administrator would like to do something as -another user. The :command:`sudo` feature may be used to do -this. - -.. note:: To use the sudo feature, you must be in the - *bz_sudoers* group. By default, all - administrators are in this group. - -If you have access to this feature, you may start a session by -going to the Edit Users page, Searching for a user and clicking on -their login. You should see a link below their login name titled -"Impersonate this user". Click on the link. This will take you -to a page where you will see a description of the feature and -instructions for using it. After reading the text, simply -enter the login of the user you would like to impersonate, provide -a short message explaining why you are doing this, and press the -button. - -As long as you are using this feature, everything you do will be done -as if you were logged in as the user you are impersonating. - -.. warning:: The user you are impersonating will not be told about what you are - doing. If you do anything that results in mail being sent, that - mail will appear to be from the user you are impersonating. You - should be extremely careful while using this feature. - diff --git a/docs/en/rst/administering/whining.rst b/docs/en/rst/administering/whining.rst deleted file mode 100644 index dc101ab9b8..0000000000 --- a/docs/en/rst/administering/whining.rst +++ /dev/null @@ -1,145 +0,0 @@ -.. _whining: - -Whining -####### - -Whining is a feature in Bugzilla that can regularly annoy users at -specified times. Using this feature, users can execute saved searches -at specific times (e.g. the 15th of the month at midnight) or at -regular intervals (e.g. every 15 minutes on Sundays). The results of the -searches are sent to the user, either as a single email or as one email -per bug, along with some descriptive text. - -.. warning:: Throughout this section it will be assumed that all users are members - of the bz_canusewhines group, membership in which is required in order - to use the Whining system. You can easily make all users members of - the bz_canusewhines group by setting the User RegExp to ".*" (without - the quotes). - - Also worth noting is the bz_canusewhineatothers group. Members of this - group can create whines for any user or group in Bugzilla using an - extended form of the whining interface. Features only available to - members of the bz_canusewhineatothers group will be noted in the - appropriate places. - -.. note:: For whining to work, a special Perl script must be executed at regular - intervals. More information on this is available in :ref:`installation-whining`. - -.. note:: This section does not cover the whineatnews.pl script. - See :ref:`installation-whining-cron` for more information on - The Whining Cron. - -.. _whining-overview: - -The Event -========= - -The whining system defines an "Event" as one or more queries being -executed at regular intervals, with the results of said queries (if -there are any) being emailed to the user. Events are created by -clicking on the "Add new event" button. - -Once a new event is created, the first thing to set is the "Email -subject line". The contents of this field will be used in the subject -line of every email generated by this event. In addition to setting a -subject, space is provided to enter some descriptive text that will be -included at the top of each message (to help you in understanding why -you received the email in the first place). - -The next step is to specify when the Event is to be run (the Schedule) -and what searches are to be performed (the Searches). - -.. _whining-schedule: - -Whining Schedule -================ - -Each whining event is associated with zero or more schedules. A -schedule is used to specify when the search (specified below) is to be -run. A new event starts out with no schedules (which means it will -never run, as it is not scheduled to run). To add a schedule, press -the "Add a new schedule" button. - -Each schedule includes an interval, which you use to tell Bugzilla -when the event should be run. An event can be run on certain days of -the week, certain days of the month, during weekdays (defined as -Monday through Friday), or every day. - -.. warning:: Be careful if you set your event to run on the 29th, 30th, or 31st of - the month, as your event may not run exactly when expected. If you - want your event to run on the last day of the month, select "Last day - of the month" as the interval. - -Once you have specified the day(s) on which the event is to be run, you -should now specify the time at which the event is to be run. You can -have the event run at a certain hour on the specified day(s), or -every hour, half-hour, or quarter-hour on the specified day(s). - -If a single schedule does not execute an event as many times as you -would want, you can create another schedule for the same event. For -example, if you want to run an event on days whose numbers are -divisible by seven, you would need to add four schedules to the event, -setting the schedules to run on the 7th, 14th, 21st, and 28th (one day -per schedule) at whatever time (or times) you choose. - -.. note:: If you are a member of the bz_canusewhineatothers group, then you - will be presented with another option: "Mail to". Using this you - can control who will receive the emails generated by this event. You - can choose to send the emails to a single user (identified by email - address) or a single group (identified by group name). To send to - multiple users or groups, create a new schedule for each additional - user/group. - -.. _whining-query: - -Whining Searches -================ - -Each whining event is associated with zero or more searches. A search -is any saved search to be run as part of the specified schedule (see -above). You start out without any searches associated with the event -(which means that the event will not run, as there will never be any -results to return). To add a search, press the "Add a search" button. - -The first field to examine in your newly added search is the Sort field. -Searches are run, and results included, in the order specified by the -Sort field. Searches with smaller Sort values will run before searches -with bigger Sort values. - -The next field to examine is the Search field. This is where you -choose the actual search that is to be run. Instead of defining search -parameters here, you are asked to choose from the list of saved -searches (the same list that appears at the bottom of every Bugzilla -page). You are only allowed to choose from searches that you have -saved yourself (the default saved search, "My Bugs", is not a valid -choice). If you do not have any saved searches, you can take this -opportunity to create one (see :ref:`list`). - -.. note:: When running searches, the whining system acts as if you are the user - executing the search. This means that the whining system will ignore - bugs that match your search but that you cannot access. - -Once you have chosen the saved search to be executed, give the search a -descriptive title. This title will appear in the email, above the -results of the search. If you choose "One message per bug", the search -title will appear at the top of each email that contains a bug matching -your search. - -Finally, decide if the results of the search should be sent in a single -email, or if each bug should appear in its own email. - -.. warning:: Think carefully before checking the "One message per bug" box. If - you create a search that matches thousands of bugs, you will receive - thousands of emails! - -Saving Your Changes -=================== - -Once you have defined at least one schedule and created at least one -search, go ahead and "Update/Commit". This will save your Event and make -it available for immediate execution. - -.. note:: If you ever feel like deleting your event, you may do so using the - "Remove Event" button in the upper-right corner of each Event. You - can also modify an existing event, so long as you "Update/Commit" - after completing your modifications. diff --git a/docs/en/rst/administering/workflow.rst b/docs/en/rst/administering/workflow.rst deleted file mode 100644 index 7ce5b7a87d..0000000000 --- a/docs/en/rst/administering/workflow.rst +++ /dev/null @@ -1,34 +0,0 @@ -.. _workflow: - -Workflow -######## - -The bug status workflow—which statuses are valid transitions from which -other statuses—can be customized. - -You need to begin by defining the statuses and resolutions you want to use -(see :ref:`field-values`). By convention, these are in all capital letters. - -Only one bug status, UNCONFIRMED, can never be renamed nor deleted. However, -it can be disabled entirely on a per-product basis (see :ref:`categorization`). -The status referred to by the :param:`duplicate_or_move_bug_status` parameter, if -set, is also undeletable. To make it deletable, -simply set the value of that parameter to a different status. - -Aside from the empty value, two resolutions, DUPLICATE and FIXED, cannot be -renamed or deleted. (FIXED could be if we fixed -`bug 1007605 `_.) - -Once you have defined your statuses, you can configure the workflow of -how a bug moves between them. The workflow configuration -page displays all existing bug statuses twice: first on the left for the -starting status, and on the top for the target status in the transition. -If the checkbox is checked, then the transition from the left to the top -status is legal; if it's unchecked, that transition is forbidden. - -The status used as the :param:`duplicate_or_move_bug_status` parameter -(normally RESOLVED or its equivalent) is required to be a legal transition -from every other bug status, and so this is enforced on the page. - -The "View Comments Required on Status Transitions" link below the table -lets you set which transitions require a comment from the user. diff --git a/docs/en/rst/api/core/v1/attachment.rst b/docs/en/rst/api/core/v1/attachment.rst deleted file mode 100644 index e45fc909d5..0000000000 --- a/docs/en/rst/api/core/v1/attachment.rst +++ /dev/null @@ -1,433 +0,0 @@ -Attachments -=========== - -The Bugzilla API for creating, changing, and getting the details of attachments. - -.. _rest_attachments: - -Get Attachment --------------- - -This allows you to get data about attachments, given a list of bugs and/or -attachment IDs. Private attachments will only be returned if you are in the -appropriate group or if you are the submitter of the attachment. - -**Request** - -To get all current attachments for a bug: - -.. code-block:: text - - GET /rest/bug/(bug_id)/attachment - -To get a specific attachment based on attachment ID: - -.. code-block:: text - - GET /rest/bug/attachment/(attachment_id) - -One of the below must be specified. - -================= ==== ====================================================== -name type description -================= ==== ====================================================== -**bug_id** int Integer bug ID. -**attachment_id** int Integer attachment ID. -================= ==== ====================================================== - -**Response** - -.. code-block:: js - - { - "bugs" : { - "1345" : [ - { (attachment) }, - { (attachment) } - ], - "9874" : [ - { (attachment) }, - { (attachment) } - ], - }, - "attachments" : { - "234" : { (attachment) }, - "123" : { (attachment) }, - } - } - -An object containing two elements: ``bugs`` and ``attachments``. - -The attachments for the bug that you specified in the ``bug_id`` argument in -input are returned in ``bugs`` on output. ``bugs`` is a object that has integer -bug IDs for keys and the values are arrays of objects as attachments. -(Fields for attachments are described below.) - -For the attachment that you specified directly in ``attachment_id``, they -are returned in ``attachments`` on output. This is a object where the attachment -ids point directly to objects describing the individual attachment. - -The fields for each attachment (where it says ``(attachment)`` in the -sample response above) are: - -================ ======== ===================================================== -name type description -================ ======== ===================================================== -data base64 The raw data of the attachment, encoded as Base64. -size int The length (in bytes) of the attachment. -creation_time datetime The time the attachment was created. -last_change_time datetime The last time the attachment was modified. -id int The numeric ID of the attachment. -bug_id int The numeric ID of the bug that the attachment is - attached to. -file_name string The file name of the attachment. -summary string A short string describing the attachment. -content_type string The MIME type of the attachment. -is_private boolean ``true`` if the attachment is private (only visible - to a certain group called the "insidergroup", - ``false`` otherwise. -is_obsolete boolean ``true`` if the attachment is obsolete, ``false`` - otherwise. -is_patch boolean ``true`` if the attachment is a patch, ``false`` - otherwise. -creator string The login name of the user that created the - attachment. -creator_detail object An object containing detailed user information for - the creator. To see the keys included in the user - detail object, see :ref:`rest_single_bug`. -flags array Array of objects, each containing the information - about the flag currently set for each attachment. - Each flag object contains items described in the - Flag object below. -================ ======== ===================================================== - -Flag object: - -================= ======== ==================================================== -name type description -================= ======== ==================================================== -id int The ID of the flag. -name string The name of the flag. -type_id int The type ID of the flag. -creation_date datetime The timestamp when this flag was originally created. -modification_date datetime The timestamp when the flag was last modified. -status string The current status of the flag such as ?, +, or -. -setter string The login name of the user who created or last - modified the flag. -requestee string The login name of the user this flag has been - requested to be granted or denied. Note, this field - is only returned if a requestee is set. -================= ======== ==================================================== - -**Errors** - -This method can throw all the same errors as :ref:`rest_single_bug`. In addition, -it can also throw the following error: - -* 304 (Auth Failure, Attachment is Private) - You specified the id of a private attachment in the "attachment_ids" - argument, and you are not in the "insider group" that can see - private attachments. - -.. _rest_add_attachment: - -Create Attachment ------------------ - -This allows you to add an attachment to a bug in Bugzilla. - -**Request** - -To create attachment on a current bug: - -.. code-block:: text - - POST /rest/bug/(bug_id)/attachment - -.. code-block:: js - - { - "ids" : [ 35 ], - "is_patch" : true, - "comment" : "This is a new attachment comment", - "summary" : "Test Attachment", - "content_type" : "text/plain", - "data" : "(Some base64 encoded content)", - "file_name" : "test_attachment.patch", - "obsoletes" : [], - "is_private" : false, - "flags" : [ - { - "name" : "review", - "status" : "?", - "requestee" : "user@bugzilla.org", - "new" : true - } - ] - } - - -The params to include in the POST body, as well as the returned -data format, are the same as below. The ``bug_id`` param will be -overridden as it it pulled from the URL path. - -================ ======= ====================================================== -name type description -================ ======= ====================================================== -**ids** array The IDs or aliases of bugs that you want to add this - attachment to. The same attachment and comment will be - added to all these bugs. -**data** base64 The content of the attachment. You must encode it in - base64 using an appropriate client library such as - ``MIME::Base64`` for Perl. -**file_name** string The "file name" that will be displayed in the UI for - this attachment and also downloaded copies will be - given. -**summary** string A short string describing the attachment. -**content_type** string The MIME type of the attachment, like ``text/plain`` - or ``image/png``. -comment string A comment to add along with this attachment. -is_markdown boolean If ``true``, the ``comment`` will be rendered as - Markdown. Defaults to the system ``use_markdown`` - setting. -is_patch boolean ``true`` if Bugzilla should treat this attachment as a - patch. If you specify this, you do not need to specify - a ``content_type``. The ``content_type`` of the - attachment will be forced to ``text/plain``. Defaults - to ``false`` if not specified. -is_private boolean ``true`` if the attachment should be private - (restricted to the "insidergroup"), ``false`` if the - attachment should be public. Defaults to ``false`` if - not specified. -flags array Flags objects to add to the attachment. The object - format is described in the Flag object below. -bug_flags array Flag objects to add to the attachment's bug. See the - ``flags`` param for :ref:`rest_create_bug` for the - object format. -================ ======= ====================================================== - -Flag object: - -To create a flag, at least the ``status`` and the ``type_id`` or ``name`` must -be provided. An optional requestee can be passed if the flag type is requestable -to a specific user. - -========= ====== ============================================================== -name type description -========= ====== ============================================================== -name string The name of the flag type. -type_id int The internal flag type ID. -status string The flags new status (i.e. "?", "+", "-" or "X" to clear a - flag). -requestee string The login of the requestee if the flag type is requestable to - a specific user. -========= ====== ============================================================== - -**Response** - -.. code-block:: js - - { - "ids" : [ - "2797" - ] - } - -==== ===== ========================= -name type description -==== ===== ========================= -ids array Attachment IDs created. -==== ===== ========================= - -**Errors** - -This method can throw all the same errors as :ref:`rest_single_bug`, plus: - -* 129 (Flag Status Invalid) - The flag status is invalid. -* 130 (Flag Modification Denied) - You tried to request, grant, or deny a flag but only a user with the required - permissions may make the change. -* 131 (Flag not Requestable from Specific Person) - You can't ask a specific person for the flag. -* 133 (Flag Type not Unique) - The flag type specified matches several flag types. You must specify - the type id value to update or add a flag. -* 134 (Inactive Flag Type) - The flag type is inactive and cannot be used to create new flags. -* 140 (Markdown Disabled) - You tried to set the "is_markdown" flag of the comment to true but the Markdown feature is not enabled. -* 600 (Attachment Too Large) - You tried to attach a file that was larger than Bugzilla will accept. -* 601 (Invalid MIME Type) - You specified a "content_type" argument that was blank, not a valid - MIME type, or not a MIME type that Bugzilla accepts for attachments. -* 603 (File Name Not Specified) - You did not specify a valid for the "file_name" argument. -* 604 (Summary Required) - You did not specify a value for the "summary" argument. -* 606 (Empty Data) - You set the "data" field to an empty string. - -.. _rest_update_attachment: - -Update Attachment ------------------ - -This allows you to update attachment metadata in Bugzilla. - -**Request** - -To update attachment metadata on a current attachment: - -.. code-block:: text - - PUT /rest/bug/attachment/(attachment_id) - -.. code-block:: js - - { - "ids" : [ 2796 ], - "summary" : "Test XML file", - "comment" : "Changed this from a patch to a XML file", - "content_type" : "text/xml", - "is_patch" : 0 - } - -================= ===== ======================================================= -name type description -================= ===== ======================================================= -**attachment_id** int Integer attachment ID. -**ids** array The IDs of the attachments you want to update. -================= ===== ======================================================= - -============ ======= ========================================================== -name type description -============ ======= ========================================================== -file_name string The "file name" that will be displayed in the UI for this - attachment. -summary string A short string describing the attachment. -comment string An optional comment to add to the attachment's bug. -is_markdown boolean If ``true``, the ``comment`` will be rendered as Markdown. - Defaults to the system ``use_markdown`` setting. -content_type string The MIME type of the attachment, like ``text/plain`` - or ``image/png``. -is_patch boolean ``true`` if Bugzilla should treat this attachment as a - patch. If you specify this, you do not need to specify a - ``content_type``. The ``content_type`` of the attachment - will be forced to ``text/plain``. -is_private boolean ``true`` if the attachment should be private (restricted - to the "insidergroup"), ``false`` if the attachment - should be public. -is_obsolete boolean ``true`` if the attachment is obsolete, ``false`` - otherwise. -flags array An array of Flag objects with changes to the flags. The - object format is described in the Flag object below. -bug_flags array An optional array of Flag objects with changes to the - flags of the attachment's bug. See the ``flags`` param - for :ref:`rest_update_bug` for the object format. -============ ======= ========================================================== - -Flag object: - -The following values can be specified. At least the ``status`` and one of -``type_id``, ``id``, or ``name`` must be specified. If a type_id or name matches -a single currently set flag, the flag will be updated unless ``new`` is specified. - -========= ======= ============================================================= -name type description -========= ======= ============================================================= -name string The name of the flag that will be created or updated. -type_id int The internal flag type ID that will be created or updated. - You will need to specify the ``type_id`` if more than one - flag type of the same name exists. -status string The flags new status (i.e. "?", "+", "-" or "X" to clear a - flag). -requestee string The login of the requestee if the flag type is requestable - to a specific user. -id int Use ID to specify the flag to be updated. You will need to - specify the ``id`` if more than one flag is set of the same - name. -new boolean Set to true if you specifically want a new flag to be - created. -========= ======= ============================================================= - -**Response** - -.. code-block:: js - - { - "attachments" : [ - { - "changes" : { - "content_type" : { - "added" : "text/xml", - "removed" : "text/plain" - }, - "is_patch" : { - "added" : "0", - "removed" : "1" - }, - "summary" : { - "added" : "Test XML file", - "removed" : "test patch" - } - }, - "id" : 2796, - "last_change_time" : "2014-09-29T14:41:53Z" - } - ] - } - -``attachments`` (array) Change objects with the following items: - -================ ======== ===================================================== -name type description -================ ======== ===================================================== -id int The ID of the attachment that was updated. -last_change_time datetime The exact time that this update was done at, for this - attachment. If no update was done (that is, no fields - had their values changed and no comment was added) - then this will instead be the last time the - attachment was updated. -changes object The changes that were actually done on this - attachment. The keys are the names of the fields that - were changed, and the values are an object with two - items: - - * added: (string) The values that were added to this - field. Possibly a comma-and-space-separated list - if multiple values were added. - * removed: (string) The values that were removed from - this field. -================ ======== ===================================================== - -**Errors** - -This method can throw all the same errors as :ref:`rest_single_bug`, plus: - -* 129 (Flag Status Invalid) - The flag status is invalid. -* 130 (Flag Modification Denied) - You tried to request, grant, or deny a flag but only a user with the required - permissions may make the change. -* 131 (Flag not Requestable from Specific Person) - You can't ask a specific person for the flag. -* 132 (Flag not Unique) - The flag specified has been set multiple times. You must specify the id - value to update the flag. -* 133 (Flag Type not Unique) - The flag type specified matches several flag types. You must specify - the type id value to update or add a flag. -* 134 (Inactive Flag Type) - The flag type is inactive and cannot be used to create new flags. -* 140 (Markdown Disabled) - You tried to set the "is_markdown" flag of the "comment" to true but Markdown feature is - not enabled. -* 601 (Invalid MIME Type) - You specified a "content_type" argument that was blank, not a valid - MIME type, or not a MIME type that Bugzilla accepts for attachments. -* 603 (File Name Not Specified) - You did not specify a valid for the "file_name" argument. -* 604 (Summary Required) - You did not specify a value for the "summary" argument. diff --git a/docs/en/rst/api/core/v1/bug-user-last-visit.rst b/docs/en/rst/api/core/v1/bug-user-last-visit.rst deleted file mode 100644 index f981220976..0000000000 --- a/docs/en/rst/api/core/v1/bug-user-last-visit.rst +++ /dev/null @@ -1,116 +0,0 @@ -Bug User Last Visited -===================== - -.. _rest-bug-user-last-visit-update: - -Update Last Visited -------------------- - -Update the last-visited time for the specified bug and current user. - -**Request** - -To update the time for a single bug id: - -.. code-block:: text - - POST /rest/bug_user_last_visit/(id) - -To update one or more bug ids at once: - -.. code-block:: text - - POST /rest/bug_user_last_visit - -.. code-block:: js - - { - "ids" : [35,36,37] - } - -======= ===== ============================== -name type description -======= ===== ============================== -**id** int An integer bug id. -**ids** array One or more bug ids to update. -======= ===== ============================== - -**Response** - -.. code-block:: js - - [ - { - "id" : 100, - "last_visit_ts" : "2014-10-16T17:38:24Z" - } - ] - -An array of objects containing the items: - -============= ======== ============================================ -name type description -============= ======== ============================================ -id int The bug id. -last_visit_ts datetime The timestamp the user last visited the bug. -============= ======== ============================================ - -**Errors** - -* 1300 (User Not Involved with Bug) - The caller's account is not involved with the bug id provided. - -.. _rest-bug-user-last-visit-get: - -Get Last Visited ----------------- - -**Request** - -Get the last-visited timestamp for one or more specified bug ids or get a -list of the last 20 visited bugs and their timestamps. - -To return the last-visited timestamp for a single bug id: - -.. code-block:: text - - GET /rest/bug_user_last_visit/(id) - -To return more than one specific bug timestamps: - -.. code-block:: text - - GET /rest/bug_user_last_visit/123?ids=234&ids=456 - -To return all the timestamps stored during the retention period: - -.. code-block:: text - - GET /rest/bug_user_last_visit - -======= ===== ============================================ -name type description -======= ===== ============================================ -**id** int An integer bug id. -**ids** array One or more optional bug ids to get. -======= ===== ============================================ - -**Response** - -.. code-block:: js - - [ - { - "id" : 100, - "last_visit_ts" : "2014-10-16T17:38:24Z" - } - ] - -An array of objects containing the following items: - -============= ======== ============================================ -name type description -============= ======== ============================================ -id int The bug id. -last_visit_ts datetime The timestamp the user last visited the bug. -============= ======== ============================================ diff --git a/docs/en/rst/api/core/v1/bug.rst b/docs/en/rst/api/core/v1/bug.rst deleted file mode 100644 index b75516eee4..0000000000 --- a/docs/en/rst/api/core/v1/bug.rst +++ /dev/null @@ -1,1369 +0,0 @@ -Bugs -==== - -The REST API for creating, changing, and getting the details of bugs. - -This part of the Bugzilla REST API allows you to file new bugs in Bugzilla and -to get information about existing bugs. - -.. _rest_single_bug: - -Get Bug -------- - -Gets information about particular bugs in the database. - -**Request** - -To get information about a particular bug using its ID or alias: - -.. code-block:: text - - GET /rest/bug/(id_or_alias) - -You can also use :ref:`rest_search_bugs` to return more than one bug at a time -by specifying bug IDs as the search terms. - -.. code-block:: text - - GET /rest/bug?id=12434,43421 - -================ ===== ====================================================== -name type description -================ ===== ====================================================== -**id_or_alias** mixed An integer bug ID or a bug alias string. -================ ===== ====================================================== - -**Response** - -.. code-block:: js - - { - "faults": [], - "bugs": [ - { - "assigned_to_detail": { - "id": 2, - "real_name": "Test User", - "nick": "user", - "name": "user@bugzilla.org", - "email": "user@bugzilla.org" - }, - "flags": [ - { - "type_id": 11, - "modification_date": "2014-09-28T21:03:47Z", - "name": "blocker", - "status": "?", - "id": 2906, - "setter": "user@bugzilla.org", - "creation_date": "2014-09-28T21:03:47Z" - } - ], - "resolution": "INVALID", - "id": 35, - "type": "defect", - "qa_contact": "", - "triage_owner": "", - "version": "1.0", - "status": "RESOLVED", - "creator": "user@bugzilla.org", - "cf_drop_down": "---", - "summary": "test bug", - "last_change_time": "2014-09-23T19:12:17Z", - "platform": "All", - "url": "", - "classification": "Unclassified", - "cc_detail": [ - { - "id": 786, - "real_name": "Foo Bar", - "nick": "foo", - "name": "foo@bar.com", - "email": "foo@bar.com" - }, - ], - "priority": "P1", - "is_confirmed": true, - "creation_time": "2000-07-25T13:50:04Z", - "assigned_to": "user@bugzilla.org", - "flags": [], - "alias": null, - "cf_large_text": "", - "groups": [], - "op_sys": "All", - "cf_bug_id": null, - "depends_on": [], - "is_cc_accessible": true, - "is_open": false, - "cf_qa_list_4": "---", - "keywords": [], - "cc": [ - "foo@bar.com", - ], - "see_also": [], - "deadline": null, - "is_creator_accessible": true, - "whiteboard": "", - "dupe_of": null, - "duplicates": [], - "target_milestone": "---", - "cf_mulitple_select": [], - "component": "SaltSprinkler", - "severity": "critical", - "cf_date": null, - "product": "FoodReplicator", - "creator_detail": { - "id": 28, - "real_name": "hello", - "nick": "namachi", - "name": "user@bugzilla.org", - "email": "namachi@netscape.com" - }, - "cf_free_text": "", - "blocks": [], - "regressed_by": [], - "regressions": [], - "comment_count": 12 - } - ] - } - -``bugs`` (array) Each bug object contains information about the bugs with valid -ids containing the following items: - -These fields are returned by default or by specifying ``_default`` in -``include_fields``. - -===================== ======== ================================================ -name type description -===================== ======== ================================================ -actual_time double The total number of hours that this bug has - taken so far. If you are not in the time-tracking - group, this field will not be included in the - return value. -alias string The unique alias of this bug. A ``null`` value - will be returned if this bug has no alias. -assigned_to string The login name of the user to whom the bug is - assigned. -assigned_to_detail object An object containing detailed user information - for the assigned_to. To see the keys included - in the user detail object, see below. -blocks array The IDs of bugs that are "blocked" by this bug. -cc array The login names of users on the CC list of this - bug. -cc_detail array Array of objects containing detailed user - information for each of the cc list members. - To see the keys included in the user detail - object, see below. -classification string The name of the current classification the bug - is in. -component string The name of the current component of this bug. -creation_time datetime When the bug was created. -creator string The login name of the person who filed this bug - (the reporter). -creator_detail object An object containing detailed user information - for the creator. To see the keys included in the - user detail object, see below. -deadline string The day that this bug is due to be completed, in - the format ``YYYY-MM-DD``. -depends_on array The IDs of bugs that this bug "depends on". -dupe_of int The bug ID of the bug that this bug is a - duplicate of. If this bug isn't a duplicate of - any bug, this will be null. -duplicates array The ids of bugs that are marked as duplicate of - this bug. -estimated_time double The number of hours that it was estimated that - this bug would take. If you are not in the - time-tracking group, this field will not be - included in the return value. -flags array An array of objects containing the information - about flags currently set for the bug. Each flag - objects contains the following items -groups array The names of all the groups that this bug is in. -id int The unique numeric ID of this bug. -is_cc_accessible boolean If true, this bug can be accessed by members of - the CC list, even if they are not in the groups - the bug is restricted to. -is_confirmed boolean ``true`` if the bug has been confirmed. Usually - this means that the bug has at some point been - moved out of the ``UNCONFIRMED`` status and into - another open status. -is_open boolean ``true`` if this bug is open, ``false`` if it - is closed. -is_creator_accessible boolean If ``true``, this bug can be accessed by the - creator of the bug, even if they are not a - member of the groups the bug is restricted to. -keywords array Each keyword that is on this bug. -last_change_time datetime When the bug was last changed. -comment_count int Number of comments associated with the bug. -op_sys string The name of the operating system that the bug - was filed against. -platform string The name of the platform (hardware) that the bug - was filed against. -priority string The priority of the bug. -product string The name of the product this bug is in. -qa_contact string The login name of the current QA Contact on the - bug. -qa_contact_detail object An object containing detailed user information - for the qa_contact. To see the keys included in - the user detail object, see below. -regressed_by array The IDs of bugs that introduced this bug. -regressions array The IDs of bugs that are introduced by this bug. -remaining_time double The number of hours of work remaining until work - on this bug is complete. If you are not in the - time-tracking group, this field will not be - included in the return value. -resolution string The current resolution of the bug, or an empty - string if the bug is open. -see_also array The URLs in the See Also field on the bug. -severity string The current severity of the bug. -status string The current status of the bug. -summary string The summary of this bug. -target_milestone string The milestone that this bug is supposed to be - fixed by, or for closed bugs, the milestone that - it was fixed for. -type string The type of the bug. -update_token string The token that you would have to pass to the - ``process_bug.cgi`` page in order to update this - bug. This changes every time the bug is updated. - This field is not returned to logged-out users. -url string A URL that demonstrates the problem described in - the bug, or is somehow related to the bug report. -version string The version the bug was reported against. -whiteboard string The value of the "status whiteboard" field on - the bug. -===================== ======== ================================================ - -Custom fields: - -Every custom field in this installation will also be included in the -return value. Most fields are returned as strings. However, some field types have -different return values. - -Normally custom fields are returned by default similar to normal bug fields or -you can specify only custom fields by using ``_custom`` in ``include_fields``. - -Extra fields: - -These fields are returned only by specifying ``_extra`` or the field name in -``include_fields``. - -======================== ======== ==================================================== -name type description -======================== ======== ==================================================== -attachments array Each array item is an Attachment object. See - :ref:`rest_attachments` for details of the object. -comments array Each array item is a Comment object. See - :ref:`rest_comments` for details of the object. -counts object An object containing the numbers of the items in the - following fields: ``attachments``, ``cc``, - ``comments``, ``keywords``, ``blocks``, - ``depends_on``, ``regressed_by``, ``regressions`` - and ``duplicates``. -description string The description (initial comment) of the bug. -filed_via string How the bug was filed, e.g. ``standard_form``. -history array Each array item is a History object. See - :ref:`rest_history` for details of the object. -tags array Each array item is a tag name. Note that tags are - personal to the currently logged in user and are not - the same as comment tags. -triage_owner string The login name of the Triage Owner of the bug's - component. -triage_owner_detail object An object containing detailed user information for - the ``triage_owner``. To see the keys included in - the user detail object, see below. -last_change_time_non_bot datetime When the bug was last changed human and not a bot. -======================== ======== ==================================================== - -User object: - -========= ====== ============================================================== -name type description -========= ====== ============================================================== -id int The user ID for this user. -real_name string The 'real' name for this user, if any. -nick string The user's nickname. Currently this is extracted from the - real_name, name or email field. -name string The user's Bugzilla login. -email string The user's email address. Currently this is the same value as - the name. -========= ====== ============================================================== - -Flag object: - -================= ======== ==================================================== -name type description -================= ======== ==================================================== -id int The ID of the flag. -name string The name of the flag. -type_id int The type ID of the flag. -creation_date datetime The timestamp when this flag was originally created. -modification_date datetime The timestamp when the flag was last modified. -status string The current status of the flag. -setter string The login name of the user who created or last - modified the flag. -requestee string The login name of the user this flag has been - requested to be granted or denied. Note, this field - is only returned if a requestee is set. -================= ======== ==================================================== - -Custom field object: - -You can specify to only return custom fields by specifying ``_custom`` or the -field name in ``include_fields``. - -* Bug ID Fields: (int) -* Multiple-Selection Fields: (array of strings) -* Date/Time Fields: (datetime) - -**Errors** - -* 100 (Invalid Bug Alias) - If you specified an alias and there is no bug with that alias. -* 101 (Invalid Bug ID) - The bug_id you specified doesn't exist in the database. -* 102 (Access Denied) - You do not have access to the bug_id you specified. - -.. _rest_history: - -Bug History ------------ - -Gets the history of changes for particular bugs in the database. - -**Request** - -To get the history for a specific bug ID: - -.. code-block:: text - - GET /rest/bug/(id)/history - -To get the history for a bug since a specific date: - -.. code-block:: text - - GET /rest/bug/(id)/history?new_since=YYYY-MM-DD - -========= ======== ============================================================ -name type description -========= ======== ============================================================ -**id** mixed An integer bug ID or alias. -new_since datetime A datetime timestamp to only show history since. -========= ======== ============================================================ - -**Response** - -.. code-block:: js - - { - "bugs": [ - { - "alias": null, - "history": [ - { - "when": "2014-09-23T19:12:17Z", - "who": "user@bugzilla.org", - "changes": [ - { - "added": "P1", - "field_name": "priority", - "removed": "P2" - }, - { - "removed": "blocker", - "field_name": "severity", - "added": "critical" - } - ] - }, - { - "when": "2014-09-28T21:03:47Z", - "who": "user@bugzilla.org", - "changes": [ - { - "added": "blocker?", - "removed": "", - "field_name": "flagtypes.name" - } - ] - } - ], - "id": 35 - } - ] - } - -``bugs`` (array) Bug objects each containing the following items: - -======= ====== ================================================================ -name type description -======= ====== ================================================================ -id int The numeric ID of the bug. -alias string The unique alias of this bug. A ``null`` value will be returned - if this bug has no alias. -history array An array of History objects. -======= ====== ================================================================ - -History object: - -======= ======== ============================================================== -name type description -======= ======== ============================================================== -when datetime The date the bug activity/change happened. -who string The login name of the user who performed the bug change. -changes array An array of Change objects which contain all the changes that - happened to the bug at this time (as specified by ``when``). -======= ======== ============================================================== - -Change object: - -============= ====== ========================================================== -name type description -============= ====== ========================================================== -field_name string The name of the bug field that has changed. -removed string The previous value of the bug field which has been - deleted by the change. -added string The new value of the bug field which has been added - by the change. -attachment_id int The ID of the attachment that was changed. - This only appears if the change was to an attachment, - otherwise ``attachment_id`` will not be present in this - object. -============= ====== ========================================================== - -**Errors** - -Same as :ref:`rest_single_bug`. - -.. _rest_search_bugs: - -Search Bugs ------------ - -Allows you to search for bugs based on particular criteria. - -**Request** - -To search for bugs: - -.. code-block:: text - - GET /rest/bug - -Unless otherwise specified in the description of a parameter, bugs are -returned if they match *exactly* the criteria you specify in these -parameters. That is, we don't match against substrings--if a bug is in -the "Widgets" product and you ask for bugs in the "Widg" product, you -won't get anything. - -Criteria are joined in a logical AND. That is, you will be returned -bugs that match *all* of the criteria, not bugs that match *any* of -the criteria. - -Each parameter can be either the type it says, or a list of the types -it says. If you pass an array, it means "Give me bugs with *any* of -these values." For example, if you wanted bugs that were in either -the "Foo" or "Bar" products, you'd pass: - -.. code-block:: text - - GET /rest/bug?product=Foo&product=Bar - -Some Bugzillas may treat your arguments case-sensitively, depending -on what database system they are using. Most commonly, though, Bugzilla is -not case-sensitive with the arguments passed (because MySQL is the -most-common database to use with Bugzilla, and MySQL is not case sensitive). - -In addition to the fields listed below, you may also use criteria that -is similar to what is used in the Advanced Search screen of the Bugzilla -UI. This includes fields specified by ``Search by Change History`` and -``Custom Search``. The easiest way to determine what the field names are and what -format Bugzilla expects is to first construct your query using the -Advanced Search UI, execute it and use the query parameters in they URL -as your query for the REST call. - -================ ======== ===================================================== -name type description -================ ======== ===================================================== -alias string The unique alias of this bug. A ``null`` value will - be returned if this bug has no alias. -assigned_to string The login name of a user that a bug is assigned to. -component string The name of the Component that the bug is in. Note - that if there are multiple Components with the same - name, and you search for that name, bugs in *all* - those Components will be returned. If you don't want - this, be sure to also specify the ``product`` argument. -count_only boolean If set to true, an object with a single key called - "bug_count" will be returned which is the number of - bugs that matched the search. -creation_time datetime Searches for bugs that were created at this time or - later. May not be an array. -creator string The login name of the user who created the bug. You - can also pass this argument with the name - ``reporter``, for backwards compatibility with - older Bugzillas. -description string The description (initial comment) of the bug. -filed_via string Searches for bugs that were created with this method. -id int The numeric ID of the bug. -last_change_time datetime Searches for bugs that were modified at this time - or later. May not be an array. -limit int Limit the number of results returned. If the value is - unset, zero or greater than the maximum value set by - the administrator, which is 10,000 by default, then - the maximum value will be used instead. This is a - preventive measure against DoS-like attacks on - Bugzilla. Use the ``offset`` argument described below - to retrieve more results. -longdescs.count int The number of comments a bug has. The bug's description - is the first comment. For example, to find bugs which someone - has commented on after they have been filed, search on - ``longdescs.count`` *greater than* 1. -offset int Used in conjunction with the ``limit`` argument, - ``offset`` defines the starting position for the - search. For example, given a search that would - return 100 bugs, setting ``limit`` to 10 and - ``offset`` to 10 would return bugs 11 through 20 - from the set of 100. -op_sys string The "Operating System" field of a bug. -platform string The Platform (sometimes called "Hardware") field of - a bug. -priority string The Priority field on a bug. -product string The name of the Product that the bug is in. -quicksearch string Search for bugs using quicksearch syntax. -resolution string The current resolution--only set if a bug is closed. - You can find open bugs by searching for bugs with an - empty resolution. -severity string The Severity field on a bug. -status string The current status of a bug (not including its - resolution, if it has one, which is a separate field - above). -summary string Searches for substrings in the single-line Summary - field on bugs. If you specify an array, then bugs - whose summaries match *any* of the passed substrings - will be returned. Note that unlike searching in the - Bugzilla UI, substrings are not split on spaces. So - searching for ``foo bar`` will match "This is a foo - bar" but not "This foo is a bar". ``['foo', 'bar']``, - would, however, match the second item. -tags string Searches for a bug with the specified tag. If you - specify an array, then any bugs that match *any* of - the tags will be returned. Note that tags are - personal to the currently logged in user. -target_milestone string The Target Milestone field of a bug. Note that even - if this Bugzilla does not have the Target Milestone - field enabled, you can still search for bugs by - Target Milestone. However, it is likely that in that - case, most bugs will not have a Target Milestone set - (it defaults to "---" when the field isn't enabled). -qa_contact string The login name of the bug's QA Contact. Note that - even if this Bugzilla does not have the QA Contact - field enabled, you can still search for bugs by QA - Contact (though it is likely that no bug will have a - QA Contact set, if the field is disabled). -triage_owner string The login name of the Triage Owner of a bug's - component. -type string The Type field on a bug. -url string The "URL" field of a bug. -version string The Version field of a bug. -whiteboard string Search the "Status Whiteboard" field on bugs for a - substring. Works the same as the ``summary`` field - described above, but searches the Status Whiteboard - field. -================ ======== ===================================================== - -**Response** - -The same as :ref:`rest_single_bug`. - -**Errors** - -If you specify an invalid value for a particular field, you just won't -get any results for that value. - -* 1000 (Parameters Required) - You may not search without any search terms. - -.. _rest_create_bug: - -Create Bug ----------- - -This allows you to create a new bug in Bugzilla. If you specify any -invalid fields, an error will be thrown stating which field is invalid. -If you specify any fields you are not allowed to set, they will just be -set to their defaults or ignored. - -You cannot currently set all the items here that you can set on enter_bug.cgi. - -The WebService interface may allow you to set things other than those listed -here, but realize that anything undocumented here may likely change in the -future. - -**Request** - -To create a new bug in Bugzilla. - -.. code-block:: text - - POST /rest/bug - -.. code-block:: js - - { - "product" : "TestProduct", - "component" : "TestComponent", - "version" : "unspecified", - "summary" : "'This is a test bug - please disregard", - "alias" : "SomeAlias", - "op_sys" : "All", - "priority" : "P1", - "platform" : "All", - "type" : "defect" - } - -Some params must be set, or an error will be thrown. These params are -marked in **bold**. - -Some parameters can have defaults set in Bugzilla, by the administrator. -If these parameters have defaults set, you can omit them. These parameters -are marked (defaulted). - -Clients that want to be able to interact uniformly with multiple -Bugzillas should always set both the params marked required and those -marked (defaulted), because some Bugzillas may not have defaults set -for (defaulted) parameters, and then this method will throw an error -if you don't specify them. - -================== ======= ==================================================== -name type description -================== ======= ==================================================== -**product** string The name of the product the bug is being filed - against. -**component** string The name of a component in the product above. -**summary** string A brief description of the bug being filed. -**version** string A version of the product above; the version the - bug was found in. -description string (defaulted) The description (initial comment) of the - bug. Some Bugzilla installations require this to not - be blank. -filed_via string (defaulted) How the bug is being filed. It will be - ``api`` by default when filing through the API. -op_sys string (defaulted) The operating system the bug was - discovered on. -platform string (defaulted) What type of hardware the bug was - experienced on. -priority string (defaulted) What order the bug will be fixed in by - the developer, compared to the developer's other - bugs. -severity string (defaulted) How severe the bug is. -**type** string The basic category of the bug. Some Bugzilla - installations require this to be specified. -alias string The alias for the bug that can be used instead of a - bug number when accessing this bug. Must be unique - in all of this Bugzilla. -assigned_to string A user to assign this bug to, if you don't want it - to be assigned to the component owner. -cc array An array of usernames to CC on this bug. -comment_is_private boolean If set to true, the description is private, - otherwise it is assumed to be public. -groups array An array of group names to put this bug into. You - can see valid group names on the Permissions tab of - the Preferences screen, or, if you are an - administrator, in the Groups control panel. If you - don't specify this argument, then the bug will be - added into all the groups that are set as being - "Default" for this product. (If you want to avoid - that, you should specify ``groups`` as an empty - array.) -qa_contact string If this installation has QA Contacts enabled, you - can set the QA Contact here if you don't want to - use the component's default QA Contact. -status string The status that this bug should start out as. Note - that only certain statuses can be set on bug - creation. -resolution string If you are filing a closed bug, then you will have - to specify a resolution. You cannot currently - specify a resolution of ``DUPLICATE`` for new - bugs, though. That must be done with - :ref:`rest_update_bug`. -target_milestone string A valid target milestone for this product. -flags array Flags objects to add to the bug. The object format - is described in the Flag object below. -keywords array One or more valid keywords to add to this bug. -dependson array One or more valid bug ids that this bug depends on. -blocked array One or more valid bug ids that this bug blocks. -regressed_by array One or more valid bug ids that introduced this bug. -================== ======= ==================================================== - -Flag object: - -To create a flag, at least the ``status`` and the ``type_id`` or ``name`` must -be provided. An optional requestee can be passed if the flag type is requestable -to a specific user. - -========= ====== ============================================================== -name type description -========= ====== ============================================================== -name string The name of the flag type. -type_id int The internal flag type ID. -status string The flags new status (i.e. "?", "+", "-" or "X" to clear flag). -requestee string The login of the requestee if the flag type is requestable - to a specific user. -========= ====== ============================================================== - -In addition to the above parameters, if your installation has any custom -fields, you can set them just by passing in the name of the field and -its value as a string. - -**Response** - -.. code-block:: js - - { - "id" : 12345 - } - -==== ==== ====================================== -name type description -==== ==== ====================================== -id int This is the ID of the newly-filed bug. -==== ==== ====================================== - -**Errors** - -* 51 (Invalid Object) - You specified a field value that is invalid. The error message will have - more details. -* 103 (Invalid Alias) - The alias you specified is invalid for some reason. See the error message - for more details. -* 104 (Invalid Field) - One of the drop-down fields has an invalid value, or a value entered in a - text field is too long. The error message will have more detail. -* 105 (Invalid Component) - You didn't specify a component. -* 106 (Invalid Product) - Either you didn't specify a product, this product doesn't exist, or - you don't have permission to enter bugs in this product. -* 107 (Invalid Summary) - You didn't specify a summary for the bug. -* 116 (Dependency Loop) - You specified values in the "blocks" and "depends_on" fields, - or the "regressions" and "regressed_by" fields, that would cause a - circular dependency between bugs. -* 120 (Group Restriction Denied) - You tried to restrict the bug to a group which does not exist, or which - you cannot use with this product. -* 129 (Flag Status Invalid) - The flag status is invalid. -* 130 (Flag Modification Denied) - You tried to request, grant, or deny a flag but only a user with the required - permissions may make the change. -* 131 (Flag not Requestable from Specific Person) - You can't ask a specific person for the flag. -* 133 (Flag Type not Unique) - The flag type specified matches several flag types. You must specify - the type id value to update or add a flag. -* 134 (Inactive Flag Type) - The flag type is inactive and cannot be used to create new flags. -* 135 (Bug Type Required) - You didn't specify a type for the bug. -* 504 (Invalid User) - Either the QA Contact, Assignee, or CC lists have some invalid user - in them. The error message will have more details. - -.. _rest_update_bug: - -Update Bug ----------- - -Allows you to update the fields of a bug. Automatically sends emails -out about the changes. - -**Request** - -To update the fields of a current bug. - -.. code-block:: text - - PUT /rest/bug/(id_or_alias) - -.. code-block:: js - - { - "ids" : [35], - "status" : "IN_PROGRESS", - "keywords" : { - "add" : ["funny", "stupid"] - } - } - -The params to include in the PUT body as well as the returned data format, -are the same as below. You must specify an ID or alias of a bug to update -in the URL path. You can also specify the ``ids`` param and they will be -combined so you can edit more than one bug at a time. - -=============== ===== ========================================================= -name type description -=============== ===== ========================================================= -**id_or_alias** mixed An integer bug ID or alias. -**ids** array The IDs or aliases of the bugs that you want to modify. -=============== ===== ========================================================= - -All following fields specify the values you want to set on the bugs you are -updating. - -===================== ======= ================================================= -name type description -===================== ======= ================================================= -alias string The alias for the bug that can be used instead of - a bug number when accessing this bug. Must be - unique in all of this Bugzilla. -assigned_to string The full login name of the user this bug is - assigned to. -blocks object (Same as ``regressed_by`` below) -depends_on object (Same as ``regressed_by`` below) -regressions object (Same as ``regressed_by`` below) -regressed_by object These specify the bugs that this bug blocks, - depends on, regresses, or is regressed by, - respectively. To set these, you should pass an - object as the value. The object may contain the - following items: - - * ``add`` (array) Bug IDs to add to this field. - * ``remove`` (array) Bug IDs to remove from this - field. If the bug IDs are not already in the - field, they will be ignored. - * ``set`` (array of) An exact set of bug IDs to - set this field to, overriding the current - value. If you specify ``set``, then ``add`` - and ``remove`` will be ignored. -cc object The users on the cc list. To modify this field, - pass an object, which may have the following - items: - - * ``add`` (array) User names to add to the CC - list. They must be full user names, and an - error will be thrown if you pass in an invalid - user name. - * ``remove`` (array) User names to remove from - the CC list. They must be full user names, and - an error will be thrown if you pass in an - invalid user name. -is_cc_accessible boolean Whether or not users in the CC list are allowed - to access the bug, even if they aren't in a group - that can normally access the bug. -comment object A comment on the change. The object may contain - the following items: - - * ``body`` (string) The actual text of the - comment. For compatibility with the parameters - to :ref:`rest_add_comment`, you can also call - this field ``comment``, if you want. - * ``is_private`` (boolean) Whether the comment is - private or not. If you try to make a comment - private and you don't have the permission to, - an error will be thrown. -comment_is_private object This is how you update the privacy of comments - that are already on a bug. This is a object, - where the keys are the ``int`` ID of comments - (not their count on a bug, like #1, #2, #3, but - their globally-unique ID, as returned by - :ref:`rest_comments` and the value is a - ``boolean`` which specifies whether that comment - should become private (``true``) or public - (``false``). - - The comment IDs must be valid for the bug being - updated. Thus, it is not practical to use this - while updating multiple bugs at once, as a single - comment ID will never be valid on multiple bugs. -component string The Component the bug is in. -deadline date The Deadline field is a date specifying when the - bug must be completed by, in the format - ``YYYY-MM-DD``. -dupe_of int The bug that this bug is a duplicate of. If you - want to mark a bug as a duplicate, the safest - thing to do is to set this value and *not* set - the ``status`` or ``resolution`` fields. They will - automatically be set by Bugzilla to the - appropriate values for duplicate bugs. -estimated_time double The total estimate of time required to fix the - bug, in hours. This is the *total* estimate, not - the amount of time remaining to fix it. -flags array An array of Flag change objects. The items needed - are described below. -groups object The groups a bug is in. To modify this field, - pass an object, which may have the following - items: - - * ``add`` (array) The names of groups to add. - Passing in an invalid group name or a group - that you cannot add to this bug will cause an - error to be thrown. - * ``remove`` (array) The names of groups to - remove. Passing in an invalid group name or a - group that you cannot remove from this bug - will cause an error to be thrown. -keywords object Keywords on the bug. To modify this field, pass - an object, which may have the following items: - - * ``add`` (array) The names of keywords to add - to the field on the bug. Passing something that - isn't a valid keyword name will cause an error - to be thrown. - * ``remove`` (array) The names of keywords to - remove from the field on the bug. Passing - something that isn't a valid keyword name will - cause an error to be thrown. - * ``set`` (array) An exact set of keywords to set - the field to, on the bug. Passing something - that isn't a valid keyword name will cause an - error to be thrown. Specifying ``set`` - overrides ``add`` and ``remove``. -op_sys string The Operating System ("OS") field on the bug. -platform string The Platform or "Hardware" field on the bug. -priority string The Priority field on the bug. -product string The name of the product that the bug is in. If - you change this, you will probably also want to - change ``target_milestone``, ``version``, and - ``component``, since those have different legal - values in every product. - - If you cannot change the ``target_milestone`` - field, it will be reset to the default for the - product, when you move a bug to a new product. - - You may also wish to add or remove groups, as - which groups are - valid on a bug depends on the product. Groups - that are not valid in the new product will be - automatically removed, and groups which are - mandatory in the new product will be - automatically added, but no other automatic group - changes will be done. - - .. note:: - Users can only move a bug into a product if - they would normally have permission to file - new bugs in that product. -qa_contact string The full login name of the bug's QA Contact. -is_creator_accessible boolean Whether or not the bug's reporter is allowed - to access the bug, even if they aren't in a group - that can normally access the bug. -remaining_time double How much work time is remaining to fix the bug, - in hours. If you set ``work_time`` but don't - explicitly set ``remaining_time``, then the - ``work_time`` will be deducted from the bug's - ``remaining_time``. -reset_assigned_to boolean If true, the ``assigned_to`` field will be - reset to the default for the component that the - bug is in. (If you have set the component at the - same time as using this, then the component used - will be the new component, not the old one.) -reset_qa_contact boolean If true, the ``qa_contact`` field will be reset - to the default for the component that the bug is - in. (If you have set the component at the same - time as using this, then the component used will - be the new component, not the old one.) -resolution string The current resolution. May only be set if you - are closing a bug or if you are modifying an - already-closed bug. Attempting to set the - resolution to *any* value (even an empty or null - string) on an open bug will cause an error to be - thrown. - - .. note:: - If you change the ``status`` field to an open - status, the resolution field will automatically - be cleared, so you don't have to clear it - manually. -see_also object The See Also field on a bug, specifying URLs to - bugs in other bug trackers. To modify this field, - pass an object, which may have the following - items: - - * ``add`` (array) URLs to add to the field. Each - URL must be a valid URL to a bug-tracker, or - an error will be thrown. - * ``remove`` (array) URLs to remove from the - field. Invalid URLs will be ignored. -severity string The Severity field of a bug. -status string The status you want to change the bug to. Note - that if a bug is changing from open to closed, - you should also specify a ``resolution``. -summary string The Summary field of the bug. -target_milestone string The bug's Target Milestone. -type string The Type field on the bug. -url string The "URL" field of a bug. -version string The bug's Version field. -whiteboard string The Status Whiteboard field of a bug. -work_time double The number of hours worked on this bug as part - of this change. - If you set ``work_time`` but don't explicitly - set ``remaining_time``, then the ``work_time`` - will be deducted from the bug's ``remaining_time``. -===================== ======= ================================================= - -You can also set the value of any custom field by passing its name as -a parameter, and the value to set the field to. For multiple-selection -fields, the value should be an array of strings. - -Flag change object: - -The following values can be specified. At least the ``status`` and one of -``type_id``, ``id``, or ``name`` must be specified. If a ``type_id`` or -``name`` matches a single currently set flag, the flag will be updated unless -``new`` is specified. - -========== ======= ============================================================ -name type description -========== ======= ============================================================ -name string The name of the flag that will be created or updated. -type_id int The internal flag type ID that will be created or updated. - You will need to specify the ``type_id`` if more than one - flag type of the same name exists. -**status** string The flags new status (i.e. "?", "+", "-" or "X" to clear a - flag). -requestee string The login of the requestee if the flag type is requestable - to a specific user. -id int Use ID to specify the flag to be updated. You will need to - specify the ``id`` if more than one flag is set of the same - name. -new boolean Set to true if you specifically want a new flag to be - created. -========== ======= ============================================================ - -**Response** - -.. code-block:: js - - { - "bugs" : [ - { - "alias" : null, - "changes" : { - "keywords" : { - "added" : "funny, stupid", - "removed" : "" - }, - "status" : { - "added" : "IN_PROGRESS", - "removed" : "CONFIRMED" - } - }, - "id" : 35, - "last_change_time" : "2014-09-29T14:25:35Z" - } - ] - } - -``bugs`` (array) This points to an array of objects with the following items: - -================ ======== ===================================================== -name type description -================ ======== ===================================================== -id int The ID of the bug that was updated. -alias string The alias of the bug that was updated, if this bug - has any alias. -last_change_time datetime The exact time that this update was done at, for - this bug. If no update was done (that is, no fields - had their values changed and no comment was added) - then this will instead be the last time the bug was - updated. -changes object The changes that were actually done on this bug. The - keys are the names of the fields that were changed, - and the values are an object with two keys: - - * ``added`` (string) The values that were added to - this field, possibly a comma-and-space-separated - list if multiple values were added. - * ``removed`` (string) The values that were removed - from this field, possibly a - comma-and-space-separated list if multiple values - were removed. -================ ======== ===================================================== - -Currently, some fields are not tracked in changes: ``comment``, -``comment_is_private``, and ``work_time``. This means that they will not -show up in the return value even if they were successfully updated. -This may change in a future version of Bugzilla. - -**Errors** - -This method can throw all the same errors as :ref:`rest_single_bug`, plus: - -* 129 (Flag Status Invalid) - The flag status is invalid. -* 130 (Flag Modification Denied) - You tried to request, grant, or deny a flag but only a user with the required - permissions may make the change. -* 131 (Flag not Requestable from Specific Person) - You can't ask a specific person for the flag. -* 132 (Flag not Unique) - The flag specified has been set multiple times. You must specify the id - value to update the flag. -* 133 (Flag Type not Unique) - The flag type specified matches several flag types. You must specify - the type id value to update or add a flag. -* 134 (Inactive Flag Type) - The flag type is inactive and cannot be used to create new flags. -* 140 (Markdown Disabled) - You tried to set the "is_markdown" flag of the "comment" to true but Markdown feature is - not enabled. -* 601 (Invalid MIME Type) - You specified a "content_type" argument that was blank, not a valid - MIME type, or not a MIME type that Bugzilla accepts for attachments. -* 603 (File Name Not Specified) - You did not specify a valid for the "file_name" argument. -* 604 (Summary Required) - You did not specify a value for the "summary" argument. - - -.. _rest_graph: - -Graph ------ - -Return a graph of bug relationships such as dependencies, regressions, and duplicates. -By default, resolved bugs are not returned but can be if needed. The bug ID provided -will be the root node of the graph. - -**Request** - -To return a graph of dependencies (default) for a given bug. Each bug in the tree will -include basic information about the bug such as status, summary, etc. - -.. code-block:: text - - GET /rest/bug/1156/graph - -To return a simple graph that only includes the bug IDs, then pass ``ids_only=1``. -Note, this will be faster for very large graphs. - -.. code-block:: text - - GET /rest/bug/1156/graph?ids_only=1 - -The default is the dependencies graph. To return the graph for other types, pass the -``relationship={dependencies,regressions,duplicates}`` parameter. - -.. code-block:: text - - GET /rest/bug/1156/graph?relationship=regressions - -============ ======= ================================================================ -name type description -============ ======= ================================================================ -ids_only boolean Do not return simple bug data with each bug ID in the tree. - Default: False -depth int Limit the depth of the graph. - Default: 3, Max: 9 -show_resolved boolean Enable if you want to also see RESOLVED bugs in the graph. - Default: False -relationship string One of "dependencies", "duplicates", or "regressions". - Default: "dependencies" -============ ======= ================================================================ - -**Response** - -The default return object will be an object with two trees based on the type of -relationship selected. For dependencies, it will be ``blocked`` and ``dependson``. -For regressions, it will be be ``regresses`` and ``regressed_by``. And for duplicates, -it will be ``dupe_of`` and ``dupe``. - -.. code-block:: js - - { - "blocked": { - "2": { - "3": { - "bug": { - "alias": null, - "id": 3, - "is_confirmed": 1, - "op_sys": "Unspecified", - "platform": "Unspecified", - "priority": "--", - "resolution": "", - "severity": "normal", - "status": "NEW", - "summary": "Another new test bug", - "target_milestone": "---", - "type": "defect", - "url": "", - "version": "unspecified", - "whiteboard": "" - } - }, - "bug": { - "alias": null, - "id": 2, - "is_confirmed": 1, - "op_sys": "Unspecified", - "platform": "Unspecified", - "priority": "--", - "resolution": "", - "severity": "normal", - "status": "NEW", - "summary": "this is a new test bug", - "target_milestone": "---", - "type": "defect", - "url": "", - "version": "unspecified", - "whiteboard": "" - } - }, - "bug": { - "alias": null, - "id": 1, - "is_confirmed": 1, - "op_sys": "Unspecified", - "platform": "Unspecified", - "priority": "--", - "resolution": "", - "severity": "normal", - "status": "NEW", - "summary": "This is a new test bug", - "target_milestone": "---", - "type": "defect", - "url": "", - "version": "unspecified", - "whiteboard": "" - } - }, - "dependson": {} - } - -The following response, is what will happen if ``ids_only=1`` is passed. - -.. code-block:: js - - { - "blocked": { - "2": { - "3": {} - } - }, - "dependson": {} - } - - -.. _rest_possible_duplicates: - -Possible Duplicates -------------------- - -Gets a list of possible duplicate bugs. - -**Request** - -To search by similar bug. - -.. code-block:: text - - GET /rest/bug/possible_duplicates?id=1234567 - -To search by a similar bug summary directly. - -.. code-block:: text - - GET /rest/bug/possible_duplicates?summary=Similar+Bug+Summary - -======= ====== ================================================================ -name type description -======= ====== ================================================================ -id int The id of a bug to find duplicates of. -summary string A summary to search for duplicates of, only used if no bug id is - given. -product string A product group to limit the search in. -limit int Limit the number of results returned. If the value is unset, - zero or greater than the maximum value set by the administrator, - which is 10,000 by default, then the maximum value will be used - instead. This is a preventive measure against DoS-like attacks - on Bugzilla. -======= ====== ================================================================ - -**Response** - -.. code-block:: js - - { - "bugs": [ - { - "alias": null, - "history": [ - { - "when": "2014-09-23T19:12:17Z", - "who": "user@bugzilla.org", - "changes": [ - { - "added": "P1", - "field_name": "priority", - "removed": "P2" - }, - { - "removed": "blocker", - "field_name": "severity", - "added": "critical" - } - ] - }, - { - "when": "2014-09-28T21:03:47Z", - "who": "user@bugzilla.org", - "changes": [ - { - "added": "blocker?", - "removed": "", - "field_name": "flagtypes.name" - } - ] - } - ], - "id": 35 - } - ] - } - -``bugs`` (array) Bug objects each containing the following items. If a bug id was -used to query this endpoint, that bug will not be in the list returned. - -======= ====== ================================================================ -name type description -======= ====== ================================================================ -id int The numeric ID of the bug. -alias string The unique alias of this bug. A ``null`` value will be returned - if this bug has no alias. -history array An array of History objects. -======= ====== ================================================================ - -History object: - -======= ======== ============================================================== -name type description -======= ======== ============================================================== -when datetime The date the bug activity/change happened. -who string The login name of the user who performed the bug change. -changes array An array of Change objects which contain all the changes that - happened to the bug at this time (as specified by ``when``). -======= ======== ============================================================== - -Change object: - -============= ====== ========================================================== -name type description -============= ====== ========================================================== -field_name string The name of the bug field that has changed. -removed string The previous value of the bug field which has been - deleted by the change. -added string The new value of the bug field which has been added - by the change. -attachment_id int The ID of the attachment that was changed. - This only appears if the change was to an attachment, - otherwise ``attachment_id`` will not be present in this - object. -============= ====== ========================================================== diff --git a/docs/en/rst/api/core/v1/bugzilla.rst b/docs/en/rst/api/core/v1/bugzilla.rst deleted file mode 100644 index 6f76c05496..0000000000 --- a/docs/en/rst/api/core/v1/bugzilla.rst +++ /dev/null @@ -1,185 +0,0 @@ -Bugzilla Information -==================== - -These methods are used to get general configuration information about this -Bugzilla instance. - -Version -------- - -Returns the current version of Bugzilla. Normally in the format of ``X.X`` or -``X.X.X``. For example, ``4.4`` for the initial release of a new branch. Or -``4.4.6`` for a minor release on the same branch. - -**Request** - -.. code-block:: text - - GET /rest/version - -**Response** - -.. code-block:: js - - { - "version": "4.5.5+" - } - -======= ====== ========================================= -name type description -======= ====== ========================================= -version string The current version of this Bugzilla -======= ====== ========================================= - -Extensions ----------- - -Gets information about the extensions that are currently installed and enabled -in this Bugzilla. - -**Request** - -.. code-block:: text - - GET /rest/extensions - -**Response** - -.. code-block:: js - - { - "extensions": { - "Voting": { - "version": "4.5.5+" - }, - "BmpConvert": { - "version": "1.0" - } - } - } - -========== ====== ==================================================== -name type description -========== ====== ==================================================== -extensions object An object containing the extensions enabled as keys. - Each extension object contains the following keys: - - * ``version`` (string) The version of the extension. -========== ====== ==================================================== - -Timezone --------- - -Returns the timezone in which Bugzilla expects to receive dates and times on the API. -Currently hard-coded to UTC ("+0000"). This is unlikely to change. - -**Request** - -.. code-block:: text - - GET /rest/timezone - -.. code-block:: js - - { - "timezone": "+0000" - } - -**Response** - -======== ====== =============================================================== -name type description -======== ====== =============================================================== -timezone string The timezone offset as a string in (+/-)XXXX (RFC 2822) format. -======== ====== =============================================================== - -.. _rest-time: - -Time ----- - -Gets information about what time the Bugzilla server thinks it is, and -what timezone it's running in. - -**Request** - -.. code-block:: text - - GET /rest/time - -**Response** - -.. code-block:: js - - { - "web_time_utc": "2014-09-26T18:01:30Z", - "db_time": "2014-09-26T18:01:30Z", - "web_time": "2014-09-26T18:01:30Z", - "tz_offset": "+0000", - "tz_short_name": "UTC", - "tz_name": "UTC" - } - -============= ====== ========================================================== -name type description -============= ====== ========================================================== -db_time string The current time in UTC, according to the Bugzilla - database server. - - Note that Bugzilla assumes that the database and the - webserver are running in the same time zone. However, - if the web server and the database server aren't - synchronized or some reason, *this* is the time that - you should rely on or doing searches and other input - to the WebService. -web_time string This is the current time in UTC, according to - Bugzilla's web server. - - This might be different by a second from ``db_time`` - since this comes from a different source. If it's any - more different than a second, then there is likely - some problem with this Bugzilla instance. In this - case you should rely on the ``db_time``, not the - ``web_time``. -web_time_utc string Identical to ``web_time``. (Exists only for - backwards-compatibility with versions of Bugzilla - before 3.6.) -tz_name string The literal string ``UTC``. (Exists only for - backwards-compatibility with versions of Bugzilla - before 3.6.) -tz_short_name string The literal string ``UTC``. (Exists only for - backwards-compatibility with versions of Bugzilla - before 3.6.) -tz_offset string The literal string ``+0000``. (Exists only for - backwards-compatibility with versions of Bugzilla - before 3.6.) -============= ====== ========================================================== - -Job Queue Status ----------------- - -Reports the status of the job queue. - -**Request** - -.. code-block:: text - - GET /rest/jobqueue_status - -This method requires an authenticated user. - -**Response** - -.. code-block:: js - - { - "total": 12, - "errors": 0 - } - -=============== ======= ==================================================== -name type description -=============== ======= ==================================================== -total integer The total number of jobs in the job queue. -errors integer The number of errors produced by jobs in the queue. -=============== ======= ==================================================== diff --git a/docs/en/rst/api/core/v1/classification.rst b/docs/en/rst/api/core/v1/classification.rst deleted file mode 100644 index 45f7bb30d5..0000000000 --- a/docs/en/rst/api/core/v1/classification.rst +++ /dev/null @@ -1,79 +0,0 @@ -Classifications -=============== - -This part of the Bugzilla API allows you to deal with the available -classifications. You will be able to get information about them as well as -manipulate them. - -.. _rest_get_classification: - -Get Classification ------------------- - -Returns an object containing information about a set of classifications. - -**Request** - -To return information on a single classification using the ID or name: - -.. code-block:: text - - GET /rest/classification/(id_or_name) - -============== ===== ===================================== -name type description -============== ===== ===================================== -**id_or_name** mixed An Integer classification ID or name. -============== ===== ===================================== - -**Response** - -.. code-block:: js - - { - "classifications": [ - { - "sort_key": 0, - "description": "Unassigned to any classifications", - "products": [ - { - "id": 2, - "name": "FoodReplicator", - "description": "Software that controls a piece of hardware that will create any food item through a voice interface." - }, - { - "description": "Silk, etc.", - "name": "Spider Secretions", - "id": 4 - } - ], - "id": 1, - "name": "Unclassified" - } - ] - } - -``classifications`` (array) Each object is a classification that the user is -authorized to see and has the following items: - -=========== ====== ============================================================ -name type description -=========== ====== ============================================================ -id int The ID of the classification. -name string The name of the classification. -description string The description of the classification. -sort_key int The value which determines the order the classification is - sorted. -products array Products the user is authorized to access within the - classification. The product object keys are described below. -=========== ====== ============================================================ - -Product object: - -=========== ====== ================================ -name type description -=========== ====== ================================ -name string The name of the product. -id int The ID of the product. -description string The description of the product. -=========== ====== ================================ diff --git a/docs/en/rst/api/core/v1/comment.rst b/docs/en/rst/api/core/v1/comment.rst deleted file mode 100644 index e7709f2572..0000000000 --- a/docs/en/rst/api/core/v1/comment.rst +++ /dev/null @@ -1,473 +0,0 @@ -Comments -======== - -.. _rest_comments: - -Get Comments ------------- - -This allows you to get data about comments, given a bug ID or comment ID. - -**Request** - -To get all comments for a particular bug using the bug ID or alias: - -.. code-block:: text - - GET /rest/bug/(id_or_alias)/comment - -To get a specific comment based on the comment ID: - -.. code-block:: text - - GET /rest/bug/comment/(comment_id) - -=============== ======== ====================================================== -name type description -=============== ======== ====================================================== -**id_or_alias** mixed A single integer bug ID or alias. -**comment_id** int A single integer comment ID. -new_since datetime If specified, the method will only return comments - *newer* than this time. This only affects comments - returned from the ``ids`` argument. You will always be - returned all comments you request in the - ``comment_ids`` argument, even if they are older than - this date. -=============== ======== ====================================================== - -**Response** - -.. code-block:: js - - { - "bugs": { - "35": { - "comments": [ - { - "time": "2000-07-25T13:50:04Z", - "text": "test bug to fix problem in removing from cc list.", - "bug_id": 35, - "count": 0, - "attachment_id": null, - "is_private": false, - "tags": [], - "creator": "user@bugzilla.org", - "creation_time": "2000-07-25T13:50:04Z", - "reactions": { - "+1": 3, - "heart": 2, - "tada": 1 - }, - "id": 75 - } - ] - } - }, - "comments": {} - } - -Two items are returned: - -``bugs`` This is used for bugs specified in ``ids``. This is an object, -where the keys are the numeric IDs of the bugs, and the value is -a object with a single key, ``comments``, which is an array of comments. -(The format of comments is described below.) - -Any individual bug will only be returned once, so if you specify an ID -multiple times in ``ids``, it will still only be returned once. - -``comments`` Each individual comment requested in ``comment_ids`` is -returned here, in a object where the numeric comment ID is the key, -and the value is the comment. (The format of comments is described below.) - -A "comment" as described above is a object that contains the following items: - -================ ======== ===================================================== -name type description -================ ======== ===================================================== -id int The globally unique ID for the comment. -bug_id int The ID of the bug that this comment is on. -attachment_id int If the comment was made on an attachment, this will - be the ID of that attachment. Otherwise it will be - null. -count int The number of the comment local to the bug. The - Description is 0, comments start with 1. -text string The body of the comment, including any special text - (such as "this bug was marked as a duplicate of..."). -raw_text string The body of the comment without any special - additional text. -creator string The login name of the comment's author. -time datetime The time (in Bugzilla's timezone) that the comment - was added. -creation_time datetime This is exactly same as the ``time`` key. Use this - field instead of ``time`` for consistency with other - methods including :ref:`rest_single_bug` and - :ref:`rest_attachments`. - - For compatibility, ``time`` is still usable. - However, please note that ``time`` may be deprecated - and removed in a future release. - -is_private boolean ``true`` if this comment is private (only visible to - a certain group called the "insidergroup"), - ``false`` otherwise. -is_markdown boolean ``true`` if this comment is markdown. ``false`` if - this comment is plaintext. -edit_count int The number of times this comment has been edited. - ``0`` if the comment has never been edited. - - Only present for users who are allowed to edit other - people's comments. Revisions hidden by an - edit-comments admin are only counted for members of - the edit-comments admins group. - -last_change_time datetime The time (in Bugzilla's timezone) of the most recent - edit to this comment, or null if the comment has - never been edited. - - Only present for users who are allowed to edit other - people's comments, and follows the same rules as - ``edit_count`` for hidden revisions. - -reactions object An object containing reacted emoji names and - corresponding counts. To retrieve reacted users, use - :ref:`rest_get_comment_reactions`. -================ ======== ===================================================== - -**Errors** - -This method can throw all the same errors as :ref:`rest_single_bug`. In addition, -it can also throw the following errors: - -* 110 (Comment Is Private) - You specified the id of a private comment in the "comment_ids" - argument, and you are not in the "insider group" that can see - private comments. -* 111 (Invalid Comment ID) - You specified an id in the "comment_ids" argument that is invalid--either - you specified something that wasn't a number, or there is no comment with - that id. - -.. _rest_add_comment: - -Create Comments ---------------- - -This allows you to add a comment to a bug in Bugzilla. All comments created via the -API will be considered Markdown (specifically GitHub Flavored Markdown). - -**Request** - -To create a comment on a current bug. - -.. code-block:: text - - POST /rest/bug/(id)/comment - -.. code-block:: js - - { - "ids" : [123,..], - "comment" : "This is an additional comment", - "is_private" : false, - "is_markdown" : true - } - -``ids`` is optional in the data example above and can be used to specify adding -a comment to more than one bug at the same time. - -=========== ======= =========================================================== -name type description -=========== ======= =========================================================== -**id** int The ID or alias of the bug to append a comment to. -ids array List of integer bug IDs to add the comment to. -**comment** string The comment to append to the bug. If this is empty - or all whitespace, an error will be thrown saying that you - did not set the ``comment`` parameter. -is_private boolean If set to true, the comment is private, otherwise it is - assumed to be public. -is_markdown boolean If true, the comment will be rendered as markdown. - Defaults to the system ``use_markdown`` setting. -work_time double Adds this many hours to the "Hours Worked" on the bug. - If you are not in the time tracking group, this value will - be ignored. -=========== ======= =========================================================== - -**Response** - -.. code-block:: js - - { - "id" : 789 - } - -==== ==== ================================= -name type description -==== ==== ================================= -id int ID of the newly-created comment. -==== ==== ================================= - -**Errors** - -* 54 (Hours Worked Too Large) - You specified a "work_time" larger than the maximum allowed value of - "99999.99". -* 100 (Invalid Bug Alias) - If you specified an alias and there is no bug with that alias. -* 101 (Invalid Bug ID) - The id you specified doesn't exist in the database. -* 109 (Bug Edit Denied) - You did not have the necessary rights to edit the bug. -* 113 (Can't Make Private Comments) - You tried to add a private comment, but don't have the necessary rights. -* 114 (Comment Too Long) - You tried to add a comment longer than the maximum allowed length - (65,535 characters). -* 140 (Markdown Disabled) - You tried to set the "is_markdown" flag to true but the Markdown feature - is not enabled. - -.. _rest_get_comment_reactions: - -Get Comment Reactions ---------------------- - -Gets reactions left on a comment with reacted users’ details. - -**Request** - -To get the reactions attached to a comment: - -.. code-block:: text - - GET /rest/bug/comment/(comment_id)/reactions - -============== ==== ============================ -name type description -============== ==== ============================ -**comment_id** int A single integer comment ID. -============== ==== ============================ - -**Response** - -.. code-block:: js - - { - "+1": [ - { - "id": 2, - "real_name": "Test User", - "nick": "user", - "name": "user@bugzilla.org", - "email": "user@bugzilla.org" - } - ] - } - -An object containing the comment's reactions, where the key is a reacted emoji -name, and the value is an array of reacted users, which are the same as user -objects returned by :ref:`rest_single_bug`. - -**Errors** - -This method can throw all of the errors that :ref:`rest_comments` throws, plus: - -* 136 (Comment Reactions Disabled) - Comment reactions are not enabled on this Bugzilla instance. - -.. _rest_update_comment_reactions: - -Update Comment Reactions ------------------------- - -Adds or removes reactions from a comment. - -**Request** - -To update the reactions attached to a comment: - -.. code-block:: text - - PUT /rest/bug/comment/(comment_id)/reactions - -Example: - -.. code-block:: js - - { - "add" : ["+1", "smile"] - } - -============== ===== ========================================= -name type description -============== ===== ========================================= -**comment_id** int The ID of the comment to update. -add array The reactions to attach to the comment. -remove array The reactions to detach from the comment. -============== ===== ========================================= - -Supported reactions: ``+1``, ``-1``, ``tada``, ``smile``, ``sad`` and ``heart``. - -**Response** - -Same as :ref:`rest_get_comment_reactions`. - -**Errors** - -This method can throw all of the errors that :ref:`rest_comments` throws, plus: - -* 136 (Comment Reactions Disabled) - Comment reactions are not enabled on this Bugzilla instance. - -* 137 (Invalid Comment Reaction) - The comment reaction provided is not supported. - -.. _rest_search_comment_tags: - -Search Comment Tags -------------------- - -Searches for tags which contain the provided substring. - -**Request** - -To search for comment tags: - -.. code-block:: text - - GET /rest/bug/comment/tags/(query) - -Example: - -.. code-block:: text - - GET /rest/bug/comment/tags/spa - -========= ====== ===================================================== -name type description -========= ====== ===================================================== -**query** string Only tags containing this substring will be returned. -limit int If provided will return no more than ``limit`` tags. - Defaults to ``10``. -========= ====== ===================================================== - -**Response** - -.. code-block:: js - - [ - "spam" - ] - -An array of matching tags. - -**Errors** - -This method can throw all of the errors that :ref:`rest_single_bug` throws, plus: - -* 125 (Comment Tagging Disabled) - Comment tagging support is not available or enabled. - -.. _rest_update_comment_tags: - -Update Comment Tags -------------------- - -Adds or removes tags from a comment. - -**Request** - -To update the tags comments attached to a comment: - -.. code-block:: text - - PUT /rest/bug/comment/(comment_id)/tags - -Example: - -.. code-block:: js - - { - "comment_id" : 75, - "add" : ["spam", "bad"] - } - -============== ===== ==================================== -name type description -============== ===== ==================================== -**comment_id** int The ID of the comment to update. -add array The tags to attach to the comment. -remove array The tags to detach from the comment. -============== ===== ==================================== - -**Response** - -.. code-block:: js - - [ - "bad", - "spam" - ] - -An array of strings containing the comment's updated tags. - -**Errors** - -This method can throw all of the errors that :ref:`rest_single_bug` throws, plus: - -* 125 (Comment Tagging Disabled) - Comment tagging support is not available or enabled. -* 126 (Invalid Comment Tag) - The comment tag provided was not valid (e.g. contains invalid characters). -* 127 (Comment Tag Too Short) - The comment tag provided is shorter than the minimum length. -* 128 (Comment Tag Too Long) - The comment tag provided is longer than the maximum length. - -.. _rest_render_comment: - -Render Comment --------------- - -Returns the HTML rendering of the provided comment text. - -**Request** - -.. code-block:: text - - POST /rest/bug/comment/render - -Example: - -.. code-block:: js - - { - "id" : 2345, - "text" : "This issue has been fixed in bug 1234." - } - -============== ====== ================================================ -name type description -============== ====== ================================================ -**text** string Comment text to render. -id int The ID of the bug to render the comment against. -============== ====== ================================================ - -**Response** - -.. code-block:: js - - { - "html" : "This issue has been fixed in bug 1234." - ] - -==== ====== =================================== -name type description -==== ====== =================================== -html string Text containing the HTML rendering. -==== ====== =================================== - -**Errors** - -This method can throw all of the errors that :ref:`rest_single_bug` throws. diff --git a/docs/en/rst/api/core/v1/component.rst b/docs/en/rst/api/core/v1/component.rst deleted file mode 100644 index ad34a2c7fd..0000000000 --- a/docs/en/rst/api/core/v1/component.rst +++ /dev/null @@ -1,181 +0,0 @@ -Components -========== - -This part of the Bugzilla API looks at individual components and also allows updating their information. - -.. _rest_get_component: - -Get Component -------------- - -This allows you to retrieve information about a specific component. - -**Request** - -To get information about the General component under the Firefox product: - -.. code-block:: text - - GET /rest/component/Firefox/General - -To get information about a component where the product name contains a slash (/) character. -Named parameters must be used instead of path based parameters. - -.. code-block:: text - - GET /rest/component?product=Firefox%20%2F%20Bugs&component=General - -**Response** - -.. code-block:: js - - { - "default_assignee": "nobody@mozilla.org", - "default_bug_type": "--", - "default_qa_contact": "", - "description": "For bugs in Firefox which do not fit into other more specific Firefox components", - "id": 2, - "is_active": true, - "name": "General", - "team_name": "Mozilla", - "triage_owner": "admin@mozilla.bugs" - } - -.. _rest_component_object: - -Component Object - -======================== ======= ======================================================== -name type description -======================== ======= ======================================================== -id int An integer ID uniquely identifying the component in - this installation only. -name string The name of the component. -description string A description of the component, which may contain HTML. -is_active boolean A boolean indicating if the component is active. -default_bug_type string The default type for bugs filed under this component. -default_assignee string The login of the default assignee for the component. -default_qa_contact string The login of the default qa contact for the component. -triage_owner string The login of the default triage owner for the component. -team_name string The team name the component belongs to. -bug_description_template string The string included in the comment field of a new bug - when the component is selected. -======================== ======= ======================================================== - -.. _rest_component_create: - -Create Component ----------------- - -This allows you to create a new component under a specific product in Bugzilla. - -**Request** - -To create a new component called ``TestComponent`` under the ``Firefox`` product: - -.. code-block:: text - - { - "name" : "TestComponent", - "description" : "This is a new test component", - "default_assignee" : "admin@mozilla.bugs", - "team_name" : "Mozilla" - } - -======================== ====== ================================================================= -name type description -======================== ====== ================================================================= -name string The name of the component. -description string A description of the component, which may contain HTML. -default_bug_type string The default type for bugs filed under this component. - If empty, then product's default bug type is used. (optional). -default_assignee string The login of the default assignee for the component. -default_qa_contact string The login of the default qa contact for the component (optional). -triage_owner string The login of the triage owner for the component (optional). -team_name string The team name the component belongs to. -bug_description_template string The string included in the comment field of a new bug - when the component is selected (optional). -======================== ====== ================================================================= - -**Response** - -.. code-block:: js - - { - "default_assignee": "admin@mozilla.bugs", - "default_bug_type": "--", - "default_qa_contact": "", - "description": "This is a new test component", - "id": 2, - "is_active": true, - "name": "TestComponent", - "team_name": "Mozilla", - "triage_owner": "" - } - -A component object `rest_component_object`_ is returned. - -.. _rest_component_update: - -Update Component ----------------- - -This allows you to update an existing component in Bugzilla. - -**Request** - -.. code-block:: text - - PUT /rest/component/Firefox/General - -To update information about a component where the product name contains a slash (/) character. -Named parameters must be used instead of path based parameters. - -.. code-block:: text - - PUT /rest/component?product=Firefox%20%2F%20Bugs&component=General - -The body of the request should look similar to below. - -.. code-block:: js - - { - "default_assignee" : "admin@mozilla.bugs", - "triage_owner" : "nobody@mozilla.org" - } - -======================== ======= ====================================================== -name type description -======================== ======= ====================================================== -name string The name of this component. -description string A description for this component. Allows some simple - HTML. -default_assignee string The login of the default assignee for the component. -default_qa_contact string The login of the default qa contact for the component. -default_bug_type string The default type for bugs filed under this component. - If empty, then product's default bug type is used. -is_active boolean ``true`` if you want the component to be active. - ``false`` if not. -triage_owner string The login of the triage owner for the component. -team_name string The team name the component belongs to. -bug_description_template string The string included in the comment field of a new bug - when the component is selected. -======================== ======= ====================================================== - -**Response** - -.. code-block:: js - - { - "default_assignee": "admin@mozilla.bugs", - "default_bug_type": "--", - "default_qa_contact": "", - "description": "For bugs in Firefox which do not fit into other more specific Firefox components", - "id": 2, - "is_active": true, - "name": "General", - "team_name": "Mozilla", - "triage_owner": "nobody@mozilla.org", - } - -A component object `rest_component_object`_ is returned. diff --git a/docs/en/rst/api/core/v1/field.rst b/docs/en/rst/api/core/v1/field.rst deleted file mode 100644 index 4de6da3b0b..0000000000 --- a/docs/en/rst/api/core/v1/field.rst +++ /dev/null @@ -1,253 +0,0 @@ -Bug Fields -========== - -The Bugzilla API for getting details about bug fields. - -.. _rest_fields: - -Fields ------- - -Get information about valid bug fields, including the lists of legal values -for each field. - -**Request** - -To get information about all fields: - -.. code-block:: text - - GET /rest/field/bug - -To get information related to a single field: - -.. code-block:: text - - GET /rest/field/bug/(id_or_name) - -========== ===== ========================================================== -name type description -========== ===== ========================================================== -id_or_name mixed An integer field ID or string representing the field name. -========== ===== ========================================================== - -**Response** - -.. code-block:: js - - { - "fields": [ - { - "display_name": "Priority", - "name": "priority", - "type": 2, - "is_mandatory": false, - "value_field": null, - "values": [ - { - "sortkey": 100, - "sort_key": 100, - "visibility_values": [], - "name": "P1" - }, - { - "sort_key": 200, - "name": "P2", - "visibility_values": [], - "sortkey": 200 - }, - { - "sort_key": 300, - "visibility_values": [], - "name": "P3", - "sortkey": 300 - }, - { - "sort_key": 400, - "name": "P4", - "visibility_values": [], - "sortkey": 400 - }, - { - "name": "P5", - "visibility_values": [], - "sort_key": 500, - "sortkey": 500 - } - ], - "visibility_values": [], - "visibility_field": null, - "is_on_bug_entry": false, - "is_custom": false, - "id": 13 - } - ] - } - -``field`` (array) Field objects each containing the following items: - -================= ======= ===================================================== -name type description -================= ======= ===================================================== -id int An integer ID uniquely identifying this field in this - installation only. -type int The number of the fieldtype. The following values are - defined: - - * ``0`` Field type unknown - * ``1`` Single-line string field - * ``2`` Single value field - * ``3`` Multiple value field - * ``4`` Multi-line text value - * ``5`` Date field with time - * ``6`` Bug ID field - * ``7`` See Also field - * ``8`` Keywords field - * ``9`` Date field - * ``10`` Integer field - -is_custom boolean ``true`` when this is a custom field, ``false`` - otherwise. -name string The internal name of this field. This is a unique - identifier for this field. If this is not a custom - field, then this name will be the same across all - Bugzilla installations. -display_name string The name of the field, as it is shown in the user - interface. -is_mandatory boolean ``true`` if the field must have a value when filing - new bugs. Also, mandatory fields cannot have their - value cleared when updating bugs. -is_on_bug_entry boolean For custom fields, this is ``true`` if the field is - shown when you enter a new bug. For standard fields, - this is currently always ``false``, even if the field - shows up when entering a bug. (To know whether or not - a standard field is valid on bug entry, see - :ref:`rest_create_bug`. -visibility_field string The name of a field that controls the visibility of - this field in the user interface. This field only - appears in the user interface when the named field is - equal to one of the values is ``visibility_values``. - Can be null. -visibility_values array This field is only shown when ``visibility_field`` - matches one of these string values. When - ``visibility_field`` is null, then this is an empty - array. -value_field string The name of the field that controls whether or not - particular values of the field are shown in the user - interface. Can be null. -values array Objects representing the legal values for - select-type (drop-down and multiple-selection) - fields. This is also populated for the - ``component``, ``version``, ``target_milestone``, - and ``keywords`` fields, but not for the ``product`` - field (you must use ``get_accessible_products`` for - that). For fields that aren't select-type fields, - this will simply be an empty array. Each object - contains the items described in the Value object - below. -================= ======= ===================================================== - -Value object: - -================= ======= ===================================================== -name type description -================= ======= ===================================================== -name string The actual value--this is what you would specify for - this field in ``create``, etc. -sort_key int Values, when displayed in a list, are sorted first by - this integer and then secondly by their name. -visibility_values array If ``value_field`` is defined for this field, then - this value is only shown if the ``value_field`` is - set to one of the values listed in this array. Note - that for per-product fields, ``value_field`` is set - to ``product`` and ``visibility_values`` will reflect - which product(s) this value appears in. -is_active boolean This value is defined only for certain - product-specific fields such as version, - target_milestone or component. When true, the value - is active; otherwise the value is not active. -description string The description of the value. This item is only - included for the ``keywords`` field. -is_open boolean For ``bug_status`` values, determines whether this - status specifies that the bug is "open" (``true``) - or "closed" (``false``). This item is only included - for the ``bug_status`` field. -can_change_to array For ``bug_status`` values, this is an array of - objects that determine which statuses you can - transition to from this status. (This item is only - included for the ``bug_status`` field.) - - Each object contains the following items: - - * name: (string) The name of the new status - * comment_required: (boolean) ``true`` if a comment - is required when you change a bug into this status - using this transition. -================= ======= ===================================================== - -**Errors** - -* 51 (Invalid Field Name or Id) - You specified an invalid field name or id. - -.. _rest_legal_values: - -Legal Values ------------- - -**DEPRECATED** Use ''Fields'' instead. - -Tells you what values are allowed for a particular field. - -**Request** - -To get information on the values for a field based on field name: - -.. code-block:: text - - GET /rest/field/bug/(field)/values - -To get information based on field name and a specific product: - -.. code-block:: text - - GET /rest/field/bug/(field)/(product_id)/values - -========== ====== ============================================================= -name type description -========== ====== ============================================================= -field string The name of the field you want information about. - This should be the same as the name you would use in - :ref:`rest_create_bug`, below. -product_id int If you're picking a product-specific field, you have to - specify the ID of the product you want the values for. -========== ====== ============================================================= - -**Response** - -.. code-block:: js - - { - "values": [ - "P1", - "P2", - "P3", - "P4", - "P5" - ] - } - -========== ====== ============================================================= -name type description -========== ====== ============================================================= -values array The legal values for this field. The values will be sorted - as they normally would be in Bugzilla. -========== ====== ============================================================= - -**Errors** - -* 106 (Invalid Product) - You were required to specify a product, and either you didn't, or you - specified an invalid product (or a product that you can't access). -* 108 (Invalid Field Name) - You specified a field that doesn't exist or isn't a drop-down field. diff --git a/docs/en/rst/api/core/v1/flag-activity.rst b/docs/en/rst/api/core/v1/flag-activity.rst deleted file mode 100644 index 4a8a2cb7f1..0000000000 --- a/docs/en/rst/api/core/v1/flag-activity.rst +++ /dev/null @@ -1,157 +0,0 @@ -Flag Activity -============= - -This API provides information about activity relating to bug and attachment flags. - -Get Flag Activity ------------------ - -**Request** - -There are a variety of methods for querying flag activity based on different criteria. - -.. code-block:: text - - GET /rest/review/flag_activity/(flag_id) - -Fetches activity for the given flag as specified by its id. - -.. code-block:: text - - GET /rest/review/flag_activity/requestee/(requestee) - -Fetches activity for flags where the requestee matches the given Bugzilla login. - -.. code-block:: text - - GET /rest/review/flag_activity/setter/(requestee) - -Fetches activity for flags where the setter matches the given Bugzilla login. - -.. code-block:: text - - GET /rest/review/flag_activity/type_id/(type_id) - -Fetches activity for all flags of the type specified by its id. - -.. code-block:: text - - GET /rest/review/flag_activity/type_name/(type_name) - -Fetches activity for all flags of the type specified by its name. - -.. code-block:: text - - GET /rest/review/flag_activity - -Fetches activity for all flags. - -There are also query parameters that can be used to further filter the response: - -====== ====== =================================================== -name type description -====== ====== =================================================== -limit int Number of entries to return. -offset int Number of entries to skip before returning results. -after date Display activity occurring on or after this date. -before date Display activity occurring before this date. -====== ====== =================================================== - -Note that if ``offset`` is specified, ``limit`` must be given as well. - -There is a site-specific maximum number of entries that will be returned regardless of -the value given for ``limit``. This is also the default if ``limit`` is not specified. - -For example, to get the first 100 flag-activity entries that occurred on or after -2018-01-01 for flag ID 42: - -.. code-block:: text - - GET /rest/review/flag_activity/42?limit=100&after=2018-01-01 - -**Response** - -.. code-block:: js - - [ - { - "attachment_id": null, - "bug_id": 1395127, - "creation_time": "2018-10-10 12:41:00", - "flag_id": 1637223, - "id": 1449303, - "requestee": { - "id": 123, - "name": "user@mozilla.com", - "nick": "user", - "real_name": "J. Random User" - }, - "setter": { - "id": 123, - "name": "user@mozilla.com", - "nick": "user", - "real_name": "J. Random User" - }, - "status": "?", - "type": { - "description": "Set this flag when the bug is in need of additional information.", - "id": 800, - "is_active": true, - "is_multiplicable": true, - "is_requesteeble": true, - "name": "needinfo", - "type": "bug" - } - } - ] - -An object containing a list of flags. The fields for each flag are as follows: - -============= ======== ==================================================== -name type description -============= ======== ==================================================== -attachment_id int The numeric ID of the associated attachment, if any. -bug_id int The numeric ID of the associated bug. -creation_time datetime The time the flag status changed. -flag_id int The numeric ID of this flag instance. -id int The numeric ID of this flag-activity event. -requestee object Data about the user of which the flag was requested. -setter object Data about the user who set the flag. -status string Status of the flag: "?", "+", or "-". -type object Data about the type of flag. -============= ======== ==================================================== - -The requestee and setter objects have the following fields: - -========= ====== ==================================================== -name type description -========= ====== ==================================================== -id int The unique ID of the user. -name string The login of the user (typically an email address). -real_name string The real name of the user, if set. -nick string The user's nickname. Currently this is extracted - the real_name, name or email field. -========= ====== ==================================================== - -The type object has the following fields: - -================ ======= ============================================================================= -name type description -================ ======= ============================================================================= -description string A plain-English description of the flag type. -id int The numeric ID of the flag type. -is_active boolean Indicates if the flag type can be used. -is_multiplicable boolean Indicates if more than one flags of this type can be set on a bug/attachment. -is_requesteeble boolean Indicates if this flag type supports a requestee. -name string Short descriptive name of this flag type. -type string The object to which this flag type can be applied (e.g. "bug", "attachment"). -================ ======= ============================================================================= - -**Errors** - -If a nonexistent but properly specified (i.e. integer value) flag or flag-type ID is given, a 200 OK -response will be returned with an empty array. In other cases, different response codes may be -returned: - -* 400 (Bad Request): An invalid flag or flag-type ID was given, or ``offset`` was given without a - value for ``limit``. diff --git a/docs/en/rst/api/core/v1/general.rst b/docs/en/rst/api/core/v1/general.rst deleted file mode 100644 index f9fd7e464a..0000000000 --- a/docs/en/rst/api/core/v1/general.rst +++ /dev/null @@ -1,214 +0,0 @@ -General -======= - -This is the standard REST API for external programs that want to interact -with Bugzilla. It provides a REST interface to various Bugzilla functions. - -Basic Information ------------------ - -**Data Format** - -The REST API only supports JSON input, and either JSON or JSONP output. -So objects sent and received must be in JSON format. - -If you need JSONP output, you must set the ``Accept: application/javascript`` -HTTP header and add a ``callback`` parameter to name your callback. - -Parameters may also be passed in as part of the query string for non-GET -requests and will override any matching parameters in the request body. - -Example request which returns the current version of Bugzilla: - -.. code-block:: http - - GET /rest/version HTTP/1.1 - Host: bugzilla.example.com - -Example response: - -.. code-block:: http - - HTTP/1.1 200 OK - Vary: Accept - Content-Type: application/json - - { - "version" : "4.2.9+" - } - -**Errors** - -When an error occurs over REST, an object is returned with the key ``error`` -set to ``true``. - -The error contents look similar to: - -.. code-block:: js - - { - "error": true, - "message": "Some message here", - "code": 123 - } - -.. _rest-query-string-limit: - -BMO's Varnish front end rejects request targets longer than 8 KiB, including -the path and query string, with a plain-text ``414 URI Too Long`` response -instead of the JSON error object described above. This limit accommodates -roughly 1,000 seven-digit bug IDs in the ``id`` parameter for -``GET /rest/bug``, depending on the other parameters. Keep request targets -below the limit and split large queries into multiple requests. - -Common Data Types ------------------ - -The Bugzilla API uses the following various types of parameters: - -======== ====================================================================== - type description -======== ====================================================================== -int Integer. -double A floating-point number. -string A string. -email A string representing an email address. This value, when returned, - may be filtered based on if the user is logged in or not. -date A specific date. Example format: ``YYYY-MM-DD``. -datetime A date/time. Timezone should be in UTC unless otherwise noted. - Example format: ``YYYY-MM-DDTHH24:MI:SSZ``. -boolean ``true`` or ``false``. -base64 A base64-encoded string. This is the only way to transfer - binary data via the API. -array An array. There may be mixed types in an array. ``[`` and ``]`` are - used to represent the beginning and end of arrays. -object A mapping of keys to values. Called a "hash", "dict", or "map" in - some other programming languages. The keys are strings, and the - values can be any type. ``{`` and ``}`` are used to represent the - beginning and end of objects. -======== ====================================================================== - -Parameters that are required will be displayed in **bold** in the parameters -table for each API method. - -.. _rest-authentication: - -Authentication --------------- - -Some methods do not require you to log in. An example of this is -:ref:`rest_single_bug`. However, authenticating yourself allows you to see -non-public information, for example, a bug that is not publicly visible. - -To authenticate yourself, you will need to use API keys: - -**API Keys** - -You can specify 'X-BUGZILLA-API-KEY' header with the API key as a value to -any request, and you will be authenticated as that user if the key is correct and has not been revoked. - -You can set up an API key by using the :ref:`API Keys tab ` in the -Preferences pages. - -**WARNING**: It should be noted that additional authentication methods exist, but they are **not recommended** for use and are likely to be deprecated in future versions of BMO, due to security concerns. These additional methods include the following: - - - api key via ``Bugzilla_api_key`` or simply ``api_key`` in query parameters. - -Useful Parameters ------------------ - -Many calls take common arguments. These are documented below and linked from -the individual calls where these parameters are used. - -.. _rest-include-fields: - -**Including Fields** - -Many calls return an array of objects with various fields in the objects. (For -example, :ref:`rest_single_bug` returns a list of ``bugs`` that have fields like -``id``, ``summary``, ``creation_time``, etc.) - -These parameters allow you to limit what fields are present in the objects, to -improve performance or save some bandwidth. - -``include_fields``: The (case-sensitive) names of fields in the response data. -Only the fields specified in the object will be returned, the rest will not be -included. Fields should be comma delimited. - -Invalid field names are ignored. - -Example request to :ref:`rest_user_get`: - -.. code-block:: text - - GET /rest/user/1?include_fields=id,name - -would return something like: - -.. code-block:: js - - { - "users" : [ - { - "id" : 1, - "name" : "user@domain.com" - } - ] - } - -**Excluding Fields** - -``exclude_fields``: The (case-sensitive) names of fields in the return value. The -fields specified will not be included in the returned objects. Fields should -be comma delimited. - -Invalid field names are ignored. - -Specifying fields here overrides ``include_fields``, so if you specify a -field in both, it will be excluded, not included. - -Example request to :ref:`rest_user_get`: - -.. code-block:: js - - GET /rest/user/1?exclude_fields=name - -would return something like: - -.. code-block:: js - - { - "users" : [ - { - "id" : 1, - "real_name" : "John Smith" - } - ] - } - -Some calls support specifying "subfields". If a call states that it supports -"subfield" restrictions, you can restrict what information is returned within -the first field. For example, if you call :ref:`rest_product_get` with an -``include_fields`` of ``components.name``, then only the component name would be -returned (and nothing else). You can include the main field, and exclude a -subfield. - -There are several shortcut identifiers to ask for only certain groups of -fields to be returned or excluded: - -========= ===================================================================== -value description -========= ===================================================================== -_all All possible fields are returned if this is specified in - ``include_fields``. -_default Default fields are returned if ``include_fields`` is empty or - this is specified. This is useful if you want the default - fields in addition to a field that is not normally returned. -_extra Extra fields are not returned by default and need to be manually - specified in ``include_fields`` either by exact field name, or adding - ``_extra``. - _custom Custom fields are normally returned by default unless this is added - to ``exclude_fields``. Also you can use it in ``include_fields`` if - for example you want specific field names plus all custom fields. - Custom fields are normally only relevant to bug objects. -========= ===================================================================== diff --git a/docs/en/rst/api/core/v1/github.rst b/docs/en/rst/api/core/v1/github.rst deleted file mode 100644 index 833618e6ab..0000000000 --- a/docs/en/rst/api/core/v1/github.rst +++ /dev/null @@ -1,268 +0,0 @@ -Github -============ - -Pull Requests -------------- - -This API endpoint is for creating attachments in a bug that are redirect links to a -specific Github pull request. This allows a bug viewer to click on the Github link -and be automatically redirected to the pull request. - -**Github Setup Instructions** - -* Create or identify a Bugzilla bot account to own this webhook. The bot - account should be least-privileged — grant it only the permissions needed - for the integration. -* A BMO admin must add that bot account to the ``github-webhook-bot`` group - via the Users admin UI (``/editusers.cgi``). -* Log in as the bot account and go to Preferences > API Keys. -* Create a new API key with a descriptive label (e.g. - ``github-webhook-mozilla-bteam-bmo``). Copy the key value — it will only - be shown once. - -.. warning:: - This API key also grants full access to the Bugzilla REST API as the bot - account. Treat it as a credential: store it only in the GitHub webhook - secret field and never share it. - -* From the repository main page, click on the Settings tab. -* Click on Webhooks from the left side menu. -* Click on the Add Webhook button near the top right. -* For the payload url, enter ``https://bugzilla.mozilla.org/rest/github/pull_request``. -* Choose ``application/json`` for the content type. -* Enter the Bugzilla API key you created above as the webhook secret. -* Make sure Enable SSL is turned on. -* Select "Let me select individual events" and only enable changes for "Pull Requests". -* Make sure at the bottom that "Active" is checked on. -* Save the webhook. - -.. note:: - If a webhook secret is ever compromised, revoke the affected API key from the - bot account's Preferences > API Keys page. Only that single webhook is affected — - all other bot accounts' webhooks continue to work without any changes. - -.. note:: - Past pull requests will not automatically get a link created in the bug. New pull - requests should get the link automatically when the pull request is first created. - -.. note:: - The API endpoint looks at the pull request title for the bug id so - make sure the title is formatted correctly to allow the bug id to be determined. - Examples are: ``Bug 1234:``, ``Bug - 1234``, ``bug 1234``, or ``Bug 1234 -``. - -**Request** - -The endpoint will error for any requests that do not have ``X-GitHub-Event`` header with -either the value ``pull_request`` or ``ping``. Ping events can happen when a webhook is -first created. In that case, Bugzilla will return success if the signature checks out. - -.. code-block:: text - - POST /rest/github/pull_request - -.. code-block:: js - - { - "pull_request": { - "html_url": "https://github.com/mozilla-bteam/bmo/pull/1943", - "number": 1943, - "title": "Bug 1234567 - Some really bad bug which should be fixed" - } - } - -The above example is only a small amount of the full data that is sent. - -Some params must be set, or an error will be thrown. The required params are -marked in **bold**. - -========================= ======= ======================================================= -name type description -========================= ======= ======================================================= -**pull_request** Object Object containing data about the current pull request. -**pull_request.html_url** string A fully qualified link to the pull request. -**pull_request.number** int The pull request ID unique to the repository. -**pull_request.title** string The full title of the current pull request containing - the bug report ID. -========================= ======= ======================================================= - -**Response** - -Operation was completed successfully. - -.. code-block:: js - - { - "error": 0 - "id": 22 - } - -======= ======= =================================================== -name type description -======= ======= =================================================== -error boolean Whether the operation was successful or not. -id int ID of the pre-existing or newly-created attachment. -======= ======= =================================================== - -An error condition occurred. - -.. code-block:: js - - { - "error": 1 - "message": "The pull request title did not contain a valid bug ID." - } - -======= ======= =================================================== -name type description -======= ======= =================================================== -error boolean Whether the operation was successful or not. -message string A message detailing what the error condition was. -======= ======= =================================================== - -Push Comments -------------- - -This API endpoint is for adding comments to a bug when a push is made to a linked -Github repository. The comment will be short and specially formatted using pieces -of information from the full JSON sent to Bugzilla by the push event. If the bug -does not have the keyword ``leave-open`` set, the bug will be resolved as FIXED. -Also, the ``qe-verify`` flag will be set to `+` for the bug unless the -``?no-qe-verify=1`` query parameter is passed in the URL. For some specific -repositories, a Firefox status flag may be set to FIXED. - -**Github Setup Instructions** - -* Create or identify a Bugzilla bot account to own this webhook. The bot - account should be least-privileged — grant it only the permissions needed - for the integration. -* A BMO admin must add that bot account to the ``github-webhook-bot`` group - via the Users admin UI (``/editusers.cgi``). -* Log in as the bot account and go to Preferences > API Keys. -* Create a new API key with a descriptive label (e.g. - ``github-webhook-mozilla-bteam-bmo-push``). Copy the key value — it will only - be shown once. - -.. warning:: - This API key also grants full access to the Bugzilla REST API as the bot - account. Treat it as a credential: store it only in the GitHub webhook - secret field and never share it. - -* From the repository main page, click on the Settings tab. -* Click on Webhooks from the left side menu. -* Click on the Add Webhook button near the top right. -* For the payload url, enter ``https://bugzilla.mozilla.org/rest/github/push_comment``. -* Add ``?no-qe-verify=1`` to the URL if you do not want the ``qe-verify`` flag set. -* Choose ``application/json`` for the content type. -* Enter the Bugzilla API key you created above as the webhook secret. -* Make sure Enable SSL is turned on. -* Select "Let me select individual events" and only enable changes for "Pushes". -* Make sure at the bottom that "Active" is checked on. -* Save the webhook. - -.. note:: - If a webhook secret is ever compromised, revoke the affected API key from the - bot account's Preferences > API Keys page. Only that single webhook is affected — - all other bot accounts' webhooks continue to work without any changes. - -.. note:: - The API endpoint looks at the commit messages for the bug ID so - make sure the message is formatted correctly to allow the bug ID to be determined. - Examples are: ``Bug 1234:``, ``Bug - 1234``, ``bug 1234``, or ``Bug 1234 -``. - -**Request** - -The endpoint will error for any events that do not have ``X-GitHub-Event`` header with -either the value ``push`` or ``ping``. Ping events can happen when a webhook is first -created. In that case, Bugzilla will return success if the signature checks out. - -.. code-block:: text - - POST /rest/github/push_comment - -.. code-block:: js - - { - "ref": "refs/heads/master", - "repository": { - "full_name": "mozilla-bteam/bmo", - "html_url": "https://github.com/mozilla-bteam/bmo", - "description": "bugzilla.mozilla.org source - report issues here: https://bugzilla.mozilla.org/enter_bug.cgi?product=bugzilla.mozilla.org", - }, - "commits": [ - { - "message": "Bug 1803939 - Webhook URL field is too short", - "url": "https://github.com/mozilla-bteam/bmo/commit/b4edfe9343e1474e0a6959531d2362078ea6ee84", - "author": { - "name": "dklawren", - "username": "dklawren" - }, - "added": [], - "removed": [], - "modified": [ - "extensions/Webhooks/Extension.pm", - "extensions/Webhooks/template/en/default/account/prefs/webhooks.html.tmpl" - ] - } - ] - } - -The above example is only a small amount of the full data that is sent. - -.. note:: - Only the first line of the commit message will be used on the bug comment. - -Some params must be set, or an error will be thrown. The required params are -marked in **bold**. - -=================================== ======= ======================================================================= -name type description -=================================== ======= ======================================================================= -**ref** string The branch (ref) that the commit was pushed to (ex: refs/heads/master). -**repository.full_name** string The name of the Github repository. -**commits** array An array of commit objects that were pushed. -**commits..message** string The full commit message containing the bug report ID. -**commits..url** string The full URL to the commit on Github. -**commits..author.username** string The user name of the commit author. -=================================== ======= ======================================================================= - -**Response** - -Operation was completed successfully. - -.. code-block:: js - - { - "bugs": { - 1803939: [ - { - "text": "Authored by https:\/\/github.com\/dklawren\nhttps:\/\/github.com\/mozilla-bteam\/bmo\/commit\/4ef4caed5bc22a734bd9ec15aaac87c19ef6e80e\nBug 1803939 - Webhook URL field is too short" - } - ] - }, - "error": 0 - } - -====================== ======= ======================================================== -name type description -====================== ======= ======================================================== -error boolean Whether the operation was successful or not. -bugs object Object containing bug IDs as object keys. -bugs. array List of comment objects that were added to the bug . -bugs...text string The comment text that was added to the bug . -====================== ======= ======================================================== - -An error condition occurred. - -.. code-block:: js - - { - "error": 1 - "message": "The push commit message did not contain a valid bug ID." - } - -======= ======= =================================================== -name type description -======= ======= =================================================== -error boolean Whether the operation was successful or not. -message string A message detailing what the error condition was. -======= ======= =================================================== diff --git a/docs/en/rst/api/core/v1/group.rst b/docs/en/rst/api/core/v1/group.rst deleted file mode 100644 index b73c780a8e..0000000000 --- a/docs/en/rst/api/core/v1/group.rst +++ /dev/null @@ -1,307 +0,0 @@ -Groups -====== - -The API for creating, changing, and getting information about groups. - -.. _rest_group_create: - -Create Group ------------- - -This allows you to create a new group in Bugzilla. You must be authenticated and -be in the *creategroups* group to perform this action. - -**Request** - -.. code-block:: text - - POST /rest/group - -.. code-block:: js - - { - "name" : "secret-group", - "description" : "Too secret for you!", - "is_active" : true - } - -Some params must be set, or an error will be thrown. The required params are -marked in **bold**. - -=============== ======= ======================================================= -name type description -=============== ======= ======================================================= -**name** string A short name for this group. Must be unique. This - is not usually displayed in the user interface, except - in a few places. -**description** string A human-readable name for this group. Should be - relatively short. This is what will normally appear in - the UI as the name of the group. -user_regexp string A regular expression. Any user whose Bugzilla username - matches this regular expression will automatically be - granted membership in this group. -is_active boolean ``true`` if new group can be used for bugs, ``false`` - if this is a group that will only contain users and no - bugs will be restricted to it. -icon_url string A URL pointing to a small icon used to identify the - group. This icon will show up next to users' names in - various parts of Bugzilla if they are in this group. -=============== ======= ======================================================= - -**Response** - -.. code-block:: js - - { - "id": 22 - } - -==== ==== ============================== -name type description -==== ==== ============================== -id int ID of the newly-created group. -==== ==== ============================== - -**Errors** - -* 800 (Empty Group Name) - You must specify a value for the "name" field. -* 801 (Group Exists) - There is already another group with the same "name". -* 802 (Group Missing Description) - You must specify a value for the "description" field. -* 803 (Group Regexp Invalid) - You specified an invalid regular expression in the "user_regexp" field. - -.. _rest_group_update: - -Update Group ------------- - -This allows you to update a group in Bugzilla. You must be authenticated and be -in the *creategroups* group to perform this action. - -**Request** - -To update a group using the group ID or name: - -.. code-block:: text - - PUT /rest/group/(id_or_name) - -.. code-block:: js - - { - "name" : "secret-group", - "description" : "Too secret for you! (updated description)", - "is_active" : false - } - -You can edit a single group by passing the ID or name of the group -in the URL. To edit more than one group, you can specify addition IDs or -group names using the ``ids`` or ``names`` parameters respectively. - -One of the below must be specified. - -============== ===== ========================================================== -name type description -============== ===== ========================================================== -**id_or_name** mixed Integer group or name. -**ids** array IDs of groups to update. -**names** array Names of groups to update. -============== ===== ========================================================== - -The following parameters specify the new values you want to set for the group(s) -you are updating. - -=========== ======= =========================================================== -name type description -=========== ======= =========================================================== -name string A new name for the groups. If you try to set this while - updating more than one group, an error will occur, as - group names must be unique. -description string A new description for the groups. This is what will appear - in the UI as the name of the groups. -user_regexp string A new regular expression for email. Will automatically - grant membership to these groups to anyone with an email - address that matches this Perl regular expression. -is_active boolean Set if groups are active and eligible to be used for bugs. - ``true`` if bugs can be restricted to this group, ``false`` - otherwise. -icon_url string A URL pointing to an icon that will appear next to the name - of users who are in this group. -=========== ======= =========================================================== - -**Response** - -.. code-block:: js - - { - "groups": [ - { - "changes": { - "description": { - "added": "Too secret for you! (updated description)", - "removed": "Too secret for you!" - }, - "is_active": { - "removed": "1", - "added": "0" - } - }, - "id": "22" - } - ] - } - -``groups`` (array) Group change objects, each containing the following items: - -======= ====== ================================================================ -name type description -======= ====== ================================================================ -id int The ID of the group that was updated. -changes object The changes that were actually done on this group. The - keys are the names of the fields that were changed, and the - values are an object with two items: - - * added: (string) The values that were added to this field, - possibly a comma-and-space-separated list if multiple values - were added. - * removed: (string) The values that were removed from this - field, possibly a comma-and-space-separated list if multiple - values were removed. -======= ====== ================================================================ - -**Errors** - -The same as :ref:`rest_group_create`. - -.. _rest_group_get: - -Get Group ---------- - -Returns information about Bugzilla groups. - -**Request** - -To return information about a specific group ID or name: - -.. code-block:: text - - GET /rest/group/(id_or_name) - -You can also return information about more than one specific group by using the -following in your query string: - -.. code-block:: text - - GET /rest/group?ids=1&ids=2&ids=3 - GET /group?names=ProductOne&names=Product2 - -If neither IDs nor names are passed, and you are in the creategroups or -editusers group, then all groups will be retrieved. Otherwise, only groups -that you have bless privileges for will be returned. - -========== ======= ============================================================ -name type description -========== ======= ============================================================ -id_or_name mixed Integer group ID or name. -ids array Integer IDs of groups. -names array Names of groups. -membership boolean Set to 1 then a list of members of the passed groups names - and IDs will be returned. -========== ======= ============================================================ - -**Response** - -.. code-block:: js - - { - "groups": [ - { - "membership": [ - { - "real_name": "Bugzilla User", - "nick": "user", - "can_login": true, - "name": "user@bugzilla.org", - "login_denied_text": "", - "id": 85, - "email_enabled": false, - "email": "user@bugzilla.org" - }, - ], - "is_active": true, - "description": "Test Group", - "user_regexp": "", - "is_bug_group": true, - "name": "TestGroup", - "id": 9 - } - ] - } - -If the user is a member of the *creategroups* group they will receive -information about all groups or groups matching the criteria that they passed. -You have to be in the creategroups group unless you're requesting membership -information. - -If the user is not a member of the *creategroups* group, but they are in the -"editusers" group or have bless privileges to the groups they require -membership information for, the is_active, is_bug_group and user_regexp values -are not supplied. - -The return value will be an object containing group names as the keys; each -value will be an object that describes the group and has the following items: - -============ ====== =========================================================== -name type description -============ ====== =========================================================== -id int The unique integer ID that Bugzilla uses to identify this - group. Even if the name of the group changes, this ID will - stay the same. -name string The name of the group. -description string The description of the group. -is_bug_group int Whether this group is to be used for bug reports or is - only administrative specific. -user_regexp string A regular expression that allows users to be added to - this group if their login matches. -is_active int Whether this group is currently active or not. -users array User objects that are members of this group; only - returned if the user sets the ``membership`` parameter to - 1. Each user object has the items describe in the User - object below. -============ ====== =========================================================== - -User object: - -============= ======= ========================================================= -name type description -============= ======= ========================================================= -id int The ID of the user. -real_name string The actual name of the user. -nick string The user's nickname. Currently this is extracted from - the real_name, name or email field. -email string The email address of the user. -name string The login name of the user. Note that in some situations - this is different than their email. -can_login boolean A boolean value to indicate if the user can login into - Bugzilla. -email_enabled boolean A boolean value to indicate if bug-related mail will - be sent to the user or not. -disabled_text string A text field that holds the reason for disabling a user - from logging into Bugzilla. If empty, then the user - account is enabled; otherwise it is disabled/closed. -============= ======= ========================================================= - -**Errors** - -* 51 (Invalid Object) - A non existing group name was passed to the function, as a result no - group object existed for that invalid name. -* 805 (Cannot view groups) - Logged-in users are not authorized to edit Bugzilla groups as they are not - members of the creategroups group in Bugzilla, or they are not authorized to - access group member's information as they are not members of the "editusers" - group or can bless the group. diff --git a/docs/en/rst/api/core/v1/index.rst b/docs/en/rst/api/core/v1/index.rst deleted file mode 100644 index bc2835e627..0000000000 --- a/docs/en/rst/api/core/v1/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -Core API v1 -=========== - -.. toctree:: - - attachment - bug - bug-user-last-visit - bugzilla - classification - comment - component - field - flag-activity - general - github - group - product - user - reminders diff --git a/docs/en/rst/api/core/v1/product.rst b/docs/en/rst/api/core/v1/product.rst deleted file mode 100644 index 178d0f67fa..0000000000 --- a/docs/en/rst/api/core/v1/product.rst +++ /dev/null @@ -1,477 +0,0 @@ -Products -======== - -This part of the Bugzilla API allows you to list the available products and -get information about them. - -.. _rest_product_list: - -List Products -------------- - -Returns a list of the IDs of the products the user can search on. - -**Request** - -To get a list of product IDs a user can select such as for querying bugs: - -.. code-block:: text - - GET /rest/product_selectable - -To get a list of product IDs a user can enter a bug against: - -.. code-block:: text - - GET /rest/product_enterable - -To get a list of product IDs a user can search or enter bugs against. - -.. code-block:: text - - GET /rest/product_accessible - -**Response** - -.. code-block:: js - - { - "ids": [ - "2", - "3", - "19", - "1", - "4" - ] - } - -==== ===== ====================================== -name type description -==== ===== ====================================== -ids array List of integer product IDs. -==== ===== ====================================== - -.. _rest_product_get: - -Get Product ------------ - -Returns a list of information about the products passed to it. - -**Request** - -To return information about a specific type of products such as -``accessible``, ``selectable``, or ``enterable``: - -.. code-block:: text - - GET /rest/product?type=accessible - -To return information about a specific product by ``id`` or ``name``: - -.. code-block:: text - - GET /rest/product/(id_or_name) - -You can also return information about more than one product by using the -following parameters in your query string: - -.. code-block:: text - - GET /rest/product?ids=1&ids=2&ids=3 - GET /rest/product?names=ProductOne&names=Product2 - -========== ====== ============================================================= -name type description -========== ====== ============================================================= -id_or_name mixed Integer product ID or product name. -ids array Product IDs -names array Product names -type string The group of products to return. Valid values are - ``accessible`` (default), ``selectable``, and ``enterable``. - ``type`` can be a single value or an array of values if more - than one group is needed with duplicates removed. -========== ====== ============================================================= - -**Response** - -.. code-block:: js - - { - "products": [ - { - "id": 1, - "default_bug_type": "defect", - "default_milestone": "---", - "default_version": "unspecified", - "components": [ - { - "is_active": true, - "default_assigned_to": "admin@bugzilla.org", - "default_bug_type": "defect", - "id": 1, - "sort_key": 0, - "name": "TestComponent", - "flag_types": { - "bug": [ - { - "is_active": true, - "grant_group": null, - "cc_list": "", - "is_requestable": true, - "id": 3, - "is_multiplicable": true, - "name": "needinfo", - "request_group": null, - "is_requesteeble": true, - "sort_key": 0, - "description": "needinfo" - } - ], - "attachment": [ - { - "description": "Review", - "is_multiplicable": true, - "name": "review", - "is_requesteeble": true, - "request_group": null, - "sort_key": 0, - "cc_list": "", - "grant_group": null, - "is_requestable": true, - "id": 2, - "is_active": true - } - ] - }, - "default_qa_contact": "", - "triage_owner": "", - "team_name": "Mozilla", - "description": "This is a test component." - } - ], - "is_active": true, - "classification": "Unclassified", - "versions": [ - { - "id": 1, - "name": "unspecified", - "is_active": true, - "sort_key": 0 - } - ], - "description": "This is a test product.", - "has_unconfirmed": true, - "milestones": [ - { - "name": "---", - "is_active": true, - "sort_key": 0, - "id": 1 - } - ], - "name": "TestProduct" - } - ] - } - -``products`` (array) Each product object has the following items: - -================= ======= ===================================================== -name type description -================= ======= ===================================================== -id int An integer ID uniquely identifying the product in - this installation only. -name string The name of the product. This is a unique identifier - for the product. -description string A description of the product, which may contain HTML. -is_active boolean A boolean indicating if the product is active. -default_bug_type string The default type for bugs filed under this product. -default_milestone string The name of the default milestone for the product. -default_version string The name of the default version for the product. -has_unconfirmed boolean Indicates whether the UNCONFIRMED bug status is - available for this product. -classification string The classification name for the product. -components array Each component object has the items described in the - Component object below. -versions array Each object describes a version, and has the - following items: ``name``, ``sort_key`` and - ``is_active``. -milestones array Each object describes a milestone, and has the - following items: ``name``, ``sort_key`` and - ``is_active``. -================= ======= ===================================================== - -If the user tries to access a product that is not in the list of accessible -products for the user, or a product that does not exist, that is silently -ignored, and no information about that product is returned. - -Component object: - -=================== ======= =================================================== -name type description -=================== ======= =================================================== -id int An integer ID uniquely identifying the component in - this installation only. -name string The name of the component. This is a unique - identifier for this component. -description string A description of the component, which may contain - HTML. -default_assigned_to string The login name of the user to whom new bugs - will be assigned by default. -default_bug_type string The default type for bugs filed under this - component. -default_qa_contact string The login name of the user who will be set as - the QA Contact for new bugs by default. Empty - string if the QA contact is not defined. -triage_owner string The login name of the user who is named as the - Triage Owner of the component. Empty string if the - Triage Owner is not defined. -team_name string The team name that is the owner of the component. -sort_key int Components, when displayed in a list, are sorted - first by this integer and then secondly by their - name. -is_active boolean A boolean indicating if the component is active. - Inactive components are not enabled for new bugs. -flag_types object An object containing two items ``bug`` and - ``attachment`` that each contains an array of - objects, where each describes a flagtype. The - flagtype items are described in the Flagtype - object below. -=================== ======= =================================================== - -Flagtype object: - -================ ======= ====================================================== -name type description -================ ======= ====================================================== -id int Returns the ID of the flagtype. -name string Returns the name of the flagtype. -description string Returns the description of the flagtype. -cc_list string Returns the concatenated CC list for the flagtype, as - a single string. -sort_key int Returns the sortkey of the flagtype. -is_active boolean Returns whether the flagtype is active or disabled. - Flags being in a disabled flagtype are not deleted. - It only prevents you from adding new flags to it. -is_requestable boolean Returns whether you can request for the given - flagtype (i.e. whether the '?' flag is available or - not). -is_requesteeble boolean Returns whether you can ask someone specifically - or not. -is_multiplicable boolean Returns whether you can have more than one - flag for the given flagtype in a given bug/attachment. -grant_group int the group ID that is allowed to grant/deny flags of - this type. If the item is not included all users are - allowed to grant/deny this flagtype. -request_group int The group ID that is allowed to request the flag if - the flag is of the type requestable. If the item is - not included all users are allowed request this - flagtype. -================ ======= ====================================================== - -To return information about components in products, you can use the -``.`` property accesssor in your request: - -.. code-block:: text - - /rest/product?type=enterable&include_fields=id,name,components.name,components.id,components.is_active,components.description - -.. _rest_product_create: - -Create Product --------------- - -This allows you to create a new product in Bugzilla. - -**Request** - -.. code-block:: text - - POST /rest/product - -.. code-block:: js - - { - "name" : "AnotherProduct", - "description" : "Another Product", - "classification" : "Unclassified", - "is_open" : false, - "has_unconfirmed" : false, - "default_version" : "unspecified" - } - -Some params must be set, or an error will be thrown. The required params are -marked in bold. - -================= ======= ===================================================== -name type description -================= ======= ===================================================== -**name** string The name of this product. Must be globally unique - within Bugzilla. -**description** string A description for this product. Allows some simple - HTML. -has_unconfirmed boolean Allow the UNCONFIRMED status to be set on bugs in - this product. Default: true. -classification string The name of the Classification which contains this - product. -default_bug_type string The default type for bugs filed under this product. - Each component can override this value. -default_milestone string The default milestone for this product. Default - '---'. -default_version string The default version for this product. Default - 'unspecified'. The old name ``version`` is still - accepted for backward compatibility. -is_open boolean ``true`` if the product is currently allowing bugs - to be entered into it. Default: ``true``. -create_series boolean ``true`` if you want series for New Charts to be - created for this new product. Default: ``true``. -================= ======= ===================================================== - -**Response** - -.. code-block:: js - - { - "id": 20 - } - -Returns an object with the following items: - -==== ==== ===================================== -name type description -==== ==== ===================================== -id int ID of the newly-filed product. -==== ==== ===================================== - -**Errors** - -* 51 (Classification does not exist) - You must specify an existing classification name. -* 700 (Product blank name) - You must specify a non-blank name for this product. -* 701 (Product name too long) - The name specified for this product was longer than the maximum - allowed length. -* 702 (Product name already exists) - You specified the name of a product that already exists. - (Product names must be globally unique in Bugzilla.) -* 703 (Product must have description) - You must specify a description for this product. - -.. _rest_product_update: - -Update Product --------------- - -This allows you to update a product in Bugzilla. - -**Request** - -.. code-block:: text - - PUT /rest/product/(id_or_name) - -You can edit a single product by passing the ID or name of the product -in the URL. To edit more than one product, you can specify addition IDs or -product names using the ``ids`` or ``names`` parameters respectively. - -.. code-block:: js - - { - "ids" : [123], - "name" : "BarName", - "has_unconfirmed" : false - } - -One of the below must be specified. - -============== ===== ========================================================== -name type description -============== ===== ========================================================== -**id_or_name** mixed Integer product ID or name. -**ids** array Numeric IDs of the products that you wish to update. -**names** array Names of the products that you wish to update. -============== ===== ========================================================== - -The following parameters specify the new values you want to set for the product(s) -you are updating. - -================= ======= ===================================================== -name type description -================= ======= ===================================================== -name string A new name for this product. If you try to set this - while updating more than one product, an error will - occur, as product names must be unique. -default_bug_type string The default type for bugs filed under this product. - Each component can override this value. -default_milestone string When a new bug is filed, what milestone does it - get by default if the user does not choose one? Must - represent a milestone that is valid for this product. -default_version string When a new bug is filed, what version does it - get by default if the user does not choose one? Must - represent a version that is valid for this product. -description string Update the long description for these products to - this value. -has_unconfirmed boolean Allow the UNCONFIRMED status to be set on bugs in - products. -is_open boolean ``true`` if the product is currently allowing bugs - to be entered into it, ``false`` otherwise. -================= ======= ===================================================== - -**Response** - -.. code-block:: js - - { - "products" : [ - { - "id" : 123, - "changes" : { - "name" : { - "removed" : "FooName", - "added" : "BarName" - }, - "has_unconfirmed" : { - "removed" : "1", - "added" : "0" - } - } - } - ] - } - -``products`` (array) Product change objects containing the following items: - -======= ====== ================================================================ -name type description -======= ====== ================================================================ -id int The ID of the product that was updated. -changes object The changes that were actually done on this product. The - keys are the names of the fields that were changed, and the - values are an object with two items: - - * added: (string) The value that this field was changed to. - * removed: (string) The value that was previously set in this - field. -======= ====== ================================================================ - -Booleans will be represented with the strings '1' and '0' for changed values -as they are stored as strings in the database currently. - -**Errors** - -* 700 (Product blank name) - You must specify a non-blank name for this product. -* 701 (Product name too long) - The name specified for this product was longer than the maximum - allowed length. -* 702 (Product name already exists) - You specified the name of a product that already exists. - (Product names must be globally unique in Bugzilla.) -* 703 (Product must have description) - You must specify a description for this product. -* 705 (Product must define a default milestone) - You must define a default milestone. -* 706 (Product must define a default version) - You must define a default version. diff --git a/docs/en/rst/api/core/v1/reminders.rst b/docs/en/rst/api/core/v1/reminders.rst deleted file mode 100644 index 40522b65eb..0000000000 --- a/docs/en/rst/api/core/v1/reminders.rst +++ /dev/null @@ -1,134 +0,0 @@ -Reminders -========= - -This part of the Bugzilla API allows creating, listing, and removing of Bugzilla reminders. - -.. _rest_get_reminder: - -Get Reminder ------------- - -This allows you to retrieve information about a specific reminder. - -**Request** - -.. code-block:: text - - GET /rest/reminder/123 - -**Response** - -.. code-block:: js - - { - "id": 123, - "bug_id": 456, - "note": "This is a reminder note", - "reminder_ts": "2024-06-08", - "creation_ts": "2024-06-07", - "sent": false - } - -To get all reminders for your account: - -.. code-block:: text - - GET /rest/reminder - -**Response** - -.. code-block:: js - - { - "reminders": [ - { - "id": 123, - "bug_id": 456, - "note": "This is a reminder note", - "reminder_ts": "2024-06-08", - "creation_ts": "2024-06-07", - "sent": false - } - ] - } - -.. _rest_reminder_object: - -Reminder Object - -======================== ======= ======================================================== -name type description -======================== ======= ======================================================== -id int An integer ID uniquely identifying the reminder in - this installation only. -bug_id int Bug ID associated with the reminder. -note string A descriptive note associated with the reminder. -reminder_ts date The date when the reminder will be sent out. -creation_ts date The date when the reminder was originally created. -sent boolean A boolean value that is set to true when delivered. -======================== ======= ======================================================== - -.. _rest_reminder_create: - -Create Reminder ---------------- - -This allows you to create a new reminder associated with a specific bug in Bugzilla. - -**Request** - -To create a new reminder: - -.. code-block:: text - - { - "bug_id": 456, - "note" : "This is a reminder note", - "reminder_ts" : "2024-06-08" - } - -======================== ====== ================================================================= -name type description -======================== ====== ================================================================= -bug_id int Bug ID associated with the reminder. -note string A descriptive note associated with the reminder. -reminder_ts date The date when the reminder will be sent out. -======================== ====== ================================================================= - -**Response** - -.. code-block:: js - - { - "id": 123, - "bug_id": 456, - "note": "This is a reminder note", - "reminder_ts": "2024-06-08", - "creation_ts": "2024-06-07", - "sent": false - } - -A reminder object `rest_reminder_object`_ is returned. - -.. _rest_reminder_remove: - -Remove Reminder ---------------- - -This allows you to remove an existing reminder in Bugzilla. - -**Request** - -.. code-block:: text - - DELETE /rest/reminder/123 - -**Response** - -If the removal of the reminder was successful, it should look like: - -.. code-block:: js - - { - "success": 1 - } diff --git a/docs/en/rst/api/core/v1/user.rst b/docs/en/rst/api/core/v1/user.rst deleted file mode 100644 index 9091e2739e..0000000000 --- a/docs/en/rst/api/core/v1/user.rst +++ /dev/null @@ -1,468 +0,0 @@ -Users -===== - -This part of the Bugzilla API allows you to create user accounts, get information -about user accounts and to log in or out using an existing account. - -.. _rest_user_login: - -Login ------ - -Logging in with a username and password is required for many Bugzilla -installations, in order to search for private bugs, post new bugs, etc. This -method allows you to retrieve a token that can be used as authentication for -subsequent API calls. Otherwise you will need to pass your ``login`` and -``password`` with each call. - -This method will be going away in the future in favor of using *API keys*. - -**Request** - -.. code-block:: text - - GET /rest/login?login=foo@example.com&password=toosecrettoshow - -============== ======= ======================================================== -name type description -============== ======= ======================================================== -**login** string The user's login name. -**password** string The user's password. -============== ======= ======================================================== - -**Response** - -.. code-block:: js - - { - "token": "786-OLaWfBisMY", - "id": 786 - } - -======== ====== =============================================================== -name type description -======== ====== =============================================================== -id int Numeric ID of the user that was logged in. -token string Token which can be passed in the parameters as - authentication in other calls. The token can be sent along - with any future requests to the webservice, for the duration - of the session, i.e. til :ref:`rest_user_logout` is called. -======== ====== =============================================================== - -**Errors** - -* 300 (Invalid Username or Password) - The username does not exist, or the password is wrong. -* 301 (Login Disabled) - The ability to login with this account has been disabled. A reason may be - specified with the error. -* 305 (New Password Required) - The current password is correct, but the user is asked to change - their password. -* 50 (Param Required) - A login or password parameter was not provided. - -.. _rest_user_logout: - -Logout ------- - -Log out the user. Basically it invalidates the token provided so it cannot be -re-used. Does nothing if the token is not in use. - -**Request** - -.. code-block:: text - - GET /rest/logout?token=1234-VWvO51X69r - -===== ====== =================================================== -name type description -===== ====== =================================================== -token string The user's token used for authentication. -===== ====== =================================================== - -.. _rest_user_valid_login: - -Valid Login ------------ - -This method will verify whether a client's current login token is still valid -or have expired. A valid username that matches must be provided as well. - -**Request** - -.. code-block:: text - - GET /rest/valid_login?login=foo@example.com&token=1234-VWvO51X69r - -========= ======= ============================================================= -name type description -========= ======= ============================================================= -**login** string The login name that matches the provided token. -token string Persistent login token currently being used for - authentication. -========= ======= ============================================================= - -**Response** - -Returns true/false depending on if the current token is valid for the provided -username. - -.. _rest_user_create: - -Create User ------------ - -Creates a user account directly in Bugzilla, password and all. Instead of this, -you should use **Offer Account by Email** when possible because that makes sure -that the email address specified can actually receive an email. This function -does not check that. You must be authenticated and be in the *editusers* group -to perform this action. - -**Request** - -.. code-block:: text - - POST /rest/user - -.. code-block:: js - - { - "email" : "user@bugzilla.org", - "full_name" : "Test User", - "password" : "K16ldRr922I1" - } - -============ ====== ============================================================= -name type description -============ ====== ============================================================= -**email** string The email address for the new user. -full_name string The user's full name. Will be set to empty if not specified. -password string The password for the new user account, in plain text. It - will be stripped of leading and trailing whitespace. If - blank or not specified, the new created account will - exist in Bugzilla but will not be allowed to log in - using DB authentication until a password is set either - by the user (through resetting their password) or by the - administrator. -============ ====== ============================================================= - -**Response** - -.. code-block:: js - - { - "id": 58707 - } - -==== ==== ============================================ -name type description -==== ==== ============================================ -id int The numeric ID of the user that was created. -==== ==== ============================================ - -**Errors** - -* 502 (Password Too Short) - The password specified is too short. (Usually, this means the - password is under three characters.) - -.. _rest_user_update: - -Update User ------------ - -Updates an existing user account in Bugzilla. You must be authenticated and be -in the *editusers* group to perform this action. - -**Request** - -.. code-block:: text - - PUT /rest/user/(id_or_name) - -You can edit a single user by passing the ID or login name of the user -in the URL. To edit more than one user, you can specify addition IDs or -login names using the ``ids`` or ``names`` parameters respectively. - -================= ======= ===================================================== - name type description -================= ======= ===================================================== -**id_or_name** mixed Either the ID or the login name of the user to - update. -**ids** array Additional IDs of users to update. -**names** array Additional login names of users to update. -full_name string The new name of the user. -email string The email of the user. Note that email used to - login to Bugzilla. Also note that you can only - update one user at a time when changing the login - name / email. (An error will be thrown if you try to - update this field for multiple users at once.) -password string The password of the user. -email_enabled boolean A boolean value to enable/disable sending - bug-related mail to the user. -login_denied_text string A text field that holds the reason for disabling a - user from logging into Bugzilla. If empty, then the - user account is enabled; otherwise it is - disabled/closed. -groups object These specify the groups that this user is directly - a member of. To set these, you should pass an object - as the value. The object's items are described in - the Groups update objects below. -bless_groups object This is the same as groups but affects what groups - a user has direct membership to bless that group. - It takes the same inputs as groups. -================= ======= ===================================================== - -Groups and bless groups update object: - -====== ===== ================================================================== -name type description -====== ===== ================================================================== -add array The group IDs or group names that the user should be added to. -remove array The group IDs or group names that the user should be removed from. -set array Integers or strings which are an exact set of group IDs and group - names that the user should be a member of. This does not remove - groups from the user when the person making the change does not - have the bless privilege for the group. -====== ===== ================================================================== - -If you specify ``set``, then ``add`` and ``remove`` will be ignored. A group in -both the ``add`` and ``remove`` list will be added. Specifying a group that the -user making the change does not have bless rights will generate an error. - -**Response** - -* users: (array) List of user change objects with the following items: - -======= ====== ================================================================ -name type description -======= ====== ================================================================ -id int The ID of the user that was updated. -changes object The changes that were actually done on this user. The keys - are the names of the fields that were changed, and the values - are an object with two items: - - * added: (string) The values that were added to this field, - possibly a comma-and-space-separated list if multiple values - were added. - * removed: (string) The values that were removed from this - field, possibly a comma-and-space-separated list if multiple - values were removed. -======= ====== ================================================================ - -**Errors** - -* 51 (Bad Login Name) - You passed an invalid login name in the "names" array. -* 304 (Authorization Required) - Logged-in users are not authorized to edit other users. - -.. _rest_user_get: - -Get User --------- - -Gets information about user accounts in Bugzilla. - -**Request** - -To get information about a single user in Bugzilla: - -.. code-block:: text - - GET /rest/user/(id_or_name) - -To get multiple users by name or ID: - -.. code-block:: text - - GET /rest/user?names=foo@bar.com&names=test@bugzilla.org - GET /rest/user?ids=123&ids=321 - -To get user matching a search string: - -.. code-block:: text - - GET /rest/user?match=foo - -To get user by using an integer ID value or by using ``match``, you must be -authenticated. - -================ ======= ====================================================== -name type description -================ ======= ====================================================== -id_or_name mixed An integer user ID or login name of the user. -ids array Integer user IDs. Logged=out users cannot pass - this parameter to this function. If they try, - they will get an error. Logged=in users will get - an error if they specify the ID of a user they - cannot see. -names array Login names. -match array This works just like "user matching" in Bugzilla - itself. Users will be returned whose real name - or login name contains any one of the specified - strings. Users that you cannot see will not be - included in the returned list. - - Most installations have a limit on how many - matches are returned for each string; the default - is 1000 but can be changed by the Bugzilla - administrator. - - Logged-out users cannot use this argument, and - an error will be thrown if they try. (This is to - make it harder for spammers to harvest email - addresses from Bugzilla, and also to enforce the - user visibility restrictions that are - implemented on some Bugzillas.) -limit int Limit the number of users matched by the - ``match`` parameter. If the value is greater than the - system limit, the system limit will be used. - This parameter is only valid when using the ``match`` - parameter. -group_ids array Numeric IDs for groups that a user can be in. -groups array Names of groups that a user can be in. If - ``group_ids`` or ``groups`` are specified, they - limit the return value to users who are in *any* - of the groups specified. -include_disabled boolean By default, when using the ``match`` parameter, - disabled users are excluded from the returned - results unless their full username is identical - to the match string. Setting ``include_disabled`` to - ``true`` will include disabled users in the returned - results even if their username doesn't fully match - the input string. -permissive boolean When querying for users using names, do not fail the - entire request if one or more errors occur. A `faults` - list is included that contains the individual errors. -================ ======= ====================================================== - -**Response** - -* users: (array) Each object describes a user and has the following items: - -================== ======== ===================================================== -name type description -================== ======== ===================================================== -id int The unique integer ID that Bugzilla uses to represent - this user. Even if the user's login name changes, - this will not change. -real_name string The actual name of the user. May be blank. -nick string The user's nickname. Currently this is extracted from - the real_name, name or email field. -email string The email address of the user. -name string The login name of the user. Note that in some - situations this is different than their email. -can_login boolean A boolean value to indicate if the user can login - into Bugzilla. -email_enabled boolean A boolean value to indicate if bug-related mail will - be sent to the user or not. Only users in the - *disableusers* group can see this field. -login_denied_text string A text field that holds the reason for disabling a - user from logging into Bugzilla. If empty then the - user account is enabled; otherwise it is - disabled/closed. Only users in the *disableusers* - group can see this field. -groups array Groups the user is a member of. If the currently - logged in user is querying their own account or is a - member of a privileged permission group, the array will - contain all the groups that the user is a member of. - Otherwise, the array will only contain groups that - the logged in user can bless. Each object describes - the group and contains the items described in the - Group object below. -saved_searches array User's saved searches, each having the following - Search object items described below. -saved_reports array User's saved reports, each having the following - Search object items described below. -last_seen_date datetime The time when the user last loaded any page. -last_activity_time datetime The time when the user last made a change to a bug. -creation_time datetime The time when the user's account was created. -ldap_email string The LDAP email address attached to the account based - on Duo Security (special permissions needed). -================== ======== ===================================================== - -Group object: - -=========== ====== ============================================================ -name type description -=========== ====== ============================================================ -id int The group ID -name string The name of the group -description string The description for the group -=========== ====== ============================================================ - -Search object: - -===== ====== ================================================================== -name type description -===== ====== ================================================================== -id int An integer ID uniquely identifying the saved report. -name string The name of the saved report. -query string The CGI parameters for the saved report. -===== ====== ================================================================== - -If you are not authenticated when you call this function, you will only be -returned the ``id``, ``name``, ``real_name`` and ``nick`` items. If you are -authenticated and not in 'editusers' group, you will only be returned the ``id``, -``name``, ``real_name``, ``nick``, ``email``, ``can_login`` and ``groups`` items. -The groups returned are filtered based on your permission to bless each group. -The ``saved_searches`` and ``saved_reports`` items are only returned if you are -querying your own account, even if you are in the editusers group. - -**Errors** - -* 51 (Bad Login Name or Group ID) - You passed an invalid login name in the "names" array or a bad - group ID in the "group_ids" argument. -* 52 (Invalid Parameter) - The value used must be an integer greater than zero. -* 304 (Authorization Required) - You are logged in, but you are not authorized to see one of the users you - wanted to get information about by user id. -* 505 (User Access By Id or User-Matching Denied) - Logged-out users cannot use the "ids" or "match" arguments to this - function. -* 804 (Invalid Group Name) - You passed a group name in the "groups" argument which either does not - exist or you do not belong to it. - -.. _rest_user_whoami: - -Who Am I --------- - -Allows for validating a user's API key, token, or username and password. -If successfully authenticated, it returns simple information about the -logged in user. - -**Request** - -.. code-block:: text - - GET /rest/whoami - -**Response** - -.. code-block:: js - - { - "id" : "1234", - "name" : "user@bugzilla.org", - "real_name" : "Test User", - "nick" : "user" - } - -========== ====== ===================================================== -name type description -========== ====== ===================================================== -id int The unique integer ID that Bugzilla uses to represent - this user. Even if the user's login name changes, - this will not change. -real_name string The actual name of the user. May be blank. -nick string The user's nickname. Currently this is extracted from - the real_name, name or email field. -name string string The login name of the user. -========== ====== ===================================================== diff --git a/docs/en/rst/api/index.rst b/docs/en/rst/api/index.rst deleted file mode 100644 index 055c8a987f..0000000000 --- a/docs/en/rst/api/index.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. _apis: - -WebService API Reference -======================== - -This Bugzilla installation has the following WebService APIs available -(as of the last time you compiled the documentation): - -.. toctree:: - :glob: - - integration - core/v*/index - ../extensions/*/api/v*/index diff --git a/docs/en/rst/api/integration.rst b/docs/en/rst/api/integration.rst deleted file mode 100644 index 24a1efbbcd..0000000000 --- a/docs/en/rst/api/integration.rst +++ /dev/null @@ -1,116 +0,0 @@ -.. _integration-best-practices: - -Integration Best Practices -========================== - -Use supported interfaces ------------------------- - -Use the :doc:`documented native REST API ` for new integrations. -BzAPI remains available as a compatibility layer, but it is deprecated. -Existing BzAPI integrations should migrate to the native REST API. If immediate -migration is not possible, use BMO's built-in ``/bzapi/`` compatibility -endpoint prefix instead of the retired standalone BzAPI service. The -compatibility layer performs additional request and response translation. - -Do not rely on scraped HTML, bug lists exported as CSV or XML, or undocumented -endpoints when your integration requires a stable interface. Use documented -REST API methods that are not marked experimental. See the :ref:`API overview -` for the other interfaces that Bugzilla provides. - -Use a dedicated bot account ---------------------------- - -Do not reuse a person's account for automation. Human accounts may acquire -privileges that the integration does not need. Request a dedicated bot account -by `filing an Administration bug -`_. -Grant the account only the privileges required by the integration. - -Authenticate with an API key in the ``X-BUGZILLA-API-KEY`` request header. -Do not put API keys in URLs, where they can be captured in logs and browser -history. See :ref:`REST API authentication ` for details. - -Poll responsibly ------------------ - -Following the `original BMO integration policy -`_, -do not poll BMO more frequently than once every five minutes. If an integration -needs lower-latency updates, use the :doc:`Webhooks API -<../extensions/Webhooks/api/v1/index>`. Contact the BMO team in the -`BMO Matrix channel `_ to -discuss requirements that the documented webhooks do not meet. - -Authenticate polling and batch-read requests. BMO applies per-IP rate limits to -anonymous reads. The request that reaches a limit can return a JSON HTTP 400 -rate-limit error, while subsequent requests from the blocked IP can return an -HTML HTTP 429 response. When either response occurs, retry with exponential -backoff and jitter. BMO does not currently send a ``Retry-After`` header. Apply -the same backoff to transient 5xx responses. - -Poll incrementally instead of repeating a full search. The -``last_change_time`` parameter to :ref:`rest_search_bugs` returns bugs modified -at or after the supplied timestamp. Bug searches may use a read replica, while -``GET /rest/time`` reads the primary database. Because BMO does not guarantee a -maximum replication lag, an integration that requires a guaranteed polling -window should confirm the current operational guidance with the BMO team. -A polling cycle should: - -* obtain BMO's current ``db_time`` from :ref:`GET /rest/time ` - before searching; -* search from at least five minutes before the previous successful cycle's - recorded time to provide headroom for replica lag and one-second timestamp - precision; -* pass ``order=bug_id`` and choose an explicit page size below BMO's current - 10,000-result search cap, such as ``limit=1000``. BMO silently lowers limits - above the cap, so never use a larger requested value as the termination - threshold. Page with ``limit`` and ``offset`` until a page contains fewer - bugs than the chosen page size. The response does not indicate when more - results are available. Do not use ``limit=0`` for paging; it discards the - supplied ``offset`` and the search remains capped; -* collect the bug IDs from every page, then fetch and process every unique bug - before saving the new ``db_time``; and -* discard the de-duplication set after each cycle. If a bug appears in a later - cycle, fetch it again even when its ``last_change_time`` matches the value - previously processed, because multiple changes can occur within the API's - one-second timestamp precision. - -Minimize requests and responses -------------------------------- - -Request only the fields the integration uses by setting -:ref:`include_fields `. This reduces response size and -server work. For polling searches, use -``include_fields=id,last_change_time`` and fetch the full bugs after all pages -have been collected. - -Combine requests when possible. For example, request multiple bug IDs in one -call with ``GET /rest/bug?id=123,456`` instead of issuing one request per -bug. Keep each batch below both :ref:`BMO's request-target size limit -` and the search result cap. This search silently -omits bugs that do not exist or that the caller cannot see, and requests above -the result cap may also omit IDs because the results were truncated. For -batches within these limits, compare the returned IDs with the requested set -and treat missing IDs as not visible, not as deleted. In contrast, -``GET /rest/bug/`` returns an explicit error for a missing or invisible -bug. - -Whenever a search is paged with ``limit`` and ``offset``, pass a stable -``order`` such as ``order=bug_id``. - -Write searches that survive configuration changes --------------------------------------------------- - -Do not hard-code every open or closed status. Use ``status=__open__`` to search -all open bugs and ``status=__closed__`` to search all closed bugs. New workflow -statuses can then be added without breaking the integration. - -Similarly, do not enumerate every resolution when searching for bugs that were -closed without being fixed. Use the custom-search parameters -``status=__closed__&f1=resolution&o1=notequals&v1=FIXED``. This allows new -non-fixed resolutions to be introduced without changing the integration. - -When combining ``last_change_time`` with custom-search parameters, number the -``f`` charts contiguously starting with ``f1``. Gaps in the numbering can -cause the generated change-time chart to replace an existing chart. diff --git a/docs/en/rst/conf.py b/docs/en/rst/conf.py deleted file mode 100644 index 504afe2c62..0000000000 --- a/docs/en/rst/conf.py +++ /dev/null @@ -1,375 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Bugzilla documentation build configuration file, created by -# sphinx-quickstart on Tue Sep 3 16:11:00 2013. -# -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys, os, re - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) - -# -- General configuration ----------------------------------------------------- - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.todo', 'sphinx.ext.extlinks'] - -if tags.has('enable_rst2pdf'): - extensions.append('rst2pdf.pdfbuilder') - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'BMO' -copyright = u'2015, The BMO Team' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '4.2' -# The full version, including alpha/beta/rc tags. -release = '' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ['**.inc.rst'] - -# The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - -rst_prolog = """ -.. role:: param - :class: param - -.. role:: paramval - :class: paramval - -.. role:: group - :class: group - -.. role:: field - :class: field - -.. |min-perl-ver| replace:: 5.10.1 -""" - -rst_epilog = """ - ----------- - -This documentation undoubtedly has bugs; if you find some, please file -them `here `_. -""" - -# -- Options for HTML output --------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'default' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -html_style = "bugzilla.css" - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -html_logo = "" - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -html_favicon = '../../../images/favicon.ico' - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# Switched off because it converted --long-option to –long-option -html_use_smartypants = False - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -html_use_index = False - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -html_show_sourcelink = False - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -html_show_copyright = False - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = 'Bugzilladoc' - -# -- Options for LaTeX output -------------------------------------------------- - -latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('index', 'BMO.tex', u'BMO Documentation', - u'The BMO Team', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output -------------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'bugzilla', u'BMO Documentation', - [u'The BMO Team'], 1) -] - -# If true, show URL addresses after external links. -#man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------------ - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ('index', 'BMO', u'BMO Documentation', - u'The BMO Team', 'BMO', 'One line description of project.', - 'Miscellaneous'), -] - -# Documents to append as an appendix to all manuals. -#texinfo_appendices = [] - -# If false, no module index is generated. -#texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' - -# -- Options for PDF output -------------------------------------------------- - -# Grouping the document tree into PDF files. List of tuples -# (source start file, target name, title, author, options). -# -# If there is more than one author, separate them with \\. -# For example: r'Guido van Rossum\\Fred L. Drake, Jr., editor' -# -# The options element is a dictionary that lets you override -# this config per-document. -# For example, -# ('index', u'MyProject', u'My Project', u'Author Name', -# dict(pdf_compressed = True)) -# would mean that specific document would be compressed -# regardless of the global pdf_compressed setting. - -pdf_documents = [ -('index', u'BMO', u'BMO Documentation', u'The BMO Team'), -] - -# A comma-separated list of custom stylesheets. Example: -pdf_stylesheets = ['sphinx','kerning','a4'] - -# A list of folders to search for stylesheets. Example: -pdf_style_path = ['.', '_styles'] - -# Create a compressed PDF -# Use True/False or 1/0 -# Example: compressed=True -pdf_compressed = True - -# A colon-separated list of folders to search for fonts. Example: -# pdf_font_path = ['/usr/share/fonts', '/usr/share/texmf-dist/fonts/'] - -# Language to be used for hyphenation support -#pdf_language = "en_US" - -# Mode for literal blocks wider than the frame. Can be -# overflow, shrink or truncate -pdf_fit_mode = "shrink" - -# Section level that forces a break page. -# For example: 1 means top-level sections start in a new page -# 0 means disabled -pdf_break_level = 2 - -# When a section starts in a new page, force it to be 'even', 'odd', -# or just use 'any' -#pdf_breakside = 'any' - -# Insert footnotes where they are defined instead of -# at the end. -#pdf_inline_footnotes = True - -# verbosity level. 0 1 or 2 -pdf_verbosity = 0 - -# If false, no index is generated. -pdf_use_index = False - -# If false, no modindex is generated. -pdf_use_modindex = False - -# If false, no coverpage is generated. -#pdf_use_coverpage = True - -# Name of the cover page template to use -#pdf_cover_template = 'sphinxcover.tmpl' - -# Documents to append as an appendix to all manuals. -#pdf_appendices = [] - -# Enable experimental feature to split table cells. Use it -# if you get "DelayedTable too big" errors -#pdf_splittables = False - -# Set the default DPI for images -#pdf_default_dpi = 72 - -# Enable rst2pdf extension modules (default is only vectorpdf) -# you need vectorpdf if you want to use sphinx's graphviz support -pdf_extensions = ['vectorpdf', 'dotted_toc'] - -# Page template name for "regular" pages -#pdf_page_template = 'cutePage' - -# Show Table Of Contents at the beginning? -pdf_use_toc = True - -# How many levels deep should the table of contents be? -pdf_toc_depth = 5 - -# Add section number to section references -pdf_use_numbered_links = True - -# Background images fitting mode -pdf_fit_background_mode = 'scale' - -# -- Options for Sphinx extensions ------------------------------------------- - -# Temporary highlighting of TODO items -todo_include_todos = False - -extlinks = {'bug': ('https://bugzilla.mozilla.org/show_bug.cgi?id=%s', 'bug %s')} diff --git a/docs/en/rst/extensions/Webhooks/api/v1/index.rst b/docs/en/rst/extensions/Webhooks/api/v1/index.rst deleted file mode 100644 index 1672154d0a..0000000000 --- a/docs/en/rst/extensions/Webhooks/api/v1/index.rst +++ /dev/null @@ -1,6 +0,0 @@ -Webhooks API v1 -=============== - -.. toctree:: - - webhooks diff --git a/docs/en/rst/extensions/Webhooks/api/v1/webhooks.rst b/docs/en/rst/extensions/Webhooks/api/v1/webhooks.rst deleted file mode 100644 index a387e49655..0000000000 --- a/docs/en/rst/extensions/Webhooks/api/v1/webhooks.rst +++ /dev/null @@ -1,55 +0,0 @@ -Webhooks -======== - -These methods are used to access information about and update -your configured webhooks. - -NOTE: You will need to pass in a valid API key with the -`X-Bugzilla-API-Key` header to perform an operations. - -List ----- - -Returns a list of your currently configured webhooks. - -**Request** - -.. code-block:: text - - GET /rest/webhooks/list - -**Response** - -.. code-block:: js - - { - "webhooks": [ - { - "component": "General", - "creator": "admin@mozilla.bugs", - "enabled": true, - "errors": 0, - "event": "create,change,attachment,comment", - "id": 1, - "name": "Test Webhooks", - "product": "Firefox", - "url": "http://server.example.com" - } - ] - } - -========= ======= ================================================= -name type description -========= ======= ================================================= -id integer The integer ID of the webhook. -creator string The account which created the webhook. -name string The name of the webhook. -url string The URL that is called when the webhook executes. -event string Comma delimited list of bug events that the - webhook will execute. -product string The product for which the webhook will execute. -component string The component for which the webhook will execute. -enabled boolean Whether the webhook is current enabled or not. -errors integer Current count of any errors encounted when - executing the webhook. -========= ======= ================================================= diff --git a/docs/en/rst/extensions/Webhooks/index-user.rst b/docs/en/rst/extensions/Webhooks/index-user.rst new file mode 100644 index 0000000000..a3daa41617 --- /dev/null +++ b/docs/en/rst/extensions/Webhooks/index-user.rst @@ -0,0 +1,366 @@ +.. _webhooks: + +Webhooks +======== + +A webhook is a callback triggered by one or more events. When an event occurs, +Bugzilla sends an HTTP POST request to a configured URL. + +Bugzilla webhooks can be triggered when a bug is created or changed. The +webhook payload contains information about the bug and the event so another +web application can respond to it. + +For example, a webhook could: + +* Update a copy of a Bugzilla bug in another system, such as Jira. +* Send a message to a chat service, such as Matrix or Slack. + +Creating a webhook +------------------ + +The :guilabel:`Webhooks` preferences tab is available only when webhooks are +enabled and your account belongs to the group configured by the Bugzilla +administrator. + +#. Log in to your Bugzilla account. +#. Go to :guilabel:`Preferences`, then select the :guilabel:`Webhooks` tab. +#. Fill in the webhook parameters: + + Name + A descriptive name for the webhook, such as "Jira webhook for new and + updated bugs in Core::Graphics". + + URL + The URL that will receive and process the webhook. + + Events + The bug events that will trigger the webhook: + + * When a new bug is created. + * When an existing bug is modified. + * When a new attachment is created. + * When an existing attachment is modified. + * When a new comment is created. + + Filters + Bug properties that determine which bugs the webhook receives: + + Product + The product containing the bugs you want to receive. The + :guilabel:`Any` option is available only to members of a group + configured by the Bugzilla administrator. + + Component + The component containing the bugs you want to receive. Select + :guilabel:`Any` to receive bugs from every component in the product. + + API keys + If the endpoint requires authentication, you can provide a header and + API key for the endpoint. For example, for the following header:: + + Authorization: Token zQ5TSBzq7tTZMtKYq9K1ZqJMjifKx3cPL7pIGk9Q + + enter ``Authorization`` as the API Key Header and + ``Token zQ5TSBzq7tTZMtKYq9K1ZqJMjifKx3cPL7pIGk9Q`` as the API Key Value. + + Bugzilla adds the header only when both values are set. If either value + is empty, Bugzilla sends the webhook without the authentication header. + +#. Click :guilabel:`Add`. + +Registered webhooks appear on the same preferences tab. To delete one or more +webhooks, select them in the :guilabel:`Your webhooks` table and click +:guilabel:`Remove selected`. + +You can also enable or disable each webhook from this table. If a webhook has +queued messages, the error count links to a page where you can inspect the +queue and delete individual messages. + +Delivered webhooks +------------------ + +When a webhook is triggered, Bugzilla sends an HTTP POST request containing a +JSON payload. The payload includes the webhook ID, webhook name, event +information, and information about the bug that matched the event and filters. + +Bugzilla ordinarily sends a webhook only if its owner can see the affected bug +and its product. A public-to-private transition can also be sent using the +bug's previous public state so the receiving system can remove information +that is no longer public. When a bug becomes public again, Bugzilla sends an +``is_private`` modification event containing its current public data. When a +payload's bug is private, its details are reduced to the bug ID and privacy +status. Private comments and attachments are sent only when the webhook owner +is authorized to see them; their payloads are also reduced to IDs and privacy +status. The receiving system must use the REST API with suitable credentials +to retrieve additional details. + +Webhooks are generally delivered in event timestamp order, but the relative +order of events with the same timestamp is not guaranteed. Bug creation and +modification events each produce a separate request. The ``changes`` field is +sent for ordinary public modification events and describes changes made to the +event target, such as the bug or attachment. Private modification payloads omit +this field. A public-to-private transition reports only the synthetic +``is_private`` change. + +The payloads below are representative. Bug objects can also contain custom +fields configured for their product and component. + +Public bug request +~~~~~~~~~~~~~~~~~~ + +.. code-block:: json + + { + "bug": { + "alias": "", + "assigned_to": "nobody@mozilla.org", + "assigned_to_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "classification": "Client Software", + "component": "Sync", + "creation_time": "2020-10-16T06:24:06", + "creator": "nobody@mozilla.org", + "creator_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "flags": [], + "id": 1629704, + "is_private": false, + "keywords": [], + "last_change_time": "2020-10-16T06:26:21", + "operating_system": "Unspecified", + "platform": "Unspecified", + "priority": "P1", + "product": "Firefox", + "qa_contact": "nobody@mozilla.org", + "qa_contact_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "resolution": "", + "see_also": [], + "severity": "--", + "status": "NEW", + "summary": "Webhook Test - Disregard", + "target_milestone": "---", + "type": "defect", + "url": "", + "version": "unspecified", + "whiteboard": "" + }, + "event": { + "action": "modify", + "routing_key": "bug.modify:priority", + "target": "bug", + "time": "2020-07-24T20:11:22", + "user": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "changes": [ + { + "field": "priority", + "removed": "P3", + "added": "P1" + } + ] + }, + "webhook_id": 23, + "webhook_name": "test-bug" + } + +Private bug request +~~~~~~~~~~~~~~~~~~~ + +.. code-block:: json + + { + "bug": { + "id": 2, + "is_private": true + }, + "event": { + "action": "modify", + "routing_key": "bug.modify:priority", + "target": "bug", + "time": "2020-07-24T20:11:22", + "user": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + } + }, + "webhook_id": 23, + "webhook_name": "test-bug" + } + +Response +~~~~~~~~ + +Bugzilla treats any HTTP 2xx response as successful. + +New comment +~~~~~~~~~~~ + +.. code-block:: json + + { + "bug": { + "alias": "", + "assigned_to": "nobody@mozilla.org", + "assigned_to_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "classification": "Client Software", + "comment": { + "body": "another test comment", + "creation_time": "2020-10-16T06:28:41", + "id": 14748073, + "is_private": false, + "number": 2 + }, + "component": "Sync", + "creation_time": "2020-10-16T06:24:06", + "creator": "nobody@mozilla.org", + "creator_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "flags": [], + "id": 1629704, + "is_private": false, + "keywords": [], + "last_change_time": "2020-10-16T06:26:21", + "operating_system": "Unspecified", + "platform": "Unspecified", + "priority": "", + "product": "Firefox", + "qa_contact": "", + "resolution": "", + "see_also": [], + "severity": "--", + "status": "NEW", + "summary": "Webhook Test - Disregard", + "target_milestone": "---", + "type": "defect", + "url": "", + "version": "unspecified", + "whiteboard": "" + }, + "event": { + "action": "create", + "routing_key": "comment.create", + "target": "comment", + "time": "2020-10-16T06:28:41", + "user": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + } + }, + "webhook_id": 23, + "webhook_name": "test-comment" + } + +New attachment +~~~~~~~~~~~~~~ + +.. code-block:: json + + { + "bug": { + "alias": "", + "assigned_to": "nobody@mozilla.org", + "assigned_to_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "attachment": { + "content_type": "text/plain", + "creation_time": "2020-10-16T07:08:12", + "description": "test attachment", + "file_name": "file_1629704.txt", + "flags": [], + "id": 9180115, + "is_obsolete": false, + "is_patch": false, + "is_private": false, + "last_change_time": "2020-10-16T07:08:12" + }, + "classification": "Client Software", + "component": "Sync", + "creation_time": "2020-10-16T06:24:06", + "creator": "nobody@mozilla.org", + "creator_detail": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + }, + "flags": [], + "id": 1629704, + "is_private": false, + "keywords": [], + "last_change_time": "2020-10-16T06:26:21", + "operating_system": "Unspecified", + "platform": "Unspecified", + "priority": "", + "product": "Firefox", + "qa_contact": "", + "resolution": "", + "see_also": [], + "severity": "--", + "status": "NEW", + "summary": "Webhook Test - Disregard", + "target_milestone": "---", + "type": "defect", + "url": "", + "version": "unspecified", + "whiteboard": "" + }, + "event": { + "action": "create", + "routing_key": "attachment.create", + "target": "attachment", + "time": "2020-10-16T07:08:12", + "user": { + "id": 1, + "login": "nobody@mozilla.org", + "real_name": "Nobody; OK to take it and work on it" + } + }, + "webhook_id": 23, + "webhook_name": "test-attachment" + } + +Errors and retries +------------------ + +If an endpoint does not return an HTTP 2xx response, or if delivery fails for +another reason, Bugzilla puts the message in the webhook's queue. After each +failed queued attempt, it schedules the next attempt using a backoff counter +shared by the webhook's queued messages. Starting the delivery daemon or +re-enabling the webhook resets this counter. From a reset state, delays are +5 seconds after the first failure, then 25, 125, and 625 seconds. After later +failures, the delay is 15 minutes. A successful delivery does not reset the +counter, so a later failure can start with a longer delay. The delivery daemon +polls every 30 seconds, so an attempt can occur later than its scheduled time. + +If a message remains stuck, later messages for that webhook remain queued until +the blocking message succeeds, is manually deleted, or is discarded because +the webhook owner is no longer authorized to receive it. + +Administrators can configure a per-message attempt limit and an exempt group. +Unless the exemption applies, Bugzilla disables the webhook and emails its +owner when a queued message reaches the limit. The owner can re-enable it from +the :guilabel:`Webhooks` preferences tab after fixing the problem. diff --git a/docs/en/rst/index.rst b/docs/en/rst/index.rst deleted file mode 100644 index 73f2487b6c..0000000000 --- a/docs/en/rst/index.rst +++ /dev/null @@ -1,13 +0,0 @@ -======================================== -BMO Documentation (bugzilla.mozilla.org) -======================================== - -.. toctree:: - :maxdepth: 1 - :numbered: 4 - - about/index - using/index - administering/index - integrating/index - api/index diff --git a/docs/en/rst/integrating/apis.rst b/docs/en/rst/integrating/apis.rst deleted file mode 100644 index ffd7d5365d..0000000000 --- a/docs/en/rst/integrating/apis.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. _api-list: - -APIs -#### - -Bugzilla has a number of APIs that you can call in your code to extract -information from and put information into Bugzilla. Some are deprecated and -will soon be removed. Which one to use? Short answer: the -:ref:`REST WebService API v1 ` -should be used for all new integrations, but keep an eye out for version 2, -coming soon. - -For BMO-specific operational guidance, see :ref:`Integration Best Practices -`. - -The APIs currently available are as follows: - -Ad-Hoc APIs -=========== - -Various pages on Bugzilla are available in machine-parsable formats as well -as HTML. For example, bugs can be downloaded as XML, and buglists as CSV. -CSV is useful for spreadsheet import. There should be links on the HTML page -to alternate data formats where they are available. - -REST -==== - -Bugzilla has a :ref:`REST API ` which is the currently-recommended API -for integrating with Bugzilla. The current REST API is version 1. It is stable, -and so will not be changed in a backwardly-incompatible way. - -**This is the currently-recommended API for new development.** - -Endpoint: :file:`/rest` diff --git a/docs/en/rst/integrating/auth0.rst b/docs/en/rst/integrating/auth0.rst deleted file mode 100644 index 51d26643d6..0000000000 --- a/docs/en/rst/integrating/auth0.rst +++ /dev/null @@ -1,44 +0,0 @@ -.. _auth0: - -Adding an Auth0 Custom Social Integration -######################################### - -Bugzilla can be added as a 'Custom Social Connection'. - -==================== =============================================== ====================================================== -Parameter Example(s) Notes -==================== =============================================== ====================================================== -Name BMO-Stage Whatever makes you happy -Client ID aaaaaaaaaaaaaaaaaaaa Ask your Bugzilla admin to create one for you. -Client Secret aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Same as above. -Authorization URL https://bugzilla.allizom.org/oauth/authorize Note the HTTP client must use the correct HOST header. -Token URL https://bugzilla.allizom.org/oauth/access_token (none) -Scope user:read As of this writing, this is the only scope available. -Fetch User Profile (see below) (none) -==================== =============================================== ====================================================== - -.. code-block:: javascript - - function (access_token, ctx, callback) { - request.get('https://bugzilla.allizom.org/api/user/profile', { - 'headers': { - 'Authorization': 'Bearer ' + access_token, - 'User-Agent': 'Auth0' - } - }, function (e, r, b) { - if (e) { - return callback(e); - } - if (r.statusCode !== 200) { - return callback(new Error(`StatusCode: ${r.statusCode}`)); - } - var profile = JSON.parse(b); - callback(null, { - user_id: profile.id, - nickname: profile.nick, - name: profile.name, - email: profile.login, - email_verified: true - }); - }); - } diff --git a/docs/en/rst/integrating/extensions.rst b/docs/en/rst/integrating/extensions.rst deleted file mode 100644 index 33904a5695..0000000000 --- a/docs/en/rst/integrating/extensions.rst +++ /dev/null @@ -1,199 +0,0 @@ -.. _extensions: - -Extensions -########## - -One of the best ways to customize Bugzilla is by using a Bugzilla -Extension. Extensions can modify both the code and UI of Bugzilla in a way -that can be distributed to other Bugzilla users and ported forward to future -versions of Bugzilla with minimal effort. We maintain a -`list of available extensions `_ -written by other people on our wiki. You would need to -make sure that the extension in question works with your version of Bugzilla. - -Or, you can write your own extension. See the `Bugzilla Extension -documentation `_ -for the core documentation on how to do that. It would make sense to read -the section on :ref:`templates`. There is also a sample extension in -:file:`$BUGZILLA_HOME/extensions/Example/` which gives examples of how to -use all the code hooks. - -This section explains how to achieve some common tasks using the Extension APIs. - -Adding A New Page to Bugzilla -============================= - -There are occasions where it's useful to add a new page to Bugzilla which -has little or no relation to other pages, and perhaps doesn't use very much -Bugzilla data. A help page, or a custom report for example. The best mechanism -for this is to use :file:`page.cgi` and the ``page_before_template`` hook. - -Altering Data On An Existing Page -================================= - -The ``template_before_process`` hook can be used to tweak the data displayed -on a particular existing page, if you know what template is used. It has -access to all the template variables before they are passed to the templating -engine. - -Adding New Fields To Bugs -========================= - -To add new fields to a bug, you need to do the following: - -* Add an ``install_update_db`` hook to add the fields by calling - ``Bugzilla::Field->create`` (only if the field doesn't already exist). - Here's what it might look like for a single field: - - .. code-block:: perl - - my $field = new Bugzilla::Field({ name => $name }); - return if $field; - - $field = Bugzilla::Field->create({ - name => $name, - description => $description, - type => $type, # From list in Constants.pm - enter_bug => 0, - buglist => 0, - custom => 1, - }); - -* Push the name of the field onto the relevant arrays in the ``bug_columns`` - and ``bug_fields`` hooks. - -* If you want direct accessors, or other functions on the object, you need to - add a BEGIN block to your Extension.pm: - - .. code-block:: perl - - BEGIN { - *Bugzilla::Bug::is_foopy = \&_bug_is_foopy; - } - - ... - - sub _bug_is_foopy { - return $_[0]->{'is_foopy'}; - } - -* You don't have to change ``Bugzilla/DB/Schema.pm``. - -* You can use ``bug_end_of_create``, ``bug_end_of_create_validators``, and - ``bug_end_of_update`` to create or update the values for your new field. - -Adding New Fields To Other Things -================================= - -If you are adding the new fields to an object other than a bug, you need to -go a bit lower-level. With reference to the instructions above: - -* In ``install_update_db``, use ``bz_add_column`` instead - -* Push on the columns in ``object_columns`` and ``object_update_columns`` - instead of ``bug_columns``. - -* Add validators for the values in ``object_validators`` - -The process for adding accessor functions is the same. - -You can use the hooks ``object_end_of_create``, -``object_end_of_create_validators``, ``object_end_of_set_all``, and -``object_end_of_update`` to create or update the values for the new object -fields you have added. In the hooks you can check the object type being -operated on and skip any objects you don't care about. For example, if you -added a new field to the ``products`` table: - -.. code-block:: perl - - sub object_end_of_create { - my ($self, $args) = @_; - my $class = $args->{'class'}; - my $object = $args->{'object'}; - if ($class->isa('Bugzilla::Product') { - [...] - } - } - -You will need to do this filtering for most of the hooks whose names begin with -``object_``. - -Adding Admin Configuration Panels -================================= - -If you add new functionality to Bugzilla, it may well have configurable -options or parameters. The way to allow an administrator to set those -is to add a new configuration panel. - -As well as using the ``config_add_panels`` hook, you will need a template to -define the UI strings for the panel. See the templates in -:file:`template/en/default/admin/params` for examples, and put your own -template in :file:`template/en/default/admin/params` in your extension's -directory. - -You can access param values from Templates using:: - - [% Param('param_name') %] - -and from code using: - -.. code-block:: perl - - Bugzilla->params->{'param_name'} - -Adding User Preferences -======================= - -To add a new user preference: - -* Call ``add_setting('setting_name', ['some_option', 'another_option'], - 'some_option')`` in the ``install_before_final_checks`` hook. (The last - parameter is the name of the option which should be the default.) - -* Add descriptions for the identifiers for your setting and choices - (setting_name, some_option etc.) to the hash defined in - :file:`global/setting-descs.none.tmpl`. Do this in a template hook: - :file:`hook/global/setting-descs-settings.none.tmpl`. Your code can see the - hash variable; just set more members in it. - -* To change behavior based on the setting, reference it in templates using - ``[% user.settings.setting_name.value %]``. Reference it in code using - ``$user->settings->{'setting_name'}->{'value'}``. The value will be one of - the option tag names (e.g. some_option). - -.. _who-can-change-what: - -Altering Who Can Change What -============================ - -Companies often have rules about which employees, or classes of employees, -are allowed to change certain things in the bug system. For example, -only the bug's designated QA Contact may be allowed to VERIFY the bug. -Bugzilla has been -designed to make it easy for you to write your own custom rules to define -who is allowed to make what sorts of value transition. - -By default, assignees, QA owners and users -with *editbugs* privileges can edit all fields of bugs, -except group restrictions (unless they are members of the groups they -are trying to change). Bug reporters also have the ability to edit some -fields, but in a more restrictive manner. Other users, without -*editbugs* privileges, cannot edit -bugs, except to comment and add themselves to the CC list. - -Because this kind of change is such a common request, we have added a -specific hook for it that :ref:`extensions` can call. It's called -``bug_check_can_change_field``, and it's documented `in the Hooks -documentation `_. - -Checking Syntax -=============== - -It's not immediately obvious how to check the syntax of your extension's -Perl modules, if it contains any. Running :command:`checksetup.pl` might do -some of it, but the errors aren't necessarily massively informative. - -:command:`perl -Mlib=lib -MBugzilla -e 'BEGIN { Bugzilla->extensions; } use Bugzilla::Extension::ExtensionName::Class;'` - -(run from ``$BUGZILLA_HOME``) is what you need. - diff --git a/docs/en/rst/integrating/faq.rst b/docs/en/rst/integrating/faq.rst deleted file mode 100644 index 964d3f1485..0000000000 --- a/docs/en/rst/integrating/faq.rst +++ /dev/null @@ -1,27 +0,0 @@ - -.. _customization-faq: - -Customization FAQ -================= - -How do I... - -...add a new field on a bug? - Use :ref:`custom-fields` or, if you just want new form fields on bug entry - but don't need Bugzilla to track the field separately thereafter, you can - use a :ref:`custom bug entry form `. - -...change the name of a built-in bug field? - :ref:`Edit ` the relevant value in the template - :file:`template/en/default/global/field-descs.none.tmpl`. - -...use a word other than 'bug' to describe bugs? - :ref:`Edit or override ` the appropriate values in the template - :file:`template/en/default/global/variables.none.tmpl`. - -...call the system something other than 'Bugzilla'? - :ref:`Edit or override ` the appropriate value in the template - :file:`template/en/default/global/variables.none.tmpl`. - -...alter who can change what field when? - See :ref:`who-can-change-what`. diff --git a/docs/en/rst/integrating/index.rst b/docs/en/rst/integrating/index.rst deleted file mode 100644 index 0cb096f835..0000000000 --- a/docs/en/rst/integrating/index.rst +++ /dev/null @@ -1,23 +0,0 @@ -.. highlight:: perl - -.. _integrating: - -=================================== -Integration and Customization Guide -=================================== - -You may find that Bugzilla already does what you want it to do, you just -need to configure it correctly. Read the :ref:`administering` sections -carefully to see if that's the case for you. If not, then this chapter -explains how to use the available mechanisms for integration and customization. - -.. toctree:: - :maxdepth: 2 - - faq - languages - skins - templates - extensions - apis - auth0 diff --git a/docs/en/rst/integrating/languages.rst b/docs/en/rst/integrating/languages.rst deleted file mode 100644 index d76a82a829..0000000000 --- a/docs/en/rst/integrating/languages.rst +++ /dev/null @@ -1,19 +0,0 @@ -Languages -========= - -Bugzilla's templates can be localized, although it's a `big job -`_. If you have -a localized set of templates for your version of Bugzilla, Bugzilla can -support multiple languages at once. In that case, Bugzilla honours the user's -``Accept-Language`` HTTP header when deciding which language to serve. If -multiple languages are installed, a menu will display in the header allowing -the user to manually select a different language. If they do this, their -choice will override the ``Accept-Language`` header. - -Many language templates can be obtained from -`the localization section of the Bugzilla website -`_. Instructions -for submitting new languages are also available from that location. There's -also a `list of localization teams -`_; you might -want to contact someone to ask about the status of their localization. diff --git a/docs/en/rst/integrating/skins.rst b/docs/en/rst/integrating/skins.rst deleted file mode 100644 index 92bf60dfc0..0000000000 --- a/docs/en/rst/integrating/skins.rst +++ /dev/null @@ -1,27 +0,0 @@ -.. _skins: - -Skins -===== - -Bugzilla supports skins - ways of changing the look of the UI without altering -its underlying structure. It ships with two - "Classic" and "Dusk". You can -find some more listed -`on the wiki `_, and there -are a couple more which are part of -`bugzilla.mozilla.org `_. -However, in each -case you may need to check that the skin supports the version of Bugzilla -you have. - -To create a new custom skin, make a directory that contains all the same CSS -file names as :file:`skins/standard/`, and put your directory in -:file:`skins/contrib/`. Then, add your CSS to the appropriate files. - -After you put the directory there, make sure to run :file:`checksetup.pl` so -that it can set the file permissions correctly. - -After you have installed the new skin, it will show up as an option in the -user's :guilabel:`Preferences`, on the :guilabel:`General` tab. If you would -like to force a particular skin on all users, just select that skin in the -:guilabel:`Default Preferences` in the :guilabel:`Administration` UI, and -then uncheck "Enabled" on the preference, so users cannot change it. diff --git a/docs/en/rst/integrating/templates.rst b/docs/en/rst/integrating/templates.rst deleted file mode 100644 index a6788cb89a..0000000000 --- a/docs/en/rst/integrating/templates.rst +++ /dev/null @@ -1,289 +0,0 @@ -.. _templates: - -Templates -######### - -Bugzilla uses a system of templates to define its user interface. The standard -templates can be modified, replaced or overridden. You can also use template -hooks in an :ref:`extension ` to add or modify the -behavior of templates using a stable interface. - -.. _template-directory: - -Template Directory Structure -============================ - -The template directory structure starts with top level directory -named :file:`template`, which contains a directory -for each installed localization. Bugzilla comes with English -templates, so the directory name is :file:`en`, -and we will discuss :file:`template/en` throughout -the documentation. Below :file:`template/en` is the -:file:`default` directory, which contains all the -standard templates shipped with Bugzilla. - -.. warning:: A directory :file:`data/template` also exists; - this is where Template Toolkit puts the compiled versions (i.e. Perl code) - of the templates. *Do not* directly edit the files in this - directory, or all your changes will be lost the next time - Template Toolkit recompiles the templates. - -.. _template-method: - -Choosing a Customization Method -=============================== - -If you want to edit Bugzilla's templates, the first decision -you must make is how you want to go about doing so. There are three -choices, and which you use depends mainly on the scope of your -modifications, and the method you plan to use to upgrade Bugzilla. - -#. You can directly edit the templates found in :file:`template/en/default`. - -#. You can copy the templates to be modified into a mirrored directory - structure under :file:`template/en/custom`. Templates in this - directory structure automatically override any identically-named - and identically-located templates in the - :file:`template/en/default` directory. (The :file:`custom` directory does - not exist by default and must be created if you want to use it.) - -#. You can use the hooks built into many of the templates to add or modify - the UI from an :ref:`extension `. Hooks generally don't go away - and have a stable interface. - -The third method is the best if there are hooks in the appropriate places -and the change you want to do is possible using hooks. It's not very easy -to modify existing UI using hooks; they are most commonly used for additions. -You can make modifications if you add JS code which then makes the -modifications when the page is loaded. You can remove UI by adding CSS to hide -it. - -Unlike code hooks, there is no requirement to document template hooks, so -you just have to open up the template and see (search for ``Hook.process``). - -If there are no hooks available, then the second method of customization -should be used if you are going to make major changes, because it is -guaranteed that the contents of the :file:`custom` directory will not be -touched during an upgrade, and you can then decide whether -to revert to the standard templates, continue using yours, or make the effort -to merge your changes into the new versions by hand. It's also good for -entirely new files, and for a few files like -:file:`bug/create/user-message.html.tmpl` which are designed to be entirely -replaced. - -Using the second method, your user interface may break if incompatible -changes are made to the template interface. Templates do change regularly -and so interface changes are not individually documented, and you would -need to work out what had changed and adapt your template accordingly. - -For minor changes, the convenience of the first method is hard to beat. When -you upgrade Bugzilla, :command:`git` will merge your changes into the new -version for you. On the downside, if the merge fails then Bugzilla will not -work properly until you have fixed the problem and re-integrated your code. - -Also, you can see what you've changed using :command:`git diff`, which you -can't if you fork the file into the :file:`custom` directory. - -.. _template-edit: - -How To Edit Templates -===================== - -.. note:: If you are making template changes that you intend on submitting - back for inclusion in standard Bugzilla, you should read the relevant - sections of the - `Developers' Guide `_. - -Bugzilla uses a templating system called Template Toolkit. The syntax of the -language is beyond the scope of this guide. It's reasonably easy to pick up by -looking at the current templates; or, you can read the manual, available on -the `Template Toolkit home page `_. - -One thing you should take particular care about is the need -to properly HTML filter data that has been passed into the template. -This means that if the data can possibly contain special HTML characters -such as ``<``, and the data was not intended to be HTML, they need to be -converted to entity form, i.e. ``<``. You use the ``html`` filter in the -Template Toolkit to do this (or the ``uri`` filter to encode special -characters in URLs). If you forget, you may open up your installation -to cross-site scripting attacks. - - -You should run :command:`./checksetup.pl` after editing any templates. Failure -to do so may mean either that your changes are not picked up, or that the -permissions on the edited files are wrong so the webserver can't read them. - -.. _template-formats: - -Template Formats and Types -========================== - -Some CGI's have the ability to use more than one template. For example, -:file:`buglist.cgi` can output itself as two formats of HTML (complex and -simple). Each of these is a separate template. The mechanism that provides -this feature is extensible - you can create new templates to add new formats. - -You might use this feature to e.g. add a custom bug entry form for a -particular subset of users or a particular type of bug. - -Bugzilla can also support different types of output - e.g. bugs are available -as HTML and as XML, and this mechanism is extensible also to add new content -types. However, instead of using such interfaces or enhancing Bugzilla to add -more, you would be better off using the :ref:`apis` to integrate with -Bugzilla. - -To see if a CGI supports multiple output formats and types, grep the -CGI for ``get_format``. If it's not present, adding -multiple format/type support isn't too hard - see how it's done in -other CGIs, e.g. :file:`config.cgi`. - -To make a new format template for a CGI which supports this, -open a current template for -that CGI and take note of the INTERFACE comment (if present.) This -comment defines what variables are passed into this template. If -there isn't one, I'm afraid you'll have to read the template and -the code to find out what information you get. - -Write your template in whatever markup or text style is appropriate. - -You now need to decide what content type you want your template -served as. The content types are defined in the -:file:`Bugzilla/Constants.pm` file in the :file:`contenttypes` -constant. If your content type is not there, add it. Remember -the three- or four-letter tag assigned to your content type. -This tag will be part of the template filename. - -Save your new template as -:file:`-..tmpl`. -Try out the template by calling the CGI as -``.cgi?format=``. Add ``&ctype=`` if the type is -not HTML. - -.. _template-specific: - -Particular Templates -==================== - -There are a few templates you may be particularly interested in -customizing for your installation. - -:file:`index.html.tmpl`: - This is the Bugzilla front page. - -:file:`global/header.html.tmpl`: - This defines the header that goes on all Bugzilla pages. - The header includes the banner, which is what appears to users - and is probably what you want to edit instead. However the - header also includes the HTML HEAD section, so you could for - example add a stylesheet or META tag by editing the header. - -:file:`global/banner.html.tmpl`: - This contains the ``banner``, the part of the header that appears - at the top of all Bugzilla pages. The default banner is reasonably - barren, so you'll probably want to customize this to give your - installation a distinctive look and feel. It is recommended you - preserve the Bugzilla version number in some form so the version - you are running can be determined, and users know what docs to read. - -:file:`global/footer.html.tmpl`: - This defines the footer that goes on all Bugzilla pages. Editing - this is another way to quickly get a distinctive look and feel for - your Bugzilla installation. - -:file:`global/variables.none.tmpl`: - This allows you to change the word 'bug' to something else (e.g. "issue") - throughout the interface, and also to change the name Bugzilla to something - else (e.g. "FooCorp Bug Tracker"). - -:file:`list/table.html.tmpl`: - This template controls the appearance of the bug lists created - by Bugzilla. Editing this template allows per-column control of - the width and title of a column, the maximum display length of - each entry, and the wrap behavior of long entries. - For long bug lists, Bugzilla inserts a 'break' every 100 bugs by - default; this behavior is also controlled by this template, and - that value can be modified here. - -:file:`bug/create/user-message.html.tmpl`: - This is a message that appears near the top of the bug reporting page. - By modifying this, you can tell your users how they should report - bugs. - -:file:`bug/process/midair.html.tmpl`: - This is the page used if two people submit simultaneous changes to the - same bug. The second person to submit their changes will get this page - to tell them what the first person did, and ask if they wish to - overwrite those changes or go back and revisit the bug. The default - title and header on this page read "Mid-air collision detected!" If - you work in the aviation industry, or other environment where this - might be found offensive (yes, we have true stories of this happening) - you'll want to change this to something more appropriate for your - environment. - -.. _custom-bug-entry: - -:file:`bug/create/create.html.tmpl` and :file:`bug/create/comment.txt.tmpl`: - You may not wish to go to the effort of creating custom fields in - Bugzilla, yet you want to make sure that each bug report contains - a number of pieces of important information for which there is not - a special field. The bug entry system has been designed in an - extensible fashion to enable you to add arbitrary HTML widgets, - such as drop-down lists or textboxes, to the bug entry page - and have their values appear formatted in the initial comment. - - An example of this is the `guided bug submission form - `_. - The code for this comes with the Bugzilla distribution as an example for - you to copy. It can be found in the files - :file:`create-guided.html.tmpl` and :file:`comment-guided.html.tmpl`. - - A hidden field that indicates the format should be added inside - the form in order to make the template functional. Its value should - be the suffix of the template filename. For example, if the file - is called :file:`create-guided.html.tmpl`, then - - :: - - - - is used inside the form. - - So to use this feature, create a custom template for - :file:`enter_bug.cgi`. The default template, on which you - could base it, is - :file:`default/bug/create/create.html.tmpl`. - Call it :file:`custom/bug/create/create-.html.tmpl`, and - in it, add form inputs for each piece of information you'd like - collected - such as a build number, or set of steps to reproduce. - - Then, create a template based on - :file:`default/bug/create/comment.txt.tmpl`, and call it - :file:`custom/bug/create/comment-.txt.tmpl`. - It needs a couple of lines of boilerplate at the top like this:: - - [% USE Bugzilla %] - [% cgi = Bugzilla.cgi % - - Then, this template can reference the form fields you have created using - the syntax ``[% cgi.param("field_name") %]``. When a bug report is - submitted, the initial comment attached to the bug report will be - formatted according to the layout of this template. - - For example, if your custom enter_bug template had a field:: - - - - and then your comment.txt.tmpl had:: - - [% USE Bugzilla %] - [% cgi = Bugzilla.cgi %] - Build Identifier: [%+ cgi.param("buildid") %] - - then something like:: - - Build Identifier: 20140303 - - would appear in the initial comment. - - This system allows you to gather structured data in bug reports without - the overhead and UI complexity of a large number of custom fields. diff --git a/docs/en/rst/requirements.txt b/docs/en/rst/requirements.txt deleted file mode 100644 index 8338b1909c..0000000000 --- a/docs/en/rst/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -sphinx==9.1.0 -readthedocs-sphinx-search==0.3.2 -sphinx_rtd_theme==3.1.0 -sphinxcontrib-applehelp==2.0.0 -sphinxcontrib-devhelp==2.0.0 -sphinxcontrib-qthelp==2.0.0 -sphinxcontrib.serializinghtml==2.0.0 -sphinxcontrib.htmlhelp==2.1.0 diff --git a/docs/en/rst/style.rst b/docs/en/rst/style.rst deleted file mode 100644 index 5058a51a33..0000000000 --- a/docs/en/rst/style.rst +++ /dev/null @@ -1,119 +0,0 @@ -:orphan: - -.. _style-guide: - -============================== -Writing Bugzilla Documentation -============================== - -The Bugzilla documentation uses -`reStructured Text (reST) `_, -as extended by our documentation compilation tool, -`Sphinx `_. This document is a reST document for -demonstration purposes. To learn from it, you need to read it in reST form. - -When you build the docs, this document gets built (at least in -the HTML version) as a standalone file, although it isn't as useful in that -form because some of the directives discussed are invisible or change when -rendered. - -`The Sphinx documentation `_ -gives a good introduction to reST and the Sphinx-specific extensions. Reading -that one immediately-linked page should be enough to get started. Later, the -`inline markup section `_ -is worth a read. - -Bugzilla's particular documentation conventions are as follows: - -Block Directives -################ - -Chapter headings use the double-equals, page title headings the #, and then -the three other levels are headings within a page. Every heading should be -preceded by an anchor, with a globally-unique name with no spaces. Now, we -demonstrate the available heading levels we haven't used yet: - -.. _uniqueanchorname: - -Third Level Heading -=================== - -Fourth Level Heading --------------------- - -Fifth Level Heading -~~~~~~~~~~~~~~~~~~~ - -(Although try not to use headings as deep as the 5th level.) - -Make links to anchors like this: :ref:`uniqueanchorname`. It'll pick up the -following heading name automatically and use it as the link text. Don't use -standard reST internal links like `uniqueanchorname`_ - they don't work -across files. - -Comments are done like this: - -.. This is a comment. It can go on to multiple lines. Follow-on lines need to - be indented. - -Other block types: - -.. note:: This is just a note, for your information. Like all double-dot - blocks, follow-on lines need to be indented. - -.. warning:: This is a warning of a potential serious problem you should be - aware of. - -.. todo:: This is some documentation-related task that still needs doing. - -Use both of the above block types sparingly. Consider putting the information -in the main text, omitting it, or (if long) placing it in a subsidiary file. - -Code gets highlighted using Pygments. Choose the highlighter at the top of -each file using: - -.. highlight:: console - -You can change the highlighter for a particular block by introducing it like -this: - -.. code-block:: perl - - # This is some Perl code - print "Hello"; - -There is a -`list of all available lexer names `_ -available. We currently use ``console``, ``perl``, and ``sql``. ``none`` is -also a valid value. - -Use 4-space indentation, except where a different value is better so that -things line up. So normally two spaces for bulleted lists, and 3 spaces -for .. blocks. - -Inline Directives -################# - -.. warning:: Remember that reST does not support nested inline markup. So you - can't have a substitution inside a link, or bold inside italics. - -* A filename or a path to a filename: - :file:`/path/to/{variable-bit-of-path}/filename.ext` - -* A command to type in the shell: - :command:`command --arguments` - -* A parameter value: - :paramval:`DB` - -* A group name: - :group:`editbugs` - -* A bug field name: - :field:`Summary` - -* Any string from the UI: - :guilabel:`Administration` - -* A specific BMO bug: - :bug:`201069` diff --git a/docs/en/rst/using/creating-an-account.rst b/docs/en/rst/using/creating-an-account.rst deleted file mode 100644 index 3d70096f55..0000000000 --- a/docs/en/rst/using/creating-an-account.rst +++ /dev/null @@ -1,39 +0,0 @@ -.. _creating-an-account: - -Creating an Account -################### - -If you want to use a particular installation of Bugzilla, first you need to -create an account. Ask the administrator responsible for your installation -for the URL you should use to access it. If you're test-driving Bugzilla, -you can use one of the installations on `Mozilla’s Bugzilla (BMO) test server -`_. - -The process of creating an account is similar to many other websites. - -#. On the home page, click the :guilabel:`New Account` link in the header. - Enter your email address, then click the ``Send`` - button. - - .. note:: If the :guilabel:`New Account` link is not available, this means that the - administrator of the installation has disabled self-registration. - Speak to the administrator to find out how to get an account. - -#. Within moments, you should - receive an email to the address you provided, which contains your - login name (generally the same as the email address), and a URL to - click to confirm your registration. - -#. Once you confirm your registration, Bugzilla will ask you your real name - (optional, but recommended) and ask you to choose a password. Depending - on how your Bugzilla is configured, there may be minimum complexity - requirements for the password. - -#. Now all you need to do is to click the :guilabel:`Log In` - link in the header or footer, - enter your email address and the password you just chose into the - login form, and click the :guilabel:`Log in` button. - -You are now logged in. Bugzilla uses cookies to remember you are -logged in, so, unless you have cookies disabled or your IP address changes, -you should not have to log in again during your session. diff --git a/docs/en/rst/using/editing.rst b/docs/en/rst/using/editing.rst deleted file mode 100644 index c147d9d3b9..0000000000 --- a/docs/en/rst/using/editing.rst +++ /dev/null @@ -1,98 +0,0 @@ -.. _editing: - -Editing a Bug -############# - -.. _attachments: - -Attachments -=========== - -Attachments are used to attach relevant files to bugs - patches, screenshots, -test cases, debugging aids or logs, or anything else binary or too large to -fit into a comment. - -You should use attachments, rather than comments, for large chunks of plain -text data, such as trace, debugging output files, or log files. That way, it -doesn't bloat the bug for everyone who wants to read it, and cause people to -receive large, useless mails. - -You should make sure to trim screenshots. There's no need to show the -whole screen if you are pointing out a single-pixel problem. - -Bugzilla stores and uses a Content-Type for each attachment -(e.g. text/html). To download an attachment as a different -Content-Type (e.g. application/xhtml+xml), you can override this -using a 'content_type' parameter on the URL, e.g. -:file:`&content_type=text/plain`. - -Also, you can enter the URL pointing to the attachment instead of -uploading the attachment itself. For example, this is useful if you want to -point to an external application, a website or a very large file. - -It's also possible to create an attachment by pasting text directly in a text -field; Bugzilla will convert it into an attachment. This is pretty useful -when you are copying and pasting, to avoid the extra step of saving the text -in a temporary file. - -.. _editing-flags: - -Flags -===== - -To set a flag, select either :guilabel:`+` or :guilabel:`-` from the drop-down -menu next to the name of the flag in the :guilabel:`Flags` list. The meaning -of these values are flag-specific and thus cannot be described in this -documentation, but by way of example, setting a flag named :guilabel:`review` -:guilabel:`+` may indicate that the bug/attachment has passed review, while -setting it to :guilabel:`-` may indicate that the bug/attachment has failed -review. - -To unset a flag, click its drop-down menu and select the blank value. -Note that marking an attachment as obsolete automatically cancels all -pending requests for the attachment. - -If your administrator has enabled requests for a flag, request a flag -by selecting :guilabel:`?` from the drop-down menu and then entering the -username of the user you want to set the flag in the text field next to the -menu. - -.. _time-tracking: - -Time Tracking -============= - -Users who belong to the group specified by the ``timetrackinggroup`` -parameter have access to time-related fields. Developers can see -deadlines and estimated times to fix bugs, and can provide time spent -on these bugs. Users who do not belong to this group can only see the deadline -but not edit it. Other time-related fields remain invisible to them. - -At any time, a summary of the time spent by developers on bugs is -accessible either from bug lists when clicking the ``Time Summary`` -button or from individual bugs when clicking the ``Summarize time`` -link in the time tracking table. The :file:`summarize_time.cgi` -page lets you view this information either per developer or per bug -and can be split on a month basis to have greater details on how time -is spent by developers. - -As soon as a bug is marked as RESOLVED, the remaining time expected -to fix the bug is set to zero. This lets QA people set it again for -their own usage, and it will be set to zero again when the bug is -marked as VERIFIED. - -.. _lifecycle: - -Life Cycle of a Bug -=================== - -The life cycle of a bug, also known as workflow, is customizable to match -the needs of your organization (see :ref:`workflow`). -The image below contains a graphical representation of -the default workflow using the default bug statuses. If you wish to -customize this image for your site, the -`diagram file <../../images/bzLifecycle.xml>`_ -is available in `Dia's `_ -native XML format. - -.. image:: ../../images/bzLifecycle.png diff --git a/docs/en/rst/using/extensions.rst b/docs/en/rst/using/extensions.rst deleted file mode 100644 index 28bae5be54..0000000000 --- a/docs/en/rst/using/extensions.rst +++ /dev/null @@ -1,18 +0,0 @@ -.. _installed-extensions-user: - -Installed Extensions -==================== - -Bugzilla can be enhanced using extensions (see :ref:`extensions`). If an -extension comes with documentation in the appropriate format, and you build -your own copy of the Bugzilla documentation using :file:`makedocs.pl`, then -the documentation for your installed extensions will show up here. - -Your Bugzilla installation has the following extensions available (as of the -last time you compiled the documentation): - -.. toctree:: - :maxdepth: 1 - :glob: - - ../extensions/*/index-user diff --git a/docs/en/rst/using/filing.rst b/docs/en/rst/using/filing.rst deleted file mode 100644 index 4555324554..0000000000 --- a/docs/en/rst/using/filing.rst +++ /dev/null @@ -1,81 +0,0 @@ -.. _filing: - -Filing a Bug -############ - -Reporting a New Bug -=================== - -Years of bug writing experience has been distilled for your -reading pleasure into the `Bug report writing guidelines -`_. -While some of the advice is Mozilla-specific, the basic principles of -reporting Reproducible, Specific bugs and isolating the Product you are -using, the Version of the Product, the Component which failed, the Hardware -Platform, and Operating System you were using at the time of the failure go a -long way toward ensuring accurate, responsible fixes for the bug that bit you. - -.. note:: If you want to file a test bug to see how Bugzilla works, you can do - so on `Mozilla’s Bugzilla (BMO) test server `_. - Please don’t do it on any production Bugzilla installation. - -The procedure for filing a bug is as follows: - -#. Click the :guilabel:`New` link available in the header or footer - of pages, or the :guilabel:`File a Bug` link on the home page. - -#. First, you have to select the product in which you found a bug. - -#. You now see a form where you can specify the component (part of - the product which is affected by the bug you discovered; if you have - no idea, just select :guilabel:`General` if such a component exists), - the version of the program you were using, the operating system and - platform your program is running on and the severity of the bug (if the - bug you found crashes the program, it's probably a major or a critical - bug; if it's a typo somewhere, that's something pretty minor; if it's - something you would like to see implemented, then that's an enhancement). - -#. You also need to provide a short but descriptive summary of the bug you found. - "My program is crashing all the time" is a very poor summary - and doesn't help developers at all. Try something more meaningful or - your bug will probably be ignored due to a lack of precision. - In the Description, give a detailed list of steps to reproduce - the problem you encountered. Try to limit these steps to a minimum set - required to reproduce the problem. This will make the life of - developers easier, and the probability that they consider your bug in - a reasonable timeframe will be much higher. - - .. note:: Try to make sure that everything in the Summary is also in the - Description. Summaries are often updated and this will ensure your original - information is easily accessible. - -#. As you file the bug, you can also attach a document (testcase, patch, - or screenshot of the problem). - -#. Depending on the Bugzilla installation you are using and the product in - which you are filing the bug, you can also request developers to consider - your bug in different ways (such as requesting review for the patch you - just attached, requesting your bug to block the next release of the - product, and many other product-specific requests). - -#. Now is a good time to read your bug report again. Remove all misspellings; - otherwise, your bug may not be found by developers running queries for some - specific words, and so your bug would not get any attention. - Also make sure you didn't forget any important information developers - should know in order to reproduce the problem, and make sure your - description of the problem is explicit and clear enough. - When you think your bug report is ready to go, the last step is to - click the :guilabel:`Submit Bug` button to add your report into the database. - -.. _cloning-a-bug: - -Clone an Existing Bug -===================== - -Bugzilla allows you to "clone" an existing bug. The newly created bug will -inherit most settings from the old bug. This allows you to track similar -concerns that require different handling in a new bug. To use this, go to -the bug that you want to clone, then click the :guilabel:`Clone This Bug` -link on the bug page. This will take you to the :guilabel:`Enter Bug` -page that is filled with the values that the old bug has. -You can then change the values and/or text if needed. diff --git a/docs/en/rst/using/finding.rst b/docs/en/rst/using/finding.rst deleted file mode 100644 index 2dd4782d27..0000000000 --- a/docs/en/rst/using/finding.rst +++ /dev/null @@ -1,323 +0,0 @@ -.. _finding: - -Finding Bugs -############ - -Bugzilla has a number of different search options. - -.. note:: Bugzilla queries are case-insensitive and accent-insensitive when - used with either MySQL or Oracle databases. When using Bugzilla with - PostgreSQL, however, some queries are case sensitive. This is due to - the way PostgreSQL handles case and accent sensitivity. - -.. _quicksearch: - -Quicksearch -=========== - -Quicksearch is a single-text-box query tool. You'll find it in -Bugzilla's header or footer. - -Quicksearch uses -metacharacters to indicate what is to be searched. For example, typing - - ``foo|bar`` - -into Quicksearch would search for "foo" or "bar" in the -summary and status whiteboard of a bug; adding - - ``:BazProduct`` - -would search only in that product. - -You can also use it to go directly to a bug by entering its number or its -alias. - -Simple Search -============= - -Simple Search is good for finding one particular bug. It works like internet -search engines - just enter some keywords and off you go. - -Advanced Search -=============== - -The Advanced Search page is used to produce a list of all bugs fitting -exact criteria. You can play with it on `Mozilla’s Bugzilla (BMO) test server -`_. - -Advanced Search has controls for selecting different possible -values for all of the fields in a bug, as described above. For some -fields, multiple values can be selected. In those cases, Bugzilla -returns bugs where the content of the field matches any one of the selected -values. If none is selected, then the field can take any value. - -After a search is run, you can save it as a Saved Search, which -will appear in the page footer. If you are in the group defined -by the "querysharegroup" parameter, you may share your queries -with other users; see :ref:`saved-searches` for more details. - -.. _custom-search: - -Custom Search -============= - -Highly advanced querying is done using the :guilabel:`Custom Search` feature -of the :guilabel:`Advanced Search` page. - -The search criteria here further restrict the set of results -returned by a query, over and above those defined in the fields at the top -of the page. It is thereby possible to search for bugs -based on elaborate combinations of criteria. - -The simplest custom searches have only one term. These searches permit the -selected *field* to be compared using a selectable *operator* to a specified -*value*. Much of this could be reproduced using the standard fields. However, -you can then combine terms using "Match All" (AND) or "Match Any" (OR), using -groups for combining and priority, in order to construct searches of almost -arbitrary complexity. - -There are three fields in each row (known as a "term") of a custom search: - -- *Field:* - the name of the field being searched - -- *Operator:* - the comparison operator - -- *Value:* - the value to which the field is being compared - -The list of available *fields* contains all the fields defined for a bug, -including any custom fields, and then also some pseudo-fields like -:guilabel:`Assignee Real Name`, :guilabel:`Days Since Bug Changed`, -:guilabel:`Time Since Assignee Touched` and other things it may be useful to -search on. - -There are a wide range of *operators* available, not all of which may make -sense for a particular field. There are various string-matching operations -(including regular expressions), numerical comparisons (which also work for -dates), and also the ability to search for change information—when a field -changed, what it changed from or to, and who did it. There are special -operators for :guilabel:`is empty` and :guilabel:`is not empty`, because -Bugzilla can't tell the difference between a value field left blank on -purpose and one left blank by accident. - -You can have an arbitrary number of rows and groups, and rearrange them by -dragging and dropping the handle on each item. You can even duplicate an item by -holding the Alt key while dragging it. The radio buttons above them define how -they relate — :guilabel:`Match All`, :guilabel:`Match All (Same Field)` or -:guilabel:`Match Any`. The difference between the first and second can be -illustrated with a comment search. If you have a search:: - - Comment contains the string "Fred" - Comment contains the string "Barney" - -then under the first regime (match separately) the search would return bugs -where "Fred" appeared in one comment and "Barney" in the same or any other -comment, whereas under the second (match against the same field), both strings -would need to occur in exactly the same comment. - -.. _advanced-features: - -Negation --------- - -At first glance, negation seems redundant. Rather than -searching for:: - - NOT ( summary contains the string "foo" ) - -one could search for:: - - summary does not contain the string "foo" - -However, the search:: - - CC does not contain the string "@mozilla.org" - -would find every bug where anyone on the CC list did not contain -"@mozilla.org" while:: - - NOT ( CC contains the string "@mozilla.org" ) - -would find every bug where there was nobody on the CC list who -did contain the string. Similarly, the use of negation also permits -complex expressions to be built using terms OR'd together and then -negated. Negation permits queries such as:: - - NOT ( ( product equals "Update" ) - OR - ( component equals "Documentation" ) - ) - -to find bugs that are neither -in the :guilabel:`Update` product or in the :guilabel:`Documentation` component -or:: - - NOT ( ( commenter equals "%assignee%" ) - OR - (component equals "Documentation" ) - ) - -to find non-documentation bugs on which the assignee has never commented. - -.. _pronouns: - -Pronoun Substitution --------------------- - -Sometimes, a query needs to compare a user-related field -(such as :guilabel:`Reporter`) with a role-specific user (such as the -user running the query or the user to whom each bug is assigned). For -example, you may want to find all bugs that are assigned to the person -who reported them. - -When the :guilabel:`Custom Search` operator is either :guilabel:`equals` or -:guilabel:`notequals`, the value can be ``%reporter%``, ``%triageowner%``, -``%assignee%``, ``%qacontact%``, ``%user%`` or ``%self%``. These are known as -"pronouns". The ``%user%`` pronoun and its alias ``%self%`` refer to the user -who is executing the query (that's you) or, in the case of whining reports, the -user who will be the recipient of the report. The ``%reporter%``, -``%triageowner%``, ``%assignee%`` and ``%qacontact%`` pronouns refer to the -corresponding fields in the bug. - -This feature also lets you search by a user's group memberships. If the -operator is either :guilabel:`equals`, :guilabel:`notequals` or -:guilabel:`anyexact`, you can search for -whether a user belongs (or not) to the specified group. The group name must be -entered using "%group.foo%" syntax, where "foo" is the group name. -So if you are looking for bugs reported by any user being in the -"editbugs" group, then you can use:: - - reporter equals "%group.editbugs%" - -.. _group_restrictions: - -Searching for Bugs Restricted to Groups ---------------------------------------- - -When administrators set up products, they can establish one or more -groups that bugs in the product can be associated with. If a bug is associated -with a group then only users who are members of the group can see it. - -This restriction is mostly used for security-related bugs, or internal tickets. - -In order to search for bugs restricted to a group, you must be a member of the group. - -Visit `the Permissions page `_ -to find the groups you belong to, then search using the clause - - Group is equal to "%group.groupname%" - -to list the bugs restricted to `groupname`. - -.. _relative-dates: - -Searching on Relative Dates ---------------------------- - -In order to conduct searches over a window of time, you can use *relative dates* in query values. - -The relative date values are of the form `nnV` where `nn` is a positive or negative integer and `V` is one of: - -* `h` – for hours -* `d` – for days -* `w` – for weeks -* `m` – for months -* `y` – for years - -A value of `1d` means 24 hours in the future from the time of the search. - -A value of `-1d` means 24 hours in the past from the time of the search. - -These relative values can be used when the :guilabel:`Custom Search` operator is one of: - -* :guilabel:`is less than` -* :guilabel:`is less than or equal to` -* :guilabel:`is greater than` -* :guilabel:`is greater than or equal to` - -and the field compared is a Datetime type. - -To find bugs opened in the last 24 hours, you could search on: - - Opened is less than "-1d" - -To find bugs opened during the current day (UTC), - - Opened is less than "-0ds" - -Appending `s` to a relative date means *start of*. - -You may also use relative dates for when a field changed. In the :guilabel:`Custom Search` operator that would be - -* :guilabel:`changed after` -* :guilabel:`changed before` - -To find bugs whose :guilabel:`priority` changed in the last seven days, search on: - - Priority changed after "-1w" - -You can also search for a change to a particular value over a relative date using the :guilabel:`Search by Change History` operator. - -To find the bugs `RESOLVED` as `WONTFIX` in the current year to date, you would search on - - Resolution changed to "WONTFIX" between "-0ys" and "NOW" - -.. _list: - -Bug Lists -========= - -The result of a search is a list of matching bugs. - -The format of the list is configurable. For example, it can be -sorted by clicking the column headings. Other useful features can be -accessed using the links at the bottom of the list: - -Long Format: - this gives you a large page with a non-editable summary of the fields - of each bug. - -XML (icon): - get the buglist in an XML format. - -CSV (icon): - get the buglist as comma-separated values, for import into e.g. - a spreadsheet. - -Feed (icon): - get the buglist as an Atom feed. Copy this link into your - favorite feed reader. If you are using Firefox, you can also - save the list as a live bookmark by clicking the live bookmark - icon in the status bar. To limit the number of bugs in the feed, - add a limit=n parameter to the URL. - -iCalendar (icon): - Get the buglist as an iCalendar file. Each bug is represented as a - to-do item in the imported calendar. - -Change Columns: - change the bug attributes which appear in the list. - -Change Several Bugs At Once: - If your account is sufficiently empowered, and more than one bug - appears in the bug list, this link is displayed and lets you easily make - the same change to all the bugs in the list - for example, changing - their assignee. - -Send Mail to Bug Assignees: - If more than one bug appears in the bug list and there are at least - two distinct bug assignees, this link is displayed which lets you - easily send an e-mail to the assignees of all bugs on the list. - -Edit Search: - If you didn't get exactly the results you were looking for, you can - return to the Query page through this link and make small revisions - to the query you just made so you get more accurate results. - -Remember Search As: - You can give a search a name and remember it; the name will appear - as an auto-completion in the search field in the header of Bugzilla - pages giving you quick access to run it again later. diff --git a/docs/en/rst/using/index.rst b/docs/en/rst/using/index.rst deleted file mode 100644 index 32273cab6a..0000000000 --- a/docs/en/rst/using/index.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. _using: - -========== -User Guide -========== - -.. toctree:: - :maxdepth: 2 - - creating-an-account - filing - understanding - editing - finding - reports-and-charts - tips - preferences - two-factor-authentication - extensions diff --git a/docs/en/rst/using/preferences.rst b/docs/en/rst/using/preferences.rst deleted file mode 100644 index ec6b3b5ab3..0000000000 --- a/docs/en/rst/using/preferences.rst +++ /dev/null @@ -1,203 +0,0 @@ -.. _user-preferences: - -User Preferences -################ - -Once logged in, you can customize various aspects of -Bugzilla via the "Preferences" link in the page footer. -The preferences are split into a number of tabs, detailed in the sections -below. - -.. _generalpreferences: - -General Preferences -=================== - -This tab allows you to change several default settings of Bugzilla. -Administrators have the power to remove preferences from this list, so you -may not see all the preferences available. - -Each preference should be self-explanatory. - -.. _emailpreferences: - -Email Preferences -================= - -This tab allows you to enable or disable email notification on -specific events. - -In general, users have almost complete control over how much (or -how little) email Bugzilla sends them. If you want to receive the -maximum amount of email possible, click the ``Enable All -Mail`` button. If you don't want to receive any email from -Bugzilla at all, click the ``Disable All Mail`` button. - -.. note:: A Bugzilla administrator can stop a user from receiving - bugmail by clicking the ``Bugmail Disabled`` checkbox - when editing the user account. This is a drastic step - best taken only for disabled accounts, as it overrides - the user's individual mail preferences. - -There are two global options -- ``Email me when someone -asks me to set a flag`` and ``Email me when someone -sets a flag I asked for``. These define how you want to -receive bugmail with regards to flags. Their use is quite -straightforward: enable the checkboxes if you want Bugzilla to -send you mail under either of the above conditions. - -If you'd like to set your bugmail to something besides -'Completely ON' and 'Completely OFF', the -``Field/recipient specific options`` table -allows you to do just that. The rows of the table -define events that can happen to a bug -- things like -attachments being added, new comments being made, the -priority changing, etc. The columns in the table define -your relationship with the bug - reporter, assignee, QA contact (if enabled) -or CC list member. - -To fine-tune your bugmail, decide the events for which you want -to receive bugmail; then decide if you want to receive it all -the time (enable the checkbox for every column) or only when -you have a certain relationship with a bug (enable the checkbox -only for those columns). For example, if you didn't want to -receive mail when someone added themselves to the CC list, you -could uncheck all the boxes in the ``CC Field Changes`` -line. As another example, if you never wanted to receive email -on bugs you reported unless the bug was resolved, you would -uncheck all boxes in the ``Reporter`` column -except for the one on the ``The bug is resolved or -verified`` row. - -.. note:: Bugzilla adds the ``X-Bugzilla-Reason`` header to - all bugmail it sends, describing the recipient's relationship - (AssignedTo, Reporter, QAContact, CC, or Voter) to the bug. - This header can be used to do further client-side filtering. - -Bugzilla has a feature called ``User Watching``. -When you enter one or more comma-delineated user accounts (usually email -addresses) into the text entry box, you will receive a copy of all the -bugmail those users are sent (security settings permitting). -This powerful functionality enables seamless transitions as developers -change projects or users go on holiday. - -Each user listed in the ``Users watching you`` field -has you listed in their ``Users to watch`` list -and can get bugmail according to your relationship to the bug and -their ``Field/recipient specific options`` setting. - -Lastly, you can define a list of bugs on which you no longer wish to receive -any email, ever. (You can also add bugs to this list individually by checking -the "Ignore Bug Mail" checkbox on the bug page for that bug.) This is useful -for ignoring bugs where you are the reporter, as that's a role it's not -possible to stop having. - -.. _saved-searches: - -Saved Searches -============== - -On this tab you can view and run any Saved Searches that you have -created, and any Saved Searches that other members of the group -defined in the :param:`querysharegroup` parameter have shared. -Saved Searches can be added to the page footer from this screen. -If somebody is sharing a Search with a group they are allowed to -:ref:`assign users to `, the sharer may opt to have -the Search show up in the footer of the group's direct members by default. - -.. _account-information: - -Account Information -=================== - -On this tab, you can change your basic account information, -including your password, email address and real name. For security -reasons, in order to change anything on this page you must type your -*current* password into the ``Password`` -field at the top of the page. -If you attempt to change your email address, a confirmation -email is sent to both the old and new addresses with a link to use to -confirm the change. This helps to prevent account hijacking. - -.. _api-keys: - -API Keys -======== - -API keys allow you to give a "token" to some external software so it can log -in to the WebService API as you without knowing your password. You can then -revoke that token if you stop using the web service, and you don't need to -change your password everywhere. - -You can create more than one API key if required. Each API key has an optional -description which can help you record what it is used for. - -On this page, you can unrevoke, revoke, make sticky, and change the description of existing -API keys for your login. A revoked key means that it cannot be used. The -description is optional and purely for your information. - -Sticky API keys may only be used from one IP address, which reduces the risk -of the key being leaked. The IP address is the one the key was last used -from. The expected workflow is that the sticky bit will be set once your application -(or script) is setup. The sticky attribute may only be set, it can't ever be unset. - -You can also create a new API key by selecting the checkbox under the 'New -API key' section of the page. - -.. _permissions: - -Permissions -=========== - -This is a purely informative page which outlines your current -permissions on this installation of Bugzilla. - -A complete list of permissions in a default install of Bugzilla is below. -Your administrator may have defined other permissions. Only users with -*editusers* privileges can change the permissions of other users. - -admin - Indicates user is an Administrator. - -bz_canusewhineatothers - Indicates user can configure whine reports for other users. - -bz_canusewhines - Indicates user can configure whine reports for self. - -bz_quip_moderators - Indicates user can moderate quips. - -bz_sudoers - Indicates user can perform actions as other users. - -bz_sudo_protect - Indicates user cannot be impersonated by other users. - -canconfirm - Indicates user can confirm a bug or mark it a duplicate. - -creategroups - Indicates user can create and destroy groups. - -editbugs - Indicates user can edit all bug fields. - -editclassifications - Indicates user can create, destroy and edit classifications. - -editcomponents - Indicates user can create, destroy and edit products, components, - versions, milestones and flag types. - -editkeywords - Indicates user can create, destroy and edit keywords. - -edittriageowners - Indicates user can edit the triage owner values for components. - -editusers - Indicates user can create, disable and edit users. - -tweakparams - Indicates user can change :ref:`Parameters `. diff --git a/docs/en/rst/using/reports-and-charts.rst b/docs/en/rst/using/reports-and-charts.rst deleted file mode 100644 index b93f50201e..0000000000 --- a/docs/en/rst/using/reports-and-charts.rst +++ /dev/null @@ -1,120 +0,0 @@ -.. _reports-and-charts: - -Reports and Charts -################## - -As well as the standard buglist, Bugzilla has two more ways of -viewing sets of bugs. These are the reports (which give different -views of the current state of the database) and charts (which plot -the changes in particular sets of bugs over time). - -.. _reports: - -Reports -======= - -A report is a view of the current state of the bug database. - -You can run either an HTML-table-based report, or a graphical -line/pie/bar-chart-based one. The two have different pages to -define them but are close cousins - once you've defined and -viewed a report, you can switch between any of the different -views of the data at will. - -Both report types are based on the idea of defining a set of bugs -using the standard search interface and then choosing some -aspect of that set to plot on the horizontal and/or vertical axes. -You can also get a form of 3-dimensional report by choosing to have -multiple images or tables. - -So, for example, you could use the search form to choose "all -bugs in the WorldControl product" and then plot their severity -against their component to see which component has had the largest -number of bad bugs reported against it. - -Once you've defined your parameters and hit :guilabel:`Generate Report`, -you can switch between HTML, CSV, Bar, Line and Pie. (Note: Pie -is only available if you didn't define a vertical axis, as pie -charts don't have one.) The other controls are fairly self-explanatory; -you can change the size of the image if you find text is overwriting -other text, or the bars are too thin to see. - -.. _charts: - -Charts -====== - -A chart is a view of the state of the bug database over time. - -Bugzilla currently has two charting systems - Old Charts and New -Charts. Old Charts have been part of Bugzilla for a long time; they -chart each status and resolution for each product, and that's all. -They are deprecated, and going away soon - we won't say any more -about them. -New Charts are the future - they allow you to chart anything you -can define as a search. - -.. note:: Both charting forms require the administrator to set up the - data-gathering script. If you can't see any charts, ask them whether - they have done so. - -An individual line on a chart is called a data set. -All data sets are organized into categories and subcategories. The -data sets that Bugzilla defines automatically use the Product name -as a :guilabel:`Category` and Component names as :guilabel:`Subcategories`, -but there is no need for you to follow that naming scheme with your own -charts if you don't want to. - -Data sets may be public or private. Everyone sees public data sets in -the list, but only their creator sees private data sets. Only -administrators can make data sets public. -No two data sets, even two private ones, can have the same set of -category, subcategory and name. So if you are creating private data -sets, one idea is to have the :guilabel:`Category` be your username. - -Creating Charts ---------------- - -You create a chart by selecting a number of data sets from the -list and pressing :guilabel:`Add To List` for each. In the -:guilabel:`List Of Data Sets To Plot`, you can define the label that data -set will have in the chart's legend and also ask Bugzilla to :guilabel:`Sum` -a number of data sets (e.g. you could :guilabel:`Sum` data sets representing -:guilabel:`RESOLVED`, :guilabel:`VERIFIED` and :guilabel:`CLOSED` in a -particular product to get a data set representing all the resolved bugs in -that product.) - -If you've erroneously added a data set to the list, select it -using the checkbox and click :guilabel:`Remove`. Once you add more than one -data set, a :guilabel:`Grand Total` line -automatically appears at the bottom of the list. If you don't want -this, simply remove it as you would remove any other line. - -You may also choose to plot only over a certain date range, and -to cumulate the results, that is, to plot each one using the -previous one as a baseline so the top line gives a sum of all -the data sets. It's easier to try than to explain :-) - -Once a data set is in the list, you can also perform certain -actions on it. For example, you can edit the -data set's parameters (name, frequency etc.) if it's one you -created or if you are an administrator. - -Once you are happy, click :guilabel:`Chart This List` to see the chart. - -.. _charts-new-series: - -Creating New Data Sets ----------------------- - -You may also create new data sets of your own. To do this, -click the :guilabel:`create a new data set` link on the -:guilabel:`Create Chart` page. This takes you to a search-like interface -where you can define the search that Bugzilla will plot. At the bottom of the -page, you choose the category, sub-category and name of your new -data set. - -If you have sufficient permissions, you can make the data set public, -and reduce the frequency of data collection to less than the default -of seven days. - diff --git a/docs/en/rst/using/tips.rst b/docs/en/rst/using/tips.rst deleted file mode 100644 index c1ef49a3ca..0000000000 --- a/docs/en/rst/using/tips.rst +++ /dev/null @@ -1,65 +0,0 @@ -.. _pro-tips: - -Pro Tips -######## - -This section distills some Bugzilla tips and best practices -that have been developed. - -Autolinkification -================= - -Bugzilla comments are plain text - so typing will -produce less-than, U, greater-than rather than underlined text. -However, Bugzilla will automatically make hyperlinks out of certain -sorts of text in comments. For example, the text -``https://www.bugzilla.org`` will be turned into a link: -``_. -Other strings which get linkified in the obvious manner are: - -+ bug 12345 - -+ bugs 123, 456, 789 - -+ comment 7 - -+ comments 1, 2, 3, 4 - -+ bug 23456, comment 53 - -+ attachment 4321 - -+ mailto\:george\@example.com - -+ george\@example.com - -+ ftp\://ftp.mozilla.org - -+ Most other sorts of URL - -A corollary here is that if you type a bug number in a comment, -you should put the word "bug" before it, so it gets autolinkified -for the convenience of others. - -.. _commenting: - -Comments -======== - -If you are changing the fields on a bug, only comment if -either you have something pertinent to say or Bugzilla requires it. -Otherwise, you may spam people unnecessarily with bugmail. -To take an example: a user can set up their account to filter out messages -where someone just adds themselves to the CC field of a bug -(which happens a lot). If you come along, add yourself to the CC field, -and add a comment saying "Adding self to CC", then that person -gets a pointless piece of mail they would otherwise have avoided. - -Don't use signs in comments. Signing your name ("Bill") is acceptable, -if you do it out of habit, but full mail/news-style -four line ASCII art creations are not. - -If you feel a bug you filed was incorrectly marked as a -DUPLICATE of another, please question it in your bug, not -the bug it was duped to. Feel free to CC the person who duped it -if they are not already CCed. diff --git a/docs/en/rst/using/two-factor-authentication.rst b/docs/en/rst/using/two-factor-authentication.rst deleted file mode 100644 index 8a128ac573..0000000000 --- a/docs/en/rst/using/two-factor-authentication.rst +++ /dev/null @@ -1,319 +0,0 @@ -.. _two-factor-authentication: - -Two-Factor Authentication -######################### - -Two-factor authentication (2FA) protects your account with two independent -credentials: your password and a second factor. If someone learns your password, -they still cannot sign in without access to your second factor. - -BMO supports two methods: - -* **Time-based one-time passwords (TOTP)** are available unless your account - belongs to a group that requires Duo. A TOTP application generates a new - six-digit code every 30 seconds. -* **Duo Security** is available to eligible Mozilla-affiliated accounts. Some - Mozilla groups require their members to use Duo. - -For the strongest separation between factors, keep your password and TOTP -generator on different devices or in different applications. A password manager -that stores both your BMO password and TOTP secret is convenient and still -protects against some attacks, but anyone who compromises that password manager -may obtain both factors. - -After you enable 2FA, BMO asks for second-factor verification when you sign in -and when you perform sensitive account actions, such as changing your email -address or password, creating an API key, or relaxing API authentication -requirements. Enabling or disabling 2FA also signs out your other BMO sessions. - -Enabling 2FA turns on the -:guilabel:`Require API key authentication for API requests` preference. -Applications and scripts that use the BMO API should authenticate with an -:ref:`API key ` instead of your password. You can turn this preference -off after verifying with your second factor, but doing so is not recommended. - -.. _required-two-factor-enrollment: - -Required 2FA Enrollment -======================= - -If BMO displays a 2FA enrollment deadline, enable 2FA before the date shown. -After that deadline, BMO restricts your account to the 2FA preferences page -until enrollment is complete. - -Some accounts are required to use Duo. If an account is used for automation -and Duo is not appropriate, `file a bug in the bugzilla.mozilla.org -Administration component -`_ -with details about the bot and its requirements to request an exception. - -.. _choose-two-factor-method: - -Choose a Method -=============== - -Before you begin: - -* Make sure you know your current BMO password. -* For TOTP, install a TOTP application on a device you control and set the - device's date and time automatically. -* For Duo, complete enrollment at `login.mozilla.com - `_ and have your Duo username ready. - -Open `BMO's Two-Factor Authentication preferences -`_, or open -:guilabel:`Preferences` and select the :guilabel:`Two-Factor Authentication` -tab. Choose an available method. - -.. figure:: ../../images/mfa-method-selection.png - :alt: BMO Two-Factor Authentication preferences showing TOTP and Duo choices - - Choose TOTP or, if your account is eligible, Duo Security. - -You must have a password on your BMO account before you can enable 2FA. If your -account does not have one, use :guilabel:`Reset Password` and follow the link -sent to your email address. - -.. _configure-totp: - -Configure TOTP -============== - -`Google Authenticator `_, -`FreeOTP `_, and other applications compatible with -the TOTP standard can generate BMO verification codes. The exact labels vary by -application, but the enrollment process is the same: - -#. Click :guilabel:`Time-based One-Time Password (TOTP)`. -#. Enter your current BMO password. -#. In your TOTP application, add a new account and choose the option to scan a - QR code. Allow camera access if the application requests it. -#. Point the device's camera at the QR code shown by BMO. The application should - add a BMO entry and begin showing a new six-digit code every 30 seconds. -#. If you cannot scan the QR code, click :guilabel:`Show as text` above it to - display the secret, then choose manual entry in your TOTP application and - enter that secret. -#. Enter the six-digit code shown by your TOTP application. -#. Click :guilabel:`Submit Changes`. - -BMO returns to the 2FA preferences page and shows TOTP as enabled. Generate -recovery codes before signing out or removing the BMO entry from your TOTP -application. - -.. figure:: ../../images/mfa-totp-enrollment.png - :alt: BMO TOTP enrollment form with a QR code and verification fields - - Scan the QR code, then verify enrollment with your password and a current - six-digit code. - -.. warning:: - - The QR code and manual secret can generate verification codes for your - account. Do not save screenshots of them or share them with anyone. - -.. _configure-duo: - -Configure Duo -============= - -Duo appears only when BMO marks your account as eligible. This includes Mozilla -employees and members of groups required to use Duo; having a Mozilla LDAP -account alone does not guarantee eligibility. Before enabling Duo in BMO, enroll -your account at `login.mozilla.com `_. - -#. Click :guilabel:`Duo Security`. -#. Enter your current BMO password. -#. Enter your Mozilla Duo username, which is generally your Mozilla LDAP - username and may differ from your BMO email address. -#. Click :guilabel:`Submit Changes`. -#. Complete the Duo Universal Prompt. - -The Duo application and a TOTP application are not interchangeable. When BMO -shows the Duo Universal Prompt, approve the request using a method enrolled in -Duo; do not enter a TOTP code created for BMO. - -If your group requires Duo, BMO does not offer the option to disable it in your -2FA preferences. Contact `Mozilla Service Desk`_ if you need help with your Duo -enrollment or device. - -.. _use-two-factor-authentication: - -Sign In and Confirm Sensitive Changes -===================================== - -After entering your email address and password, BMO completes sign-in using the -method configured on your account: - -* TOTP users enter the current six-digit code from their TOTP application. An - unused BMO recovery code also works in this field. -* Duo users complete the Duo Universal Prompt using an enrolled Duo method. BMO - recovery codes do not replace this prompt. - -BMO asks you to verify again before sensitive account changes. Read the prompt -carefully and use the same method. Never approve an unexpected Duo request or -give a TOTP or recovery code to another person. - -.. _two-factor-recovery-codes: - -Generate Recovery Codes -======================= - -For TOTP accounts, recovery codes let you verify your identity if your normal -second factor is lost, unavailable, or replaced. Generate them immediately -after enabling TOTP. - -#. Return to the :guilabel:`Two-Factor Authentication` preferences tab. -#. Click :guilabel:`Generate Printable Recovery Codes`. -#. Enter your current password and either a current TOTP code or an unused - recovery code. -#. Click :guilabel:`Generate Printable Recovery Codes` again to submit the - form. -#. Print the codes and store them in a secure offline location. - -.. figure:: ../../images/mfa-enabled.png - :alt: BMO preferences showing enabled TOTP and the recovery-code button - - Generate recovery codes from the preferences page after enabling 2FA. - -.. figure:: ../../images/mfa-recovery-codes.png - :alt: BMO printable recovery-code page showing ten single-use codes - - BMO displays ten printable recovery codes. - -Each recovery code is a nine-digit, single-use code. Enter one in the same field -that normally accepts your TOTP code. Generating a new set immediately -invalidates every code from the previous set. - -Do not store recovery codes with your password or on the device that provides -your second factor. If you are unsure whether your codes remain private, -generate and print a new set. - -BMO recovery codes cannot replace a Duo verification, even though the 2FA -preferences page offers Duo users the recovery-code generator. Duo users should -configure more than one authentication method in Duo and contact `Mozilla -Service Desk`_ if none of those methods are available. - -.. _two-factor-troubleshooting: - -Troubleshooting -=============== - -.. _two-factor-totp-code-rejected: - -TOTP Code Is Rejected ---------------------- - -#. Make sure you are using the code from the BMO entry in your TOTP application, - not a Duo passcode or a code for another service. -#. Set the device's date and time automatically. TOTP depends on an accurate - clock. -#. If the displayed code is about to expire, wait for the next code and enter it - promptly. -#. Enter only the six digits shown by the application. - -If current codes continue to fail and you are already signed in, use an unused -recovery code to :ref:`disable and re-enable TOTP -`. If you are signed out, you need two unused recovery -codes: one to sign in and another to disable TOTP. Otherwise, contact the BMO -administrators. - -.. _two-factor-duo-prompt-not-load: - -Duo Prompt Does Not Load ------------------------- - -Content-blocking or privacy extensions can prevent the Duo Universal Prompt from -loading. Temporarily allow the Duo page, reload BMO, and try again. Also confirm -that the Duo username configured in BMO belongs to your Mozilla account. - -If the prompt still does not load, or none of your enrolled Duo methods is -available, contact `Mozilla Service Desk`_. - -.. _two-factor-no-method-available: - -No 2FA Method Is Available --------------------------- - -BMO requires a password before it can enable 2FA. If your account signs in -through an external identity provider and does not yet have a BMO password, use -:guilabel:`Reset Password` on the 2FA preferences page and follow the link sent -to your email address. - -.. _lost-two-factor-device: - -If You Lose Your Device -======================= - -If you use TOTP and have recovery codes: - -#. Sign in with your password and one unused recovery code. -#. Open the :guilabel:`Two-Factor Authentication` preferences tab. -#. Click :guilabel:`Disable Two-factor Authentication`. -#. Enter your current password and verify with another unused recovery code. -#. Click :guilabel:`Submit Changes`. -#. Enable 2FA again with your replacement device and generate a new set of - recovery codes. - -If you use Duo and still have another enrolled Duo device or recovery method, -use it in the Duo Universal Prompt. Duo users who cannot access an enrolled -method should contact `Mozilla Service Desk`_. - -If you have lost both your second factor and all recovery codes, contact -`the BMO administrators `_. You will need to -provide enough information to establish that you own the account. Account -recovery is not guaranteed. - -.. _change-two-factor-method: - -Change or Disable 2FA -===================== - -If your account permits changing methods, first disable the current method, -then enable the new one. You must enter your current password and verify with -your current second factor. TOTP users may verify with an unused recovery code -instead. There is a brief period when your account is not protected by 2FA, so -complete the new enrollment immediately. - -When you enable or disable 2FA, BMO signs out every other session while keeping -your current session active. You can also review and end sessions from BMO's -`Sessions preferences -`_. - -.. _two-factor-frequently-asked-questions: - -Frequently Asked Questions -========================== - -.. _two-factor-move-totp-new-device: - -Can I Move TOTP to a New Device? --------------------------------- - -If both devices are available, use your TOTP application's supported transfer -process, then confirm that the new device produces working BMO codes before -removing the old entry. Otherwise, disable TOTP while the old device still -works, enable it again with the new device, and generate new recovery codes. -BMO does not display the original TOTP secret again after enrollment. - -.. _two-factor-store-totp-password-manager: - -Can I Store TOTP in My Password Manager? ----------------------------------------- - -Yes, if your password manager supports it, but this places your password and -second factor in the same security boundary. A separate TOTP application or -device provides stronger protection if your password manager is compromised. -Whichever approach you choose, keep recovery codes separately in a secure -offline location. - -.. _two-factor-api-client-stopped-working: - -Why Did My API Client Stop Working? ------------------------------------ - -Enabling 2FA also enables the -:guilabel:`Require API key authentication for API requests` preference. -Password-authenticated scripts may therefore stop working. Create an -:ref:`API key ` for the client rather than weakening this preference. - -.. _Mozilla Service Desk: https://mozilla-hub.atlassian.net/servicedesk/customer/portal/1 diff --git a/docs/en/rst/using/understanding.rst b/docs/en/rst/using/understanding.rst deleted file mode 100644 index 27d49b0e1f..0000000000 --- a/docs/en/rst/using/understanding.rst +++ /dev/null @@ -1,303 +0,0 @@ -.. _understanding: - -Understanding a Bug -################### - -The core of Bugzilla is the screen which displays a particular -bug. Note that the labels for most fields are hyperlinks; -clicking them will take you to context-sensitive help on that -particular field. Fields marked * may not be present on every -installation of Bugzilla. - -*Summary:* - A one-sentence summary of the problem, displayed in the header next to - the bug number. - -*Status (and Resolution):* - These define exactly what state the bug is in—from not even - being confirmed as a bug, through to being fixed and the fix - confirmed by Quality Assurance. The different possible values for - Status and Resolution on your installation should be documented in the - context-sensitive help for those items. - -*Alias:* - A unique short text name for the bug, which can be used instead of the - bug number. - -*Product and Component*: - Bugs are divided up by Product and Component, with a Product - having one or more Components in it. - -*Version:* - The "Version" field usually contains the numbers or names of released - versions of the product. It is used to indicate the version(s) affected by - the bug report. - -*Hardware (Platform and OS):* - These indicate the computing environment where the bug was - found. - -*Importance (Priority and Severity):* - The Priority field is used to prioritize bugs, either by the assignee, - or someone else with authority to direct their time such as a project - manager. It's a good idea not to change this on other people's bugs. The - default values are P1 to P5. - - The Severity field indicates how severe the problem is—from blocker - ("application unusable") to trivial ("minor cosmetic issue"). You - can also use this field to indicate whether a bug is an enhancement - request. - -*\*Target Milestone:* - A future version by which the bug is to - be fixed. e.g. The Bugzilla Project's milestones for future - Bugzilla versions are 4.4, 5.0, 6.0, etc. Milestones are not - restricted to numbers, though—you can use any text strings, such - as dates. - -*Assigned To:* - The person responsible for fixing the bug. - -*\*QA Contact:* - The person responsible for quality assurance on this bug. - -*URL:* - A URL associated with the bug, if any. - -*\*Whiteboard:* - A free-form text area for adding short notes and tags to a bug. - -*Keywords:* - The administrator can define keywords which you can use to tag and - categorize bugs—e.g. ``crash`` or ``regression``. - -*Personal Tags:* - Unlike Keywords which are global and visible by all users, Personal Tags - are personal and can only be viewed and edited by their author. Editing - them won't send any notifications to other users. Use them to tag and keep - track of sets of bugs that you personally care about, using your own - classification system. - -*Dependencies (Depends On and Blocks):* - If this bug cannot be fixed unless other bugs are fixed (depends - on), or this bug stops other bugs being fixed (blocks), their - numbers are recorded here. - - Clicking the :guilabel:`Dependency tree` link shows - the dependency relationships of the bug as a tree structure. - You can change how much depth to show, and you can hide resolved bugs - from this page. You can also collapse/expand dependencies for - each non-terminal bug on the tree view, using the [-]/[+] buttons that - appear before the summary. - -*Opened:* - The person who filed the bug, and the date and time they did it. - -*Updated:* - The date and time the bug was last changed. - -*CC List:* - A list of people who get mail when the bug changes, in addition to the - Reporter, Assignee and QA Contact (if enabled). - -*Ignore Bug Mail:* - Set this if you want never to get bugmail from this bug again. See also - :ref:`emailpreferences`. - -*\*See Also:* - Bugs, in this Bugzilla, other Bugzillas, or other bug trackers, that are - related to this one. - -*Flags:* - A flag is a kind of status that can be set on bugs or attachments - to indicate that the bugs/attachments are in a certain state. - Each installation can define its own set of flags that can be set - on bugs or attachments. See :ref:`flags`. - -*\*Time Tracking:* - This form can be used for time tracking. - To use this feature, you have to be a member of the group - specified by the :param:`timetrackinggroup` parameter. See - :ref:`time-tracking` for more information. - - Orig. Est.: - This field shows the original estimated time. - Current Est.: - This field shows the current estimated time. - This number is calculated from ``Hours Worked`` - and ``Hours Left``. - Hours Worked: - This field shows the number of hours worked. - Hours Left: - This field shows the ``Current Est.`` - - ``Hours Worked``. - This value + ``Hours Worked`` will become the - new Current Est. - %Complete: - This field shows what percentage of the task is complete. - Gain: - This field shows the number of hours that the bug is ahead of the - ``Orig. Est.``. - Deadline: - This field shows the deadline for this bug. - -*Attachments:* - You can attach files (e.g. test cases or patches) to bugs. If there - are any attachments, they are listed in this section. See - :ref:`attachments` for more information. - -*Additional Comments:* - You can add your two cents to the bug discussion here, if you have - something worthwhile to say. - -.. _flags: - -Flags -===== - -Flags are a way to attach a specific status to a bug or attachment, -either ``+`` or ``-``. The meaning of these symbols depends on the name of -the flag itself, but contextually they could mean pass/fail, -accept/reject, approved/denied, or even a simple yes/no. If your site -allows requestable flags, then users may set a flag to ``?`` as a -request to another user that they look at the bug/attachment and set -the flag to its correct status. - -A set flag appears in bug reports and on "edit attachment" pages with the -abbreviated username of the user who set the flag prepended to the -flag name. For example, if Jack sets a "review" flag to ``+``, it appears -as :guilabel:`Jack: review [ + ]`. - -A requested flag appears with the user who requested the flag prepended -to the flag name and the user who has been requested to set the flag -appended to the flag name within parentheses. For example, if Jack -asks Jill for review, it appears as :guilabel:`Jack: review [ ? ] (Jill)`. - -You can browse through open requests made of you and by you by selecting -:guilabel:`My Requests` from the footer. You can also look at open requests -limited by other requesters, requestees, products, components, and flag names. -Note that you can use '-' for requestee to specify flags with no requestee -set. - -.. _flags-simpleexample: - -A Simple Example ----------------- - -A developer might want to ask their manager, -"Should we fix this bug before we release version 2.0?" -They might want to do this for a *lot* of bugs, -so they decide to streamline the process. So: - -#. The Bugzilla administrator creates a flag type called blocking2.0 for bugs - in your product. It shows up on the :guilabel:`Show Bug` screen as the text - :guilabel:`blocking2.0` with a drop-down box next to it. The drop-down box - contains four values: an empty space, ``?``, ``-``, and ``+``. - -#. The developer sets the flag to ``?``. - -#. The manager sees the :guilabel:`blocking2.0` - flag with a ``?`` value. - -#. If the manager thinks the feature should go into the product - before version 2.0 can be released, they set the flag to - ``+``. Otherwise, they set it to ``-``. - -#. Now, every Bugzilla user who looks at the bug knows whether or - not the bug needs to be fixed before release of version 2.0. - -.. _flags-about: - -About Flags ------------ - -Flags can have four values: - -``?`` - A user is requesting that a status be set. (Think of it as 'A question is being asked'.) - -``-`` - The status has been set negatively. (The question has been answered ``no``.) - -``+`` - The status has been set positively. - (The question has been answered ``yes``.) - -``_`` - ``unset`` actually shows up as a blank space. This just means that nobody - has expressed an opinion (or asked someone else to express an opinion) - about the matter covered by this flag. - -.. _flag-askto: - -Flag Requests -------------- - -If a flag has been defined as :guilabel:`requestable`, and a user has enough -privileges to request it (see below), the user can set the flag's status to -``?``. This status indicates that someone (a.k.a. "the requester") is asking -someone else to set the flag to either ``+`` or ``-``. - -If a flag has been defined as :guilabel:`specifically requestable`, -a text box will appear next to the flag into which the requester may -enter a Bugzilla username. That named person (a.k.a. "the requestee") -will receive an email notifying them of the request, and pointing them -to the bug/attachment in question. - -If a flag has *not* been defined as :guilabel:`specifically requestable`, -then no such text box will appear. A request to set this flag cannot be made -of any specific individual; these requests are open for anyone to answer. In -Bugzilla this is known as "asking the wind". A requester may ask the wind on -any flag simply by leaving the text box blank. - -.. _flag-types: - -.. _flag-type-attachment: - -Attachment Flags ----------------- - -There are two types of flags: bug flags and attachment flags. - -Attachment flags are used to ask a question about a specific -attachment on a bug. - -Many Bugzilla installations use this to -request that one developer review another -developer's code before they check it in. They attach the code to -a bug report, and then set a flag on that attachment called -:guilabel:`review` to -:guilabel:`review? reviewer@example.com`. -reviewer\@example.com is then notified by email that -they have to check out that attachment and approve it or deny it. - -For a Bugzilla user, attachment flags show up in three places: - -#. On the list of attachments in the :guilabel:`Show Bug` - screen, you can see the current state of any flags that - have been set to ``?``, ``+``, or ``-``. You can see who asked about - the flag (the requester), and who is being asked (the - requestee). - -#. When you edit an attachment, you can - see any settable flag, along with any flags that have - already been set. The :guilabel:`Edit Attachment` - screen is where you set flags to ``?``, ``-``, ``+``, or unset them. - -#. Requests are listed in the :guilabel:`Request Queue`, which - is accessible from the :guilabel:`My Requests` link (if you are - logged in) or :guilabel:`Requests` link (if you are logged out) - visible on all pages. - -.. _flag-type-bug: - -Bug Flags ---------- - -Bug flags are used to set a status on the bug itself. You can -see Bug Flags in the :guilabel:`Show Bug` and :guilabel:`Requests` -screens, as described above. - -Only users with enough privileges (see below) may set flags on bugs. -This doesn't necessarily include the assignee, reporter, or users with the -:group:`editbugs` permission. diff --git a/docs/lib/Pod/Simple/HTML/Bugzilla.pm b/docs/lib/Pod/Simple/HTML/Bugzilla.pm deleted file mode 100644 index 5a2203473e..0000000000 --- a/docs/lib/Pod/Simple/HTML/Bugzilla.pm +++ /dev/null @@ -1,68 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -package Pod::Simple::HTML::Bugzilla; - -use 5.10.1; -use strict; -use warnings; - -use parent qw(Pod::Simple::HTML); - -# Without this constant, HTMLBatch will throw undef warnings. -use constant VERSION => $Pod::Simple::HTML::VERSION; -use constant CODE_CLASS => ' class="code"'; -use constant META_CT => ''; -use constant DOCTYPE => ''; - -sub new { - my $self = shift->SUPER::new(@_); - - my $doctype = $self->DOCTYPE; - my $content_type = $self->META_CT; - - my $html_pre_title = < - - -END_HTML - - my $html_post_title = <<END_HTML; - - $content_type - - -END_HTML - - $self->html_header_before_title($html_pre_title); - $self->html_header_after_title($html_post_title); - - # Fix some tags to have classes so that we can adjust them. - my $code = CODE_CLASS; - $self->{'Tagmap'}->{'Verbatim'} = "\n

";
-  $self->{'Tagmap'}->{'VerbatimFormatted'} = "\n
";
-  $self->{'Tagmap'}->{'F'}                 = "";
-  $self->{'Tagmap'}->{'C'}                 = "";
-
-  # Don't put head4 tags into the Table of Contents. We have this
-  delete $Pod::Simple::HTML::ToIndex{'head4'};
-
-  return $self;
-}
-
-# Override do_beginning to put the name of the module at the top
-sub do_beginning {
-  my $self = shift;
-  $self->SUPER::do_beginning(@_);
-  print {$self->{'output_fh'}} "

" . $self->get_short_title . "

"; - return 1; -} - -1; diff --git a/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm b/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm deleted file mode 100644 index ae05ecf872..0000000000 --- a/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm +++ /dev/null @@ -1,112 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -package Pod::Simple::HTMLBatch::Bugzilla; - -use 5.10.1; -use strict; -use warnings; - -use parent qw(Pod::Simple::HTMLBatch); - -# This is the same hack that HTMLBatch does to "import" this subroutine. -BEGIN { *esc = \&Pod::Simple::HTML::esc } - -# Describes how top-level modules should be sorted and named. This -# is a translation from HTMLBatch's names to our categories. -# Note that if you leave out a category here, it will not be indexed -# in the contents file, even though its HTML POD will still exist. -use constant FILE_TRANSLATION => { - Files => [ - 'importxml', 'contrib', 'checksetup', 'email_in', - 'install-module', 'sanitycheck', 'jobqueue', 'migrate', - 'collectstats' - ], - Modules => ['bugzilla'], - Extensions => ['extensions'], -}; - -# This is basically copied from Pod::Simple::HTMLBatch, and overridden -# so that we can format things more nicely. -sub _write_contents_middle { - my ($self, $Contents, $outfile, $toplevel2submodules) = @_; - - my $file_trans = FILE_TRANSLATION; - - # For every top-level category... - foreach my $category (sort keys %$file_trans) { - - # Get all of the HTMLBatch categories that should be in this - # category. - my @category_data; - foreach my $b_category (@{$file_trans->{$category}}) { - my $data = $toplevel2submodules->{$b_category}; - push(@category_data, @$data) if $data; - } - next unless @category_data; - - my @downlines = sort { $a->[-1] cmp $b->[-1] } @category_data; - - # And finally, actually print out the table for this category. - printf $Contents qq[
%s
\n
\n], esc($category), - esc($category); - print $Contents '' . "\n"; - - # For every POD... - my $row_count = 0; - foreach my $e (@downlines) { - $row_count++; - my $even_or_odd = $row_count % 2 ? 'even' : 'odd'; - my $name = esc($e->[0]); - my $path = join("/", '.', esc(@{$e->[3]})) . $Pod::Simple::HTML::HTML_EXTENSION; - my $description = $self->{bugzilla_desc}->{$name} || ''; - $description = esc($description); - my $html = < - - - -END_HTML - - print $Contents $html; - } - print $Contents "
$name$description
\n\n"; - } - - return 1; -} - -# This stores the name and description for each file, so that -# we can get that information out later. -sub note_for_contents_file { - my $self = shift; - my $retval = $self->SUPER::note_for_contents_file(@_); - - my ($namelets, $infile) = @_; - my $parser = $self->html_render_class->new; - $parser->set_source($infile); - my $full_title = $parser->get_title; - $full_title =~ /^\S+\s+-+\s+(.+)/; - my $description = $1; - - $self->{bugzilla_desc} ||= {}; - $self->{bugzilla_desc}->{join('::', @$namelets)} = $description; - - return $retval; -} - -# Exclude modules being in lib/. -sub find_all_pods { - my ($self, $dirs) = @_; - my $mod2path = $self->SUPER::find_all_pods($dirs); - foreach my $mod (keys %$mod2path) { - delete $mod2path->{$mod} if $mod =~ /^lib::/; - } - return $mod2path; -} - -1; diff --git a/docs/makedocs.pl b/docs/makedocs.pl deleted file mode 100755 index 6f34215888..0000000000 --- a/docs/makedocs.pl +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env perl -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -# This script compiles all the documentation. -# -# Required software: -# -# 1) Sphinx documentation builder (python-sphinx package on Debian/Ubuntu) -# -# 2a) rst2pdf -# or -# 2b) pdflatex, which means the following Debian/Ubuntu packages: -# * texlive-latex-base -# * texlive-latex-recommended -# * texlive-latex-extra -# * texlive-fonts-recommended -# -# All these TeX packages together are close to a gig :-| But after you've -# installed them, you can remove texlive-latex-extra-doc to save 400MB. - -use 5.10.1; -use strict; -use warnings; - -use File::Basename; -BEGIN { chdir dirname($0); } - -use lib qw(.. ../lib lib ../local/lib/perl5); - -use Cwd; -use File::Copy::Recursive qw(rcopy); -use File::Find; -use File::Path qw(rmtree); -use File::Which qw(which); -use Pod::Simple; - -use Bugzilla::Constants qw(BUGZILLA_VERSION bz_locations); -use Pod::Simple::HTMLBatch::Bugzilla; -use Pod::Simple::HTML::Bugzilla; - -############################################################################### -# Subs -############################################################################### - -my $error_found = 0; - -sub MakeDocs { - my ($name, $cmdline) = @_; - - say "Creating $name documentation ..." if defined $name; - say "make $cmdline\n"; - system('make', $cmdline) == 0 or $error_found = 1; - print "\n"; -} - -sub make_pod { - say "Creating API documentation..."; - - my $converter = Pod::Simple::HTMLBatch::Bugzilla->new; - - # Don't output progress information. - $converter->verbose(0); - $converter->html_render_class('Pod::Simple::HTML::Bugzilla'); - - my $doctype = Pod::Simple::HTML::Bugzilla->DOCTYPE; - my $content_type = Pod::Simple::HTML::Bugzilla->META_CT; - my $bz_version = BUGZILLA_VERSION; - - my $contents_start = < - - $content_type - Bugzilla $bz_version API Documentation - - -

Bugzilla $bz_version API Documentation

-END_HTML - - $converter->contents_page_start($contents_start); - $converter->contents_page_end(""); - $converter->add_css('./../../../style.css'); - $converter->javascript_flurry(0); - $converter->css_flurry(0); - mkdir("html"); - mkdir("html/api"); - $converter->batch_convert(['../../'], 'html/api/'); - - print "\n"; -} - -############################################################################### -# Make the docs ... -############################################################################### - -my @langs; - -# search for sub directories which have a 'rst' sub-directory -opendir(LANGS, './'); -foreach my $dir (readdir(LANGS)) { - next if (($dir eq '.') || ($dir eq '..') || (!-d $dir)); - if (-d "$dir/rst") { - push(@langs, $dir); - } -} -closedir(LANGS); - -my $docparent = getcwd(); -foreach my $lang (@langs) { - chdir "$docparent/$lang"; - - make_pod(); - - next if grep { $_ eq '--pod-only' } @ARGV; - - chdir "$docparent/$lang"; - - MakeDocs('HTML', 'html'); - MakeDocs('TXT', 'text'); - - if (grep { $_ eq '--with-pdf' } @ARGV) { - if (which('pdflatex')) { - MakeDocs('PDF', 'latexpdf'); - } - elsif (which('rst2pdf')) { - rmtree('pdf', 0, 1); - MakeDocs('PDF', 'pdf'); - } - else { - say 'pdflatex or rst2pdf not found. Skipping PDF file creation'; - } - } - - rmtree('doctrees', 0, 1); -} - -die "Error occurred building the documentation\n" if $error_found; diff --git a/docs/style.css b/docs/style.css deleted file mode 100644 index fa85b6c41f..0000000000 --- a/docs/style.css +++ /dev/null @@ -1,97 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This Source Code Form is "Incompatible With Secondary Licenses", as - * defined by the Mozilla Public License, v. 2.0. - */ - -/* This style file is used by the API documentation */ - -body { - background: white; - color: #111; - padding: 0 1em; - font-family: Verdana, Arial, sans-serif; -} - -a:link, a:active { color: #36415c; } -a:visited { color: #666; } -a:hover { color: #888; } - -h1 { - font-size: 150%; - font-weight: bold; - border-bottom: 2px solid #ccc; -} -h2 { - font-size: 125%; - font-weight: bold; - border-bottom: 1px solid #ccc; - margin-bottom: 8px; -} -h3 { - font-size: 115%; - font-weight: bold; - margin-bottom: 0; - padding-bottom: 0; -} - -/* This makes Description/Params/Returns look nice. */ -dd { margin-top: .2em; } -dd p { margin-top: 0; } -dl { margin-bottom: 1em; } - -/* This makes the names of functions slightly larger, in Gecko. */ -body > dl > dt code { font-size: 1.35em; } - -#pod h1 a, #pod h2 a, #pod h3 a { - color: #36415c; - text-decoration: none; -} - -pre, code, tt, kbd, samp { - /* Unfortunately, the default monospace fonts on most browsers - look odd with relative sizing. */ - font-size: 12px; -} - -.code { - background: #eed; - border: 1px solid #ccc; -} - -pre.code, pre.programlisting, pre.screen { - margin-left: 10px; - padding: 0.5em; - background: #eed; - border: 1px solid #ccc; -} - -/* Special styles for the Contents page */ - -.contentspage dt { - font-size: large; - font-weight: bold; -} - -.pod_desc_table { - border-collapse: collapse; - table-layout: auto; - border: 1px solid #ccc; -} - -.pod_desc_table th { - text-align: left; -} - -.pod_desc_table td, .pod_desc_table th { - padding: .25em; - border-top: 1px solid #ccc; -} - -.pod_desc_table .odd th, .pod_desc_table .odd td { - background-color: #eee; -} - -.pod_desc_table diff --git a/extensions/BMO/lib/Reports/Attention.pm b/extensions/BMO/lib/Reports/Attention.pm index 7ec8d7b2b8..1f1eb12f20 100644 --- a/extensions/BMO/lib/Reports/Attention.pm +++ b/extensions/BMO/lib/Reports/Attention.pm @@ -161,7 +161,7 @@ sub critical_assigned_bugs { my $dbh = Bugzilla->dbh; # Preselected values for inserting into SQL - my $cache = Bugzilla->process_cache->{attention}; + my $cache = Bugzilla->request_cache->{attention}; my $keyword_id = $cache->{sec_critical_id}; my $class_ids = join ',', @{$cache->{classification_ids}}; my $bug_states = join ',', map { $dbh->quote($_) } BUG_STATE_OPEN; @@ -205,7 +205,7 @@ sub critical_needinfo_bugs { return [] if !exists $flags->{tracking}; # Preselected values for inserting into SQL - my $cache = Bugzilla->process_cache->{attention}; + my $cache = Bugzilla->request_cache->{attention}; my $needinfo_id = $cache->{needinfo_flag_id}; my $keyword_id = $cache->{sec_critical_id}; my $class_ids = join ',', @{$cache->{classification_ids}}; @@ -282,7 +282,7 @@ sub important_assigned_bugs { return [] if !exists $flags->{status}; # Preselected values for inserting into SQL - my $cache = Bugzilla->process_cache->{attention}; + my $cache = Bugzilla->request_cache->{attention}; my $class_ids = join ',', @{$cache->{classification_ids}}; my $bug_states = join ',', map { $dbh->quote($_) } BUG_STATE_OPEN; my $nightly_flag_id = $flags->{status}->{nightly}->flag_id; @@ -324,7 +324,7 @@ sub important_needinfo_bugs { my $dbh = Bugzilla->dbh; # Cached values for inserting into SQL - my $cache = Bugzilla->process_cache->{attention}; + my $cache = Bugzilla->request_cache->{attention}; my $needinfo_id = $cache->{needinfo_flag_id}; my $class_ids = join ',', @{$cache->{classification_ids}}; my $keyword_id = $cache->{sec_high_id}; @@ -358,7 +358,7 @@ sub other_needinfo_bugs { my $dbh = Bugzilla->dbh; # Cached values for inserting into SQL - my $cache = Bugzilla->process_cache->{attention}; + my $cache = Bugzilla->request_cache->{attention}; my $needinfo_id = $cache->{needinfo_flag_id}; my $class_ids = join ',', @{$cache->{classification_ids}}; @@ -374,7 +374,7 @@ sub other_needinfo_bugs { AND bugs.bug_severity NOT IN ('S1','S2') AND (keywords.keywordid IS NULL OR keywords.keywordid NOT IN (?, ?)) AND (bug_group_map.group_id IS NULL OR bug_group_map.group_id NOT IN (" - . join ',', @{$cache->{sec_group_ids}} . ')) + . (join ',', @{$cache->{sec_group_ids}}) . ')) ORDER BY bugs.delta_ts, bugs.bug_id'; my $bugs = get_bug_list($query, $user->id, $user->id, $cache->{sec_high_id}, @@ -396,42 +396,45 @@ sub report { = $input->{who} ? Bugzilla::User->check({name => $input->{who}}) : $user; $vars->{who} = $who->login; - # Create a global seen list of bugs (if not yet exists) to make sure - # we do not show a bug more than once across all lists. Request cache - # lasts for only this request. - my $request_cache = Bugzilla->request_cache; - $request_cache->{attention} = {}; - $request_cache->{attention}->{global_seen} = {}; - my $dbh = Bugzilla->dbh; - # Here we load some values into cache that will be used later - # by the various queries. Process cache lasts til server restart. - my $process_cache = Bugzilla->process_cache->{attention} = {}; - - # classifications - $process_cache->{classification_ids} ||= $dbh->selectcol_arrayref(' + # Set up the cache used by the various queries below. It holds a global + # seen list of bugs, so we do not show a bug more than once across all + # lists, along with values interpolated into the queries. Request cache + # lasts for this request only, so a keyword, flag type or security group + # added mid-session is picked up on the next page load rather than at + # the next server restart. + my $lookup_cache = Bugzilla->request_cache->{attention} + = {global_seen => {}}; + + # classifications. As with the security groups below, fall back to a + # non-existent id if none are found so the IN () clauses built from this + # list stay valid SQL and simply match nothing. + my $classification_ids = $dbh->selectcol_arrayref(' SELECT id FROM classifications WHERE name IN (' . join(', ', map { $dbh->quote($_) } CLASSIFICATIONS) . ')'); + $lookup_cache->{classification_ids} + = @{$classification_ids} ? $classification_ids : [0]; # needinfo flag - $process_cache->{needinfo_flag_id} ||= $dbh->selectrow_array(" + $lookup_cache->{needinfo_flag_id} = $dbh->selectrow_array(" SELECT id FROM flagtypes WHERE name = 'needinfo'"); # keyword ids - $process_cache->{sec_critical_id} ||= $dbh->selectrow_array(" + $lookup_cache->{sec_critical_id} = $dbh->selectrow_array(" SELECT id FROM keyworddefs WHERE name = 'sec-critical'"); - $process_cache->{sec_high_id} ||= $dbh->selectrow_array(" + $lookup_cache->{sec_high_id} = $dbh->selectrow_array(" SELECT id FROM keyworddefs WHERE name = 'sec-high'"); - $process_cache->{regression_id} ||= $dbh->selectrow_array(" - SELECT id FROM keyworddefs WHERE name = 'regression'"); - # Get a list of group ids that end in -security - $process_cache->{sec_group_ids} - ||= $dbh->selectcol_arrayref('SELECT id FROM ' + # Get a list of group ids that end in -security. Fall back to a + # non-existent id if there are none, so the IN () clauses built from + # this list stay valid SQL and simply match nothing. + my $sec_group_ids + = $dbh->selectcol_arrayref('SELECT id FROM ' . $dbh->quote_identifier('groups') . ' WHERE name LIKE \'%-security\''); + $lookup_cache->{sec_group_ids} = @{$sec_group_ids} ? $sec_group_ids : [0]; # build bug lists $vars->{critical_needinfo_bugs} = critical_needinfo_bugs($who); @@ -443,8 +446,8 @@ sub report { # count number of unique bugs my %bug_ids; foreach my $name (qw( - s1_bugs sec_crit_bugs critical_needinfo_bugs s2_bugs - sec_high_bugs important_needinfo_bugs other_needinfo_bugs + critical_needinfo_bugs critical_assigned_bugs important_needinfo_bugs + important_assigned_bugs other_needinfo_bugs )) { foreach my $bug (@{$vars->{$name}}) { diff --git a/extensions/BugModal/template/en/default/bug_modal/groups.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/groups.html.tmpl index 48a28b3664..ad18dd3c21 100644 --- a/extensions/BugModal/template/en/default/bug_modal/groups.html.tmpl +++ b/extensions/BugModal/template/en/default/bug_modal/groups.html.tmpl @@ -108,8 +108,9 @@ [% " disabled=\"disabled\"" UNLESS user_can_edit_accessible %]> - The assignee [% IF (Param('useqacontact')) %]and QA contact[% END %] - can always see [% terms.abug %], and this section does not take effect + The assignee[% IF (Param('useqacontact')) %], QA contact,[% END %] + and triage owner (when a member of mozilla-employee-confidential) can + always see [% terms.abug %], and this section does not take effect unless the [% terms.bug %] is restricted to at least one group. [% END %] diff --git a/extensions/BugModal/web/attachments_overlay.js b/extensions/BugModal/web/attachments_overlay.js index a109c7d216..2360b3b7ce 100644 --- a/extensions/BugModal/web/attachments_overlay.js +++ b/extensions/BugModal/web/attachments_overlay.js @@ -295,7 +295,7 @@ window.addEventListener('DOMContentLoaded', () => { /** * Load the data for all the attachments on the current bug. * @returns {Promise} Attachments. - * @see https://bmo.readthedocs.io/en/latest/api/core/v1/attachment.html#get-attachment + * @see https://bugzilla.mozilla.org/docs/en/md/api/core/v1/attachment.md#get-attachment */ const loadBugAttachments = async () => { const { bugs } = await Bugzilla.API.get(`bug/${bugId}/attachment`, { diff --git a/extensions/GitHubPullRequests/lib/API/V1/PullRequests.pm b/extensions/GitHubPullRequests/lib/API/V1/PullRequests.pm index 3f706bcd21..f7b1f582fe 100644 --- a/extensions/GitHubPullRequests/lib/API/V1/PullRequests.pm +++ b/extensions/GitHubPullRequests/lib/API/V1/PullRequests.pm @@ -115,14 +115,36 @@ sub _fetch_pull_request { sortkey => int($pr_number), }; - # Return a cached summary if we have a fresh one. - my $cache_key = "github_pr." . $url; + my $reviews_url = $api_url . '/reviews?per_page=' . GITHUB_REVIEWS_PER_PAGE; + + # Look up the cached wrapper. A new key prefix (.v2.) is used so that any + # pre-existing entries from the old bare-$pr_data format are ignored and + # simply expire on their own - no migration or shape-sniffing needed. + my $cache_key = "github_pr.v2." . $url; my $cached = Bugzilla->memcached->get_data({key => $cache_key}); - return $cached if defined $cached; + # Fresh hit: still inside the freshness window, so serve without any call. + if (defined $cached && ref($cached) eq 'HASH') { + return $cached->{pr_data} + if defined $cached->{fresh_until} && time() < $cached->{fresh_until}; + } + + # Stale hit with etags: revalidate with conditional requests. 304 responses + # are free (GitHub does not count them against the rate limit), so an + # unchanged PR costs nothing beyond the round trip. + if ( defined $cached + && ref($cached) eq 'HASH' + && ref($cached->{pr_data}) eq 'HASH' + && ($cached->{pr_etag} || $cached->{reviews_etag})) + { + return _revalidate_pull_request($ua, $cache_key, $base, $api_url, $cached); + } + + # Miss (or an entry without etags, e.g. a cached inaccessible result): do a + # full fetch. my $pr_response = _github_get($ua, $api_url); unless ($pr_response->{ok}) { - WARN("GitHub: failed to fetch PR $url: " . $pr_response->{errmsg}); + _warn_fetch_failure($url, $pr_response); return _cache_inaccessible($cache_key, $base); } @@ -135,6 +157,95 @@ sub _fetch_pull_request { return _cache_inaccessible($cache_key, $base); } + my $reviews_response = _github_get($ua, $reviews_url); + my @reviews; + if ($reviews_response->{ok}) { + @reviews = _summarize_reviews($reviews_response->{data}); + } + else { + _warn_fetch_failure("$url reviews", $reviews_response); + } + + my $pr_data = {%$base, _pr_summary_fields($pr), reviews => \@reviews}; + + _store_wrapper($cache_key, { + pr_data => $pr_data, + pr_etag => $pr_response->{etag}, + reviews_etag => $reviews_response->{ok} ? $reviews_response->{etag} : undef, + }); + + return $pr_data; +} + +# Revalidate a stale-but-cached PR using conditional requests. On a 304 we +# reuse the cached fields; on a 200 we recompute from the fresh body. An error +# on the PR endpoint is fatal (falls back to inaccessible); a reviews error is +# non-fatal and yields empty reviews, matching the full-fetch path. +sub _revalidate_pull_request { + my ($ua, $cache_key, $base, $api_url, $cached) = @_; + + my $reviews_url = $api_url . '/reviews?per_page=' . GITHUB_REVIEWS_PER_PAGE; + my $old_data = $cached->{pr_data}; + + # PR endpoint. + my $pr_response = _github_get($ua, $api_url, $cached->{pr_etag}); + unless ($pr_response->{ok}) { + _warn_fetch_failure($old_data->{url}, $pr_response); + return _cache_inaccessible($cache_key, $base); + } + + my ($pr_fields, $pr_etag); + if ($pr_response->{not_modified}) { + + # Unchanged: reuse cached base fields and keep the existing etag. + $pr_fields = { + title => $old_data->{title}, + state => $old_data->{state}, + author => $old_data->{author}, + labels => $old_data->{labels}, + inaccessible => 0, + }; + $pr_etag = $cached->{pr_etag}; + } + else { + my $pr = $pr_response->{data}; + unless (ref($pr) eq 'HASH') { + WARN("GitHub: unexpected response shape for PR " . $old_data->{url}); + return _cache_inaccessible($cache_key, $base); + } + $pr_fields = {_pr_summary_fields($pr)}; + $pr_etag = $pr_response->{etag}; + } + + # Reviews endpoint. + my $reviews_response = _github_get($ua, $reviews_url, $cached->{reviews_etag}); + my ($reviews, $reviews_etag); + if (!$reviews_response->{ok}) { + _warn_fetch_failure($old_data->{url} . ' reviews', $reviews_response); + $reviews = []; + $reviews_etag = undef; + } + elsif ($reviews_response->{not_modified}) { + $reviews = $old_data->{reviews} // []; + $reviews_etag = $cached->{reviews_etag}; + } + else { + $reviews = [_summarize_reviews($reviews_response->{data})]; + $reviews_etag = $reviews_response->{etag}; + } + + my $pr_data = {%$base, %$pr_fields, reviews => $reviews}; + + _store_wrapper($cache_key, + {pr_data => $pr_data, pr_etag => $pr_etag, reviews_etag => $reviews_etag}); + + return $pr_data; +} + +# Derive the servable summary fields (title/state/author/labels) from a PR body. +sub _pr_summary_fields { + my ($pr) = @_; + my $state; if ($pr->{draft}) { $state = 'draft'; @@ -149,38 +260,59 @@ sub _fetch_pull_request { $state = 'open'; } - my @labels = map { $_->{name} } @{$pr->{labels} // []}; - - my $reviews_response - = _github_get($ua, $api_url . '/reviews?per_page=' . GITHUB_REVIEWS_PER_PAGE); - my @reviews; - if ($reviews_response->{ok}) { - @reviews = _summarize_reviews($reviews_response->{data}); - } - - my $pr_data = { - %$base, + return ( title => $pr->{title}, state => $state, author => ref($pr->{user}) eq 'HASH' ? $pr->{user}{login} : undef, - reviews => \@reviews, - labels => \@labels, + labels => [map { $_->{name} } @{$pr->{labels} // []}], inaccessible => 0, - }; + ); +} - Bugzilla->memcached->set_data( - {key => $cache_key, value => $pr_data, expires_in => GITHUB_CACHE_SECONDS}); +# Store the versioned cache wrapper. The freshness window (GITHUB_CACHE_SECONDS) +# is tracked in-band via fresh_until, while the hard memcached TTL is the much +# longer GITHUB_REVALIDATE_SECONDS so the etags outlive the freshness window and +# remain available for conditional revalidation. +sub _store_wrapper { + my ($cache_key, $wrapper) = @_; - return $pr_data; + $wrapper->{fresh_until} = time() + GITHUB_CACHE_SECONDS; + Bugzilla->memcached->set_data({ + key => $cache_key, + value => $wrapper, + expires_in => GITHUB_REVALIDATE_SECONDS, + }); +} + +# Classify a fetch failure and log it distinctly so a globally-misconfigured +# token (401/403 across many repos) is unmistakable and doesn't look like an +# ordinary private/deleted PR (404). +sub _warn_fetch_failure { + my ($what, $response) = @_; + + my $status = $response->{status} // 0; + if ($status == 401 || $status == 403) { + WARN("GitHub: auth/permission failure ($status) for $what" + . " - check github_api_token scope/validity"); + } + elsif ($status == 404) { + WARN("GitHub: PR not found or private ($status): $what"); + } + else { + WARN("GitHub: failed to fetch $what: " . $response->{errmsg}); + } } sub _cache_inaccessible { my ($cache_key, $base) = @_; my $error_data = {%$base, inaccessible => 1}; + + # Inaccessible entries carry no etags and use the shorter error TTL so we + # recover quickly once the PR becomes reachable again. Bugzilla->memcached->set_data({ key => $cache_key, - value => $error_data, + value => {pr_data => $error_data, fresh_until => time() + GITHUB_ERROR_CACHE_SECONDS}, expires_in => GITHUB_ERROR_CACHE_SECONDS, }); @@ -188,24 +320,44 @@ sub _cache_inaccessible { } sub _github_get { - my ($ua, $url) = @_; + my ($ua, $url, $etag) = @_; - my $response = $ua->get( - $url, + my @headers = ( 'Accept' => 'application/vnd.github+json', 'X-GitHub-Api-Version' => '2022-11-28', ); + push @headers, ('If-None-Match' => $etag) if defined $etag; + + my $response = $ua->get($url, @headers); + + # LWP treats 304 as non-success, but for a conditional request it means the + # cached copy is still valid. GitHub echoes the ETag on a 304, so carry it + # through to keep the stored value current. + if ($response->code == 304) { + return { + ok => 1, + not_modified => 1, + status => 304, + etag => $response->header('ETag'), + }; + } unless ($response->is_success) { - return {ok => 0, errmsg => $response->status_line}; + return {ok => 0, status => $response->code, errmsg => $response->status_line}; } my $data = eval { decode_json($response->decoded_content) }; if ($@) { - return {ok => 0, errmsg => "JSON parse error: $@"}; + return {ok => 0, status => $response->code, errmsg => "JSON parse error: $@"}; } - return {ok => 1, data => $data}; + return { + ok => 1, + not_modified => 0, + status => $response->code, + etag => $response->header('ETag'), + data => $data, + }; } sub _summarize_reviews { diff --git a/extensions/GitHubPullRequests/lib/Constants.pm b/extensions/GitHubPullRequests/lib/Constants.pm index 50346bb0e6..3e564e3905 100644 --- a/extensions/GitHubPullRequests/lib/Constants.pm +++ b/extensions/GitHubPullRequests/lib/Constants.pm @@ -19,6 +19,7 @@ our @EXPORT = qw( GITHUB_API_BASE GITHUB_API_TIMEOUT GITHUB_CACHE_SECONDS + GITHUB_REVALIDATE_SECONDS GITHUB_ERROR_CACHE_SECONDS GITHUB_MAX_PULL_REQUESTS GITHUB_REVIEWS_PER_PAGE @@ -40,10 +41,18 @@ use constant GITHUB_PR_REGEX => use constant GITHUB_API_BASE => 'https://api.github.com'; use constant GITHUB_API_TIMEOUT => 10; -# How long (in seconds) to cache a PR's summary in memcached. GitHub's -# unauthenticated rate limit is low (60 req/hr per IP) and authenticated is -# 5000/hr, so caching avoids re-fetching the same PR on every bug view. -use constant GITHUB_CACHE_SECONDS => 300; +# How long (in seconds) a cached PR summary is served without contacting GitHub +# (the freshness window). Once this elapses we revalidate with conditional +# requests rather than doing a full re-fetch; GitHub does not count 304 Not +# Modified responses against the rate limit, so revalidation is effectively +# free and a longer freshness window is safe. +use constant GITHUB_CACHE_SECONDS => 900; + +# Hard memcached TTL for a cached PR summary. This is deliberately much longer +# than the freshness window so the stored ETags survive past GITHUB_CACHE_SECONDS +# and remain available for conditional (If-None-Match) revalidation. Without +# this the ETag would expire exactly when we want to use it. +use constant GITHUB_REVALIDATE_SECONDS => 86_400; # Cache inaccessible/failed lookups for a shorter period so that persistent # failures (rate limiting, outages, private repos) don't re-hit GitHub on every diff --git a/extensions/Push/lib/Connector/Webhook.pm b/extensions/Push/lib/Connector/Webhook.pm index 0accb7af20..90d6057174 100644 --- a/extensions/Push/lib/Connector/Webhook.pm +++ b/extensions/Push/lib/Connector/Webhook.pm @@ -62,7 +62,7 @@ sub should_send { return 0 unless Bugzilla->params->{webhooks_enabled}; my $webhook = Bugzilla::Extension::Webhooks::Webhook->new($self->{webhook_id}); - my $event = $webhook->event; + my %events = map { $_ => 1 } split(/,/, $webhook->event); my $product = $webhook->product_name; my $component = $webhook->component_name; @@ -76,18 +76,18 @@ sub should_send { if (($product eq $bug_data->{product} || $product eq 'Any') && ($component eq $bug_data->{component} || $component eq 'Any')) { - if ( ($event =~ /create/ && $message->routing_key eq 'bug.create') - || ($event =~ /change/ && $message->routing_key =~ /^bug\.modify/) - || ($event =~ /comment/ && $message->routing_key eq 'comment.create') - || ($event =~ /attachment_change/ && $message->routing_key =~ /^attachment[.]modify/) - || ($event =~ /attachment/ && $message->routing_key eq 'attachment.create')) + if ( ($events{create} && $message->routing_key eq 'bug.create') + || ($events{change} && $message->routing_key =~ /^bug\.modify/) + || ($events{comment} && $message->routing_key eq 'comment.create') + || ($events{attachment_change} && $message->routing_key =~ /^attachment[.]modify/) + || ($events{attachment} && $message->routing_key eq 'attachment.create')) { return 1; } } # check if the bug was removed from a product/component we care about - if ($event =~ /change/ && $message->routing_key =~ /\Qbug.modify\E/) { + if ($events{change} && $message->routing_key =~ /\Qbug.modify\E/) { my $removed_product = ""; my $removed_component = ""; if (exists $payload->{event}->{changes}) { diff --git a/extensions/Push/t/webhook.t b/extensions/Push/t/webhook.t new file mode 100644 index 0000000000..4815336c87 --- /dev/null +++ b/extensions/Push/t/webhook.t @@ -0,0 +1,152 @@ +#!/usr/bin/env perl +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +use 5.10.1; +use strict; +use warnings; +use lib qw( . lib local/lib/perl5 ); + +use Bugzilla; +BEGIN { Bugzilla->extensions } + +use Test2::V0; + +use Bugzilla::Test::MockParams (webhooks_enabled => 1); +use Bugzilla::Extension::Push::Connector::Webhook; + +{ + package TestWebhookOwner; + + sub can_see_bug { return 1 } + sub can_see_product { return 1 } + sub is_insider { return 1 } +} + +{ + package TestWebhook; + + sub event { return $_[0]->{event} } + sub product_name { return 'Firefox' } + sub component_name { return 'Any' } + sub user { return bless({}, 'TestWebhookOwner') } +} + +{ + package TestMessage; + + sub routing_key { return $_[0]->{routing_key} } + sub payload_decoded { return $_[0]->{payload} } +} + +my $selected_events; +my $connector + = bless({webhook_id => 1}, 'Bugzilla::Extension::Push::Connector::Webhook'); + +sub make_payload { + my ($routing_key, %args) = @_; + my ($target) = split(/[.]/, $routing_key); + + my $bug = { + id => 1, + product => $args{product} // 'Firefox', + component => 'General', + }; + my $payload = { + event => { + target => $target, + changes => $args{changes} // [], + }, + }; + + if ($target eq 'bug') { + $payload->{bug} = $bug; + } + else { + $payload->{$target} = { + bug => $bug, + is_private => 0, + }; + } + + return $payload; +} + +sub should_send { + my ($events, $routing_key, %args) = @_; + $selected_events = $events; + my $message = bless( + { + routing_key => $routing_key, + payload => make_payload($routing_key, %args), + }, + 'TestMessage' + ); + return $connector->should_send($message); +} + +{ + no warnings qw(redefine once); + local *Bugzilla::Extension::Webhooks::Webhook::new + = sub { return bless({event => $selected_events}, 'TestWebhook') }; + + my @individual_events = ( + ['create', 'bug.create'], + ['change', 'bug.modify:summary'], + ['comment', 'comment.create'], + ['attachment', 'attachment.create'], + ['attachment_change', 'attachment.modify:is_obsolete'], + ); + + foreach my $test (@individual_events) { + my ($event, $routing_key) = @{$test}; + ok(should_send($event, $routing_key), "$event selects $routing_key"); + } + + ok(!should_send('attachment_change', 'bug.modify:summary'), + 'attachment_change does not select bug modifications'); + ok(!should_send('attachment_change', 'attachment.create'), + 'attachment_change does not select new attachments'); + ok(!should_send('attachment', 'attachment.modify:is_obsolete'), + 'attachment does not select attachment modifications'); + + ok(should_send('create,comment,attachment_change', 'bug.create'), + 'combined selection includes bug creation'); + ok(should_send('create,comment,attachment_change', 'comment.create'), + 'combined selection includes comments'); + ok( + should_send( + 'create,comment,attachment_change', + 'attachment.modify:is_obsolete' + ), + 'combined selection includes attachment modifications' + ); + ok(!should_send('create,comment,attachment_change', 'attachment.create'), + 'combined selection excludes unselected attachment creation'); + + my @product_change = ({field => 'product', removed => 'Firefox'}); + ok( + should_send( + 'change', + 'bug.modify:product', + product => 'Thunderbird', + changes => \@product_change + ), + 'change selects a bug moved out of the configured product' + ); + ok( + !should_send( + 'attachment_change', + 'bug.modify:product', + product => 'Thunderbird', + changes => \@product_change + ), + 'attachment_change does not select a bug moved out of the configured product' + ); +} + +done_testing; diff --git a/extensions/TrackingFlags/lib/Flag.pm b/extensions/TrackingFlags/lib/Flag.pm index 5a09d944fe..9322643b88 100644 --- a/extensions/TrackingFlags/lib/Flag.pm +++ b/extensions/TrackingFlags/lib/Flag.pm @@ -273,8 +273,7 @@ sub preload_all_the_things { return unless @flag_ids; # Preload values - my $value_objects = Bugzilla::Extension::TrackingFlags::Flag::Value->match( - {tracking_flag_id => \@flag_ids}); + my $value_objects = _values_for_flag_ids(\@flag_ids); # Now populate the tracking flags with this set of value objects. foreach my $obj (@$value_objects) { @@ -319,6 +318,32 @@ sub preload_all_the_things { @$flags = values %flag_hash; } +# Return value objects for the given tracking flag ids. +# +# The whole tracking_flags_values table is small and changes rarely, so it is +# read once per request (Flag::Value is IS_CONFIG, so the unfiltered select is +# served from memcached as well) and sliced in perl. Querying per call meant a +# query returning roughly half the table for every Flag->match, which happens +# once per bug whenever custom fields are collected - see the +# active_custom_fields call in Bugzilla::Bug::to_hash. +sub _values_for_flag_ids { + my ($flag_ids) = @_; + my $rows = Bugzilla->request_cache->{tracking_flags_value_rows} ||= do { + my %by_flag_id; + foreach my $value (Bugzilla::Extension::TrackingFlags::Flag::Value->get_all) { + push @{$by_flag_id{$value->tracking_flag_id}}, {%$value}; + } + \%by_flag_id; + }; + + # Callers store a back-reference to their own flag object on each value, so + # fresh objects are returned rather than the cached rows themselves. + return [ + map { Bugzilla::Extension::TrackingFlags::Flag::Value->new_from_hash({%$_}) } + map { @{$rows->{$_} || []} } @$flag_ids + ]; +} + ############################### #### Validators #### ############################### diff --git a/extensions/TrackingFlags/lib/Flag/Value.pm b/extensions/TrackingFlags/lib/Flag/Value.pm index 52d63970d2..0bf5ade50b 100644 --- a/extensions/TrackingFlags/lib/Flag/Value.pm +++ b/extensions/TrackingFlags/lib/Flag/Value.pm @@ -24,6 +24,10 @@ use Scalar::Util qw(blessed weaken); use constant DB_TABLE => 'tracking_flags_values'; +# Values change rarely, so unfiltered selects are cached in memcached and the +# cache is cleared automatically when a value is created, updated or deleted. +use constant IS_CONFIG => 1; + use constant DB_COLUMNS => qw( id tracking_flag_id diff --git a/extensions/Webhooks/template/en/default/account/prefs/webhooks.html.tmpl b/extensions/Webhooks/template/en/default/account/prefs/webhooks.html.tmpl index 5511115932..cd8f631e61 100644 --- a/extensions/Webhooks/template/en/default/account/prefs/webhooks.html.tmpl +++ b/extensions/Webhooks/template/en/default/account/prefs/webhooks.html.tmpl @@ -53,7 +53,8 @@ window.onload = function() {

It will be sent a POST request with the information of the [% terms.bugs %] that match with the events and filters selected to your URL.
- Documentation about webhooks is available here. + Documentation about webhooks is available + here.

diff --git a/extensions/Webhooks/template/en/default/pages/webhooks.html.tmpl b/extensions/Webhooks/template/en/default/pages/webhooks.html.tmpl deleted file mode 100644 index c5f47dc2a4..0000000000 --- a/extensions/Webhooks/template/en/default/pages/webhooks.html.tmpl +++ /dev/null @@ -1,340 +0,0 @@ -[%# This Source Code Form is subject to the terms of the Mozilla Public - # License, v. 2.0. If a copy of the MPL was not distributed with this - # file, You can obtain one at http://mozilla.org/MPL/2.0/. - # - # This Source Code Form is | "Incompatible With Secondary Licenses", as - # defined by the Mozilla Public License, v. 2.0. - #%] - -[% PROCESS global/header.html.tmpl - title = "Webhooks Documentation" - style = "#bugzilla-body li { - margin: 5px - } - h4 { - margin-bottom: 0px - } - .heading { - font-weight: bold - } - #main-inner{ - margin-left: 20%; - margin-right: 20%; - margin-bottom: 5% - } - " -%] - -

[% terms.Bugzilla %] Webhooks

- -

A webhook is a custom callback defined by events. Is triggered when those events happen, and a POST -request is sent to a defined URL.

- -

In the case of [% terms.Bugzilla %], a webhook can be triggered by a change to, or creation of a [% terms.bug %]. The -parameters of the [% terms.bug %] are exposed to the webhook handler which makes a callback (over HTTP) to another -web application.

- -

Examples of [% terms.Bugzilla %] webhooks could include:

-
    -
  • Updating a copy of the [% terms.Bugzilla %] [% terms.bug %] in another system such as Jira
  • -
  • Sending a message to a chat server such as Matrix or Slack
  • -
- -

Creating a webhook

-

To create a webhook follow the next steps:

-
    -
  1. Access to your [% terms.Bugzilla %] Account.
  2. -
  3. Go to your Preferences Panel > Webhooks.
  4. -
  5. Fill out all of the parameters:
  6. -

    Name

    -

    A name for the webhook, which should be descriptive (e.g. “Jira Webhook for New & Updated [% terms.Bugs %] in Core::Graphics”)

    - -

    URL

    -

    The URL which will receive and process the webhook.

    - -

    Events

    -

    The [% terms.bug %] events that will trigger your new webhook.

    -
      -
    • When a new [% terms.bug %] is created
    • -
    • When an existing [% terms.bug %] is modified
    • -
    • When a new attachment is created
    • -
    • When an existing attachment is modified
    • -
    • When a new comment is created
    • -
    - -

    Filters

    -

    Properties of a [% terms.bug %] that specify which [% terms.bugs %] you will receive.

    -
      -
    • Product: name of the product of the [% terms.bugs %] that you want to receive.
    • -
    • Component: name of the component of the [% terms.bugs %] that you want to receive. - If you want to receive the [% terms.bugs %] of all the components of a product, select Any.
    • -
    - -

    API Keys

    -

    If your endpoint requires authentication, you may optionally provide a header and API key for your endpoint. - An example of a header may look like Authorization: Token zQ5TSBzq7tTZMtKYq9K1ZqJMjifKx3cPL7pIGk9Q. - So you would enter Authorization for the API Key Header and - Token zQ5TSBzq7tTZMtKYq9K1ZqJMjifKx3cPL7pIGk9Q for the API Key Value.

    -

    Note: If one or both of the values are empty, the webhook will still send the data to your endpoint, - but the request may fail if the endoint requires authentication.

    - -
  7. Add the webhook.
  8. -
- -

You can see your registered webhooks in the same panel.

-

If you want to delete a webhook, select the webhook in “Your webhooks” table and click remove -selected. You can select more than one.

- -

Delivered webhook

-

When a webhook is triggered the HTTP POST of a fixed JSON structure payload that is delivered -contains the webhook_id, webhook_name and the information about the [% terms.bug %] that matches the event and filters.

- -

If the [% terms.bug %] is private, only the [% terms.bug %] id and some other basic information is sent and the external system will -need to query BMO over the REST API to get the actual details of the [% terms.bug %].

- -

The webhooks will be called in the same order as the events triggering them and will be one request per new -[% terms.bug %] and per changed [% terms.bug %]. The "changes" parameter will be sent only when the triggered event is changed and will -content every change made in the [% terms.bug %].

- -

Public [% terms.Bug %] Request

- -{ - "[% terms.bug %]": { - "alias": "", - "assigned_to": "nobody@mozilla.org", - "assigned_to_detail": { - "id": 1, - "login": "nobody@mozilla.org", - "real_name": "Nobody; OK to take it and work on it" - }, - "classification": "Client Software", - "comment": { - "body": "another test comment", - "creation_time": "2020-10-16T06:28:41", - "id": 14748073, - "is_private": false, - "number": 2 - }, - "component": "Sync", - "creation_time": "2020-10-16T06:24:06", - "creator": "nobody@mozilla.org", - "creator_detail": { - "id": 1, - "login": "nobody@mozilla.org", - "real_name": "Nobody; OK to take it and work on it" - }, - "flags": [], - "id": 1629704, - "is_private": false, - "keywords": [], - "last_change_time": "2020-10-16T06:26:21", - "operating_system": "Unspecified", - "platform": "Unspecified", - "priority": "P1", - "product": "Firefox", - "qa_contact": "nobody@mozilla.org", - "qa_contact_detail": { - "id": 1, - "login": "nobody@mozilla.org", - "real_name": "Nobody; OK to take it and work on it" - }, - "resolution": "", - "severity": "--", - "status": "NEW", - "summary": "Webhook Test - Disregard", - "target_milestone": "---", - "type": "defect", - "url": "", - "version": "unspecified", - "whiteboard": "" - }, - "event": { - "action": "modify", - "routing_key": "bug.modify:priority" - "target": "bug", - "time": "2020-07-24T20:11:22", - "user": { - "id": 1, - "login": "nobody@mozilla.org", - "real_name": "Nobody; OK to take it and work on it" - }, - "changes": [ - { - "field": "priority", - "removed": "P3", - "added": "P1" - } - ] - }, - "webhook_id": 23, - "webhook_name": "test-bug" -} - - -

Private [% terms.Bug %] Request

- -{ - "[% terms.bug %]": { - "id": 2, - "is_private": true - }, - "event": { - "action": "modify", - "routing_key": "bug.modify:priority" - "target": "bug", - "time": "2020-07-24T20:11:22", - "user": { - "id": 1, - "login": "nobody@mozilla.org", - "real_name": "Nobody; OK to take it and work on it" - } - }, - "webhook_id": 23, - "webhook_name": "test-bug", -} - - -

Response

-

HTTP 200 OK. The request has succeeded.

- -

New Comment

- -{ - "[% terms.bug %]": { - "alias": "", - "assigned_to": "nobody@mozilla.org", - "assigned_to_detail": { - "id": 1, - "login": "nobody@mozilla.org", - "real_name": "Nobody; OK to take it and work on it" - }, - "classification": "Client Software", - "comment": { - "body": "another test comment", - "creation_time": "2020-10-16T06:28:41", - "id": 14748073, - "is_private": false, - "number": 2 - }, - "component": "Sync", - "creation_time": "2020-10-16T06:24:06", - "creator": "nobody@mozilla.org", - "creator_detail": { - "id": 1, - "login": "nobody@mozilla.org", - "real_name": "Nobody; OK to take it and work on it" - }, - "flags": [], - "id": 1629704, - "is_private": false, - "keywords": [], - "last_change_time": "2020-10-16T06:26:21", - "operating_system": "Unspecified", - "platform": "Unspecified", - "priority": "", - "product": "Firefox", - "qa_contact": "", - "resolution": "", - "severity": "--", - "status": "NEW", - "summary": "Webhook Test - Disregard", - "target_milestone": "---", - "type": "defect", - "url": "", - "version": "unspecified", - "whiteboard": "" - }, - "event": { - "action": "create", - "routing_key": "comment.create", - "target": "comment", - "time": "2020-10-16T06:28:41", - "user": { - "id": 1, - "login": "nobody@mozilla.org", - "real_name": "Nobody; OK to take it and work on it" - } - }, - "webhook_id": 23, - "webhook_name": "test-comment" -} - - -

New Attachment

- -{ - "[% terms.bug %]": { - "alias": "", - "assigned_to": "nobody@mozilla.org", - "assigned_to_detail": { - "id": 1, - "login": "nobody@mozilla.org", - "real_name": "Nobody; OK to take it and work on it" - }, - "attachment": { - "content_type": "text/plain", - "creation_time": "2020-10-16T07:08:12", - "description": "test attachment", - "file_name": "file_1629704.txt", - "flags": [], - "id": 9180115, - "is_obsolete": false, - "is_patch": false, - "is_private": false, - "last_change_time": "2020-10-16T07:08:12" - } - "classification": "Client Software", - "component": "Sync", - "creation_time": "2020-10-16T06:24:06", - "creator": "nobody@mozilla.org", - "creator_detail": { - "id": 1, - "login": "nobody@mozilla.org", - "real_name": "Nobody; OK to take it and work on it" - }, - "flags": [], - "id": 1629704, - "is_private": false, - "keywords": [], - "last_change_time": "2020-10-16T06:26:21", - "operating_system": "Unspecified", - "platform": "Unspecified", - "priority": "", - "product": "Firefox", - "qa_contact": "", - "resolution": "", - "severity": "--", - "status": "NEW", - "summary": "Webhook Test - Disregard", - "target_milestone": "---", - "type": "defect", - "url": "", - "version": "unspecified", - "whiteboard": "" - }, - "event": { - "action": "create", - "routing_key": "attachment.create", - "target": "attachment", - "time": "2020-10-16T07:08:12", - "user": { - "id": 1, - "login": "nobody@mozilla.org", - "real_name": "Nobody; OK to take it and work on it" - } - }, - "webhook_id": 23, - "webhook_name": "test-attachment" -} - - -

Errors

-

If the response is not 200, the [% terms.Bugzilla %] system will retry 4 attempts, waiting 5s, 10s, 15s and -20s between each attempt. If none of those attempts is successful, the system will continue trying -every 15 minutes.

- -

If a message is stuck without a successful attempt, the next messages that trigger the webhook -will be stored in a queue in the order that were triggered and will be delivered in that order when -the first message in the queue is delivered.

- -[% INCLUDE global/footer.html.tmpl %] diff --git a/js/util.js b/js/util.js index 21595a77ba..3cfa4a690c 100644 --- a/js/util.js +++ b/js/util.js @@ -438,7 +438,7 @@ var Bugzilla = Bugzilla || {}; // eslint-disable-line no-var /** * Enable easier access to the Bugzilla REST API. * @hideconstructor - * @see https://bmo.readthedocs.io/en/latest/api/ + * @see https://bugzilla.mozilla.org/docs/en/md/api/index.md */ Bugzilla.API = class API { /** diff --git a/qa/t/rest_github_pull_requests.t b/qa/t/rest_github_pull_requests.t index 00d03485a0..9aae8a77ee 100644 --- a/qa/t/rest_github_pull_requests.t +++ b/qa/t/rest_github_pull_requests.t @@ -102,10 +102,19 @@ my %mock_prs = ( }, ); +# The cache entry is now a versioned wrapper (github_pr.v2.): the summary +# we serve lives under pr_data, alongside revalidation metadata (etags and a +# fresh_until epoch). A fresh_until in the future makes this a "fresh hit", so +# the endpoint serves pr_data verbatim without any outbound request to GitHub. foreach my $pr_url (keys %mock_prs) { Bugzilla->memcached->set_data({ - key => "github_pr.$pr_url", - value => $mock_prs{$pr_url}, + key => "github_pr.v2.$pr_url", + value => { + pr_data => $mock_prs{$pr_url}, + pr_etag => undef, + reviews_etag => undef, + fresh_until => time() + 300, + }, expires_in => 300, }); } diff --git a/report.cgi b/report.cgi index b8f2aa58ba..5c6ef9136f 100755 --- a/report.cgi +++ b/report.cgi @@ -291,7 +291,7 @@ if ($vars->{debug}) { } # All formats point to the same section of the documentation. -$vars->{'doc_section'} = 'reporting.html#reports'; +$vars->{'doc_section'} = 'using/reports-and-charts.html#reports'; disable_utf8() if ($format->{'ctype'} =~ /^image\//); diff --git a/skins/standard/docs.css b/skins/standard/docs.css new file mode 100644 index 0000000000..77a1a26134 --- /dev/null +++ b/skins/standard/docs.css @@ -0,0 +1,161 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This Source Code Form is "Incompatible With Secondary Licenses", as + * defined by the Mozilla Public License, v. 2.0. */ + +/* Styles for the in-app documentation viewer (pages/doc_viewer.html.tmpl) */ + +.docs-page { + max-width: 60rem; + margin: 0 auto; + padding: 16px 24px 32px; +} + +.docs-breadcrumb { + margin-bottom: 8px; + font-size: var(--font-size-small); +} + +.docs-content { + font-size: var(--font-size-x-large); + line-height: var(--line-height-comfortable); +} + +.docs-content h1, +.docs-content h2, +.docs-content h3, +.docs-content h4, +.docs-content h5, +.docs-content h6 { + margin: 1.5em 0 0.5em; + line-height: var(--line-height-default); +} + +.docs-content h1 { + margin-top: 0.5em; + padding-bottom: 0.3em; + border-bottom: 1px solid var(--primary-region-border-color); +} + +.docs-content h2 { + padding-bottom: 0.2em; + border-bottom: 1px solid var(--primary-region-border-color); +} + +.docs-content p, +.docs-content ul, +.docs-content ol { + margin: 0.75em 0; +} + +.docs-content li > p { + margin: 0.25em 0; +} + +.docs-content code { + padding: 1px 4px; + border-radius: 4px; + background-color: var(--secondary-region-background-color); + font-family: var(--font-family-monospace); + font-size: 0.9em; +} + +.docs-content pre { + padding: 12px 16px; + border: 1px solid var(--primary-region-border-color); + border-radius: var(--primary-region-border-radius, 4px); + background-color: var(--secondary-region-background-color); + overflow-x: auto; +} + +.docs-content pre code { + padding: 0; + background-color: transparent; +} + +.docs-content table { + margin: 1em 0; + border-collapse: collapse; +} + +.docs-content th, +.docs-content td { + padding: 6px 12px; + border: 1px solid var(--grid-border-color); + vertical-align: top; +} + +.docs-content th { + background-color: var(--grid-header-background-color); + text-align: left; +} + +.docs-content tr:nth-child(even) td { + background-color: var(--grid-background-color); +} + +.docs-content img { + max-width: 100%; +} + +/* The documentation home page is a table of contents; render its lists + * without bullets. */ +.docs-index ul { + padding-left: 0; + list-style: none; +} + +.docs-index ul ul { + padding-left: 1.5em; +} + +.docs-index li { + margin: 0.25em 0; +} + +.docs-content blockquote { + margin: 1em 0; + padding: 4px 16px; + border-left: 4px solid var(--primary-region-border-color); + color: var(--secondary-label-color); +} + +/* GFM alerts: > [!NOTE], > [!WARNING], etc. */ +.docs-content .docs-alert { + color: var(--primary-text-color); +} + +.docs-content .docs-alert .docs-alert-title { + margin: 0.5em 0; + font-weight: bold; +} + +.docs-content .docs-alert-note, +.docs-content .docs-alert-tip { + border-left-color: var(--accent-color-blue-2, #0969da); +} + +.docs-content .docs-alert-note .docs-alert-title, +.docs-content .docs-alert-tip .docs-alert-title { + color: var(--accent-color-blue-2, #0969da); +} + +.docs-content .docs-alert-important { + border-left-color: var(--accent-color-purple-1, #8250df); +} + +.docs-content .docs-alert-important .docs-alert-title { + color: var(--accent-color-purple-1, #8250df); +} + +.docs-content .docs-alert-warning, +.docs-content .docs-alert-caution { + border-left-color: var(--accent-color-red-1, #cf222e); +} + +.docs-content .docs-alert-warning .docs-alert-title, +.docs-content .docs-alert-caution .docs-alert-title { + color: var(--accent-color-red-1, #cf222e); +} diff --git a/t/Support/Files.pm b/t/Support/Files.pm index c83d014702..9b4d9be485 100644 --- a/t/Support/Files.pm +++ b/t/Support/Files.pm @@ -19,7 +19,7 @@ our @additional_files = (); our @files = glob('*'); find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/; }, qw(Bugzilla docs)); -push(@files, 'extensions/create.pl', 'docs/makedocs.pl', 'cpanfile'); +push(@files, 'extensions/create.pl', 'cpanfile'); our @extensions = grep { $_ ne 'extensions/create.pl' && !-e "$_/disabled" } glob('extensions/*'); diff --git a/t/bmo/keyword-security-count.t b/t/bmo/keyword-security-count.t new file mode 100755 index 0000000000..f9980969e5 --- /dev/null +++ b/t/bmo/keyword-security-count.t @@ -0,0 +1,184 @@ +#!/usr/bin/env perl +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +# Regression tests for Bug 2056990: describekeywords.cgi leaked the number of +# hidden security bugs, both because the `csectype-*` family was missing from +# the security keyword list and because the keyword counts themselves were not +# filtered by group visibility. + +use 5.10.1; +use strict; +use warnings; +use lib qw(. lib local/lib/perl5); +use Test::More; + +use Bugzilla; +use Bugzilla::Bug; +use Bugzilla::Constants; +use Bugzilla::Group; +use Bugzilla::Keyword; +use Bugzilla::Product; +use Bugzilla::User; +BEGIN { Bugzilla->extensions } + +Bugzilla->usage_mode(USAGE_MODE_TEST); +Bugzilla->error_mode(ERROR_MODE_DIE); + +my $dbh = Bugzilla->dbh; + +my $admin = Bugzilla::User->check({id => 1}); +Bugzilla->set_user($admin); + +my ($product) = Bugzilla::Product->get_all; +plan skip_all => 'No product available' unless $product; +plan skip_all => 'Product has no component' unless @{$product->components}; +plan skip_all => 'Product has no version' unless @{$product->versions}; + +############################################################################### +# is_security_keyword() +############################################################################### + +# `csectype-*` is the family that regressed: the old pattern was +# /^(?:sec|csec|wsec|opsec)-/, and `csec` does not match `csectype-` because +# the alternation is anchored on the trailing hyphen. +my %expected = ( + 'csectype-uaf' => 1, + 'csectype-sandbox-escape' => 1, + 'csectype-priv-escalation' => 1, + 'sec-critical' => 1, + 'sec-high' => 1, + 'csec-high' => 1, + 'wsec-audit' => 1, + 'opsec-infra' => 1, + 'csectype' => 0, + 'security' => 0, + 'sectionfoo' => 0, + 'relnote' => 0, + 'perf' => 0, +); + +foreach my $name (sort keys %expected) { + my $keyword = bless({name => $name}, 'Bugzilla::Keyword'); + is($keyword->is_security_keyword, + $expected{$name}, "is_security_keyword('$name') is $expected{$name}"); +} + +############################################################################### +# get_all_with_bug_count() only counts bugs visible to the current user +############################################################################### + +my $suffix = "bug2056990-$$"; +my $keyword_name = "csectype-$suffix"; +my $group_name = "keyword-count-$suffix"; + +my $keyword = Bugzilla::Keyword->create({ + name => $keyword_name, + description => 'Temporary keyword for bug 2056990', + is_active => 1, +}); +ok($keyword->id, "Created keyword $keyword_name"); + +my $group = Bugzilla::Group->create({ + name => $group_name, + description => 'Temporary group for bug 2056990', + isbuggroup => 1, +}); +ok($group->id, "Created group $group_name"); + +$dbh->do( + 'INSERT INTO group_control_map + (group_id, product_id, entry, membercontrol, othercontrol, canedit) + VALUES (?, ?, 0, ?, 0, 0)', undef, $group->id, $product->id, CONTROLMAPSHOWN +); + +my @bug_ids; +foreach my $which (qw(public restricted)) { + my $bug = Bugzilla::Bug->create({ + short_desc => "Keyword count $which bug - Bug 2056990", + product => $product->name, + component => $product->components->[0]->name, + bug_type => 'defect', + bug_severity => 'normal', + op_sys => 'Unspecified', + rep_platform => 'Unspecified', + version => $product->versions->[0]->name, + }); + ok($bug->id, "Created $which bug " . $bug->id); + push @bug_ids, $bug->id; + + $dbh->do('INSERT INTO keywords (bug_id, keywordid) VALUES (?, ?)', + undef, $bug->id, $keyword->id); + $dbh->do('INSERT INTO bug_group_map (bug_id, group_id) VALUES (?, ?)', + undef, $bug->id, $group->id) + if $which eq 'restricted'; +} + +sub count_for_keyword { + my ($name) = @_; + my ($found) + = grep { $_->name eq $name } @{Bugzilla::Keyword->get_all_with_bug_count()}; + return $found ? $found->bug_count : undef; +} + +# An anonymous (logged out) user is in no groups at all. +Bugzilla->set_user(Bugzilla::User->new()); +is(count_for_keyword($keyword_name), + 1, 'Anonymous user only counts the unrestricted bug'); + +# A user who is a member of the restricting group sees both bugs. Use a +# freshly created user so no stale group membership can be cached for it. +my $login = "keyword-count-$suffix\@bugzilla.test"; +my $member = Bugzilla::User->create({ + login_name => $login, + cryptpassword => '*', + disabledtext => '', + disable_mail => 1, +}); +$dbh->do( + 'INSERT INTO user_group_map (user_id, group_id, isbless, grant_type) + VALUES (?, ?, 0, ?)', undef, $member->id, $group->id, GRANT_DIRECT +); +Bugzilla->memcached->clear_all(); + +$member = Bugzilla::User->new({id => $member->id, cache => 0}); +Bugzilla->set_user($member); +ok($member->in_group($group_name), "Test user is a member of $group_name"); +is(count_for_keyword($keyword_name), + 2, 'Group member counts both the restricted and unrestricted bug'); + +# Keywords whose bugs are all hidden must still be listed, with a count of 0, +# rather than disappearing from the report entirely. +Bugzilla->set_user($admin); +my $hidden_keyword = Bugzilla::Keyword->create({ + name => "csectype-hidden-$suffix", + description => 'Temporary keyword for bug 2056990', + is_active => 1, +}); +$dbh->do('INSERT INTO keywords (bug_id, keywordid) VALUES (?, ?)', + undef, $bug_ids[1], $hidden_keyword->id); + +Bugzilla->set_user(Bugzilla::User->new()); +is(count_for_keyword($hidden_keyword->name), + 0, 'Fully hidden keyword is still listed with a count of 0'); + +############################################################################### +# Cleanup +############################################################################### + +Bugzilla->set_user($admin); +$dbh->do('DELETE FROM keywords WHERE keywordid IN (?, ?)', + undef, $keyword->id, $hidden_keyword->id); +$dbh->do('DELETE FROM bug_group_map WHERE group_id = ?', undef, $group->id); +$dbh->do('DELETE FROM user_group_map WHERE group_id = ?', undef, $group->id); +$dbh->do('DELETE FROM group_control_map WHERE group_id = ?', undef, $group->id); +$keyword->remove_from_db(); +$hidden_keyword->remove_from_db(); +$group->remove_from_db(); +Bugzilla->memcached->clear_all(); + +done_testing(); diff --git a/t/bmo/triage-owner-security-visibility.t b/t/bmo/triage-owner-security-visibility.t new file mode 100644 index 0000000000..c6852a3559 --- /dev/null +++ b/t/bmo/triage-owner-security-visibility.t @@ -0,0 +1,290 @@ +#!/usr/bin/env perl +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +# Regression test for Bug 2065387: a component's triage owner may see +# group-restricted bugs in that component, but only while they are also a +# member of the mozilla-employee-confidential group. +# +# The rule is implemented twice and the two copies must stay synchronized: +# +# * Bugzilla::User::visible_bugs - direct bug access (show_bug, REST get) +# * Bugzilla::Search - the security_triage join in +# _standard_joins plus the matching term +# in _standard_where +# +# Every case below is therefore asserted through both paths. If the join is +# ever added without the WHERE term (or vice versa) the search assertions +# break, and if either path drops the group check the negative assertions +# break. + +use 5.10.1; +use strict; +use warnings; +use lib qw(. lib local/lib/perl5); +use Test::More; + +use Bugzilla; +use Bugzilla::Bug; +use Bugzilla::Component; +use Bugzilla::Constants; +use Bugzilla::Group; +use Bugzilla::Product; +use Bugzilla::Search; +use Bugzilla::User; +BEGIN { Bugzilla->extensions } + +Bugzilla->usage_mode(USAGE_MODE_TEST); +Bugzilla->error_mode(ERROR_MODE_DIE); + +my $dbh = Bugzilla->dbh; +my $pid = $$; + +my $confidential + = Bugzilla::Group->new({name => 'mozilla-employee-confidential'}); +plan skip_all => 'mozilla-employee-confidential group required' + unless $confidential; + +my $admin = Bugzilla::User->check({id => 1}); +Bugzilla->set_user($admin); + +# The helpers below grant and revoke group membership through set_groups(), +# which requires the acting user to have bless rights on the group. +plan skip_all => 'admin cannot bless ' . $confidential->name + unless $admin->can_bless($confidential->id); + +my ($product) = grep { @{$_->versions} } Bugzilla::Product->get_all; +plan skip_all => 'Need a product with at least one version' unless $product; + +############################################################################### +# Helpers +############################################################################### + +# set_groups() checks Bugzilla->user->can_bless(), which caches its group list +# on the user object. The fixtures create a group after that cache would have +# been filled, so re-read the admin before each change. +sub as_admin { + $admin = reload($admin); + Bugzilla->set_user($admin); +} + +# set_groups() stashes the change and update() applies it, writes the audit and +# profiles_activity rows, and invalidates the memcached group list. The admin +# group is granted bless on every group at creation time, so the admin may make +# both of these changes. +sub add_to_group { + my ($user, $group) = @_; + as_admin(); + my $target = reload($user); + $target->set_groups({add => [$group->name]}); + $target->update(); +} + +sub remove_from_group { + my ($user, $group) = @_; + as_admin(); + my $target = reload($user); + $target->set_groups({remove => [$group->name]}); + $target->update(); +} + +sub test_user { + my ($login) = @_; + my $user = Bugzilla::User->new({name => $login}); + return $user if $user; + return Bugzilla::User->create({ + login_name => $login, + realname => $login, + cryptpassword => 'triage-owner-test-passw0rd!', + disabledtext => '', + disable_mail => 1, + }); +} + +# Always re-read the user so neither the object cache, the per-object group +# list, nor the per-object _visible_bugs_cache can mask a permission change. +sub reload { + my ($user) = @_; + return Bugzilla::User->new({id => $user->id}); +} + +sub can_see { + my ($user, $bug_id) = @_; + return reload($user)->can_see_bug($bug_id) ? 1 : 0; +} + +sub search_finds { + my ($user, $bug_id) = @_; + my $searcher = reload($user); + Bugzilla->set_user($searcher); + my $search = Bugzilla::Search->new( + fields => ['bug_id'], + params => {f1 => 'bug_id', o1 => 'equals', v1 => $bug_id}, + user => $searcher, + ); + my $found = grep { $_->[0] == $bug_id } @{$search->data}; + Bugzilla->set_user($admin); + return $found ? 1 : 0; +} + +############################################################################### +# Fixtures +############################################################################### + +# The bug is restricted by a throwaway group that none of the triage owners +# belong to. Restricting it with mozilla-employee-confidential itself would let +# the triage owner in through ordinary group membership and prove nothing about +# the triage-owner rule. +my $sec_group = Bugzilla::Group->create({ + name => "test-triage-sec-$pid", + description => 'Temp security group for Bug 2065387 test', + isbuggroup => 1, +}); +$dbh->do( + 'INSERT IGNORE INTO group_control_map + (group_id, product_id, entry, membercontrol, othercontrol, canedit) + VALUES (?, ?, 0, 1, 0, 0)', undef, $sec_group->id, $product->id +); + +# The admin needs the group to be able to file the restricted bug. +add_to_group($admin, $sec_group); +as_admin(); + +my $owner_member = test_user("triage-member-$pid\@triage.test"); +my $owner_nonmember = test_user("triage-nonmember-$pid\@triage.test"); +my $owner_other = test_user("triage-other-$pid\@triage.test"); + +add_to_group($owner_member, $confidential); +add_to_group($owner_other, $confidential); + +# $owner_nonmember is deliberately left out of mozilla-employee-confidential. +remove_from_group($owner_nonmember, $confidential); + +# initialowner is the admin on both components so that a triage owner never +# picks up access as the default assignee instead. +my $comp_target = Bugzilla::Component->create({ + product => $product, + name => "TriageOwnerTarget-$pid", + description => 'Temp component for Bug 2065387 test', + initialowner => $admin->login, + team_name => 'Mozilla', + triage_owner_id => $owner_member->login, +}); +my $comp_other = Bugzilla::Component->create({ + product => $product, + name => "TriageOwnerOther-$pid", + description => 'Temp component for Bug 2065387 test', + initialowner => $admin->login, + team_name => 'Mozilla', + triage_owner_id => $owner_other->login, +}); + +my $bug = Bugzilla::Bug->create({ + short_desc => "Triage owner visibility - Bug 2065387 - $pid", + product => $product->name, + component => $comp_target->name, + bug_type => 'defect', + bug_severity => 'normal', + op_sys => 'Unspecified', + rep_platform => 'Unspecified', + version => $product->versions->[0]->name, + groups => [$sec_group->name], +}); + +############################################################################### +# Tests +############################################################################### + +ok( + (grep { $_->name eq $sec_group->name } @{$bug->groups_in}), + 'Test bug ' . $bug->id . ' is restricted to ' . $sec_group->name +); + +# --- Positive: triage owner who is in mozilla-employee-confidential --- + +ok(can_see($owner_member, $bug->id), + 'Triage owner in mozilla-employee-confidential can see the restricted bug'); +ok( + search_finds($owner_member, $bug->id), + 'Triage owner in mozilla-employee-confidential finds the restricted bug via search' +); + +# --- Negative: triage owner of a different component --- +# +# In mozilla-employee-confidential, but triage owner of the wrong component, +# so the join must not match. + +ok(!can_see($owner_other, $bug->id), + 'Triage owner of a different component cannot see the restricted bug'); +ok( + !search_finds($owner_other, $bug->id), + 'Triage owner of a different component does not find the restricted bug via search' +); + +# --- Negative: triage owner of the right component, not in the group --- + +$comp_target->set_triage_owner($owner_nonmember->login); +$comp_target->update(); + +ok( + !can_see($owner_nonmember, $bug->id), + 'Triage owner outside mozilla-employee-confidential cannot see the restricted bug' +); +ok( + !search_finds($owner_nonmember, $bug->id), + 'Triage owner outside mozilla-employee-confidential does not find the restricted bug via search' +); + +# --- Negative: same user and component, group membership revoked --- +# +# The strongest form of the check. Only the group membership changes between +# the passing assertions above and these, so nothing else can explain a pass. + +$comp_target->set_triage_owner($owner_member->login); +$comp_target->update(); +remove_from_group($owner_member, $confidential); + +ok(!can_see($owner_member, $bug->id), + 'Revoking mozilla-employee-confidential revokes the triage owner bug access'); +ok( + !search_finds($owner_member, $bug->id), + 'Revoking mozilla-employee-confidential removes the bug from triage owner search results' +); + +# Re-granting restores access, confirming the previous failures were caused by +# the group check and not by leftover state from set_triage_owner(). +add_to_group($owner_member, $confidential); + +ok( + can_see($owner_member, $bug->id), + 'Re-granting mozilla-employee-confidential restores the triage owner bug access' +); +ok( + search_finds($owner_member, $bug->id), + 'Re-granting mozilla-employee-confidential restores the bug in triage owner search results' +); + +############################################################################### +# Cleanup +############################################################################### + +Bugzilla->set_user($admin); +$bug->remove_from_db(); +$comp_target->remove_from_db(); +$comp_other->remove_from_db(); + +foreach my $user ($owner_member, $owner_nonmember, $owner_other) { + remove_from_group($user, $confidential); +} +remove_from_group($admin, $sec_group); + +$dbh->do('DELETE FROM group_control_map WHERE group_id = ?', + undef, $sec_group->id); +$dbh->do('DELETE FROM bug_group_map WHERE group_id = ?', undef, $sec_group->id); +$sec_group->remove_from_db(); + +done_testing(); diff --git a/t/mfa-duo-verify.t b/t/mfa-duo-verify.t new file mode 100644 index 0000000000..2c4196305a --- /dev/null +++ b/t/mfa-duo-verify.t @@ -0,0 +1,104 @@ +#!/usr/bin/env perl +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. +use 5.10.1; +use strict; +use warnings; +use lib qw( . lib local/lib/perl5 ); + +use Bugzilla::Test::MockDB; +use Bugzilla::Test::MockLocalconfig urlbase => 'http://bmo.test/'; +use Bugzilla::Test::MockParams (duo_uri => 'http://duo.test/'); +use Bugzilla::Test::Util qw(create_user); + +use Bugzilla; +use Bugzilla::Constants; +use Bugzilla::MFA; +use Bugzilla::Token qw(issue_short_lived_session_token); +use JSON::MaybeXS qw(encode_json); +use Test::More; +use Try::Tiny; + +BEGIN { Bugzilla->extensions } + +Bugzilla->usage_mode(USAGE_MODE_TEST); +Bugzilla->error_mode(ERROR_MODE_DIE); +Bugzilla->input_params({}); + +my $user = create_user('duo-user@mozilla.test', '*'); +Bugzilla->set_user($user); +Bugzilla->dbh->do('UPDATE profiles SET mfa = ? WHERE userid = ?', + undef, 'Duo', $user->id); + +# Mint an mfa session token carrying $event, the way verify_prompt does. +# set_token_extra_data is not used directly because its upsert is MySQL-only. +sub mfa_token { + my ($event) = @_; + my $token = issue_short_lived_session_token('mfa', $user); + Bugzilla->dbh->do('INSERT INTO token_data (token, extra_data) VALUES (?, ?)', + undef, $token, encode_json($event)); + return $token; +} + +sub dies_like { + my ($code, $re, $name) = @_; + my $err; + try { $code->() } catch { $err = $_ }; + like($err // '(did not die)', $re, $name); +} + +my $event = { + reason => 'creating an API key', + actions => [{type => 'create', description => 'test key'}], + postback => {action => 'userprefs.cgi', fields => {tab => 'apikey'}}, +}; + +my $provider = Bugzilla::MFA->new_from($user, 'Duo'); +isa_ok($provider, 'Bugzilla::MFA::Duo'); + +# The core of bug 2060356: a session-cookie attacker can trigger verify_prompt +# and recover the mfa token from the Set-Cookie header without ever completing +# Duo. Replaying it must not yield a verified event. +dies_like( + sub { $provider->verify_token(mfa_token($event), {no_delete => 1}) }, + qr/Invalid Duo Security MFA Code/, + 'verify_token rejects an event that never passed Duo' +); + +# Duo's own callback runs before duo_verified exists, so it opts out. +{ + my $got = $provider->verify_token(mfa_token($event), + {no_delete => 1, no_redirect => 1, provider_callback => 1}); + is($got->{reason}, 'creating an API key', + 'provider_callback bypasses the gate for the Duo callback itself'); +} + +# The happy path: the callback has recorded a successful code exchange. +{ + my $verified = {%$event, duo_verified => 1}; + my $got = $provider->verify_token(mfa_token($verified)); + is($got->{actions}[0]{type}, 'create', 'verify_token accepts a verified event'); +} + +# A recovery code must not stand in for Duo verification. Duo users have no +# form to enter one, and generating them is now blocked outright. +dies_like( + sub { $provider->generate_recovery_codes() }, + qr/Recovery codes are not available/, + 'Duo refuses to generate recovery codes' +); + +# Providers that verify inline are unaffected: the base verify_event is a no-op. +{ + my $dummy = Bugzilla::MFA->new_from($user, 'Dummy'); + isa_ok($dummy, 'Bugzilla::MFA::Dummy'); + my $got = $dummy->verify_token(mfa_token($event), {no_delete => 1}); + is($got->{reason}, 'creating an API key', + 'non-Duo providers are not gated on duo_verified'); +} + +done_testing; diff --git a/t/mojo-docs.t b/t/mojo-docs.t new file mode 100644 index 0000000000..c36911c869 --- /dev/null +++ b/t/mojo-docs.t @@ -0,0 +1,91 @@ +#!/usr/bin/env perl +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. +use strict; +use warnings; +use 5.10.1; +use lib qw( . lib local/lib/perl5 ); + +BEGIN { + $ENV{LOG4PERL_CONFIG_FILE} = 'log4perl-t.conf'; + $ENV{BUGZILLA_DISABLE_HOSTAGE} = 1; +} + +use Bugzilla::Test::MockLocalconfig (urlbase => 'http://bmo.test/'); +use Bugzilla::Test::MockDB; +use Bugzilla::Test::MockParams; + +use Test2::V0; +use Test::Mojo; + +# Rendering the docs requires libcmark-gfm. +eval { require Bugzilla::Markdown::GFM; 1 } + or plan skip_all => 'libcmark-gfm is not available'; + +my $t = Test::Mojo->new('Bugzilla::App'); + +# /docs and /docs/en redirect to the documentation home page. +$t->get_ok('/docs')->status_is(302) + ->header_like(Location => qr{/docs/en/md/index\.md$}); +$t->get_ok('/docs/en')->status_is(302) + ->header_like(Location => qr{/docs/en/md/index\.md$}); + +# The home page renders inside the normal Bugzilla chrome. +$t->get_ok('/docs/en/md/index.md')->status_is(200) + ->element_exists('#header', 'Bugzilla page header is present'); +$t->element_exists('main#bugzilla-body .docs-content', + 'docs render inside the standard page body') + ->text_like('.docs-content h1' => qr/Documentation/); + +# The home page table of contents renders without list bullets +# (docs-index class); other pages keep normal lists. +$t->get_ok('/docs/en/md/index.md') + ->element_exists('.docs-content.docs-index', 'home page has docs-index class'); + +# Sub-pages render and headings get GitHub-style anchor ids. +$t->get_ok('/docs/en/md/using/index.md')->status_is(200) + ->element_exists('.docs-content h1[id]', 'headings carry generated ids'); +$t->element_exists_not('.docs-content.docs-index', + 'sub-pages do not get the docs-index class'); + +# GFM alert blockquotes become styled callouts. +$t->get_ok('/docs/en/md/integrating/templates.md')->status_is(200) + ->element_exists('.docs-alert.docs-alert-warning'); +$t->text_is('.docs-alert-warning .docs-alert-title' => 'Warning'); + +# Directory URLs redirect to the section index. +$t->get_ok('/docs/en/md/using')->status_is(302) + ->header_like(Location => qr{/docs/en/md/using/index\.md$}); + +# Legacy Sphinx-style .html links (old docs_urlbase bookmarks) redirect to +# the Markdown page with the same name. +$t->get_ok('/docs/en/md/using/finding.html')->status_is(302) + ->header_like(Location => qr{/docs/en/md/using/finding\.md$}); +$t->get_ok('/docs/en/md/no-such-page.html')->status_is(404); + +# Images shipped with the docs are served. +SKIP: { + skip 'no sample image in docs/en/images', 1 + unless -f 'docs/en/images/bzLifecycle.png'; + $t->get_ok('/docs/en/images/bzLifecycle.png')->status_is(200) + ->header_is('Content-Type' => 'image/png'); +} + +# Directory traversal and non-doc files are rejected. +$t->get_ok('/docs/en/md/../../../Bugzilla.pm')->status_is(404); +$t->get_ok('/docs/en/localconfig')->status_is(404); +$t->get_ok('/docs/en/md/no-such-page.md')->status_is(404); + +# The docs_urlbase parameter is gone, but the template variable now points +# at the in-app viewer: the header help menu should link to it. +ok(!exists Bugzilla->params->{docs_urlbase}, + 'docs_urlbase parameter no longer exists'); +$t->get_ok('/docs/en/md/index.md') + ->element_exists('#header a[href="/docs/en/md/"]', + 'header Documentation menu links to the in-app docs'); + +done_testing; diff --git a/template/en/default/account/prefs/apikey.html.tmpl b/template/en/default/account/prefs/apikey.html.tmpl index 6def9b1c31..9c8cba7dc4 100644 --- a/template/en/default/account/prefs/apikey.html.tmpl +++ b/template/en/default/account/prefs/apikey.html.tmpl @@ -18,7 +18,7 @@

Documentation on how to log in is available - + here.

diff --git a/template/en/default/account/prefs/mfa.html.tmpl b/template/en/default/account/prefs/mfa.html.tmpl index e003bf2454..71c2c81290 100644 --- a/template/en/default/account/prefs/mfa.html.tmpl +++ b/template/en/default/account/prefs/mfa.html.tmpl @@ -6,7 +6,7 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% SET MFA_HOWTO = docs_urlbase _ "using/two-factor-authentication.html" %] +[% SET MFA_HOWTO = docs_urlbase _ "using/two-factor-authentication.md" %] [% tab_footer = BLOCK %]
@@ -87,10 +87,14 @@ [% INCLUDE "mfa/protected.html.tmpl" %] [% END %] -
- - [% INCLUDE "mfa/protected.html.tmpl" %] -
+ [%# Duo has no verification form, so a recovery code could never be + # entered. Recovery is handled by Duo Security itself. %] + [% IF user.mfa != 'Duo' %] +
+ + [% INCLUDE "mfa/protected.html.tmpl" %] +
+ [% END %]

diff --git a/template/en/default/admin/params/general.html.tmpl b/template/en/default/admin/params/general.html.tmpl index 5ef0b58824..3bbc78e3ae 100644 --- a/template/en/default/admin/params/general.html.tmpl +++ b/template/en/default/admin/params/general.html.tmpl @@ -34,14 +34,6 @@ "Email address that should receive system generated notifications," _ " such as account lockout and SES issues.", - docs_urlbase => - "The URL that is the common initial leading part of all" - _ " $terms.Bugzilla documentation URLs. It may be an absolute URL," - _ " or a URL relative to the urlbase parameter. Leave this" - _ " empty to suppress links to the documentation." - _ "'%lang%' will be replaced by user's preferred language (if" - _ " documentation is available in that language).", - utf8 => "Use UTF-8 (Unicode) encoding for all text in ${terms.Bugzilla}. New" _ " installations should set this to true to avoid character encoding" diff --git a/template/en/default/bug/tagging.html.tmpl b/template/en/default/bug/tagging.html.tmpl index 149ddbe8cc..0e28fecd97 100644 --- a/template/en/default/bug/tagging.html.tmpl +++ b/template/en/default/bug/tagging.html.tmpl @@ -27,11 +27,7 @@ [% END %] - [% IF Param('docs_urlbase') %] - the named tag - [% ELSE %] - the named tag - [% END %] + the named tag [% IF user.tags.size %] - (YYYY-MM-DD or relative dates) + (YYYY-MM-DD or relative dates) diff --git a/template/en/default/search/search-create-series.html.tmpl b/template/en/default/search/search-create-series.html.tmpl index 64be10571e..2b72fa3411 100644 --- a/template/en/default/search/search-create-series.html.tmpl +++ b/template/en/default/search/search-create-series.html.tmpl @@ -37,7 +37,7 @@ javascript = js_data javascript_urls = [ "js/productform.js", "js/TUI.js", "js/field.js", "js/advanced-search.js" ] style_urls = [ "skins/standard/search_form.css", "skins/standard/advanced-search.css" ] - doc_section = "reporting.html#charts-new-series" + doc_section = "using/reports-and-charts.html#charts-new-series" %] diff --git a/template/en/default/search/search-report-graph.html.tmpl b/template/en/default/search/search-report-graph.html.tmpl index ab321f5342..20be10156a 100644 --- a/template/en/default/search/search-report-graph.html.tmpl +++ b/template/en/default/search/search-report-graph.html.tmpl @@ -36,7 +36,7 @@ var queryform = "reportform" javascript = js_data javascript_urls = [ "js/productform.js", "js/TUI.js", "js/field.js", "js/advanced-search.js" ] style_urls = [ "skins/standard/search_form.css", "skins/standard/advanced-search.css" ] - doc_section = "reporting.html#reports" + doc_section = "using/reports-and-charts.html#reports" %] [% PROCESS "search/search-report-select.html.tmpl" %] diff --git a/template/en/default/search/search-report-table.html.tmpl b/template/en/default/search/search-report-table.html.tmpl index b98b031a33..066a070167 100644 --- a/template/en/default/search/search-report-table.html.tmpl +++ b/template/en/default/search/search-report-table.html.tmpl @@ -36,7 +36,7 @@ var queryform = "reportform" javascript = js_data javascript_urls = [ "js/productform.js", "js/TUI.js", "js/field.js", "js/advanced-search.js" ] style_urls = [ "skins/standard/search_form.css", "skins/standard/advanced-search.css" ] - doc_section = "reporting.html#reports" + doc_section = "using/reports-and-charts.html#reports" %] [% PROCESS "search/search-report-select.html.tmpl" %] diff --git a/token.cgi b/token.cgi index 35c2a48316..25ca510bc0 100755 --- a/token.cgi +++ b/token.cgi @@ -513,11 +513,6 @@ sub mfa_event_from_token { # verify my $event = $user->mfa_provider->verify_token($token); - # If we got this far and MFA is Duo, we should be verified - if ($user->mfa eq 'Duo' && !$event->{duo_verified}) { - ThrowUserError('duo_user_error', {reason => 'Invalid Duo Security MFA Code'}); - } - return ($user, $event); } diff --git a/userprefs.cgi b/userprefs.cgi index d3028c6703..a660df65bb 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -736,7 +736,12 @@ sub SaveMFA { ThrowUserError('password_incorrect'); } - my $mfa = $cgi->param('mfa') // $user->mfa; + # The provider performs the verification, so it has to be the user's real + # one. The request parameter is only meaningful while enrolling -- the + # prefs UI emits it solely in the not-yet-enrolled branch -- and honouring + # it afterwards would let the caller name a provider whose checks are + # no-ops (anything but TOTP/Duo falls through to MFA::Dummy). + my $mfa = $user->mfa || $cgi->param('mfa'); my $provider = Bugzilla::MFA->new_from($user, $mfa) // return; my $reason; @@ -745,6 +750,10 @@ sub SaveMFA { $reason = 'Two-factor enrollment'; } elsif ($action eq 'recovery') { + if ($mfa eq 'Duo') { + ThrowUserError('duo_user_error', + {reason => 'Recovery codes are not available when using Duo Security.'}); + } $reason = 'Recovery code generation'; } elsif ($action eq 'disable') { @@ -811,15 +820,10 @@ sub SaveMFAupdate { sub SaveMFAcallback { my $mfa_token = shift; my $user = Bugzilla->user; - my $mfa = Bugzilla->cgi->param('mfa'); + my $mfa = $user->mfa || Bugzilla->cgi->param('mfa'); my $provider = Bugzilla::MFA->new_from($user, $mfa) // return; my $event = $provider->verify_token($mfa_token); - # Must have passed the Duo verification to proceed to update - if ($mfa eq 'Duo' && !$event->{duo_verified}) { - ThrowUserError('duo_user_error', {reason => 'Invalid Duo Security MFA Code'}); - } - SaveMFAupdate($event->{action}, $mfa); }