Skip to content

Instantly share code, notes, and snippets.

View dklawren's full-sized avatar

David Lawrence dklawren

View GitHub Profile
@dklawren
dklawren / 1301884_dkl_fix.patch
Created October 7, 2016 20:02
1301884_dkl_fix.patch
diff --git a/Bugzilla/API/1_0/Util.pm b/Bugzilla/API/1_0/Util.pm
index a67db2d..e8756db 100644
--- a/Bugzilla/API/1_0/Util.pm
+++ b/Bugzilla/API/1_0/Util.pm
@@ -361,10 +361,10 @@ sub datetime_format_outbound {
# simple types
-sub as_boolean { $_[0] ? JSON::true : JSON::false }
-sub as_double { defined $_[0] ? $_[0] + 0.0 : JSON::null }
SELECT DISTINCT
setter.login_name, ft.name, flags.status, grant_group.name
FROM
flag_state_activity AS flags
JOIN
profiles AS setter ON flags.setter_id = setter.userid
JOIN
flagtypes AS ft ON ft.id = flags.type_id
JOIN
groups AS grant_group ON grant_group.id = ft.grant_group_id
SELECT DISTINCT
setter.login_name, ft.name, flag.status, grant_group.name
FROM
flags AS flag
JOIN
profiles AS setter ON flag.setter_id = setter.userid
JOIN
flagtypes AS ft ON ft.id = flag.type_id
JOIN
groups AS grant_group ON grant_group.id = ft.grant_group_id
SELECT DISTINCT
setter.login_name, ft.name, flag.status, grant_group.name
FROM
flags AS flag
JOIN
profiles AS setter ON flag.setter_id = setter.userid
JOIN
flagtypes AS ft ON ft.id = flag.type_id
JOIN
groups AS grant_group ON grant_group.id = ft.grant_group_id
SELECT DISTINCT
setter.login_name, ft.name, flag.status, grant_group.name
FROM
flags AS flag
JOIN
profiles AS setter ON flag.setter_id = setter.userid
JOIN
flagtypes AS ft ON ft.id = flag.type_id
JOIN
groups AS grant_group ON grant_group.id = ft.grant_group_id
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use lib qw(. local/lib/perl5)';
use Bugzilla;
use Bugzilla::FlagType;
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use lib qw(. local/lib/perl5);
use Bugzilla;
use Bugzilla::FlagType;
diff --git a/process_bug.cgi b/process_bug.cgi
index f97d02b..76595f6 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -393,7 +393,7 @@ if (defined $cgi->param('id')) {
##############################
# Do Actual Database Updates #
##############################
-my $sent_changes;
+my $sent_changes = [];
# 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/.
"""
Test repository handling logic.
"""
from commitindex.reviews.bugzilla import Bugzilla
from testing import MountebankClient
# 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/.
# TODO:
# 1. Load REST URL from system wide config
# 2. New content_type for conduit attachments?
# 3. Add comment_tags for conduit attachments?
"""Interface to a Bugzilla system."""