Skip to content

Instantly share code, notes, and snippets.

@dklawren
Created June 15, 2017 19:05
Show Gist options
  • Save dklawren/94c1f669d6f261731dd48b8174507786 to your computer and use it in GitHub Desktop.
Save dklawren/94c1f669d6f261731dd48b8174507786 to your computer and use it in GitHub Desktop.
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',
can_review => 1,
},
reviewboard => {
title => 'MozReview',
regex => $mozreview_url_re,
content_type => 'text/x-review-board-request',
can_review => 1,
},
Phabricator => {
title => 'Phabricator',
regex => phabricator_url_re(),
content_type => 'text/x-phabricator-request',
can_review => 1,
},
google_docs => {
title => 'Google Doc',
regex => qr#^https://docs\.google\.com/(?:document|spreadsheets|presentation)/d/#i,
content_type => 'text/x-google-doc',
can_review => 0,
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment