Skip to content

tholder/call-rota

 
 

Repository files navigation

#Call Rota Generate on-call rotas given information about people.

##Purpose

Generates a collection of people who can be on call for second line for a week, following certain rules:

  • No more than 1 person from the same team
  • At least 1 person with production access (that isn't web operations)
  • Has 2 developers and 1 web operations person on it

##Nomenclature

  • rota_skill_group indicates whether a person has a development or a web operations skillset.
  • RotaWeek is the current output produced by a RotaWeekBuilder. This exposes three methods:
    • web_ops - the person with a web operations speciality. It is a requirement to have at least one web operations person on the rota each week.
    • dev - the person with a development speciality and production access. It is a requirement to have one developer with production access on the rota each week.
    • supplemental_dev - another person with a development speciality. This person may or may not have production access.

##Dependencies

No external services.

The input format has been designed to match the current data from the Google Spreadsheets used at GDS to manage on-call rotas.

##Running the application

require 'people_collection_factory'
require 'rota_week_builder'

#people_inputs and deploy_access_inputs in the format described below
people = PeopleCollectionFactory.new(people_inputs, deploy_access_inputs)

rota_week = RotaWeekBuilder.new(people).call

##Running the test suite

$ bundle exec rake

##Application structure A collection of people is generated by a PeopleCollectionFactory, which is then used by a RotaWeekBuilder to build a RotaWeek.

A PeopleCollectionFactory takes in two sets of input data.

###people_inputs An array where each element in the array describes a person that can be placed in the rota. Each element must follow the below format:

{
  full_name: "Tom Russell",
  use_name: "Tom R", # Unique shortened identifier for a person
  team: "User Formats", # Free text, uniquely identifies the team
  rota_skill_group: "developer", # Either 'developer' or 'webops'
}

###deploy_access_inputs An array where each element in the array gives the use_name of a user with production access. Each element must follow the below format:

{
  use_name: "Tom R", # Unique shortened identifier for a person.
}

##Future work

  • Add CSV parsing for input data.
  • Add CSV output.
  • Add bin script to run the application.
  • Add rule: no more than 1 tech lead at a time -- a canonical source of who is and is not a tech lead does not appear to be available yet.
  • Rotate people fairly: this requires historical knowledge of who has been on call, and whether they were webops, dev or supplemental_dev.
  • Generate more than one week at a time.

About

A script to generate on-call rotas

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 95.9%
  • Shell 4.1%