Time estimate inconsistency between actual data and GraphQL
Time trackable entities (issues and merge requests) have the time_estimate
attribute defined as nullable (by default, because there's no "non-nullable" enforcement) in here: https://gitlab.com/gitlab-org/gitlab/-/blob/0e9f6624d4fbb7d69de7fcc8f5e9b38ced7867cb/app/models/concerns/time_trackable.rb#L18
This is slightly inconsistent with what the GraphQL types for issues and merge requests define:
- issue type: https://gitlab.com/gitlab-org/gitlab/-/blob/0e9f6624d4fbb7d69de7fcc8f5e9b38ced7867cb/app/graphql/types/issue_type.rb#L111-112
- merge request type: https://gitlab.com/gitlab-org/gitlab/-/blob/0e9f6624d4fbb7d69de7fcc8f5e9b38ced7867cb/app/graphql/types/merge_request_type.rb#L190-191
We should make it consistent by either:
- allow null values to be returned by the GraphQL type
- prevent null values explicitly on the database field
- note that the database field has a default value set to
0
so, if we go down this route, we can perform an update to set all rows that could have it set toNULL
back to0
and the update the non-null constraint
- note that the database field has a default value set to