gitlab-org--gitlab-foss/spec/services/merge_requests
Yorick Peterse 6ef87a2083
Merge issuable "reopened" state into "opened"
Having two states that essentially mean the same thing is very much like
having a boolean "true" and boolean "mostly-true": it's rather silly.
This commit merges the "reopened" state into the "opened" state while
taking care of system notes still showing messages along the lines of
"Alice reopened this issue".

A big benefit from having only two states (opened and closed) is that
indexing and querying becomes simpler and more performant. For example,
to get all the opened queries we no longer have to query both states:

    SELECT *
    FROM issues
    WHERE project_id = 2
    AND state IN ('opened', 'reopened');

Instead we can query a single state directly, which can be much faster:

    SELECT *
    FROM issues
    WHERE project_id = 2
    AND state = 'opened';

Further, only having two states makes indexing easier as we will only
ever filter (and thus scan an index) using a single value. Partial
indexes could help but aren't supported on MySQL, complicating the
development process and not being helpful for MySQL.
2017-07-28 13:31:51 +02:00
..
conflicts Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
add_todo_when_build_fails_service_spec.rb Use :empty_project where possible in service specs 2017-03-27 20:44:09 -04:00
assign_issues_service_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
build_service_spec.rb Use described_class when possible 2017-07-27 14:31:53 +02:00
close_service_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
create_from_issue_service_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
create_service_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
get_urls_service_spec.rb Merge issuable "reopened" state into "opened" 2017-07-28 13:31:51 +02:00
merge_request_diff_cache_service_spec.rb Move diffable? method from Repository to Diff::File 2017-06-08 09:32:57 -05:00
merge_service_spec.rb Use described_class when possible 2017-07-27 14:31:53 +02:00
merge_when_pipeline_succeeds_service_spec.rb Add transient head_pipeline_of to pipeline factories 2017-05-22 17:06:45 -03:00
post_merge_service_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
refresh_service_spec.rb Use described_class when possible 2017-07-27 14:31:53 +02:00
reopen_service_spec.rb Merge issuable "reopened" state into "opened" 2017-07-28 13:31:51 +02:00
resolved_discussion_notification_service_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
update_service_spec.rb Use described_class when possible 2017-07-27 14:31:53 +02:00