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

Add route to get a member's data for helper review #451

Merged
merged 12 commits into from
Mar 16, 2021

Conversation

mbaruh
Copy link
Member

@mbaruh mbaruh commented Mar 6, 2021

Added route for getting a user's join date, total messages, and top 3 channels by activity.

This information will be used to auto-review nominees.

Thank you @jb3 for the query, and everyone who helped me set-up metricity.

  • Add relevant tests.

Added route for getting a user's join date, total messages, and top 3 channels by activity.

This information will be used to auto-review nominees.
@coveralls
Copy link

coveralls commented Mar 6, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling d213474 on mbaruh/channel-activity into 49c7afa on main.

@mbaruh mbaruh changed the title WIP: Add route to get a member's data for helper review Add route to get a member's data for helper review Mar 6, 2021
@mbaruh mbaruh marked this pull request as ready for review March 6, 2021 23:49
@mbaruh mbaruh requested a review from jb3 as a code owner March 6, 2021 23:49
Copy link
Member

@jb3 jb3 left a comment

Choose a reason for hiding this comment

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

All looking good! Couple of minor comments.

Comment on lines +106 to +107
WHEN channels.name ILIKE 'help-%%' THEN 'the help channels'
WHEN channels.name ILIKE 'ot%%' THEN 'off-topic'
Copy link
Member

Choose a reason for hiding this comment

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

Grammar here is irking me a bit.

Suggested change
WHEN channels.name ILIKE 'help-%%' THEN 'the help channels'
WHEN channels.name ILIKE 'ot%%' THEN 'off-topic'
WHEN channels.name ILIKE 'help-%%' THEN 'Help channels'
WHEN channels.name ILIKE 'ot%%' THEN 'Off topic'

Copy link
Member Author

Choose a reason for hiding this comment

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

The purpose of those names is to be used in a sentence, rather than titles, although I agree it's not the prettiest

Copy link
Member

Choose a reason for hiding this comment

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

Ah, gotcha, I thought it would be more a sort of list like ```
Help channels: 24,404 messages
Off topic: 12,000 messages
...: ... messages

pydis_site/apps/api/models/bot/metricity.py Outdated Show resolved Hide resolved
pydis_site/apps/api/viewsets/bot/user.py Show resolved Hide resolved
pydis_site/apps/api/tests/test_users.py Outdated Show resolved Hide resolved
joined_at = "foo"
total_messages = 10
total_blocks = 1
channel_activity = [["bar", 4], ["buzz", 6]]
Copy link
Member

Choose a reason for hiding this comment

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

There should be subtests to test each case in the query (i.e. you need to test off topic and help channels too).

@MarkKoz MarkKoz added area: API Related to or causes API changes language: python Involves Python code type: feature New feature or request labels Mar 12, 2021
Base automatically changed from master to main March 13, 2021 19:57
@mbaruh mbaruh merged commit 8276ba5 into main Mar 16, 2021
@mbaruh mbaruh deleted the mbaruh/channel-activity branch March 16, 2021 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Related to or causes API changes language: python Involves Python code type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants