fastruby / pecas

Classy Leaderboards for Noko Time (and Alarms!)
https://fastruby.github.io/pecas/
MIT License
7 stars 5 forks source link

[REQUEST] Send a smart notification via Slack DM for people submitting entries that don't meet minimum criteria #98

Closed etagwerker closed 2 years ago

etagwerker commented 2 years ago

Before we start...:

Branch/Commit:

main branch.

Describe the feature:

As a person submitting entries I do sometimes make mistakes And then I submit entries that don't have a JIRA id or URL And then I would like to see a notification in Slack at the end of the day

Problem:

As a Noko and JIRA user I want to submit entries that include a JIRA ID or URL So that I can have traceability to figure out how much time I spent on a JIRA story/task/sub-task/epic

Resources:

Once a day, we should have a scheduled job that reviews all the entries submitted by the team during that day. The task should probably run every weekday at 8pm PST.

The job would check that the entries are well formed. They should meet this criteria:

The notification should include a list of entries that look suspicious. Here is a template:

@etagwerker Hi Ernesto, I found these entries that are missing a JIRA ticket or ID: 

- Did work (3 hours) 
- Worked on stuff (1 hour) 

Please make sure that these entries are accurate. If they are all good, great! If not, please make sure you fix them so you don't get penalized for any of them!

You will need to use:

I will abide by the code of conduct

mcelaney commented 2 years ago

@etagwerker would you prefer the scheduled job implemented at the Rails level (ActiveJob), at the docker level (docker-cron or whatever), or an option c?

If ActiveJob - should I use a specific Queue adapter (is SideKiq still the default?) do the extra work to make the queue handler configurable?

etagwerker commented 2 years ago

@mcelaney Hey, I think cron would be the best way to go. It should probably run every hour and use the user's timezone to determine if "now is the end of day" for the person who should receive the notification.

Considering we have teammates all over the world (from India to Guatemala) I think that would be the best way to go... so I think it would be a rake task that will be scheduled once an hour.

etagwerker commented 2 years ago

One thing to keep in mind: The criteria will change in the future. So this is the first iteration of this feature. In our vision the criteria will start as a small set of rules but it might evolve into using ML to determine whether a time entry is good or bad.

Just bringing this up in case it makes a difference when you design the solution.