Files
pipewright/examples/issue_triage/graph.yaml
T

103 lines
2.3 KiB
YAML

name: issue-triage
description: Label GitHub-style issues and route the urgent bugs
nodes:
issues:
type: source.file
params:
path: data/issues.jsonl
kind: issue
heuristics:
type: label.expr
params:
labels:
has_traceback: re(r'traceback|sigsegv|segfault|exception|error:', payload.body)
has_code: '''```'' in payload.body'
words: words(payload.body)
engagement: payload.comments + payload.reactions
inputs:
in: issues.out
substantive:
type: filter.expr
params:
expr: labels.words >= 8
inputs:
in: heuristics.out
classify:
type: llm.label
params:
model: labeler
prompt: |-
Classify this issue.
Title: {{ payload.title }}
{{ payload.body }}
Severity: 0 = cosmetic, 1 = minor, 2 = major (broken feature), 3 = critical (crash, data loss, security, many users blocked).
system: You triage issues for a software project. Be concise and literal.
labels:
category:
type: string
enum:
- bug
- feature
- question
- docs
severity:
type: integer
minimum: 0
maximum: 3
summary:
type: string
maxLength: 160
inputs:
in: substantive.out
route:
type: route.expr
params:
routes:
urgent: labels.category == 'bug' and (labels.severity >= 2 or labels.has_traceback)
features: labels.category == 'feature'
default: other
inputs:
in: classify.out
export_urgent:
type: sink.jsonl
params:
path: out/urgent.jsonl
fields:
- key
- payload.title
- labels.category
- labels.severity
- labels.summary
- labels.engagement
inputs:
in: route.urgent
export_features:
type: sink.jsonl
params:
path: out/features.jsonl
fields:
- key
- payload.title
- labels.category
- labels.severity
- labels.summary
- labels.engagement
inputs:
in: route.features
export_other:
type: sink.jsonl
params:
path: out/other.jsonl
fields:
- key
- payload.title
- labels.category
- labels.severity
- labels.summary
- labels.engagement
inputs:
in: route.other