Skip to content
Permalink
Browse files
Merge pull request #21 from knaufk/FLINK-23250
[FLINK-23250] dont unassign people automatically
  • Loading branch information
knaufk committed Jul 5, 2021
2 parents bd377c0 + 8567f87 commit 614cd742acf43fcf38173a42417e1b3d9316670f
Showing 4 changed files with 10 additions and 30 deletions.
@@ -49,7 +49,7 @@ The time periods before warning differ based on the priority:

### Rule 2: Unassign Stale Assigned Tickets

Assigned tickets without an update for {stale_assigned.stale_days} are unassigned after a warning period of {stale_assigned.warning_days}. Before this happens the assignee is notified that this is about to happen and asked for an update on the status of her contribution.
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

@@ -25,10 +25,10 @@ stale_assigned:
warning_comment: |
I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help the community manage its development. I see this issue is assigned but has not received an update in {stale_days} days, so it has been labeled "{warning_label}".
If you are still working on the issue, please remove the label and add a comment updating the community on your progress. If this issue is waiting on feedback, please consider this a reminder to the committer/reviewer. Flink is a very active project, and so we appreciate your patience.
If you are no longer working on the issue, please unassign yourself so someone else may work on it. If the "warning_label" label is not removed in {warning_days} days, the issue will be automatically unassigned.
If you are no longer working on the issue, please unassign yourself so someone else may work on it.
done_comment: |
This issue was marked "{warning_label}" {warning_days} days ago and has not received an update. I have automatically removed the current assignee from the issue so others in the community may pick it up. If you are still working on this ticket, please ask a committer to reassign you and provide an update about your current status.
Irrelevant
stale_minor:
ticket_limit: 10
@@ -48,12 +48,14 @@ def get_issues(self, jql_query, limit=10000):
total = 1
issues = []
while current < min(total, limit):
response = self.jira_client.jql(jql_query, limit=limit_per_api_request, start=current)
response = self.jira_client.jql(
jql_query, limit=limit_per_api_request, start=current
)
total = response["total"]
issues = issues + response["issues"]
current = len(issues)
logging.info(f'"{jql_query}" returned {len(issues)} issues')
return issues[:min(limit, len(issues))]
return issues[: min(limit, len(issues))]

def has_recently_updated_subtask(self, parent, updated_within_days):
find_subtasks_updated_within = (
@@ -106,7 +108,7 @@ def mark_stale_tickets_stale(self, jql_query):

else:
logging.info(
f"Found https://issues.apache.org/jira/browse/{key}, but is has recently updated Subtasks."
f"Found https://issues.apache.org/jira/browse/{key}, but is has recently updated Subtasks. "
f"Ignoring for now."
)
i += 1
@@ -23,8 +23,7 @@

class StaleAssignedRule(FlinkJiraRule):
"""
Assigned tickets without an update for {stale_assigned.stale_days} are unassigned after a warning period of
{stale_assigned.warning_days}. Before this happens the assignee is notified that this is about to happen and
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.
"""

@@ -42,25 +41,4 @@ def run(self):
)

def handle_stale_ticket(self, key, warning_label, done_label, comment):
self.unassign(key, warning_label, done_label, comment)

def unassign(self, key, warning_label, done_label, comment):
if not self.is_dry_run:
if self.jira_client.get_issue_status(key) == "In Progress":
self.jira_client.edit_issue(
key,
{"assignee": [{"set": {"name": self.jira_client.username}}]},
notify_users=False,
)
self.jira_client.set_issue_status(key, "Open")
self.jira_client.edit_issue(
key,
{
"labels": [{"add": done_label}, {"remove": warning_label}],
"comment": [{"add": {"body": comment}}],
"assignee": [{"set": {"name": None}}],
},
notify_users=False,
)
else:
logging.info(f"DRY_RUN (({key})): Unassigning.")
pass

0 comments on commit 614cd74

Please sign in to comment.