From d534f7bdcb04bcf10ad912fb1d88a0157c0107bb Mon Sep 17 00:00:00 2001 From: Hans Hasselberg Date: Fri, 24 Jan 2020 09:24:21 +0100 Subject: [PATCH] bot: replace stalebot with hashibot (#7113) --- .github/stale.yml | 40 ----------------------------------- .hashibot.hcl | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 40 deletions(-) delete mode 100644 .github/stale.yml create mode 100644 .hashibot.hcl diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 93a4eeead..000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 60 -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 30 - -# Issues with these labels will never be considered stale. Set to `[]` to disable -# We don't close any issue that is an enhancement or confirmed bug, but issues -# waiting for reproduction cases and questions tend to get outdated. -exemptLabels: - - "enhancement" - - "bug" - - "thinking" - - "docs" - -# Label to use when marking as stale -staleLabel: "waiting-reply" - -# Comment to post when marking as stale. Set to `false` to disable -markComment: | - Hey there, - We wanted to check in on this request since it has been inactive for at least 60 days. - If you think this is still an important issue in the latest version of [Consul](https://github.com/hashicorp/consul/blob/master/CHANGELOG.md) - or [its documentation](https://www.consul.io/docs) please reply with a comment here which will cause it to stay open for investigation. - If there is still no activity on this issue for 30 more days, we will go ahead and close it. - - Feel free to check out the [community forum](https://discuss.hashicorp.com/c/consul) as well! - Thank you! - -# Comment to post when removing the stale label. Set to `false` to disable -unmarkComment: false - -# Comment to post when closing a stale Issue. Set to `false` to disable -closeComment: > - Hey there, - This issue has been automatically closed because there hasn't been any activity for at least 90 days. - If you are still experiencing problems, or still have questions, feel free to [open a new one](https://github.com/hashicorp/consul/issues/new) :+1: - -# Limit to only `issues` -only: issues - diff --git a/.hashibot.hcl b/.hashibot.hcl new file mode 100644 index 000000000..dcc637472 --- /dev/null +++ b/.hashibot.hcl @@ -0,0 +1,53 @@ +behavior "regexp_issue_labeler" "panic_label" { + regexp = "panic:" + labels = ["crash"] +} + +behavior "remove_labels_on_reply" "remove_stale" { + labels = ["waiting-reply"] +} + +poll "closed_issue_locker" "locker" { + schedule = "0 50 1 * * *" + closed_for = "720h" # 30 days + max_issues = 500 + sleep_between_issues = "5s" + + message = <<-EOF + Hey there, + + This issue has been automatically locked because it is closed and there hasn't been any activity for at least _30_ days. + + If you are still experiencing problems, or still have questions, feel free to [open a new one](https://github.com/hashicorp/consul/issues/new) :+1:. + EOF +} + +poll "stale_issue_closer" "stale_closer" { + schedule = "0 22 23 * * *" + no_reply_in_last = "480h" # 20 days + max_issues = 500 + sleep_between_issues = "5s" + labels = ["waiting-reply"] + message = <<-EOF + Hey there, + + This issue has been automatically closed because there hasn't been any activity for at least _20_ days. + + If you are still experiencing problems, or still have questions, feel free to [open a new one](https://github.com/hashicorp/consul/issues/new) :+1:. + EOF +} + +poll "stale_issue_closer" "close_closer" { + schedule = "0 50 2 * * *" + no_reply_in_last = "1m" # hack to close issue with that label immediately. + max_issues = 500 + sleep_between_issues = "5s" + labels = ["close-issue"] + message = <<-EOF + Hey there, + + This issue has been automatically closed because it was labled with `close-issue`. + + If you are still experiencing problems, or still have questions, feel free to [open a new one](https://github.com/hashicorp/consul/issues/new) :+1:. + EOF +}