Coder Social home page Coder Social logo

bnaveenkr / gitnotify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sairam/gitnotify

0.0 2.0 0.0 195 KB

Notify users about new branches and track commits/merges done on branches

Home Page: http://gitnotify.com/

License: MIT License

Go 72.24% HTML 27.76%

gitnotify's Introduction

gitnotify

Github Release/Branch Version Watcher

How to Setup

Fetch Dependencies

go get -u golang.org/x/oauth2
go get -u gopkg.in/gomail.v2
go get -u gopkg.in/robfig/cron.v2 # requires modification to file aka bugfix
go get -u gopkg.in/yaml.v2
go get -u github.com/google/go-github/github
go get -u github.com/gorilla/mux
go get -u github.com/gorilla/sessions
go get -u github.com/markbates/goth
go get -u github.com/sairam/timezone # forked and added a method
go get -u github.com/spf13/cast

Modify package

  • gopkg.in/robfig/cron.v2
  • Edit line 102
  • Replace t = t.Truncate(time.Hour) with t = time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), 0, 0, 0, s.Location)

How to build for Linux

  • env GOOS=linux GOARCH=amd64 go build

Runtime Dependencies

  • cp .env.sample .env.prod
  • edit config.yml
  • ls tmpl/

Running on a Linux/Mac environment

  1. mkdir sessions
  2. Fill in the .env.prod file and modify config.yml
  3. Load the env variables from .env.prod
  4. Use the binary gitnotify and tmpl/ directory
  5. Start with ./gitnotify in a screen. All logs are currently written to stdout

Backup

  1. take a copy of the config.yml -> dataDir or data/ directory
  2. take a copy of the sessions/ directory
  3. The .env.prod file containing the environment variables
  4. The config.yml file containing the settings

TODO

  1. Host on separate instance (install Caddy w/ https and configure server)
  2. Log when adding a repository from the UI fails
  3. Use select2 instead of input box since typeahead.js does not allow multiple inputs
  4. Cache response of typeahead/branch list from Github to serve in Frontend

Known Knowns

  1. Clean up fetched_info from settings.yml file when a repository is removed
  2. Fix manual editing of cron.v2 since it does not work on +0530 like TZs
  3. Integration and Unit tests need to be added
  4. Fix TODO present in the code

Nice to Have

  1. JSON output to be used for sending information as webhooks to Zapier like services
  2. Allow autofill of branch names based on repo names
  3. Suggest names of popular repositories to ease adding first few repositories
  4. Add support for Gitlab
  5. An LRU Based Cache backed by disk in case memory exceeds limit. To Explore: hashicorp/golang-lru, boltdb/bolt, wunderlist/ttlcache, redis

FAQ

Can I run this inside my own organisation

Only the Configuration needs to be setup properly.

Disclaimer

I started learning Go (~Sep 2016) and this is my first project trying to "solve" a problem

Flow of user

Development Flow

  1. Users login via Github
  2. Users keep "an eye" on a project
  3. Notifies users on
  4. creation of new branches/tags.
  5. Track a branch for latest commits and links
  6. Send email with summary

User Flow

  1. Landing Page at /home
  2. User logins via Github to authenticate/track
  3. User adds url of repository to track creation of branches/tags and/or branches for latest commits
  4. User receives a confirmation email with the current list of branches
  5. Users receives an email once a day about the information that has changed

Backend Flow

  1. A non logged in user sees the static page present at /home at /
  2. User logs in via Github
  3. Settings page has a set of repositories s/he is tracking
  4. Suggestions based on code language can be pulled for user to track
  5. Once user adds the config, we save it to the settings
  6. After validating the config, an email is sent to the user with the action made
  7. A cron job or daemon uses the user's token to pull the required information
  8. Diffs with the previous information that is present
  9. Sends an email to the user with changes based on settings

Configuration

  • Copy .env.example to .env
  • Fill in data into .env
  • environment variables required to be loaded for the server to run

gitnotify's People

Contributors

sairam avatar

Watchers

James Cloos avatar Naveen Kumar avatar

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.