Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

escalation not removal #1058

Merged
merged 5 commits into from
May 7, 2018
Merged

escalation not removal #1058

merged 5 commits into from
May 7, 2018

Conversation

owocki
Copy link
Contributor

@owocki owocki commented May 2, 2018

Description
  • expiration script escalates to @vs77bb if a user is MIA, but does not do removal itself
  • changes the 'did user abanadon work and can't start another task' functionality to be only IFF the user has been removed from another task by a staff member.
Checklist
  • linter status: 100% pass
  • changes don't break existing behavior
  • commit message follows commit guidelines
Affected core subsystem(s)

start/ stop work

Refers/Fixes

self/ vivek idea on slack

@mbeacom
Copy link
Contributor

mbeacom commented May 2, 2018

test_handle_expired failing here. I'll look at resolving this following my meeting.

@thelostone-mc
Copy link
Member

thelostone-mc commented May 3, 2018

Does this mean we'd have manual intervention for every issue that has been ignored by the bounty hunter which he's started work on ?
Given our current scale of abandoned issues (which is small) -> this would make things a lot smoother 👍

@owocki
Copy link
Contributor Author

owocki commented May 7, 2018

yes thats the plan

@owocki owocki requested a review from mbeacom May 7, 2018 16:06
if not settings.SLACK_TOKEN or bounty.get_natural_value() < 0.0001 or (
bounty.network != settings.ENABLE_NOTIFICATIONS_ON_NETWORK):
return False

msg = f"@{username} has been removed from {bounty.github_url} due to inactivity on the github thread."
msg = f"@vivek, {bounty.github_url} is being escalated to you, due to inactivity for {last_heard_from_user_days} days from @{username} on the github thread."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could make a gitcoinco moderators team of anyone that will potentially triage this type of situation (i.e. vivek at the moment) and @ mention the team here versus vivek.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For instance @gitcoinco/moderators

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure.. but this is a slack message not a github message :P

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exceptionally derp today.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

download




def record_user_action_on_interest(interest, event_name, last_heard_from_user_days):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstrings 😢

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@owocki
Copy link
Contributor Author

owocki commented May 7, 2018

@mbeacom just fixed the tests

if not settings.SLACK_TOKEN or bounty.get_natural_value() < 0.0001 or (
bounty.network != settings.ENABLE_NOTIFICATIONS_ON_NETWORK):
return False

msg = f"@{username} has been removed from {bounty.github_url} due to inactivity on the github thread."
msg = f"@vivek, {bounty.github_url} is being escalated to you, due to inactivity for {last_heard_from_user_days} days from @{username} on the github thread."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (161 > 120 characters)

@@ -749,10 +749,10 @@ def maybe_notify_user_removed_github(bounty, username, last_heard_from_user_days

status_header = get_status_header(bounty)

msg = f"""{status_header}@{username} has been removed for inactivity and [the issue]({bounty.url}) has been returned to an ‘Open’ Status. Let us know if you believe this has been done in error!
msg = f"""{status_header}@{username} due to inactivity, we have escalated [this issue]({bounty.url}) to Gitcoin's moderation team. Let us know if you believe this has been done in error!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (180 > 120 characters)




def record_user_action_on_interest(interest, event_name, last_heard_from_user_days):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E303 too many blank lines (3)

return JsonResponse({
'error': _('Due to a prior abandoned bounty, you are unable to start work at this time. Please contact support.'),
'error': _('Because a staff member has had to remove you from a bounty in the past, you are unable to start more work at this time. Please contact support.'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (170 > 120 characters)

record_user_action(interest, 'bounty_abandonment_final', last_heard_from_user_days)

interest.delete()
record_user_action_on_interest(interest, 'bounty_abandonment_escalation_to_mods', last_heard_from_user_days)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (136 > 120 characters)

# commenting in slack
maybe_notify_bounty_user_removed_to_slack(bounty, interest.profile.handle)
maybe_notify_bounty_user_escalated_to_slack(bounty, interest.profile.handle, last_heard_from_user_days)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W293 blank line contains whitespace

# send email
bounty_startwork_expired(interest.profile.email, bounty, interest, last_heard_from_user_days)

elif should_warn_user:

record_user_action(interest, 'bounty_abandonment_warning', last_heard_from_user_days)
record_user_action_on_interest(interest, 'bounty_abandonment_warning', last_heard_from_user_days)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (125 > 120 characters)


print(f'executing should_warn_user for {interest.profile} / {bounty.github_url} ')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W293 blank line contains whitespace

# commenting on the GH issue
maybe_warn_user_removed_github(bounty, interest.profile.handle, last_heard_from_user_days)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W293 blank line contains whitespace

# commenting in slack
maybe_notify_bounty_user_warned_removed_to_slack(bounty, interest.profile.handle, last_heard_from_user_days)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W293 blank line contains whitespace

@codecov
Copy link

codecov bot commented May 7, 2018

Codecov Report

Merging #1058 into master will increase coverage by 1.16%.
The diff coverage is 58.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1058      +/-   ##
==========================================
+ Coverage   32.03%   33.19%   +1.16%     
==========================================
  Files         105      105              
  Lines        7249     7929     +680     
  Branches      941     1155     +214     
==========================================
+ Hits         2322     2632     +310     
- Misses       4819     5156     +337     
- Partials      108      141      +33
Impacted Files Coverage Δ
app/dashboard/helpers.py 28.77% <ø> (ø) ⬆️
app/dashboard/models.py 68.45% <100%> (+2.74%) ⬆️
app/dashboard/utils.py 33.33% <100%> (+6.06%) ⬆️
app/dashboard/views.py 16.47% <14.28%> (+0.95%) ⬆️
app/dashboard/notifications.py 17.58% <50%> (+1.51%) ⬆️
...eting/management/commands/expiration_start_work.py 73.97% <63.63%> (-7.46%) ⬇️
app/marketing/utils.py 42% <0%> (-5.83%) ⬇️
app/faucet/views.py 26.31% <0%> (-3.42%) ⬇️
app/marketing/views.py 15.77% <0%> (-0.99%) ⬇️
app/dashboard/ios.py 19.71% <0%> (-0.87%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e7ccd69...cfd89ce. Read the comment docs.

@@ -486,6 +486,19 @@ def process_bounty_details(bounty_details):


def record_user_action(event_name, old_bounty, new_bounty):
"""Records a user action

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W291 trailing whitespace

if not settings.SLACK_TOKEN or bounty.get_natural_value() < 0.0001 or (
bounty.network != settings.ENABLE_NOTIFICATIONS_ON_NETWORK):
return False

msg = f"@{username} has been removed from {bounty.github_url} due to inactivity on the github thread."
msg = f"@vivek, {bounty.github_url} is being escalated to you, due to inactivity for {last_heard_from_user_days} days from @{username} on the github thread."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (161 > 120 characters)




def record_user_action_on_interest(interest, event_name, last_heard_from_user_days):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E303 too many blank lines (3)

Copy link
Contributor

@mbeacom mbeacom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! :shipit:

@owocki owocki merged commit db31f53 into master May 7, 2018
@mbeacom mbeacom deleted the kevin/escalation_not_removal branch May 8, 2018 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants