Skip to content

Sinatra application for setting up a developer training tracking repo

License

Notifications You must be signed in to change notification settings

umts/dev-training-web

Repository files navigation

Introduction

This application is a Sinatra-based web app for authorizing our developer trainees with GitHub and then creating a developer-training tracking repository for them on GitHub.

The training repo is created in the trainee's account, and select staff are added as "outside collaborators" to it.

Setup

Clone the repository and run the setup script

script/setup

Configuration

application.yml

You'll need an OAuth app on GitHub in order to interact with the GitHub API. See "Creating an OAuth App" for more information. For local development, create an app with an "authorization callback URL" of http://localhost:9292/auth/github/callback.

Finally, if you want to interact with the GitHub API in the developer console, You can create a Personal Access Token (PAT). This is optional, but if it's defined in the config, then @training in the console will be initialized with that token.

collaborators.yml

This is just a YAML array containing the GitHub usernames that will be added to a trainee's repository as collaborators.

qualifications.yml

Each YAML document in this file corresponds to an issue that the trainee will be assigned to complete. Each document can have the following fields:

  • title: This will be the issue title, it's required
  • description: This will be the issue body
  • subtasks: This is an array of "sub-tasks" that will be used to construct a GitHub-flavored Markdown task-list appended to the issue body.

This file is kept in source-control with the intention that changes to our training process can go through the normal PR, review, merge process.

README.md.erb

This is the template used for new training repositories. It's passed to an instance of DevTraining::Readme, see the documentation for more information.

Running the App

script/server

will start the development server using Puma. Alternately, it's a Rack app, so any other rack-compatible server will work if pointed at the config.ru file.

Developing

Developer Console

script/console

will load the ApplicationConfiguration, require the DevTraining libraries, and (if possible) initialize a DevTraining with your PAT to @training.

Docs

API Documentation is generated with RDoc:

bundle exec rake rdoc

The compiled documentation is available in the GH pages environment for this project.

Tests and Linting

RSpec, Rubocop, and Haml-Lint are in the Gemfile. You can run then the usual way. Alternatively, the default Rake task,

bundle exec rake

will run all of them (stopping on the first tool to fail).