tree: d6287c65b14c50f7d3e158aa0d0923cf7c19d239 [path history] [tgz]
  1. bin/
  2. lib/
  3. test/
  4. .gcloudignore
  5. .gitignore
  6. analysis_options.yaml
  8. pubspec.lock
  9. pubspec.yaml

This folder contains the source for a Cloud Function implementing a GitHub WebHook endpoint which can react to issues being labeled and send notifications to subscribers.

It also can inspect newly opened issues for specific keywords and treat matches as if a specific label was assigned to an issue.

Newly created issues are also fed to crash-symbolizer's /symbolize endpoint in attempt to extract and symbolize any native crashes.

This function is also responsible for routing comments mentioning @flutter-symbolizer-bot to crash-symbolizer's ‘/symbolize’ endpoint.


To run local tests use script from this folder.


To deploy use script.

Note that deploying requires configuring two environment variables:

  • GITHUB_SECRET should be equal to the Hook Secret which you will use when creating a GitHub Hook at{org}/{repo}/settings/hooks
  • SENDGRID_SECRET should be equal to SendGrid API secret which you get when you add SendGrid to your Cloud Project (see docs for the initial setup).

Note: Function is connecting to crash-symbolizer GCE instance through VPC Connector with name cloud-run-to-gce.


Firestore needs to contain github-label-subscriptions collection.

The following Security Rules must be configured to ensure that each user can only edit its own subscriptions

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /github-label-subscriptions/{userId} {
      allow read, update, delete: if request.auth.uid == userId;
      allow create: if request.auth.uid != null;

    match /github-keyword-subscriptions/{repo} {
      allow read: if true;
      allow write, create, update, delete: if false

    match /{document=**} {
      allow read, write: if false;

Implementation Details

Subscriptions to labels are stored in the Firestore collection called github-label-subscriptions with each document at github-label-subscriptions/{userId} path has the following format

message Subscription {
    string email = 1;

    // Each subscription has format repo-name:label-name. For example
    // subscribing to label 'bug' in 'dart-lang/sdk' repo would be
    // recorded as 'dart-lang/sdk:bug'.
    repeated string subscriptions = 2;

Subscriptions are intended to be managed by users themselves so they are indexed by Firebase UID issued by Firebase authentification.

Subscriptions to keywords for specific repositories are stored at github-keyword-subscriptions/{repositoryName}, where {repositoryName} is full repository name with / replaced with $.

// Represents a subscription to keywords inside issue body. If the match is
// found then this is treated as if the issue is labeled with the given label.
message KeywordSubscription {
    string label = 1;
    repeated string keywords = 2;

Note: security rules prevent editing keyword subscriptions by anybody - so they can only be changed via Firebase Console UI.

Mails are sent via SendGrid.