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

Replace ban/banned with suspend/suspended in user facing text #5816

Merged
merged 5 commits into from Feb 10, 2020
Merged

Replace ban/banned with suspend/suspended in user facing text #5816

merged 5 commits into from Feb 10, 2020

Conversation

rhymes
Copy link
Contributor

@rhymes rhymes commented Jan 30, 2020

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

We're going to change the language, at least in user facing strings, from ban/banned/banished to suspend/suspended.

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Jan 30, 2020
citizen428
citizen428 previously approved these changes Jan 31, 2020
Copy link
Contributor

@citizen428 citizen428 left a comment

Choose a reason for hiding this comment

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

NOTE: approved despite failing check because it's a simple wording change from "banned" to "suspended" to make it work.

The PR description mentions "at least in user facing strings", so I think this is ok. 👍

Overall though I'm a fan of having a ubiquitous language, which would include renaming the methods at one point. The more words we have for the same thing ("ban", "banish", "suspend"), the harder it will become to onboard new people.

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Jan 31, 2020
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Jan 31, 2020
citizen428
citizen428 previously approved these changes Feb 3, 2020
Copy link
Contributor

@citizen428 citizen428 left a comment

Choose a reason for hiding this comment

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

👍

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Feb 3, 2020
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Feb 4, 2020
@rhymes rhymes changed the title Replace ban/banned/banished with suspend/suspended in user facing text Replace ban/banned with suspend/suspended in user facing text Feb 4, 2020
Copy link
Contributor

@citizen428 citizen428 left a comment

Choose a reason for hiding this comment

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

Looking good @rhymes, thanks. Just left some questions.

@@ -46,7 +46,7 @@ def after_sign_in_path_for(resource)
end

def raise_banned
raise "BANNED" if current_user&.banned
raise "SUSPENDED" if current_user&.banned
Copy link
Contributor

Choose a reason for hiding this comment

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

General question: the way this is used is through before_actions like this one:

before_action :raise_banned, only: %i[new create update]

Could it potentially make sense to move this check into a policy?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also on the danger of sounding nitpicky, it's a bit confusing to see a method called raise_banned and then raise "SUSPENDED" right below. Maybe we can rename the method to raise_suspended`? It only would need to change in 3 places from what I can tell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could it potentially make sense to move this check into a policy?

Not sure TBH as I'm totally unfamiliar with all the suspension tooling, but I think it's out of the scope here

Also on the danger of sounding nitpicky, it's a bit confusing to see a method called raise_banned and then raise "SUSPENDED" right below. Maybe we can rename the method to raise_suspended`? It only would need to change in 3 places from what I can tell.

Done!

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree that a policy would be outside the scope of this PR, but it seemed like a good point to start the discussion. 😃

Thanks for changing the method name!

Copy link
Contributor

Choose a reason for hiding this comment

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

How painful would it be to rename the role on the user as well? Just looking at this method, we have current_user&.banned, which might cause a bit of confusion since "banned" is actually now "suspended". I don't think this should block this PR, but we probably shouldn't have too many different ways to refer to the same concept.

Also, looking at role.rb, we also have a comment_banned role. Do we need to make any modifications to handle that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the goal is to slowly change it all I think. We'd probably need a migration to go over the roles table and update that role.

Let's see what we can do in a follow up PR :)

Copy link
Contributor

Choose a reason for hiding this comment

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

That sounds great. Definitely seems like it could be its own PR 😄

citizen428
citizen428 previously approved these changes Feb 6, 2020
@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Feb 6, 2020
vaidehijoshi
vaidehijoshi previously approved these changes Feb 6, 2020
Copy link
Contributor

@mstruve mstruve left a comment

Choose a reason for hiding this comment

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

We need to update our honeybadger error handling to ensure these errors are grouped appropriately

@pr-triage pr-triage bot added PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Feb 6, 2020
@rhymes
Copy link
Contributor Author

rhymes commented Feb 7, 2020

@mstruve please take over this PR as I'm not entirely sure what I should put in the initializer 👀

SUSPENDED => suspended ?
SUSPENDED => banned ?

something else?

@mstruve
Copy link
Contributor

mstruve commented Feb 7, 2020

Either works but if we don't want a new error to pop up in Honeybadger then lets go with

SUSPENDED => banned

@rhymes rhymes dismissed stale reviews from vaidehijoshi and citizen428 via 9a7e9fb February 10, 2020 13:48
@rhymes rhymes requested a review from a team February 10, 2020 13:48
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes labels Feb 10, 2020
Copy link
Contributor

@mstruve mstruve left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Feb 10, 2020
@mstruve mstruve merged commit c41d66e into forem:master Feb 10, 2020
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Feb 10, 2020
@rhymes rhymes deleted the rhymes/replace-ban_banned-suspend_suspended branch February 10, 2020 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants