Coder Social home page Coder Social logo

repo_housekeeper's Introduction

Repo Housekeeper

This repository contains some simple tools for helping to keep the puppetlabs/* repository namespace cleaned up and welcoming. For example, the first task is a weekly email reminder to our [email protected] mailing list with a sampling of some of our oldest open pull requests and some instructions on cleaning them up.

Using the tools

Note: Right now, there's only a few tasks; stale_pulls that calls out old stagnant pull requests, and codeowner_coverage that just looks for public repositories without CODEOWNERS files.

The tasks are self-configured in the repository as config.yaml. You'll also need the Community Team sendgrid token for sending mail. You can get that from the Community Team for testing, but when running as a GitHub action, it's accessible as the SENDGRID_PASSWORD secret.

Running during development

Make sure to install the required gems first:

$ bundle install --path vendor/bundle

To print the email to stdout instead of actually sending it, append debug=true to the end of your command line. For example, this is how you would run the stale_pulls task:

$ bundle exec rake stale_pulls debug=true

If you'd like to test sending an email, you will need to export some environment variables. Note that many tasks will expect other environment variables set as well. This is how you'd run that same stale_pulls task and send a test email:

$ export SENDGRID_PASSWORD=<sendgrid token -- get this from the Community Team>
$ export EMAIL_ADDRESS='[email protected]'
$ bundle exec rake stale_pulls

Tasks

Configuration:

Tasks are configured via environment variables in the workflow.

  • GITHUB_TOKEN: comes automatically with the workflow and allows higher API rate limits
  • EXTENDED_TOKEN: a personal access token created on @binford2k's account that allows org-team access.
  • SENDGRID_PASSWORD: configured as a GitHub secret
  • EMAIL_ADDRESS: the email address to send the report to.

stale_pulls

This task is very simple. It gets a list of the 100 oldest open pull requests in the entire @puppetlabs namespace. Then it takes a random sampling of 15 of those and emails a report. The sampling ensures that it's not just reporting about the same PRs every week.

The email content is configured by html and text format templates.

codeowner_coverage

This task just iterates all public repositories and builds a list of those without CODEOWNERS. Right after we did the push to get all the repos covered, that list should be empty. But over time as people create new repos, this task will help keep that coverage. This task requires the escalated privileges of the EXTENDED_TOKEN token.

The email content is configured by html and text format templates.

support_pulls

This task generates a list of all open pull requests made by members of the support team on repositories in the puppetlabs namespace. This helps them keep track of weekly work. This task requires the escalated privileges of the EXTENDED_TOKEN token. Owned/requested by:

The email content is configured by html and text format templates.

cloud_ci

This task generates a report of all reports with a release.yml workflow. Many (but not all) of these will be using the CloudCI release pipeline maintained by IAC. This report is used to help track/audit the userbase. This task requires the escalated privileges of the EXTENDED_TOKEN token. Owned/requested by:

The email content is configured by html and text format templates.

missing_licenses

This task finds all public repositories that don't have an explicit license associated with them. It locates a license by the presence of a file in the root of the repository with a name that starts with "license", case insensitive.

The email content is configured by html and text format templates.

repo_housekeeper's People

Contributors

binford2k avatar mwaggett avatar livinginsyn avatar nmburgan avatar puppet-sec-bot avatar mikaelsmith avatar impl avatar

Watchers

James Cloos avatar  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.