https://github.com/coder/labeler
A GitHub app that labels your issues for you
https://github.com/coder/labeler
Last synced: 15 days ago
JSON representation
A GitHub app that labels your issues for you
- Host: GitHub
- URL: https://github.com/coder/labeler
- Owner: coder
- Created: 2024-02-27T20:10:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-11T23:58:35.000Z (4 months ago)
- Last Synced: 2025-04-02T22:35:29.595Z (23 days ago)
- Language: Go
- Homepage:
- Size: 115 KB
- Stars: 26
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# labeler
`labeler` is a GitHub app that automatically labels newly created issues for you
based on your past labelling decisions.> [!IMPORTANT]
> You can install coder-labeler on your repo
> [**here**](https://github.com/marketplace/coder-labeler).
We currently use it on [`coder/coder`](https://github.com/coder/coder) and
[`coder/code-server`](https://github.com/coder/code-server).The labeler is well-suited to manage labels that _describe_ or _reduce_ the
semantic information of an issue. For example, labels like `bug`, `enhancement`,
are self-evident from the contents of an issue. Often, a tracker will use labels
that add information to an issue, e.g. `wontfix`, `roadmap`. These _inscriptive_
labels should be disabled in your configuration.[#5](https://github.com/coder/labeler/issues/5) tracks the automatic disabling
of inscriptive labels.## Configuration
The labeler's primary configuration is your label descriptions. This way, the labeler interprets your label system in the same way a human would.
Additionally, the `labeler` reads your `.github/labeler.yml`
file for a list of Regex exclusions. Here's an example:```yaml
# .github/labeler.yml
exclude:
- good first issue
- customer.*$
```[#4](https://github.com/coder/labeler/issues/4) tracks the creation
of a dashboard for debugging configuration.## Architecture
```mermaid
sequenceDiagram
participant GitHub
participant Labeler as @coder-labeler
participant AI as OpenAI
GitHub->>Labeler: [Create|Reopen] Issue event
note over Labeler: Load repo data, all labeling is stateless
Labeler->GitHub: Get all repo issue labels
Labeler->GitHub: Get last 100 repo issues
Labeler->AI: Generate setLabels via GPT completion
Labeler ->> GitHub: Add labels to issue
```The labeler uses a GPT-4o completion with the past 100 opened issues instead of
a more complex vector DB / embedding system. This is because of the proven
accuracy of @cdr-bot on coder/coder and the fact that the completion approach lets us remove
the need for a DB.### Context construction
See [aicontext.go](./aicontext.go) for the code that constructs the GPT context.