Skip to content

Adding OKR checkin reminder todo item

Darby Frey requested to merge okr-checkin-todos into master

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.

Screenshot_2023-09-28_at_12.10.01_PM

How to set up and validate locally

  1. Enable the okrs_mvc and okr_checkin_reminders feature flag locally. In the rails console, run:

    Feature.enable(:okrs_mvc)
    Feature.enable(:okr_checkin_reminders)
  2. 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
  3. 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.

Edited by Darby Frey

Merge request reports