Set spent time when using timelogs API
All threads resolved!
All threads resolved!
Compare changes
Files
4+ 7
− 0
At the moment we don't set the spent_at
time when creating
timelogs via the API. This is causing issues when filtering.
This MR addresses this initially by setting it to the current time.
Moving forward, we can look to support passing a time in.
lee@cc-gdk-2:~/gitlab-development-kit/gitlab$ bundle exec rake db:migrate:down VERSION=20211213130324 RAILS_ENV=development
== 20211213130324 UpdateTimelogsSpentAtDefault: reverting =====================
-- change_column_default(:timelogs, :spent_at, {:from=>#<Proc:0x00005563b1af2570 /home/lee/gitlab-development-kit/gitlab/db/migrate/20211213130324_update_timelogs_spent_at_default.rb:5 (lambda)>, :to=>nil})
-> 0.0042s
== 20211213130324 UpdateTimelogsSpentAtDefault: reverted (0.0059s) ============
lee@cc-gdk-2:~/gitlab-development-kit/gitlab$ bundle exec rake db:migrate:up VERSION=20211213130324 RAILS_ENV=development
== 20211213130324 UpdateTimelogsSpentAtDefault: migrating =====================
-- change_column_default(:timelogs, :spent_at, {:from=>nil, :to=>#<Proc:0x000055d799913b30 /home/lee/gitlab-development-kit/gitlab/db/migrate/20211213130324_update_timelogs_spent_at_default.rb:5 (lambda)>})
-> 0.0041s
== 20211213130324 UpdateTimelogsSpentAtDefault: migrated (0.0042s) ============
http://gdk.test:3000/api/v4/projects/6/issues/35/add_spent_time
{ "duration": 5 }
spent_at
valueThis checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #347473 (closed)