Skip to content

Build qe CLI with a gh module for label management #323

@mmcky

Description

@mmcky

Summary

Build a qe command-line tool with a gh module to manage GitHub
configuration for QuantEcon repositories — starting with labels. The tool
should hold a schema of the labels we use as a single source of truth, and
provide tooling to apply that schema to a given repo (and across repos).

The label set below is a starting point only. We will run team-focused
surveys to decide the best set before treating any of it as final.

Motivation

Labels have drifted badly across our lecture repos — roughly 70 distinct label
names
across six repos (lecture-python-intro, lecture-python-programming,
lecture-python.myst, lecture-python-advanced.myst, lecture-dp,
lecture-jax), with only bug, in-work, and ready present in all six. There
are near-duplicate variants (automated issue / automated-issue / automated,
linkchecker / broken-links, high-priority / high priority), redundant
triple-tagging by bots, and stale one-off project labels.

We want one shared, consistent vocabulary and a repeatable way to apply and
audit it
, owned by a first-party tool rather than ad-hoc scripts or a
third-party action.

Proposal: qe gh labels

A standalone Python CLI that shells out to gh for all GitHub calls, so
it inherits existing gh auth (no PAT to store or rotate) and keeps GitHub's own
CLI doing the API work.

qe gh labels sync     # apply the schema to one/many repos  (--repos --prune --dry-run)
qe gh labels check    # read-only drift report; non-zero exit if a repo diverges (CI-friendly)
qe gh labels export   # dump a repo's current labels to a schema file (bootstrap / backup)

1. A label schema (single source of truth)

A version-controlled manifest — list of labels with name, color,
description, and optional aliases (old names to rename from, preserving
the issue/PR tags on existing items). Example shape:

- name: "enhancement"
  color: "a2eeef"
  description: "New content or an improvement to existing material"
  aliases: ["improve", "new lecture", "lecture"]

2. Tooling to apply it to a repo

Per label, per repo: update if the canonical name exists; else rename the first
existing alias (history-preserving); else create. With --prune, labels not in
the schema (and not consumed as an alias) are removed, so a repo converges to
exactly the schema. --dry-run previews every change.

Starting-point label set (PROVISIONAL — pending team surveys)

A 16-label set proposed as a discussion starting point, grouped by dimension.
Colour conveys meaning where useful (priority = heat scale, automation = grey);
the PR lifecycle (WIP → ready → in review) is left to native GitHub PR
features
(Draft → Ready for review → review state) rather than labels.

Group Labels
Type bug, enhancement, documentation, maintenance, question
Community good first issue, help wanted
Priority high-priority, low-priority (unlabelled = normal)
Workflow do-not-merge
Automation/CI automated, broken-links, build-failure, dependencies
Meta duplicate, wontfix

This is a conversation starter, not a decision. The point of the schema +
tooling is that whatever the team lands on becomes trivial to apply everywhere.

Open questions for the team

  • What is the right label set? Run a short survey of maintainers across the
    lecture repos. Which dimensions matter (type / priority / area / status)? Do we
    want an area:* split (content vs code)? Keep a ready label, or rely on the
    native Review-requested dashboard?
  • Scope of the schema — one global set for all lecture repos, or a base set
    plus per-repo extensions?
  • Automation contract — our label-applying actions (action-link-checker,
    action-check-warnings, action-style-guide) should emit only canonical
    labels; fold this check into qe gh bots check later.
  • Distributionuv tool install / pipx from a new QuantEcon/qe-cli?

Suggested next steps

  • Agree this direction and create QuantEcon/qe-cli.
  • Define the schema format and commit a first labels.yml (the provisional
    set above, explicitly marked draft).
  • Implement qe gh labels sync / check / export with --dry-run.
  • Run a maintainer survey to finalise the label set.
  • Apply the agreed schema across all lecture repos; wire check into CI as a
    drift guard.

Context: this consolidates a label-unification audit + proposal already drafted
(full inventory, migration map, and a working reference implementation of the
sync engine). Happy to attach those to the qe-cli repo once it exists.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions