Git Product home page Git Product logo

ghstat's Introduction

ghstat

Snap Status

ghstat is a small utility I wrote for gathering metrics about hiring pipelines at Canonical. If you aren't a Hiring Lead at Canonical, there is very little chance this is interesting to you 😉.

The tool uses go-rod under the hood to drive a headless browser, which can interact with both the Ubuntu One SSO, and subsequently Greenhouse.

Installation

The easiest way to consume ghstat is using the Snap:

sudo snap install ghstat

Or you can clone, build and run like so:

git clone https://github.com/jnsgruk/ghstat
cd ghstat
go build -o ghstat main.go
./ghstat

Usage

The output of ghstat --help can be seen below. In general, once the configuration file is in place, you'll likely just invoke ghstat.

On the first launch, you'll need to enter your Ubuntu One login, password and one-time password. After that, the cookies created will be stored for future use, so you'll only need to reauthenticate once the session expires.

A utility for gathering role-specific statistics from Greenhouse.

ghstat provides automation for gather statistics about a given Hiring Lead and the roles
they manage as part of Canonical's hiring process.

This tool is configured using a single file in one of the following locations:

  - ./ghstat.yaml
  - $HOME/.config/ghstat/ghstat.yaml

The configuration file should specify a top-level 'leads' list:

    leads:
    - name: Joe Bloggs
        roles:
        - 1234567
        - 8910111

By default, ghstat will try to reuse an active Greenhouse session by reading the cookies
from a previous invocation. In the case that this isn't possible, it will prompt
for Ubuntu One credentials. To streamline login, the following environment variables can be set:

  - U1_LOGIN - the username/email for Ubuntu One login
  - U1_PASSWORD - the password for Ubuntu One login

For more information, visit the homepage at: https://github.com/jnsgruk/ghstat

Usage:
  ghstat [flags]

Flags:
  -c, --config string   path to a specific config file to use
  -h, --help            help for ghstat
  -l, --leads strings   filter results to specific hiring leads from the config
  -o, --output string   choose the output format ('pretty', 'markdown' or 'json') (default "pretty")
  -v, --verbose         enable verbose logging
      --version         version for ghstat

Configuration

The tool takes some simple configuration as a YAML file, which it expects to find either in the current working directory, or in ~/.config/ghstat/ghstat.yaml:

# (Required): A list of Hiring Leads
leads:
  # (Required) The name or alias of the Hiring Lead in question
  - name: <hiring lead name>
    # (Required) The list of role IDs they Hiring Lead manages. These IDs can
    # be gathered by navgating to the role Dashboard, and looking at the ID in
    # the URL, for example: https://canonical.greenhouse.io/sdash/<ID here>
    roles:
      - <number>

An example config file can be seen below:

leads:
  - name: Joe Bloggs
    roles:
      - 1234567
      - 8910111

  - name: A.N. Other
    roles:
      - 1213141
      - 5161718
      - 1920212
      - 2232425

Development / HACKING

This project uses goreleaser to build and release.

You can get started by just using Go, or with goreleaser:

# Clone the repository
git clone https://github.com/jnsgruk/ghstat
cd ghstat

# Build/run with Go
go run main.go

# Run the tests
go test ./...

# Build a snapshot release with goreleaser (output in ./dist)
goreleaser build --rm-dist --snapshot

ghstat's People

Contributors

jnsgruk avatar dependabot[bot] avatar simskij avatar

Stargazers

Loïc Minier avatar  avatar Jerzy Husakowski avatar

Watchers

 avatar  avatar

Forkers

simskij

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.