Introduce Start, Current, and end Values
What does this MR do and why?
This MR add start, end, and current columns to progress table. gitlab-org/incubation-engineering/okr/meta#29 (closed)
- Adds Start, End, and Current value columns for work_item_progresses table.
- Post-deployment migration to backfill current_value with progress
- Update current_value whenever progress is updated.
There will be followup MRs and full context can be found in this EPIC - &8991
- Write to current_value instead of progress column
- Calculate progress value from start, end, and current value
- Make progress read-only.
Migration Output
bundle exec rake db:migrate
main: == 20230313092109 AddStartEndAndCurrentValuesToWiProgressess: migrating =======
main: -- add_column(:work_item_progresses, :start_value, :float, {:default=>0, :null=>false})
main: -> 0.0023s
main: -- add_column(:work_item_progresses, :end_value, :float, {:default=>100, :null=>false})
main: -> 0.0005s
main: -- add_column(:work_item_progresses, :current_value, :float, {:default=>0, :null=>false})
main: -> 0.0004s
main: == 20230313092109 AddStartEndAndCurrentValuesToWiProgressess: migrated (0.0072s)
main: == 20230316073726 BackfillCurrentValueWithProgressWorkItemProgresses: migrating
main: == 20230316073726 BackfillCurrentValueWithProgressWorkItemProgresses: migrated (0.0157s)
How to set up and validate locally
- Run
bundle exec rails db:migrate
- Enable
okrs_mvc
feature flag for a projectFeature.enable(:okrs_mvc, Project.find(6)
- Create an Objective from Issues List(Use
New Issue
dropdown) and create couple of children and enter progress value - From rails console fetch the progress record for the work item
WorkItem.find(:id).progress
and progress and current_value should be same as the one entered in above step - Run rake task
bundle exec rake gitlab:work_items:copy_wi_progress
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.
Edited by Abhilash Kotte