Repository Cohorts
How OSPOs Can Programmatically Categorize All Their Repositories
#ossummit
@
Live Demos of Repository Cohorts to Try During Talk or After
Demo that takes any GitHub organization but only has partial data https://aka.ms/RepositoryCohorts/Demo/YourGitHubOrg
�Demo using Microsoft repository metadata, no data gaps:
What Are Repository Cohorts
Repository Cohorts Definition
Repository Cohorts - In Practice
For each repository, each cohort has a value of either true or false. A continuous dimension like “age” will be split into a number of cohorts. In a group of cohorts, like age, only one cohort will be true. Other cohorts are singular like “does repo use GitHub Actions”.
| cohort_age_ Baby 30d | cohort_age_ Toddler 30to90d | cohort_age_ Teen 90to365d | cohort_age_ Adult 365to1095d | cohort_age_ senior More1095d | Cohort_ githubActions |
Repo A | False | False | False | True | False | True |
Repo B | True | False | False | False | False | True |
What Problems Do Repository Cohorts Solve?
How Do Repository Cohorts Help?
Instead of… | Repository Cohorts... |
..manually reading repositories to understand what they’re about | ..uses metadata to work at any scale |
..creating queries against raw metadata for each project | ..creates ability to identify cohorts once, then reuses in many projects |
..having to think about combinations of raw values | ..are easy to remember higher order representations |
Repository cohorts improve time to insights when working with repository metadata by reducing number of steps required as well as cognitive load.
Example Microsoft Repository Cohort Groups
Two Microsoft Repositories, Only True Cohorts
*this was true at one point in time
CMS Repository Cohort Pipeline
Open Source Repository Maturity Models
Repository Templates
Outbound Checklists
Cookiecutter
Repolinter Configs
Establishing a Baseline: Repo Metrics, Maturity Models, Templates, and Checklists
@ 4:10-4:50pm RM447-448 https://ossna2024.sched.com/event/1aBPh
CMS Repository Cohort Definitions: Maturity Model Tiers
Level | Name | Purpose | Description |
Tier 0 | Private Repository | Experimental, Historical | Project is private, usually with a single developer. Typically working projects, example code, and early prototypes. |
Tier 1 | One-Time Release | Publication for Informational, Accountability, Transparency Purposes | Project released publicly, but without planned future activity or maintenance from original author(s). |
Tier 2 | Close Collaboration | Collaboration with smaller, mostly internal teams | Project within a team or Operational Division (OpDiv), Internal Repo for Innersource-style work |
Tier 3 | Working in Public | Collaboration in the open with smaller, semi-open teams | Project developed Open Source by CMS or a CMS contractor, public website hosted on GitHub, tool or utility used in CMS official business by the public. Limited external contribution, CMS-led (by choice or by statute.) |
Tier 4 | Community Governance | Collaboration broadly in public | Project donated to or stewarded by an external community, open standard that welcomes public input, mature open source project that purposefully develops an open governance structure. |
CMS Repository Cohort Definitions: Maturity Model Tiers
Public Repo on GitHub!
cookiecutter cmdline tool
CMS Repository Cohort Definitions: Nadia Labels
In her book “Working in Public” by Nadia Asparouhova classifies repositories into four cohorts:
CMS Repository Cohort Definitions: Nadia Labels in Augur!
See Augur API Documentation for nadia_project_labeling_badge:�https://github.com/chaoss/augur/blob/main/augur/api/metrics/repo_meta.py#L205
How CMS Creates Repository Cohorts (1/3): Repo Metrics
Cohort Reuse
DSACMS Metrics scripts pulls Augur.io API endpoint to get Project Label and Color, and uses Shields.io to create a project badge on a Repo Report
Metadata Collection
When we can, we ‘hack upstream’ and use existing open source tools. ��In this case, we are using CHAOSS’ Augur project
Augur.io Ingests public repository data and history from GitHub.com
Cohort Creation
Augur.io uses previously mentioned nadia_project_category() to categorize projects based on methodology identified by CHAOSS OSPO Metrics WG members (Shout-out Justin Gosses!)
How CMS Creates Repository Cohorts (3/3): Repolinter
https://github.com/todogroup/repolinter
Repolinter is a tool maintained by the TODOGroup for checking repositories for common open source issues, using pre-defined rulesets. This can be run stand-alone as a script, pre-commit in your IDE, or post-commit or within CI/CD systems!
✔ = Pass
✖ = Fail
⚠ = Warn
Thanks to Chan and Satwic at the Comcast OSPO, we now have repolinter.json configs and rules that map to each Tier of our Open Source Repository Maturity Model!
Demo: CMS.gov Open Source Repository Metrics
How Microsoft Creates Repository Cohorts
Cohort Reuse
Repository cohorts get reused as a Kusto query that gets combined with other queries as well as in PowerBI dashboards and Jupyter notebooks.
Metadata Collection
A centralized data team is responsible for metadata collection across all public & internal code platforms.
They make available upon internal request multiple tables of metadata for public GitHub repos as part of their Kusto cluster, a type of cloud database.
Cohort Creation
Microsoft OSPO has an internally visible catalog of Kusto queries, including a query for generating repository cohorts that uses the collected GitHub metadata as well as an export of ClearlyDefined.io to determine which repos build packages.
Microsoft Examples of Using Repository Cohorts
Demographics: How many of each repository cohort?
Representative sample: Select repositories for interviews or manual investigations.
Snapshot: When a potential new policy only applies to a subset of repositories, we can use cohorts to produce a snapshot description of the range of activity, community shape, etc. of that subset to help design effective policy and outreach.
Demo A: Repository Cohorts Applied to Microsoft repositories
Count of Repos
Demo B: See Repository Cohorts for your GitHub Organization
Demo: All Cohort Definitions are in a JSON.
Please submit PRs
To the cohort.js file in the Microsoft demo @
Conclusions
Live Demos of Repository Cohorts
Questions & Pull Requests
Demo that takes any GitHub organization but only has partial data https://aka.ms/RepositoryCohorts/Demo/YourGitHubOrg
�Demo using Microsoft repository metadata, no data gaps:
Any Repository Cohorts Questions?