Skip to content

Instantly share code, notes, and snippets.

View dklawren's full-sized avatar

David Lawrence dklawren

View GitHub Profile
sub phabricator_url_re {
my $phab_uri = Bugzilla->params->{phabricator_base_uri} || 'https://example.com';
return qr/^${phab_uri}D\d+$/i;
}
our %autodetect_attach_urls = (
github_pr => {
title => 'GitHub Pull Request',
regex => qr#^https://github\.com/[^/]+/[^/]+/pull/\d+/?$#i,
content_type => 'text/x-github-pull-request',
@dklawren
dklawren / gist:fe48a1956de30b7c1914903514947724
Created April 14, 2017 17:20
docker-compose.yml for phabricator
version: '2'
services:
phabricator:
restart: always
ports:
- "62443:443"
- "62080:80"
- "62022:22"
volumes:
- ./repos:/repos
# 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."""
# 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
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 = [];
#!/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;
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