Giter Site home page Giter Site logo

pull-request-notifier's Introduction

Pull Request Notifier - Chrome Extension

Build Status Codacy Badge Codacy Badge TypeScript

The Google Chrome extension that allows you to be notified of changes in Pull Requests. Currently only Bitbucket is supported. GitHub support is on the way (see milestones).

assigned_prs

Why?

The motivation of creating this project is simple.

Developers who work in team on the same project want to have immediate feedback on code they create. They create pull requests and assign people asking for a code review. Assigned people receive email notifications but sometimes they are getting lost in a mass of messages they receive everyday.

I wanted to provide simple and immediate notifications for developers using Bitbucket for repository hosting to make their work easier and more responsive.

Currently project is being used by a small bunch of developers. Instant feedback and feature requests pushed me to release several versions and the 0.6.0 version was the last one published before it's been published on Github.

Features

  • Extension popup with a list of assigned and authored pull requests
  • Code review progress:
    • proportions (3/10 - three people accepted per 10 assigned)
    • percentage (25%)
    • progress bar
  • Pull request preview with detailed info
    • target branch
    • markdown-formatted description
    • list of assignees
  • Showing notifications:
    • Assigned new pull request
    • Accepted pull request
    • Updated pull requests
    • Comments and replies on a pull request
  • Notification sounds
  • Sending a reminder to all assignees who haven't approved a PR yet
  • Easier PR opening by clicking on a notification or an item on the list
  • Google Analytics tracking
  • Error and logs tracking with Loggly

Build with

Requirements

Due to API changes, at least version 33.x.x of Google Chrome is required. However, the current version is highly recommended.

Development

To run project on your machine, ensure you have following packages installed:

  • node.js >= 6.x
  • yarn >= 1.0.0
  • gulp - tested with 3.9.1

Installation

To install project dependencies, simply run the following command from root directory of the project:

yarn install

Testing

To run tests, execute standard npm command:

yarn test

Coverage

If you want to generate code coverage, you can set GENERATE_COVERAGE=1 environment variable. Coverage report will be dumped into build/coverage directory.

GENERATE_COVERAGE=1 yarn test

Building a project

The extension is built with Webpack. There are two ways to build a project: dev and prod. Running tests also executes build with its own context, so there's also a test environment. Details of build process are shown in the table below.

Dev-version

Development version of the build results in creating a dist directory with compiled sources and re-generated extension manifest. You can point your browser here to run it locally.

To build development version of the project, run the following in your terminal:

yarn run build:dev

Production version

Production version is almost the same as development but it takes much more time to build because of more aggressive code uglification. The result of the prod build is a zipped extension, ready to publish in the store. You can find it in build directory.

To build production version of the project, run the following in your terminal:

yarn run build:prod

If you'd like to create an extension file, ready to use in your browser without publishing it in the store, you can run alternative prod build by calling

yarn run build:crx

You can find the result file with *.crx extension in build directory. To install it, simply drag-and-drop it onto the extensions page.

Note: To build the CRX file properly, it needs a key for package signature. To point where is your key, use CRX_PEM_PATH environment variable.

Build steps on environments

Build step DEV TEST PROD
*.ts files compilation
tslint checks
stylelint checks
merging common code
generating html views
generating html views
sources uglifying

Environment variables with DotEnv

For some cases, e.g. Google Analytics or Loggly integration, you must provide a token to communicate with the service. This can be made by a DotEnv webpack plugin. To set up your secrets, create a copy of .env.example in the project root and rename it to .env. Then update desired values.

The .env file is ignored by git.

Google Analytics tracking

Extension is integrated with Google Analytics. It sends page views, events and custom timings.

Enable tracking

To enable tracking, simply insert a tracking code into .env file for GOOGLE_ANALYTICS_KEY variable.

Tracking details

Currently, following events are sending hits to Google Analytics:

  1. Page views:
  • Pop-up
  • Background page (when extension starts)
  • Options page
  1. Events:
  • Pop-up opened
  • Pull request opened and which way it's been opened
  • Reminder sent
  • Successful connection to server established
  • Switch tabs (and which tab)
  • Notification shown (and which notification)
  1. Custom timings:
  • How long is pop-up opened?
  • How long is notification shown (and closed by user interaction)?

Contributing

Please read CONTRIBUTING.md for details on the code of conduct, and the process for submitting pull requests.

Versioning

The project uses SemVer for versioning. For the versions available, see the tags on this repository.

License

todo

pull-request-notifier's People

Contributors

eps90 avatar fon60 avatar gintoki88 avatar

Watchers

 avatar  avatar

Forkers

dacsoftware

pull-request-notifier's Issues

Add Google Analytics tracking

Events:

General

  • Background process start
  • Connecting to server

Popup:

  • Popup open
  • Opening PR from popup
  • Tabs switching
  • Preview opening
  • Sending a reminder from list
  • Sending a reminder from preview
  • Opening PR from preview

Notifications:

  • Opening PR from notification

Options page

  • Opening

Custom timings:

  • How long is popup opened
  • How long notification is shown

Improve code coverage

Because of compilation layers (ts -> webpack) some of the lines are covered incorrectly. It's worth to find a way to do it properly and configure build process.

Error tracking

  • Find some error tracking service for open source
  • Configure it in the app

Add support for i18n

  • Convert currently hardcoded values to i18n messages
  • Allow changing the language in the settings
  • Add a note in docs about i18n contribution
  • Find a way to be notified about missing translations
  • Find a way to load languages dynamically
  • Prepare the extension for i18n support in the store

Update application icons

Currently, the extension has a Bitbucket icon. We need a new icon for the extension, as well as for notifications.

Update docs

Elements to provide:

  • Badges
  • Requirements
  • Features
  • Installation
  • Testing
  • List google analytics events and timings
  • Contributing
  • CONTRIBUTING.md file

OAuth2 authorization support

In order to stop setting up a username in settings and improve security, the extension has to have OAuth2 integration implemented.

Observing pull requests

In order to be notified on pull requests that aren't assigned to nor authored by logged in user, there should be an option to observe changes on projects or pull requests.

Do not disturb mode

Allow to enter DND mode, for a limited time or on specified hours. Optionally, allow to enter DND mode from extension's context menu.

Services abstraction for clean code and easier management

To provide better more clean code and better code management, there must be created some services abstractions. Since TypeScript has interface in the syntax, some of implementations can be done in various ways, like InMemory. Also, hiding some services behind implementation can provide better testing, without mocks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.