Skip to content
Permalink
Browse files
[FLINK-22034] get rid of LOWER_PRIORITIES constant
  • Loading branch information
knaufk committed Apr 22, 2021
1 parent a600249 commit 3fcb3fff062c80d08c22c816836d600155e009af
Showing 2 changed files with 6 additions and 9 deletions.
@@ -67,13 +67,13 @@ def get_args():
)
stale_minor_rule = StaleMinorRule(jira, jira_bot_config["stale_minor"], args.dryrun)
stale_major_rule = StaleMajorOrAboveRule(
jira, jira_bot_config["stale_major"], args.dryrun, "Major"
jira, jira_bot_config["stale_major"], args.dryrun, "Major", "Minor"
)
stale_critical_rule = StaleMajorOrAboveRule(
jira, jira_bot_config["stale_critical"], args.dryrun, "Critical"
jira, jira_bot_config["stale_critical"], args.dryrun, "Critical", "Major"
)
stale_blocker_rule = StaleMajorOrAboveRule(
jira, jira_bot_config["stale_blocker"], args.dryrun, "Blocker"
jira, jira_bot_config["stale_blocker"], args.dryrun, "Blocker", "Critical"
)
stale_assigned_rule.run()
stale_minor_rule.run()
@@ -16,8 +16,6 @@
# limitations under the License.
################################################################################

import logging

from flink_jira_rule import FlinkJiraRule


@@ -31,12 +29,11 @@ class StaleMajorOrAboveRule(FlinkJiraRule):
The time periods before warning differ based on the priority:
"""

def __init__(self, jira_client, config, is_dry_run, priority):
def __init__(self, jira_client, config, is_dry_run, priority, lower_priority):
super().__init__(jira_client, config, is_dry_run)
self.lower_priority = lower_priority
self.priority = priority

LOWER_PRIORITIES = {"Blocker": "Critical", "Critical": "Major", "Major": "Minor"}

def run(self):
self.handle_tickets_marked_stale(
f"project=FLINK AND Priority = {self.priority} AND resolution = Unresolved "
@@ -49,4 +46,4 @@ def run(self):
)

def handle_stale_ticket(self, key):
self.set_priority(key, self.LOWER_PRIORITIES[self.priority])
self.set_priority(key, self.lower_priority)

0 comments on commit 3fcb3ff

Please sign in to comment.