[FLINK-23206] Minor tickets are moved to Not a Priority instead of closing
diff --git a/README.md b/README.md
index 855d2fb..95bb38c 100644
--- a/README.md
+++ b/README.md
@@ -40,9 +40,9 @@
## About the Rules
-### Rule 1 Major+ Need Assignee or Discussion
+### Rule 1 Tickets Need an Assignee or Discussion Eventually
-Tickets major and above need an assignee, or an update within {stale_<blocker|critical|major>.stale_days}, otherwise the priority will be reduced after a warning period of {stale_<blocker|critical|major>.warning_days} days.
+Any ticket (except ones with priority "Not a Priority") needs an assignee, or an update within {stale_<blocker|critical|major|minor>.stale_days}, otherwise the priority will be reduced after a warning period of {stale_<blocker|critical|major>.warning_days} days.
An update of a Sub-Task counts as an update to the ticket.
Before this happens the assignee/reporter/watchers are notified that the ticket is about to become stale and will be deprioritized.
The time periods before warning differ based on the priority:
@@ -51,10 +51,6 @@
Assigned tickets without an update for {stale_assigned.stale_days} days are marked stale. The assignee is notified and asked for an update on the status of her contribution.
-### Rule 3: Close Stale Minor Tickets
-
-An unresolved Minor ticket without an update for {stale_minor.stale_days} is closed after a warning period of {stale_minor.warning_days} with a comment that encourages users to watch, comment and simply reopen with a higher priority if the problem insists.
-
## About Apache Flink
Apache Flink is an open source project of The Apache Software Foundation (ASF).
diff --git a/config.yaml b/config.yaml
index 7ea46e4..1b00ddc 100644
--- a/config.yaml
+++ b/config.yaml
@@ -35,12 +35,12 @@
stale_days: 180
warning_days: 7
warning_label: "stale-minor"
- done_label: "auto-closed"
+ done_label: "auto-deprioritized-minor"
warning_comment: |
- I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help the community manage its development. I noticed that neither this issue nor its subtasks had updates for {stale_days} days, so I labeled it "{warning_label}". If you are still affected by this bug or are still interested in this issue, please update and remove the label.
+ I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help the community manage its development. I see this issues has been marked as Minor but is unassigned and neither itself nor its Sub-Tasks have been updated for {stale_days} days. I have gone ahead and marked it "{warning_label}". If this ticket is still Minor, please either assign yourself or give an update. Afterwards, please remove the label or in {warning_days} days the issue will be deprioritized.
done_comment: |
- This issue was labeled "{warning_label}" {warning_days} days ago and has not received any updates so I have gone ahead and closed it. If you are still affected by this or would like to raise the priority of this ticket please re-open, removing the label "{done_label}" and raise the ticket priority accordingly.
+ This issue was labeled "{warning_label}" {warning_days} days ago and has not received any updates so it is being deprioritized. If this ticket is actually Minor, please raise the priority and ask a committer to assign you the issue or revive the public discussion.
stale_blocker:
ticket_limit: 5
diff --git a/flink_jira_bot.py b/flink_jira_bot.py
index 36f8ca0..76dce7a 100644
--- a/flink_jira_bot.py
+++ b/flink_jira_bot.py
@@ -24,8 +24,7 @@
from pathlib import Path
from stale_assigned_rule import StaleAssignedRule
-from stale_major_or_above_rule import StaleMajorOrAboveRule
-from stale_minor_rule import StaleMinorRule
+from stale_unassigned_rule import StaleUnassignedRule
def get_args():
@@ -65,14 +64,16 @@
stale_assigned_rule = StaleAssignedRule(
jira, jira_bot_config["stale_assigned"], args.dryrun
)
- stale_minor_rule = StaleMinorRule(jira, jira_bot_config["stale_minor"], args.dryrun)
- stale_major_rule = StaleMajorOrAboveRule(
+ stale_minor_rule = StaleUnassignedRule(
+ jira, jira_bot_config["stale_minor"], args.dryrun, "Minor", "Not a Priority"
+ )
+ stale_major_rule = StaleUnassignedRule(
jira, jira_bot_config["stale_major"], args.dryrun, "Major", "Minor"
)
- stale_critical_rule = StaleMajorOrAboveRule(
+ stale_critical_rule = StaleUnassignedRule(
jira, jira_bot_config["stale_critical"], args.dryrun, "Critical", "Major"
)
- stale_blocker_rule = StaleMajorOrAboveRule(
+ stale_blocker_rule = StaleUnassignedRule(
jira, jira_bot_config["stale_blocker"], args.dryrun, "Blocker", "Critical"
)
stale_assigned_rule.run()
diff --git a/stale_assigned_rule.py b/stale_assigned_rule.py
index ecbc3d3..47875c7 100644
--- a/stale_assigned_rule.py
+++ b/stale_assigned_rule.py
@@ -16,8 +16,6 @@
# limitations under the License.
################################################################################
-import logging
-
from flink_jira_rule import FlinkJiraRule
diff --git a/stale_minor_rule.py b/stale_minor_rule.py
deleted file mode 100644
index 35e9c49..0000000
--- a/stale_minor_rule.py
+++ /dev/null
@@ -1,63 +0,0 @@
-################################################################################
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-################################################################################
-
-import logging
-
-from flink_jira_rule import FlinkJiraRule
-
-
-class StaleMinorRule(FlinkJiraRule):
- """
- An unresolved Minor ticket without an update for {stale_minor.stale_days} or a fixVersion is closed after a warning period of
- {stale_minor.warning_days} with a comment that encourages users to watch, comment and simply reopen with a higher
- priority if the problem insists.
- """
-
- def __init__(self, jira_client, config, is_dry_run):
- super().__init__(jira_client, config, is_dry_run)
-
- def run(self):
- self.handle_tickets_marked_stale(
- f"project=FLINK AND Priority = Minor AND resolution = Unresolved "
- f'AND labels in ("{self.warning_label}") '
- f"AND updated < startOfDay(-{self.warning_days}d)"
- )
- self.mark_stale_tickets_stale(
- f'project = FLINK AND type != "Sub-Task" AND Priority = Minor AND resolution = Unresolved '
- f'AND updated < startOfDay(-{self.stale_days}d) AND fixVersion = null AND NOT labels in '
- f'("{self.warning_label}")'
- )
-
- def handle_stale_ticket(self, key, warning_label, done_label, comment):
- self.close_issue(key, warning_label, done_label, comment)
-
- def close_issue(self, key, warning_label, done_label, comment):
- if not self.is_dry_run:
- self.jira_client.edit_issue(
- key,
- {"labels": [{"add": done_label}, {"remove": warning_label}]},
- notify_users=False,
- )
- self.jira_client.set_issue_status(
- key,
- "Closed",
- fields={"resolution": {"name": "Auto Closed"}},
- update={"comment": [{"add": {"body": comment}}]},
- )
- else:
- logging.info(f"DRY_RUN (({key})): Closing.")
diff --git a/stale_major_or_above_rule.py b/stale_unassigned_rule.py
similarity index 89%
rename from stale_major_or_above_rule.py
rename to stale_unassigned_rule.py
index c0f8123..a4bb433 100644
--- a/stale_major_or_above_rule.py
+++ b/stale_unassigned_rule.py
@@ -20,14 +20,13 @@
import logging
-class StaleMajorOrAboveRule(FlinkJiraRule):
+class StaleUnassignedRule(FlinkJiraRule):
"""
- Tickets major and above without a fixVersion need an assignee, or an update within {stale_<blocker|critical|major>.stale_days},
+ Any ticket (except ones with priority "Not a Priority") needs an assignee, or an update within {stale_<blocker|critical|major|minor>.stale_days},
otherwise the priority will be reduced after a warning period of {stale_<blocker|critical|major>.warning_days} days.
- An update of on of the Sub-Tasks counts as an update to the ticket.
- Before this happens the assignee/reporter/watchers are notified that the ticket is about to become stale and will
- be deprioritized.
- The time periods before warning differ based on the priority.
+ An update of a Sub-Task counts as an update to the ticket.
+ Before this happens the assignee/reporter/watchers are notified that the ticket is about to become stale and will be deprioritized.
+ The time periods before warning differ based on the priority:
"""
def __init__(self, jira_client, config, is_dry_run, priority, lower_priority):