Label to workflow rules and a default workflow are the intake-routes resource: ordered, case-insensitive, first rule wins, seeded with bug to tdd, feature to feasibility, default triage. A write naming an undefined workflow or an empty label is refused. The daemon reads it through the workflow definitions client when pinning a task and at intake. The kind indirection only carried this routing, so it is removed: the per-kind NATS subjects (every consumer already bound archie.task.>) are one subject, the envelope and playbook triggers lose their kind, and x-intake-routes is dropped. The dashboard gets an Issue routing page under Automation; the trigger card reads the same setting.
25 lines
808 B
Go
25 lines
808 B
Go
package workintake
|
|
|
|
import "strings"
|
|
|
|
// SubjectTask is where every issue-intake task is published. Routing to a
|
|
// workflow happens at pin time from the intake-routes setting, so the subject
|
|
// carries nothing about the issue.
|
|
const SubjectTask = "archie.task.issue"
|
|
|
|
// SubjectTaskWildcard matches every task subject.
|
|
const SubjectTaskWildcard = "archie.task.>"
|
|
|
|
// SubjectReactionWildcard matches every reaction subject.
|
|
const SubjectReactionWildcard = "archie.reaction.>"
|
|
|
|
// LabelValue returns the part of a label after its last "::", so a scoped
|
|
// label such as "kind::bug" matches the rule for "bug".
|
|
func LabelValue(label string) string {
|
|
trimmed := strings.TrimSpace(label)
|
|
if i := strings.LastIndex(trimmed, "::"); i >= 0 {
|
|
return strings.TrimSpace(trimmed[i+len("::"):])
|
|
}
|
|
return trimmed
|
|
}
|