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

Create digesting mechanism #197

Closed
iandunn opened this issue Jun 16, 2022 · 6 comments
Closed

Create digesting mechanism #197

iandunn opened this issue Jun 16, 2022 · 6 comments
Assignees

Comments

@iandunn
Copy link
Member

iandunn commented Jun 16, 2022

Several contributions require a digest mechanism, since they are so frequent that they would quickly fill up a person's profile and crowd out all other activity. For example, #177, #178, #193 #196 would add things like:

  • performed 53 actions in HelpScout this week. (replying, triaging, etc)
  • Wrote 15 comments in 3 GitHub repositories this week
  • updated handbooks 22 times this week
  • translated 45 strings this week
  • approved 82 translated strings this week

Those could use a <summary> to allow expanding to see individual items. It could be a rolling digest, so we don't have to wait on crons to get an accurate number.

It'd be nice if they all used the same code for DRYness and consistent UX, unless there's a compelling reason otherwise. There are some differences to take into account though:

  • GitHub events are tracked in a separate table than normal BuddyPress activity
  • HelpScout activity may run on a cron while others are instant additions to the BuddyPress db. (cc @dd32 since an hourly cron might work better than weekly for a rolling digest )

cc @angelsjin since you've been talking to the teams, do you think they'll have any preferences on how bulk actions like these are displayed on profiles?

@tellyworth
Copy link

I like the idea. Having a single cron job for rolling digests that handles a few different data sources would keep things neat, if not 100% DRY.

I'm not sure how useful the detail part of the summary list would be in practice. That's probably up to teams. Some like HelpScout would intentionally have no detail for privacy/safety reasons. You could consider starting with just the summary, and adding detail later as an enhancement.

The rolling digest idea is a neat solution. I guess you'd store counts and detail items in commentmeta?

@akirk
Copy link
Member

akirk commented Jun 17, 2022

Another idea might be a Github-style activity data that shows the activity over a year. It might be easier for visualizing continued activity. I'd combine all the activities into the same color which would convey something like "any contributions is equally important" although it could make sense to weigh different amounts of activities differently (like 10 translations = 1 core comment – not an actual recommendation).

This could go hand in hand with a rolling digest as a way to dig deeper into the activity graph.

@iandunn
Copy link
Member Author

iandunn commented Jun 20, 2022

a single cron job for rolling digests that handles a few different data sources

So, something like this?

# cron runs every 5 minutes
sources = github table, trac table, buddypress activity table

for each source   
    check for new  items since past cron run

    for each new item
        if already has rolling digest
            bump digest value
        else
            create digest

That could work. The only tricky part I can think of is making is making sure it knows which items were already counted, so it doesn't count them twice, or miss any. If we rely on the cron timing we'd probably miss a few entries around the edges of the timing window (e.g., cron runs 500ms "late", so it misses the entry that came in 250ms before it ran).

The cron could keep track of all the entries for the past 3 runs, though, and use that to make sure they've all been processed. eg, save an array like [ 'id1' => 'done', 'id2' => 'pending' ] to the db (or just memcache).

It feels simpler to me to just bump the digest when each activity entry is inserted, though. Maybe we could have a DRY function that does the bumping, though, and each of the source inserters call that function?

@iandunn
Copy link
Member Author

iandunn commented Jun 20, 2022

not sure how useful the detail part of the summary list would be in practice.... could consider starting with just the summary, and adding detail later as an enhancement.

👍🏻

store counts and detail items in commentmeta?

I think the details would fit logically in activity.content (assuming there's room), and then the counts could use bp_activity_add_meta().

@iandunn
Copy link
Member Author

iandunn commented Jun 20, 2022

a Github-style activity data that shows the activity over a year. It might be easier for visualizing continued activity.

Yeah, I like that idea. Probably out of scope for this ticket, but a visualization would really help to see consistency. I'd probably make it based on weeks rather than days, since contributing every day wouldn't be a healthy "work"/life balance.

@iandunn iandunn mentioned this issue Jun 20, 2022
8 tasks
@iandunn iandunn changed the title Create digesting mechanmism Create digesting mechanism Jun 20, 2022
@iandunn
Copy link
Member Author

iandunn commented Jun 23, 2022

@naokomc suggested this for Polyglots:

Tally up the count at the end of each day and post once

The daily might be simpler than a rolling digest, but has the downside that activity wouldn't show up immediately, which might confuse folks from time to time.

I'm leaning towards the rolling digest still, but don't feel too strongly.

For GTEs and PTEs, it might make sense to combine reviewed strings and translated strings

I think that'll work regardless of the digest approach, and might be something that other teams want down the line 👍🏻

Use a milestone, like the first 1 translation approved, then 100, 1,000, 10,000...

Milestones are an interesting idea, and could be a great way to encourage folks and show appreciation. It might be out of scope for this round of changes, but I think it's a good idea to keep in mind for the future. fyi @angelasjin, @josephahaden

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

No branches or pull requests

3 participants