Skip to content

[WIP] LG-10812 | Report on total user count#9300

Closed
n1zyy wants to merge 4 commits intomainfrom
mattw/LG-10812_v2
Closed

[WIP] LG-10812 | Report on total user count#9300
n1zyy wants to merge 4 commits intomainfrom
mattw/LG-10812_v2

Conversation

@n1zyy
Copy link
Contributor

@n1zyy n1zyy commented Oct 2, 2023

🎫 Ticket

LG-10812

🛠 Summary of changes

This presently builds on an unmerged PR so it won't really make sense on main just yet.

ThatSpaceGuy and others added 3 commits October 2, 2023 15:31
This builds on Luis's unmerged PR (#9299) and needs a test still.

changelog: Internal, Reporting, Monthly report includes all-time user count

upload_to_s3(account_reuse_data, report_name: 'account_reuse')
upload_to_s3(total_profiles_data, report_name: 'total_profiles', )
upload_to_s3(total_users_all_time_table, report_name: 'total_users_all_time')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Much of this is actually from Luis's PR; you can view my commits individually if you need to separate them out. I'll rebase this Friday as appropriate.

let(:expected_count) { 2 }

it 'includes the suspended user in the count' do
expect(suspended_user).to be_suspended
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aside: I just recently learned about how much magic you can do with built-in rspec matchers. If a class responds to foo?, then you can just expect(subject).to be_foo. https://rubydoc.info/gems/rspec-expectations/RSpec/Matchers#be-instance_method

This was kind of scaffolding for myself to confirm that my 'suspended' user was indeed suspended, but I'm inclined to leave it in for clarity.


it 'includes the suspended user in the count' do
expect(suspended_user).to be_suspended
expect(subject.total_user_count_report).to eq(expected_report)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not super proud of this pattern. I'm essentially testing total_user_count, which I made private (because it should be), in a roundabout way. The diff should hopefully make it clear enough if it fails, but it's a little hamfisted.

All that said, I'm not testing these because I think they might break; I'm testing them to make explicit what I intend as the expected behavior. Should a suspended, unconfirmed, or rejected-for-fraud user be included in "Total users all-time", or is that surprising? Given that we have previously received requests for "active users," I am interpreting "Total users all-time" to include non-active users, but will the consumers of our report agree? (I worry that this turns into a large can of worms otherwise.)

@n1zyy
Copy link
Contributor Author

n1zyy commented Oct 11, 2023

Superseded by #9350

@n1zyy n1zyy closed this Oct 11, 2023
@n1zyy n1zyy deleted the mattw/LG-10812_v2 branch October 11, 2023 18:54
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.

2 participants