Git Product home page Git Product logo

dev-works-logger's Introduction

dev-works-logger

CI Rust Build a bot to collect data from Git

What are we trying to build?

  • A Bot (not for Discord)
  • It will run every week/month
  • It will check all the repositories for the organization (with Github GraphQL) for the most amount of PR for a single contributor
  • Create an image for that person and it will post it to Twitter and Discord
  • Create a docker

.env params you must have

  • GITHUB_ORG_NAME
  • GITHUB_TOKEN
  • TWITTER_TOKEN
  • DISCORD_HOOK

Image to post

Should follow:

  • A picture of the organization owning the repo
  • A text with the name of the organization on the picture
  • A Picture of the contributor
  • A text about the contributor achievement (in the picture)
  • A text about the contributor (in the tweet)
  • As much as information as possible on the contributor
  • Awesome design gets extra points

Bonuses

  • Add more things like most amount of issues, most amount of reviews and so on.

What did I do?

Utils

  • Write docs
    • How to run?
    • How to contribute?
    • Write the Makefile?
      • Welcome new comers
      • Set Git hooks dir
      • Install cocogitto tools for standardizing commits
  • Write REQUIREMENTS
  • Change the project name
    • From git-stats-bot to dev-works-logger
  • Refactor folder structure
    • +-- main.rs
    • +-- modules
    • +---- git
    • +------ mod.rs
    • +------ models
    • +-------- mod.rs
    • +-------- module1.rs
    • +-------- module2.rs
    • +---- discord
    • +------ mod.rs
    • +------ models
    • +-------- mod.rs
    • +-------- module1.rs
    • +-------- module2.rs
    • +-- utils
    • +---- init
    • +------ mod.rs

Developments

  • Manage env variables with dotenv
  • Fetch data from GraphQL Github with gql_client
  • Research GraphQL
    • Get all recent commits of a repo
    • Get all recent active repos
  • Refactor: instead of using gql_client, I plan to change it to reqwest with json body
    • Create my own request client
  • Research about Git hooks
  • Twitter API
    • Auth
    • Create a tweet
    • Determine a template for tweet
      • Title (depends on the number of CHANGED FILE to generate)
      • Body
        • Total commits in the day, total changed files
      • Tags
      • Create a function to check the tweet's length before tweeting
    • Send an email related to the tweet's status (false/true)
  • Discord
    • Enable Github Webhook for Discord
    • Discord Bot
  • Research CI/CD on Github Action
    • Add script to check Rust before merging PRs
    • Add script to deploy Docker Image to Heroku
    • Improve Deploy script
      • Divide the whole script into pieces
      • Remove some parts being not used
    • Disable CI for now, I plan to do drive the project with another direction.
  • Cronjob
    • Cronjob
  • Docker
    • Build Docker Image
    • Research docker-compose
      • Build a docker image to develop locally
    • Improve Docker Image
      • Create a minimal docker image
      • Cron job
      • ENV variables not found
        • Find a way to get a github name, token on CI
        • Pass env variables when building docker image on CI
  • Deploy to Heroku
  • Plan to deploy to another server (Heroku is not free from 28/11)
    • Docker (Auto build: 5$ per month)
    • GCS
    • Localhost is the best choice for now, until I can find the alt.
  • Send Email SMTP
    • Investigate
  • Implement CLI to trigger some features
    • Overall configurations
      • Github
        • PAC
        • Username
      • [ ]
    • Twitter commands
      • Config Twitter credentials
      • Switch ON/OFF feature
    • Email commands
      • Config Gmail credentials
        • username, password
      • Switch ON/OFF feature
    • Discord commands
      • Config Discord credentials
      • Switch ON/OFF feature
  • Add scripts to cut down the time to deal with some dev parts
    • Docker
      • Build image
      • Run image
      • Exec image
      • Push image to Docker Hub
    • Release
      • Changelog generator
    • Development
      • Run debug
  • Actix web impl (In a long-term)
    • Restructure folder
      • Monorepo
      • docker-compose for building all services
  • Database impl (MongoDB) (In a long-term)

How to run this project?

Install

  • Run Makefile with make -f Makefile

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.