Adding OKR checkin reminder todo item
What does this MR do and why?
Part of https://gitlab.com/gitlab-org/incubation-engineering/okr/meta/-/issues/19+, this MR adds todo items associated with OKR checkin reminders. For some context, when an OKR checkin reminder is sent, the assignee will get an email and a todo. This MR adds the todo functionality, but doesn't connect it to the reminder cron job. That connection will be added in a follow up MR once Adding OKR checkin reminder email notifications (!131426 - merged) is merged.
Screenshots or screen recordings
A checkin reminder todo will look like the screenshot below. The author of the KR will show up as the author of the todo and it will display in the possessive form (i.e. authorname's ...
). It will display the same author name regardless of if the author is the assignee or not. Instead of saying, for example, Your OKR requires an update
.
How to set up and validate locally
-
Enable the
okrs_mvc
andokr_checkin_reminders
feature flag locally. In the rails console, run:Feature.enable(:okrs_mvc) Feature.enable(:okr_checkin_reminders)
-
Create some OKR seed data. In the rails console run:
objective = WorkItem.create( title: "Sample Objective", author: User.first, project: Project.first, work_item_type_id: ::WorkItems::Type.default_by_type(:objective).id ) objective.create_progress(reminder_frequency: 'weekly') key_result = WorkItem.create( title: "Sample Key Result", author: User.first, project: Project.first, work_item_type_id: ::WorkItems::Type.default_by_type(:key_result).id ) WorkItems::ParentLink.create( work_item: key_result, work_item_parent: objective ) key_result.assignees<<User.first
-
Create a todo for the KR. In the rails console, run:
TodoService.new.request_okr_checkin(key_result, User.first)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.