Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Conversation

@mcelaney
Copy link
Contributor

@mcelaney mcelaney commented Mar 2, 2022

Closes #98

Description:
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 in the user's local time zone as defined by Slack.

Initially only internal employees would receive these messages. We determine which users to include by inspecting the @ombuteam on Slack.

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

  • They should have a description that is more than two words.
  • If the entry doesn't have a #calls label, then it should have a JIRA ID.
  • If the entry doesn't have a JIRA ID or URL, then it should notify the person in Slack

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!

To Do

  • Create and permission a Slack Bot
  • Build a Slack Service to utilize the Web API of the Slack Bot
  • Build a rules system to assess time entry descriptions
  • Build a TimeEntry domain to manage finding the correct Slack Users, current entries, and validation logic
  • Build a rake task to utilize this domain
  • Set up a cron job to call the rake task on a 1 hour interval

QA

  • tests pass
  • Add yourself to the pecas_dev group on Slack
  • Add a time entry for today that lacks a Jira ticket, url, or the #calls tag
  • spin up the app between 7pm and 8pm
  • You should get a message on Slack an hour late.

Screen Shot 2022-03-02 at 5 59 11 PM

I will abide by the code of conduct.

@mcelaney mcelaney requested a review from a team as a code owner March 2, 2022 08:15
@mcelaney mcelaney requested review from bronzdoc and kindoflew and removed request for a team March 2, 2022 08:15
@mcelaney
Copy link
Contributor Author

mcelaney commented Mar 3, 2022

The cron job seems to be working but it's the part I'm least confident in... so if someone with more experience in Docker could pay extra attention to my changes there could have a look I'd appreciate it.

@kindoflew
Copy link
Contributor

hey @bronzdoc, your DevOps wisdom is needed! could you review this when you have the time? thanks!

Copy link
Contributor

@bronzdoc bronzdoc left a comment

Choose a reason for hiding this comment

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

@mcelaney I left some comments regarding style, mocking, and a suggestion for the docker problem. Let me know what you think, thanks!

@mcelaney
Copy link
Contributor Author

#101 (comment)

@bronzdoc Makes sense to me. I'll pull the cron stuff back out.

We'll expect these to be set up as workers in Heroku
@lubc
Copy link
Contributor

lubc commented Mar 14, 2022

@bronzdoc hey, looks like this is ready for re-review

@lubc lubc requested a review from bronzdoc March 14, 2022 22:33
@kindoflew
Copy link
Contributor

@bronzdoc :shipit:

@mcelaney mcelaney added the BLOCKED PR is blocked by something. label Apr 4, 2022
@mcelaney
Copy link
Contributor Author

mcelaney commented Apr 4, 2022

This PR is blocked by #100

@lubc
Copy link
Contributor

lubc commented Apr 25, 2022

@arielj hey, do you think you can help review this PR? If you don't have time I can try to find someone else. Thank you!

@kindoflew kindoflew removed the BLOCKED PR is blocked by something. label May 11, 2022
@kindoflew
Copy link
Contributor

@mcelaney this has some merge conflicts now.

@bronzdoc do you have time to review this again? if not i can ping someone else.

Copy link
Contributor

@bronzdoc bronzdoc left a comment

Choose a reason for hiding this comment

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

LGTM, still needs a rebase tho

end
end

# let(:user) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove this commented code?

Copy link
Member

@etagwerker etagwerker left a comment

Choose a reason for hiding this comment

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

I've tested this locally and it seems to behave as expected. I had to tweak something in the spec so that it passes (both locally and in CI)

@bronzdoc bronzdoc merged commit 00fd489 into main Jun 2, 2022
@bronzdoc bronzdoc deleted the feature/entry-validation-alerts branch June 2, 2022 18:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

6 participants