diff --git a/proposals/0066-label-automation-tooling.md b/proposals/0066-label-automation-tooling.md new file mode 100644 index 00000000..ee0ef17c --- /dev/null +++ b/proposals/0066-label-automation-tooling.md @@ -0,0 +1,339 @@ +# Label Automation Tooling + +* **Owners:** + * `@jan--f` + +* **Implementation Status:** `Not implemented` + +* **Related Issues and PRs:** + * [PROM-65](https://github.com/prometheus/proposals/pull/65) + +* **Other docs or links:** + * [Prom-Prow Bot Implementation](https://github.com/jan--f/prom-prow) (to be + moved to `prometheus` org) + * [GitHub Actions: Add Labels to Issues](https://docs.github.com/en/actions/tutorials/manage-your-work/add-labels-to-issues) + * [CNCF Hosted Tools](https://contribute.cncf.io/resources/services/hosted-tools/) + * [Kubernetes Prow](https://docs.prow.k8s.io/) + * [GitHub CODEOWNERS Documentation](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) + +> TL;DR: This proposal recommends using a custom lightweight chat-ops bot +> (prom-prow) for Prometheus repositories. The bot provides Prow-style commands +> (`/lgtm`, `/cc`, `/label`, `/hold`) without the complexity of OWNERS files or +> running a full Prow instance. It uses GitHub's native collaborator permissions +> for command authorization and CODEOWNERS for automatic review assignment, +> providing bidirectional sync between `/lgtm` commands and GitHub UI approvals. + +## Why + +The label system proposed in PROM-65 introduces structured labels for issue and +PR workflow management. However, manually applying and managing these labels +would create significant overhead for maintainers and contributors. Automation +is essential to make the label system practical and effective. + +The Kubernetes ecosystem has demonstrated that chat-ops style label management +(using `/label`, `/approve`, `/lgtm` commands in PR comments) can provide an +efficient and intuitive workflow for maintainers. This approach should be +adopted for Prometheus projects. + +### Pitfalls of the current solution + +Currently, Prometheus projects rely entirely on manual label application: + +- Maintainers must navigate GitHub's UI to apply labels +- Difficult to enforce consistent labeling practices +- No automatic labeling based on PR content or actions + +## Goals + +Goals and use cases for the solution as proposed in [How](#how): + +* Enable chat-ops style label management through PR comments +* Provide a lightweight, maintainable automation solution +* Support the label taxonomy defined in PROM-65 +* Align with CNCF's preference for GitHub Actions where possible + +### Audience + +This proposal targets: + +- Prometheus maintainers and contributors who need efficient label management + tools + +## Non-Goals + +* Running a full Kubernetes-based Prow instance +* Implementing all Prow plugins and features +* Automatic merge functionality (at least initially) +* Replacing manual label operations + +## How + +### Proposed Architecture + +This proposal recommends using the **prom-prow** bot, a custom lightweight chat-ops bot designed specifically for Prometheus repositories. The bot is implemented as a GitHub Action and provides Prow-style commands without requiring OWNERS files or running a full Prow instance. + +### Prom-Prow Bot + +The **prom-prow bot** is a custom GitHub Action that provides Prow-style chat-ops commands optimized for Prometheus workflows. Unlike existing Prow GitHub Actions, prom-prow is designed to work seamlessly with GitHub's native permission system and CODEOWNERS without requiring OWNERS files. + +#### Supported Commands + +The following commands are available in PR comments: + +- **`/lgtm`**: Approve the PR + - Anyone: Submits an approving GitHub review (if repository is configured to + allow reviews by Actions) + - Collaborators: Also adds `review/lgtm` label + - PR authors cannot approve their own changes +- **`/lgtm cancel`**: Cancel approval + - Anyone: Dismisses the user's review + - Collaborators: Also removes `review/lgtm` label (only if no other collaborators have approved) +- **`/cc @user1 @user2`**: Request reviews from specified users (requires write access) +- **`/label