apiVersion: v1
kind: ConfigMap
metadata:
  name: triage-party-config-release
  namespace: triageparty-release
data:
  # The contents of config/config.yaml
  config.yaml: |
    settings:
      name: kubernetes
      min_similarity: 0.8
      repos:
        - https://github.com/kubernetes/kubernetes
        - https://github.com/kubernetes/release
        - https://github.com/kubernetes/sig-release

      # Who should automatically be considered a project member?
      # See: https://developer.github.com/v4/enum/commentauthorassociation/
      # Default is "collaborator, owner, member", unless "members" is set
      member-roles:
      # - collaborator
      # - owner
      # - member

      # Who else do we consider to be a project member? Default is empty.
      # members:
      # - k8s-ci-robot

    collections:
      - id: milestone
        name: Current Milestone
        dedup: true
        description: >
          A Kanban visualization of milestones, showing the flow of issues through each stage.
        rules:
          - milestone-not-started
          - milestone-assignee-updated
          - milestone-pr-needs-review
          - milestone-pr-needs-work
          - milestone-pr-needs-merge
          - milestone-recently-closed

      - id: sig-release
        name: Sig Release Triage
        dedup: true
        description: >
          Dashboard tracking the current status of all issues and PRs targeting the current release (1.22).
        rules:
          - sig-release-issues
          - sig-release-prs

      - id: release-team
        name: Release Team
        dedup: true
        description: >
          Dashboard tracking the current status of all issues and PRs for the release team.
        rules:
          - release-team-prs
          - release-team-issues

      - id: release-engineering
        name: Release Engineering Team
        dedup: true
        description: >
          Dashboard tracking the current status of all issues and PRs for the release engineering.
        rules:
          - release-engineering-issues
          - release-engineering-prs

      - id: ci-signal
        name: CI Signal
        dedup: true
        description: >
          Dashboard tracking CI Signal issues.
        rules:
          - kind-flake
          - kind-failing-test

    rules:
      ### Milestone ###
      milestone-issues:
        name: "v1.22 Issues"
        resolution: "Add a milestone/ label"
        type: issue
        filters:
        - milestone: "v1.22"

      ### Milestone Kanban ###
      milestone-not-started:
        name: "Not started"
        type: issue
        filters:
          - tag: open-milestone
          - tag: "!assignee-updated"
          - tag: "!(assignee-open-pr|assignee-closed-pr)"
      milestone-assignee-updated:
        name: "In Progress"
        type: issue
        filters:
          - tag: open-milestone
          - tag: "assignee-updated"
          - tag: "!(pr-changes-requested|pr-reviewer-comment|pr-unreviewed|pr-new-commits|pr-approved|pr-changes-requested)"
      milestone-pr-needs-merge:
        name: "PR needs Merge"
        type: issue
        filters:
          - tag: open-milestone
          - tag: "(pr-approved|pr-approved-but-pushed)"
      milestone-pr-needs-review:
        name: "PR needs Review"
        type: issue
        filters:
          - tag: open-milestone
          - tag: "(pr-unreviewed|pr-new-commits)"
      milestone-pr-needs-work:
        name: "PR needs work"
        type: issue
        filters:
          - tag: open-milestone
          - tag: "(pr-changes-requested|pr-reviewer-comment)"
      milestone-recently-closed:
        name: "Finish Line"
        type: issue
        filters:
          - tag: open-milestone
          - state: closed
          - updated: -30d

      ### Daily Triage ####
      issue-needs-priority-overdue:
        name: "Unprioritized issues older than 7 days"
        resolution: "Add a priority/ or triage/ label"
        type: issue
        filters:
          - label: "!priority/.*"
          - label: "!triage/.*"
          - created: +7d

      issue-needs-comment-overdue:
        name: "Uncommented older than 7 days"
        resolution: "Add a priority/ or triage/ label"
        type: issue
        filters:
          - tag: "!commented"
          - tag: "recv"
          - created: +7d

      issue-soon-overdue:
        name: "Important soon, but no updates in 90 days"
        resolution: "Downgrade to important-longterm"
        type: issue
        filters:
          - label: "priority/important-soon"
          - updated: +90d

      issue-longterm-overdue:
        name: "Important longterm, but no updates in 180 days"
        resolution: "Downgrade to backlog"
        type: issue
        filters:
          - label: "priority/important-longterm"
          - updated: +180d

      # Don't leave code reviews hanging
      pr-reviewable:
        name: "Pull Requests: Review Ready"
        resolution: "Review requests or mark them as do-not-merge/work-in-progress"
        type: pull_request
        filters:
          - label: "!do-not-merge.*"
          - label: "!needs-rebase"
          - label: "!cncf-cla: no"
          - tag: "!requested-changes"
          - tag: "!send"
          # Temporarily workaround inability to track PR eligibility
          - updated: +1d

      # Issues missing initial feedback
      issue-needs-kind:
        name: "Unkinded Issues"
        resolution: "Add a kind/ label"
        type: issue
        filters:
          - label: "!kind/.*"

      issue-needs-priority:
        name: "Unprioritized Recent Issues"
        resolution: "Add a priority/ or triage/ label"
        type: issue
        filters:
          - label: "!priority/.*"
          - label: "!triage/.*"

      issue-needs-comment:
        name: "Uncommented Recent Issues"
        resolution: "Add a comment"
        type: issue
        filters:
          - tag: "!commented"
          - tag: "recv"
          - created: -7d

      # Issues that may need reprioritized
      issue-new-with-reactions:
        name: "New, has multiple reactions, but not important-soon"
        resolution: "Check if issue should be prioritized as important-soon"
        type: issue
        filters:
          - reactions: ">2"
          - created: -10d
          - tag: "!send"
          - label: "!priority/important-soon"

      issue-new-with-many-commenters:
        name: "New, has multiple commenters, but not important-soon"
        resolution: "Check if issue should be prioritized as important-soon"
        type: issue
        filters:
          - commenters: ">3"
          - created: -10d
          - tag: "!send"
          - label: "!priority/important-soon"

      # Don't forget our users
      issue-updated-needs-info:
        name: "needs information, has update"
        resolution: "Comment and remove triage/needs-information tag"
        type: issue
        filters:
          - label: triage/needs-information
          - tag: recv

      issue-updated-has-question:
          name: "Recently updated issue has a question"
          resolution: "Add an answer"
          type: issue
          filters:
            - tag: recv-q
            - label: "!triage/needs-information"
            - tag: "!member-last"
            - tag: "!contributor-last"
            - responded: +3d
            - updated: -7d

      ####### Weekly Triage #########
      # SLO nearing
      issue-near-soon-overdue:
        name: "Important soon, but no updates in 60 days"
        resolution: "Downgrade to important-longterm"
        type: issue
        filters:
          - label: "priority/important-soon"
          - updated: +60d

      issue-near-longterm-overdue:
        name: "Important longterm, but no updates in 120 days"
        resolution: "Downgrade to backlog"
        type: issue
        filters:
          - label: "priority/important-longterm"
          - updated: +120d

      # issues needing reprioritization
      many-reactions:
        name: "many reactions, low priority"
        resolution: "Upgrade to priority-soon, priority-longterm, or longterm-support"
        filters:
          - reactions: ">3"
          - reactions-per-month: ">0.75"
          - label: "!priority/important-soon"
          - label: "!priority/important-longterm"
          - label: "!long-term-support"

      many-commenters:
        name: "many commenters, low priority"
        resolution: "Upgrade to priority-soon, priority-longterm, or longterm-support"
        filters:
          - commenters: ">2"
          - commenters-per-month: ">1.9"
          - created: "+30d"
          - label: "!priority/important-soon"
          - label: "!priority/important-longterm"
          - label: "!long-term-support"

      issue-zombies:
        name: "Screaming into the void"
        resolution: "Reopen, or ask folks to open a new issue"
        type: issue
        filters:
          - state: closed
          - updated: -7d
          - tag: recv
          - comments-while-closed: ">1"

      # Issues needing closure
      issue-stale-needs-info:
        name: "Needs information for over 2 weeks"
        resolution: "Close or remove triage/needs-information label"
        type: issue
        filters:
          - label: triage/needs-information
          - updated: +13d

      issue-stale-support:
        name: "Support request over 30 days old"
        resolution: "Close, or add to triage/long-term-support"
        type: issue
        filters:
          - label: kind/support
          - label: "!long-term-support"
          - updated: +29d

      lifecycle-rotten:
        name: "Issues nearing expiration"
        resolution: "Close or label as frozen"
        filters:
          - label: lifecycle/rotten

      # PR's needing closure
      pr-approved-stale:
        name: "Pull requests: Approved and getting old"
        type: pull_request
        filters:
          - label: "!do-not-merge.*"
          - label: "!needs-rebase"
          - label: "approved"
          - updated: +5d

      pr-unapproved-stale:
        name: "Pull Requests: Stale"
        resolution: "Add comment and/or close PR"
        type: pull_request
        filters:
          - created: +20d
          - updated: +5d

      # People with questions
      issue-has-question:
        name: "Overdue answers for a question"
        resolution: "Add a comment"
        type: issue
        filters:
          - tag: recv-q
          - label: "!triage/needs-information"
          - tag: "!member-last"
          - tag: "!contributor-last"
          - responded: +6d

      issue-updated-support:
        name: "Updated support requests"
        resolution: "Move out of support, or add a comment"
        type: issue
        filters:
          - tag: recv
          - label: "!triage/needs-information"
          - tag: "!member-last"
          - tag: "!contributor-last"
          - responded: +6d

      features-old:
        name: "Features that have not been commented on within 90 days"
        resolution: "Comment or close the issue"
        type: issue
        filters:
          - responded: +90d
          - created: +90d
          - label: "kind/feature"

      lifecycle-stale:
        name: "Issues nearing expiration"
        resolution: "Close or label as frozen"
        filters:
          - label: lifecycle/stale

      release-team-issues:
        name: "area-release-team"
        type: issue
        filters:
          - label: area/release-team
          - label: sig/release

      release-team-prs:
        name: "area-release-team-prs"
        type: pull_request
        filters:
          - label: area/release-team
          - label: sig/release

      release-engineering-issues:
        name: "release-eng-issues"
        type: issue
        filters:
          - label: area/release-eng
          - label: sig/release

      release-engineering-prs:
        name: "release-eng-prs"
        type: pull_request
        filters:
          - label: area/release-eng
          - label: sig/release

      sig-release-issues:
        name: "sig-release-issues"
        type: issue
        filters:
          - label: area/release-team
          - milestone: "v1.22"

      sig-release-prs:
        name: "sig-release-prs"
        type: pull_request
        filters:
          - label: area/release-team
          - milestone: "v1.22"

      kind-flake:
        name: "Items that are classified as flake"
        type: issue
        filters:
          - label: kind/flake

      kind-failing-test:
        name: "Items that are classified as failing test"
        type: issue
        filters:
          - label: kind/failing-test

      # Urgent
      urgent-prs:
        name: "Urgent Pull Requests"
        type: pull_request
        resolution: Merge em
        filters:
          - label: "priority/critical-urgent"

      urgent-issues:
        name: "Urgent Issues"
        type: issue
        resolution: Close or deprioritize
        filters:
          - label: "priority/critical-urgent"

      # Soon
      soon-bugs:
        name: "bugs labelled important/soon"
        type: issue
        resolution: Close or deprioritize
        filters:
          - label: "priority/important-soon"
          - label: "kind/bug"

      soon-features:
        name: "features labelled important/soon"
        type: issue
        resolution: Close or deprioritize
        filters:
          - label: "priority/important-soon"
          - label: "kind/feature-request"

      soon-other:
        name: "other issues labelled important-soon"
        type: issue
        resolution: Close or deprioritize
        filters:
          - label: "priority/important-soon"
          - label: "!kind/feature-request"
          - label: "!kind/bug"

      soon-prs:
        name: "PR's labelled important-soon"
        type: pull_request
        resolution: Merge em
        filters:
          - label: "priority/important-soon"

      ## Similar
      similar-prs:
        name: "Similar Pull Requests"
        type: pull_request
        resolution: Close as duplicate or give a better title
        filters:
          - tag: similar

      similar-issues:
        name: "Similar Issues"
        type: issue
        resolution: Close as duplicate or give a better title
        filters:
          - tag: similar

      # for statistics generation
      open-issues:
        name: "Open Issues"
        type: issue

      open-prs:
        name: "Open PRs"
        type: pull_request
